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

dcovector-io.hpp

Go to the documentation of this file.
00001 //=============================================================================
00002 /*! operator() for non-const object */
00003 inline CPPSL_double dcovector::operator()(const long& i)
00004 {
00005 #ifdef  CPPSL_DEBUG
00006   if( i<0 || L<=i ){
00007     std::cerr << "[ERROR] dcovector::operator()(const long&)"
00008               << std::endl
00009               << "The required component is out of the vector size."
00010               << std::endl
00011               << "Your input was (" << i << ")." << std::endl;
00012     exit(1);
00013   }
00014 #endif//CPPSL_DEBUG
00015   
00016   return CPPSL_double( Array, i, 0, Desc );
00017 }
00018 
00019 //=============================================================================
00020 /*! operator() for const object */
00021 inline double dcovector::operator()(const long& i) const
00022 {
00023 #ifdef  CPPSL_DEBUG
00024   if( i<0 || L<=i ){
00025     std::cerr << "[ERROR] dcovector::operator()(const long&) const"
00026               << std::endl
00027               << "The required component is out of the vector size."
00028               << std::endl
00029               << "Your input was (" << i << ")." << std::endl;
00030     exit(1);
00031   }
00032 #endif//CPPSL_DEBUG
00033   
00034   double alpha;
00035   pdelget_('A', ' ', alpha, Array, i+1, 1, Desc);
00036   return alpha;
00037 }
00038 
00039 ///////////////////////////////////////////////////////////////////////////////
00040 ///////////////////////////////////////////////////////////////////////////////
00041 ///////////////////////////////////////////////////////////////////////////////
00042 
00043 //=============================================================================
00044 /*! set value for const object */
00045 inline void dcovector::set(const long& i, const double& v) const
00046 {
00047 #ifdef  CPPSL_DEBUG
00048   if( i<0 || L<=i ){
00049     std::cerr << "[ERROR] dcovector::set(const long&, const double&) const"
00050               << std::endl
00051               << "The required component is out of the vector size."
00052               << std::endl
00053               << "Your input was (" << i << ")." << std::endl;
00054     exit(1);
00055   }
00056 #endif//CPPSL_DEBUG
00057   
00058   pdelset_(Array, i+1, 1, Desc, v);
00059 }
00060 
00061 ///////////////////////////////////////////////////////////////////////////////
00062 ///////////////////////////////////////////////////////////////////////////////
00063 ///////////////////////////////////////////////////////////////////////////////
00064 
00065 //=============================================================================
00066 inline std::ostream& operator<<(std::ostream& s, const dcovector& vec)
00067 {
00068   for(long i=0; i<vec.L; i++){
00069     s << " " << vec(i) << std::endl;
00070   }
00071   
00072   return s;
00073 }

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