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]) );