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

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