00001
00002
00003 inline CPPSL_double drovector::operator()(const long& i)
00004 {
00005 #ifdef CPPSL_DEBUG
00006 if( i<0 || L<=i ){
00007 std::cerr << "[ERROR] drovector::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, 0, i, Desc );
00017 }
00018
00019
00020
00021 inline double drovector::operator()(const long& i) const
00022 {
00023 #ifdef CPPSL_DEBUG
00024 if( i<0 || L<=i ){
00025 std::cerr << "[ERROR] drovector::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, 1, i+1, Desc);
00036 return alpha;
00037 }
00038
00039
00040
00041
00042
00043
00044
00045 inline void drovector::set(const long& i, const double& v) const
00046 {
00047 #ifdef CPPSL_DEBUG
00048 if( i<0 || L<=i ){
00049 std::cerr << "[ERROR] drovector::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, 1, i+1, Desc, v);
00059 }
00060
00061
00062
00063
00064
00065
00066 inline std::ostream& operator<<(std::ostream& s, const drovector& vec)
00067 {
00068 for(long i=0; i<vec.Ll; i++){ s << " " << vec(i); }
00069 s << std::endl;
00070
00071 return s;
00072 }