6 std::cerr <<
"# [MARK] drovector::operator()(const long&)"
12 std::cerr <<
"[ERROR] drovector::operator()(const long&)"
14 <<
"The required component is out of the vector size."
16 <<
"Your input was (" << i <<
")." << std::endl;
29 std::cerr <<
"# [MARK] drovector::operator()(const long&) const"
35 std::cerr <<
"[ERROR] drovector::operator()(const long&) const"
37 <<
"The required component is out of the vector size."
39 <<
"Your input was (" << i <<
")." << std::endl;
56 std::cerr <<
"# [MARK] drovector::set(const long&, const double&) const"
62 std::cerr <<
"[ERROR] drovector::set(const long&, const double&) const"
64 <<
"The required component is out of the vector size."
66 <<
"Your input was (" << i <<
")." << std::endl;
79 inline std::ostream& operator<<(std::ostream& s,
const drovector& vec)
82 std::cerr <<
"# [MARK] operator<<(std::ostream&, const drovector&)"
86 for(
long i=0; i<vec.L; i++){ s <<
" " << vec.Array[i]; }
97 inline void drovector::write(
const char *filename)
const
100 std::cerr <<
"# [MARK] drovector::write(const char*) const"
104 std::ofstream s(filename, std::ios::trunc);
106 s <<
"drovector" <<
" " <<
L << std::endl;
107 for(
long i=0; i<
L; i++){
116 inline void drovector::read(
const char *filename)
119 std::cerr <<
"# [MARK] drovector::read(const char*)"
123 std::ifstream s( filename );
125 std::cerr <<
"[ERROR] drovector::read(const char*) " << std::endl
126 <<
"The file \"" << filename <<
"\" can not be opened."
133 if(
id !=
"drovector" ){
134 std::cerr <<
"[ERROR] drovector::read(const char*) " << std::endl
135 <<
"The type name of the file \"" << filename
136 <<
"\" is not drovector." << std::endl
137 <<
"Its type name was " <<
id <<
" ." << std::endl;
145 std::cerr <<
"[ERROR] drovector::read(const char*) " << std::endl
146 <<
"There is something is wrong with the file \""
147 << filename <<
" ." << std::endl
148 <<
"Most likely, there is not enough data components, "
149 <<
"or a linefeed code or space code is missing "
150 <<
"at the end of the last line." << std::endl;
double & operator()(const long &)
Definition: drovector-io.hpp:3
double * Array
1D Array to store vector data
Definition: _drovector.hpp:8
Real Double-precision Row Vector Class.
Definition: drovector.hpp:3
void set(const long &, const double &) const
Definition: drovector-io.hpp:53
long L
vector size
Definition: _drovector.hpp:7
void resize(const long &)
Definition: drovector-misc.hpp:93