6 #ifndef MYRAMATH_EXPRESSION_PRINT_H 7 #define MYRAMATH_EXPRESSION_PRINT_H 22 template<
class Number> std::ostream& operator << (std::ostream& out, const Expression<1,Number>& e)
26 out <<
"size " << N <<
" arity-1 Expression of " << typestring<Number>() <<
": " << std::endl;
28 for (
int n = 0; n < N; ++n)
29 out << e.evaluate(make_Index(n)) <<
" ";
30 out <<
"]" << std::endl;
35 template<
class Number> std::ostream& operator << (std::ostream& out, const Expression<2,Number>& e)
40 out <<
"size " << I <<
" by " << J <<
" arity-2 Expression of " << typestring<Number>() <<
": " << std::endl;
41 for (
int i = 0; i < I; ++i)
44 for (
int j = 0; j < J; ++j)
45 out << e.evaluate(make_Index(i,j)) <<
" ";
46 out <<
"]" << std::endl;
52 template<
int Arity> std::ostream& operator << (std::ostream& out, const Index<Arity>& index)
56 for (
int n = 0; n < N; ++n)
57 out << index[n] <<
" ";
Implementation detail of Expression templates.
An interface used to fill containers from Expression's (see Matrix::evaluate(), for example)...
Essentially a std::array<int,N>, provided for backwards compatibility.
Definition: Index.h:23