Main Page | Class List | File List | Class Members | File Members | Related Pages

_dgematrix-io.hpp

Go to the documentation of this file.
00001 //=============================================================================
00002 /*! operator() for const object */
00003 inline CPPSL_double _dgematrix::operator()(const long& i, const long& j) const
00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( i<0 || j<0 || M<=i || N<=j ){
00007     std::cerr << "[ERROR] _dgematrix::operator()"
00008               << "(const long&, const long&) const" << std::endl
00009               << "The required component is out of the matrix size."
00010               << std::endl
00011               << "Your input was (" << i << "," << j << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   return CPPSL_double( Array, i, j, Desc );
00017 }
00018 
00019 ///////////////////////////////////////////////////////////////////////////////
00020 ///////////////////////////////////////////////////////////////////////////////
00021 ///////////////////////////////////////////////////////////////////////////////
00022 
00023 //=============================================================================
00024 inline std::ostream& operator<<(std::ostream& s, const _dgematrix& mat)
00025 {
00026   for(long i=0; i<mat.M; i++){
00027     for(long j=0; j<mat.N; j++){
00028       s << " " << mat(i,j);
00029     }
00030     s << std::endl;
00031   }
00032   
00033   mat.destroy();
00034   return s;
00035 }

Generated on Sat Jan 31 19:25:43 2004 for CPPScaLapack by doxygen 1.3.5