30 #ifndef __MatrixEigen_H
31 #define __MatrixEigen_H 1
35 #include <boost/version.hpp>
36 #if (BOOST_VERSION >= 103400)
37 #include <boost/none.hpp>
39 #include <boost/none_t.hpp>
82 typedef typename type_traits<value_type>::real_type real_type;
83 typedef Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> matrix_type;
85 typedef typename super::graph_ptrtype graph_ptrtype;
115 return M_mat( i, j );
147 return M_mat.rows()*M_mat.cols();
173 return M_is_initialized;
196 matrix_type
const&
mat ()
const
244 graph_ptrtype
const&
graph );
255 M_mat.setZero( M_mat.rows(), M_mat.cols() );
264 M_mat.setZero( M_mat.rows(), M_mat.cols() );
281 const value_type& value )
283 M_mat( i, j ) += value;
296 const value_type& value )
298 M_mat( i, j ) = value;
308 void printMatlab(
const std::string name=
"NULL" )
const;
343 void addMatrix(
const ublas::matrix<T, ublas::row_major>&,
344 const std::vector<size_type>&,
345 const std::vector<size_type>& ) {}
351 void addMatrix(
const boost::numeric::ublas::matrix<T, ublas::row_major>&,
const std::vector<size_type>& ) {}
367 int* cols,
int ncols,
370 void scale(
const T a );
389 return real_type( 0 );
404 return real_type( 0 );
421 bool M_is_initialized;
422 mutable bool M_is_closed;
427 mutable matrix_type M_mat;
438 Feel::detail::ignore_unused_variable_warning( rhs );
439 Feel::detail::ignore_unused_variable_warning( vals );
441 for (
size_type i = 0; i < rows.size(); ++i )
443 value_type value = 1.0;
446 value = M_mat( rows[i], rows[i] );
447 M_mat.row( rows[i] ).setZero();
450 M_mat( rows[i], rows[i] ) = value;
453 rhs.
set( rows[i], value * vals(rows[i]) );
void zero()
Definition: matrixeigendense.hpp:262
void diagonal(Vector< T > &dest) const
Definition: matrixeigendense.cpp:146
Definition: solverlinear.hpp:33
bool isInitialized() const
Definition: matrixeigendense.hpp:171
boost::shared_ptr< MatrixSparse< T > > transpose() const
Definition: matrixsparse.hpp:543
void clear()
Definition: matrixeigendense.hpp:252
virtual void set(const size_type i, const value_type &value)=0
void zero(size_type start1, size_type stop1, size_type start2, size_type stop2)
Definition: matrixeigendense.hpp:267
void printMatlab(const std::string name="NULL") const
Definition: matrixeigendense.cpp:207
Definition: feelalg/enums.hpp:59
matrix_type & mat()
Definition: matrixeigendense.hpp:204
void set(const size_type i, const size_type j, const value_type &value)
Definition: matrixeigendense.hpp:294
graph_ptrtype const & graph() const
Definition: matrixsparse.hpp:262
value_type operator()(size_type i, size_type j) const
Definition: matrixeigendense.hpp:113
void zeroRows(std::vector< int > const &rows, Vector< value_type > const &values, Vector< value_type > &rhs, Context const &on_context)
Definition: matrixeigendense.hpp:433
size_type size1() const
Definition: matrixeigendense.hpp:128
interface to eigen sparse matrix
Definition: matrixeigendense.hpp:71
void add(const size_type i, const size_type j, const value_type &value)
Definition: matrixeigendense.hpp:279
real_type l1Norm() const
Definition: matrixeigendense.hpp:387
bool closed() const
Definition: matrixeigendense.hpp:187
void addMatrix(const ublas::matrix< T, ublas::row_major > &, const std::vector< size_type > &, const std::vector< size_type > &)
Definition: matrixeigendense.hpp:343
matrix_type const & mat() const
Definition: matrixeigendense.hpp:196
size_type rowStop() const
Definition: matrixeigendense.hpp:163
size_type nnz() const
Definition: matrixeigendense.hpp:145
size_type rowStart() const
Definition: matrixeigendense.hpp:154
value_type energy(Vector< value_type > const &__v, Vector< value_type > const &__u, bool transpose=false) const
Definition: matrixeigendense.cpp:155
void close() const
Definition: matrixeigendense.cpp:131
interface to vector
Definition: matrixeigendense.hpp:50
size_t size_type
Indices (starting from 0)
Definition: feelcore/feel.hpp:319
Definition: matrixsparse.hpp:76
Context class.
Definition: feelcore/context.hpp:63
void addMatrix(const boost::numeric::ublas::matrix< T, ublas::row_major > &, const std::vector< size_type > &)
Definition: matrixeigendense.hpp:351
size_type size2() const
Definition: matrixeigendense.hpp:137
void updateBlockMat(boost::shared_ptr< MatrixSparse< value_type > > m, std::vector< size_type > start_i, std::vector< size_type > start_j)
Definition: matrixeigendense.cpp:197
real_type linftyNorm() const
Definition: matrixeigendense.hpp:402
Graph representation of the Compressed Sparse Row format.
Definition: graphcsr.hpp:57