00001
00003 inline std::complex<double>& _zcovector::operator()(const long& i) const
00004 {
00005 #ifdef CPPL_VERBOSE
00006 std::cerr << "# [MARK] _zcovector::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] _zcovector::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 _zcovector& vec)
00030 {
00031 #ifdef CPPL_VERBOSE
00032 std::cerr << "# [MARK] operator<<(std::ostream&, const _zcovector&)"
00033 << std::endl;
00034 #endif//CPPL_VERBOSE
00035
00036 for(long i=0; i<vec.L; i++){
00037 s << " " << vec.Array[i] << std::endl;
00038 }
00039
00040 vec.destroy();
00041 return s;
00042 }
00043
00047
00048
00049 inline void _zcovector::write(const char* filename) const
00050 {
00051 #ifdef CPPL_VERBOSE
00052 std::cerr << "# [MARK] _zcovector::write(const char*) const"
00053 << std::endl;
00054 #endif//CPPL_VERBOSE
00055
00056 std::ofstream s(filename, std::ios::trunc);
00057
00058 s << "zcovector" << " " << L << std::endl;
00059 for(long i=0; i<L; i++){
00060 s << operator()(i) << std::endl;
00061 }
00062
00063 s.close();
00064 destroy();
00065 }