00001
00003 inline std::complex<double>& _zrovector::operator()(const long& i) const
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] _zrovector::operator()(const long&) const"
00007 << std::endl;
00008 #endif//CPPL_VERBOSE
00009
00010 #ifdef CPPL_DEBUG
00011 if( i<0 || L<=i ){
00012 std::cerr << "[ERROR] _zrovector::operator()(const long&) const"
00013 << std::endl
00014 << "The required component is out of the vector size."
00015 << std::endl
00016 << "Your input was (" << i << ")." << std::endl;
00017 exit(1);
00018 }
00019 #endif//CPPL_DEBUG
00020
00021 return Array[i];
00022 }
00023
00027
00028
00029 inline std::ostream& operator<<(std::ostream& s, const _zrovector& vec)
00030 {
00031 #ifdef CPPL_VERBOSE
00032 std::cerr << "# [MARK] operator<<(std::ostream&, const _zrovector&)"
00033 << std::endl;
00034 #endif//CPPL_VERBOSE
00035
00036 for(long i=0; i<vec.L; i++){ s << " " << vec.Array[i]; }
00037 s << std::endl;
00038
00039 vec.destroy();
00040 return s;
00041 }
00042
00046
00047
00048 inline void _zrovector::write(const char* filename) const
00049 {
00050 #ifdef CPPL_VERBOSE
00051 std::cerr << "# [MARK] _zrovector::write(const char*) const"
00052 << std::endl;
00053 #endif//CPPL_VERBOSE
00054
00055 std::ofstream s(filename, std::ios::trunc);
00056
00057 s << "zrovector" << " " << L << std::endl;
00058 for(long i=0; i<L; i++){
00059 s << operator()(i) << " ";
00060 }
00061 s << std::endl;
00062
00063 s.close();
00064 destroy();
00065 }