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

_dcovector-constructor.hpp

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

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