Matrix.h
Go to the documentation of this file.
1 //=================================================================================================
33 //=================================================================================================
34 
35 #ifndef _BLAZE_MATH_MATRIX_H_
36 #define _BLAZE_MATH_MATRIX_H_
37 
38 
39 //*************************************************************************************************
40 // Includes
41 //*************************************************************************************************
42 
43 #include <iomanip>
44 #include <ostream>
46 
47 
48 namespace blaze {
49 
50 //=================================================================================================
51 //
52 // GLOBAL OPERATORS
53 //
54 //=================================================================================================
55 
56 //*************************************************************************************************
59 template< typename MT, bool SO >
60 inline std::ostream& operator<<( std::ostream& os, const Matrix<MT,SO>& m );
62 //*************************************************************************************************
63 
64 
65 //*************************************************************************************************
73 template< typename MT // Type of the matrix
74  , bool SO > // Storage order
75 inline std::ostream& operator<<( std::ostream& os, const Matrix<MT,SO>& m )
76 {
77  typename MT::CompositeType tmp( ~m );
78 
79  for( size_t i=0UL; i<tmp.rows(); ++i ) {
80  os << "( ";
81  for( size_t j=0UL; j<tmp.columns(); ++j ) {
82  os << std::setw(12) << tmp(i,j) << " ";
83  }
84  os << ")\n";
85  }
86 
87  return os;
88 }
89 //*************************************************************************************************
90 
91 } // namespace blaze
92 
93 #endif
const This & CompositeType
Data type for composite expression templates.
Definition: CompressedMatrix.h:2588
Namespace of the Blaze C++ math library.
Definition: Blaze.h:57
Header file for the Matrix base class.