CPPLapack
 All Classes Files Functions Variables Friends
drovector-constructor.hpp
Go to the documentation of this file.
00001 //=============================================================================
00002 /*! drovector constructor */
00003 inline drovector::drovector()
00004 {VERBOSE_REPORT;
00005   //////// initialize ////////
00006   l =0;
00007   cap =0;
00008   array =NULL;
00009 }
00010 
00011 //=============================================================================
00012 /*! drovector copy constructor */
00013 inline drovector::drovector(const drovector& 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 /*! drovector constructor to cast _drovector */
00026 inline drovector::drovector(const _drovector& 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 /*! drovector constructor with size specification */
00038 inline drovector::drovector(const long& _l, const long margin)
00039 {VERBOSE_REPORT;
00040 #ifdef  CPPL_DEBUG
00041   if( _l<0 || margin<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 #endif//CPPL_DEBUG
00048   
00049   //////// initialize ////////
00050   l =_l;
00051   cap =l+margin;
00052   array =new double[cap];
00053 }
00054 
00055 //=============================================================================
00056 /*! drovector constructor with filename */
00057 inline drovector::drovector(const char* filename)
00058 {VERBOSE_REPORT;
00059   array =NULL;
00060   read(filename);
00061 }
00062 
00063 ///////////////////////////////////////////////////////////////////////////////
00064 ///////////////////////////////////////////////////////////////////////////////
00065 ///////////////////////////////////////////////////////////////////////////////
00066 
00067 //=============================================================================
00068 /*! drovector destructor */
00069 inline drovector::~drovector()
00070 {VERBOSE_REPORT;
00071   delete [] array;
00072 }
 All Classes Files Functions Variables Friends