CPPLapack
 All Classes Files Functions Variables Friends
dcovector-constructor.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! dcovector constructor */
00003 inline dcovector::dcovector()
00004 {VERBOSE_REPORT;
00005   //////// initialize ////////
00006   l =0;
00007   cap =0;
00008   array =NULL;
00009 }
00010 
00011 //=============================================================================
00012 /*! dcovector copy constructor */
00013 inline dcovector::dcovector(const dcovector& vec)
00014 {VERBOSE_REPORT;
00015   //////// initialize ////////
00016   l =vec.l;
00017   cap =vec.cap;
00018   array =new double[cap];
00019   
00020   //////// copy ////////
00021   dcopy_(l, vec.array, 1, array, 1);
00022 }
00023 
00024 //=============================================================================
00025 /*! dcovector constructor to cast _dcovector */
00026 inline dcovector::dcovector(const _dcovector& vec)
00027 {VERBOSE_REPORT;
00028   //////// initialize ////////
00029   l =vec.l;
00030   cap =vec.cap;
00031   array =vec.array;
00032   
00033   vec.nullify();
00034 }
00035 
00036 //=============================================================================
00037 /*! dcovector constructor with size specification */
00038 inline dcovector::dcovector(const long& _l, const long margin)
00039 {VERBOSE_REPORT;
00040 #ifdef  CPPL_DEBUG
00041   if( _l<0 ){
00042     ERROR_REPORT;
00043     std::cerr << "Vector size must be positive integers. " << std::endl
00044               << "Your input was (" << _l << ")." << std::endl;
00045     exit(1);
00046   }
00047   if( margin<0 ){
00048     ERROR_REPORT;
00049     std::cerr << "Vector margin must be zero or above. " << std::endl
00050               << "Your input was (" << _l << ", " << margin << ")." << std::endl;
00051     exit(1);
00052   }
00053 #endif//CPPL_DEBUG
00054   
00055   //////// initialize ////////
00056   l =_l;
00057   cap =l+margin;
00058   array =new double[cap];
00059 }
00060 
00061 //=============================================================================
00062 /*! dcovector constructor with filename */
00063 inline dcovector::dcovector(const char* filename)
00064 {VERBOSE_REPORT;
00065   array =NULL;
00066   read(filename);
00067 }
00068 
00069 ///////////////////////////////////////////////////////////////////////////////
00070 ///////////////////////////////////////////////////////////////////////////////
00071 ///////////////////////////////////////////////////////////////////////////////
00072 
00073 //=============================================================================
00074 /*! dcovector destructor */
00075 inline dcovector::~dcovector()
00076 {VERBOSE_REPORT;
00077   //////// delete array ////////
00078   delete [] array;
00079 }
 All Classes Files Functions Variables Friends