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

_dgematrix-constructor.hpp

Go to the documentation of this file.
00001 //============================================================================
00002 /*! _dgematrix constructor without arguments */
00003 inline _dgematrix::_dgematrix()
00004 {
00005   //////// initialize ////////
00006   M =N =0;
00007   Ml =Nl =0;
00008   Desc[0]=1; Desc[1]=icontxt; Desc[2]=0; Desc[3]=0; Desc[4]=mb; Desc[5]=nb;
00009   Desc[6]=0; Desc[7]=0; Desc[8]=max(1,Ml);
00010   Array =new double[0];
00011   
00012 #ifdef  CPPSL_DEBUG
00013   std::cerr << "# [NOTE] _dgematrix::_dgematrix() "
00014             << "A new 0x0 matrix at " << Array
00015             << " has been made." << std::endl;
00016 #endif//CPPSL_DEBUG
00017 }
00018 
00019 
00020 //////////////////////////////////////////////////////////////////////////////
00021 //////////////////////////////////////////////////////////////////////////////
00022 //////////////////////////////////////////////////////////////////////////////
00023 //============================================================================
00024 /*! _dgematrix copy constructor */
00025 inline _dgematrix::_dgematrix(const _dgematrix& mat)
00026 {
00027   //////// initialize ////////
00028   M =mat.M; N =mat.N;
00029   Ml =mat.Ml; Nl =mat.Nl;
00030   for(int i=0; i<9; i++){ Desc[i] =mat.Desc[i]; }
00031   Array =mat.Array;
00032   
00033 #ifdef  CPPSL_DEBUG
00034   std::cerr << "# [NOTE] _dgematrix::_dgematrix(const _dgematrix&) "
00035             << "A new matrix at " << Array << " has been made." << std::endl;
00036 #endif//CPPSL_DEBUG
00037 }
00038 
00039 //============================================================================
00040 /*! _dgematrix constructor to cast dgematrix */
00041 inline _dgematrix::_dgematrix(const dgematrix& mat)
00042 {
00043   M =mat.M; N =mat.N;
00044   Ml =mat.Ml; Nl =mat.Nl;
00045   for(int i=0; i<9; i++){ Desc[i] =mat.Desc[i]; }
00046   Array =mat.Array;
00047   
00048 #ifdef  CPPSL_DEBUG
00049   std::cerr << "# [NOTE] _dgematrix::_dgematrix(const dgematrix&) "
00050             << "A new matrix pointing at " << Array << " has been made."
00051             << std::endl;
00052 #endif//CPPSL_DEBUG
00053 }
00054 
00055 //////////////////////////////////////////////////////////////////////////////
00056 //////////////////////////////////////////////////////////////////////////////
00057 //////////////////////////////////////////////////////////////////////////////
00058 
00059 //============================================================================
00060 /*! _dgematrix constructor with size specification */
00061 inline _dgematrix::_dgematrix(const long& _m, const long& _n)
00062 {
00063 #ifdef  CPPSL_DEBUG
00064   if( _m<0 || _n<0 ){
00065     std::cerr << "[ERROR] _dgematrix::_dgematrix(const long, const long)"
00066               << std::endl
00067               << "Matrix sizes must be positive integers. " << std::endl
00068               << "Your input was (" << _m << "," << _n << ")." << std::endl;
00069     exit(1);
00070   }
00071 #endif//CPPSL_DEBUG
00072   
00073   //////// initialize ////////
00074   M =_m; N =_n;
00075   Ml =numroc_( M, mb, myrow, 0, nprow );
00076   Nl =numroc_( N, nb, mycol, 0, npcol );
00077   Desc[0]=1; Desc[1]=icontxt; Desc[2]=M; Desc[3]=N; Desc[4]=mb; Desc[5]=nb;
00078   Desc[6]=0; Desc[7]=0; Desc[8]=max(1,Ml);
00079   Array =new double[Ml*Nl];
00080   
00081 #ifdef  CPPSL_DEBUG
00082   std::cerr << "# [NOTE] _dgematrix(const long&, const long&) "
00083             << "A new matrix at " << Array << " has been made." << std::endl;
00084 #endif//CPPSL_DEBUG
00085 }
00086 
00087 ///////////////////////////////////////////////////////////////////////////////
00088 ///////////////////////////////////////////////////////////////////////////////
00089 ///////////////////////////////////////////////////////////////////////////////
00090 
00091 //============================================================================
00092 /*! _dgematrix destructor */
00093 inline _dgematrix::~_dgematrix()
00094 {
00095 #ifdef  CPPSL_DEBUG
00096   std::cerr << "# [NOTE] _dgematrix::~_dgematrix() "
00097             << "A _dgematrix is going to be destructed." << std::endl;
00098 #endif//CPPSL_DEBUG
00099   //////// do nothing ////////
00100 }

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