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

_drovector-constructor.hpp

Go to the documentation of this file.
00001 //============================================================================
00002 /*! _drovector constructor */
00003 inline _drovector::_drovector()
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]=1;
00010   Array =new double[0];
00011   
00012 #ifdef  CPPSL_DEBUG
00013   std::cerr << "# [NOTE] _drovector::_drovector() "
00014             << "A new 0x0 vector at " << Array << " has been made."
00015             << std::endl;
00016 #endif//CPPSL_DEBUG
00017 }
00018 
00019 //============================================================================
00020 /*! _drovector copy constructor */
00021 inline _drovector::_drovector(const _drovector& 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] _drovector::_drovector(const _drovector&) "
00031             << "A new vector pointing at " << Array << " has been made."
00032             << std::endl;
00033 #endif//CPPSL_DEBUG
00034 }
00035 
00036 //============================================================================
00037 /*! _drovector constructor to cast drovector */
00038 inline _drovector::_drovector(const drovector& 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] _drovector::_drovector(const __drovector&) "
00051             << "A new vector at " << Array << " has been made." << std::endl;
00052 #endif//CPPSL_DEBUG
00053 }
00054 
00055 //============================================================================
00056 /*! _drovector constructor with size specification */
00057 inline _drovector::_drovector(const long& _l)
00058 {
00059 #ifdef  CPPSL_DEBUG
00060   if( _l<0 ){
00061     std::cerr << "[ERROR] _drovector::_drovector(const long&)" << std::endl
00062               << "Vector size must be positive integers. " << std::endl
00063               << "Your input was (" << _l << ")." << std::endl;
00064     exit(1);
00065   }
00066 #endif//CPPSL_DEBUG
00067   
00068   //////// initialize ////////
00069   L =_l;
00070   long nl(numroc_(L, nb, mycol, 0, npcol));
00071   if(myrow==0){ Ll=nl; } else{ Ll=0; }
00072   Desc[0]=1; Desc[1]=icontxt; Desc[2]=L; Desc[3]=1; Desc[4]=mb; Desc[5]=nb;
00073   Desc[6]=0; Desc[7]=0; Desc[8]=1;
00074   Array =new double[Ll];
00075   
00076 #ifdef  CPPSL_DEBUG
00077   std::cerr << "# [NOTE] _drovector::_drovector(const long&) "
00078             << "A new vector at " << Array << " has been made." << std::endl;
00079 #endif//CPPSL_DEBUG
00080 }
00081 
00082 ///////////////////////////////////////////////////////////////////////////////
00083 ///////////////////////////////////////////////////////////////////////////////
00084 ///////////////////////////////////////////////////////////////////////////////
00085 
00086 //============================================================================
00087 /*! _drovector destructor */
00088 inline _drovector::~_drovector()
00089 {
00090 #ifdef  CPPSL_DEBUG
00091   std::cerr << "# [NOTE] _drovector::~_drovector() "
00092             << "A _drovector is going to be destructed." << std::endl;
00093 #endif//CPPSL_DEBUG
00094   //////// do nothing ////////
00095 }

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