SparseMatrix.hpp 974 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/*
 * Matrix.hpp
 *
 *  Created on: Oct 5, 2015
 *      Author: i-bird
 */

#ifndef OPENFPM_NUMERICS_SRC_MATRIX_SPARSEMATRIX_HPP_
#define OPENFPM_NUMERICS_SRC_MATRIX_SPARSEMATRIX_HPP_

#include <Eigen/Sparse>

/*! \brief It store the non zero elements of the matrix
 *
 *
 */
template<typename T> struct cval
{
	size_t j;
	T value;
};

/*! \brief It store the non zero elements of the matrix
 *
 *
 */
template<typename T, unsigned int impl> struct triplet
{
	long int i;
	long int j;
	T val;

	long int & row()
	{
		return i;
	}

	long int & col()
	{
		return j;
	}

	T & value()
	{
		return val;
	}
};

Pietro Incardona's avatar
Pietro Incardona committed
49
/*! \brief Sparse Matrix implementation
50
 *
Pietro Incardona's avatar
Pietro Incardona committed
51
 * \tparam T Type of the sparse Matrix store on each row,colums
52
 * \tparam id_t type of id
Pietro Incardona's avatar
Pietro Incardona committed
53
 * \tparam Mi implementation
54 55 56 57 58 59 60 61 62 63
 *
 */
template<typename T,typename id_t ,typename Mi = Eigen::SparseMatrix<T,0,id_t>>
class SparseMatrix
{
};

#include "SparseMatrix_Eigen.hpp"

#endif /* OPENFPM_NUMERICS_SRC_MATRIX_SPARSEMATRIX_HPP_ */