38 #ifndef NEKTAR_LIB_UTILITIES_NEK_MATRIX_HPP
39 #define NEKTAR_LIB_UTILITIES_NEK_MATRIX_HPP
47 #ifdef NEKTAR_USE_EXPRESSION_TEMPLATES
50 #include <ExpressionTemplates/ExpressionTemplates.hpp>
55 template<
typename DataType,
typename FormType>
56 std::ostream& operator<<(std::ostream& os, const NekMatrix<DataType, FormType>& rhs)
61 for(
unsigned int i = 0; i < rhs.GetRows(); ++i)
64 for(
unsigned int j = 0; j < rhs.GetColumns(); ++j)
67 os.precision(osprecision);
69 if( j != rhs.GetColumns() - 1 )
75 if( i != rhs.GetRows()-1 )
83 template<
typename DataType,
typename FormType>
84 std::ostream&
operator>>(std::ostream& os,
const NekMatrix<DataType, FormType>& rhs)
87 os <<
"[" << std::endl;
89 for(
unsigned int i = 0; i < rhs.GetRows(); ++i)
91 for(
unsigned int j = 0; j < rhs.GetColumns(); ++j)
106 if( i != rhs.GetRows()-1 )
111 os <<
"]" << std::endl;
118 #ifdef NEKTAR_USE_EXPRESSION_TEMPLATES
122 struct IsBlockMatrix :
public boost::false_type {};
125 struct IsBlockMatrix<Nektar::NekMatrix<T, Nektar::BlockMatrixTag> > :
public boost::true_type {};
127 template<
typename DataType>
128 struct HasUnaryOp<NegateOp, DataType, typename boost::enable_if<IsBlockMatrix<DataType> >::type> :
public boost::false_type {};
132 struct CommutativeTraits<Nektar::NekMatrix<LhsDataType, LhsMatrixType> ,
133 expt::MultiplyOp, Nektar::NekMatrix<RhsDataType, RhsMatrixType> > :
public boost::false_type
139 struct CommutativeTraits<Nektar::NekMatrix<LhsDataType, LhsMatrixType> ,
147 #endif //NEKTAR_LIB_UTILITIES_NEK_MATRIX_HPP