CPPLapack
|
Samll Real Double-precision Row Vector Class. More...
#include <drovector_small.hpp>
Public Member Functions | |
drovector_small () | |
drovector_small (const drovector &) | |
drovector_small (const double &) | |
drovector_small (const double &, const double &) | |
drovector_small (const double &, const double &, const double &) | |
~drovector_small () | |
_drovector | to_drovector () const |
double & | operator() (const long &) |
double | operator() (const long &) const |
drovector_small< l > & | set (const long &, const double &) |
void | read (const char *filename) |
void | write (const char *filename) const |
drovector_small< l > & | zero () |
template<long L> | |
drovector_small< L > & | operator= (const drovector_small< L > &) |
Public Attributes | |
double | array [l] |
Friends | |
template<long _l> | |
std::ostream & | operator<< (std::ostream &, const drovector_small< _l > &) |
template<long _l> | |
dcovector_small< _l > | t (const drovector_small< _l > &) |
template<long _l> | |
double | nrm2 (const drovector_small< _l > &) |
template<long _l> | |
long | idamax (const drovector_small< _l > &) |
template<long _l> | |
double | damax (const drovector_small< _l > &) |
template<long L> | |
drovector_small< L > & | operator+= (drovector_small< L > &, const drovector_small< L > &) |
template<long L> | |
drovector_small< L > & | operator-= (drovector_small< L > &, const drovector_small< L > &) |
template<long L> | |
drovector_small< L > & | operator*= (drovector_small< L > &, const double &) |
template<long L> | |
drovector_small< L > & | operator/= (drovector_small< L > &, const double &) |
template<long L> | |
const drovector_small< L > & | operator+ (const drovector_small< L > &) |
template<long L> | |
drovector_small< L > | operator- (const drovector_small< L > &) |
template<long L> | |
drovector_small< L > | operator+ (const drovector_small< L > &, const drovector_small< L > &) |
template<long L> | |
drovector_small< L > | operator- (const drovector_small< L > &, const drovector_small< L > &) |
template<long L> | |
double | operator* (const drovector_small< L > &, const dcovector_small< L > &) |
template<long M, long N> | |
drovector_small< N > | operator* (const drovector_small< M > &, const dgematrix_small< M, N > &) |
template<long L> | |
drovector_small< L > | operator* (const drovector_small< L > &, const dsymatrix_small< L > &) |
template<long L> | |
drovector_small< L > | operator* (const drovector_small< L > &, const double &) |
template<long L> | |
drovector_small< L > | operator/ (const drovector_small< L > &, const double &) |
template<long L> | |
drovector_small< L > | operator* (const double &, const drovector_small< L > &) |
Samll Real Double-precision Row Vector Class.
Definition at line 3 of file drovector_small.hpp.
drovector_small< l >::drovector_small | ( | ) | [inline] |
Definition at line 4 of file drovector_small-constructors.hpp.
{VERBOSE_REPORT; ; }
drovector_small< l >::drovector_small | ( | const drovector & | vec | ) | [inline, explicit] |
Definition at line 12 of file drovector_small-constructors.hpp.
References drovector::array, and drovector::l.
drovector_small< l >::drovector_small | ( | const double & | x | ) | [inline] |
Definition at line 31 of file drovector_small-constructors.hpp.
{VERBOSE_REPORT; for(long k=0; k<l; k++){ array[k] =x; } }
drovector_small< l >::drovector_small | ( | const double & | x, |
const double & | y | ||
) | [inline] |
Definition at line 41 of file drovector_small-constructors.hpp.
drovector_small< l >::drovector_small | ( | const double & | x, |
const double & | y, | ||
const double & | z | ||
) | [inline] |
Definition at line 50 of file drovector_small-constructors.hpp.
drovector_small< l >::~drovector_small | ( | ) | [inline] |
Definition at line 64 of file drovector_small-constructors.hpp.
{VERBOSE_REPORT; ; }
_drovector drovector_small< l >::to_drovector | ( | ) | const [inline] |
Definition at line 4 of file drovector_small-functions.hpp.
References _().
double & drovector_small< l >::operator() | ( | const long & | k | ) | [inline] |
Definition at line 20 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; return array[k]; }
double drovector_small< l >::operator() | ( | const long & | k | ) | const [inline] |
Definition at line 28 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; return array[k]; }
drovector_small< l > & drovector_small< l >::set | ( | const long & | k, |
const double & | v | ||
) | [inline] |
Definition at line 36 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; (*this)(k) =v; return *this; }
void drovector_small< l >::read | ( | const char * | filename | ) | [inline] |
Definition at line 76 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; std::ifstream s( filename ); if(!s){ ERROR_REPORT; std::cerr << "The file \"" << filename << "\" can not be opened." << std::endl; exit(1); } std::string id; s >> id; if( id != "drovector" && id != "#drovector" ){ ERROR_REPORT; std::cerr << "The type name of the file \"" << filename << "\" is not drovector." << std::endl << "Its type name was " << id << " ." << std::endl; exit(1); } long _l; s >> _l; if(l!=_l){ ERROR_REPORT; std::cerr << "Matrix size is invalid." << std::endl; exit(1); } for(long k=0; k<l; k++){ s >> (*this)(k); } if(s.eof()){ ERROR_REPORT; std::cerr << "There is something is wrong with the file \"" << filename << "\"." << std::endl << "Most likely, there is not enough data components, or a linefeed code or space code is missing at the end of the last line." << std::endl; exit(1); } s >> id;//tmp if(!s.eof()){ ERROR_REPORT; std::cerr << "There is something is wrong with the file \"" << filename << "\"." << std::endl << "Most likely, there are extra data components." << std::endl; exit(1); } s.close(); }
void drovector_small< l >::write | ( | const char * | filename | ) | const [inline] |
Definition at line 58 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; std::ofstream ofs(filename, std::ios::trunc); ofs.setf(std::cout.flags()); ofs.precision(std::cout.precision()); ofs.width(std::cout.width()); ofs.fill(std::cout.fill()); ofs << "#drovector" << " " << l << std::endl; for(long k=0; k<l; k++){ ofs << (*this)(k) << std::endl; } ofs.close(); }
drovector_small< l > & drovector_small< l >::zero | ( | ) | [inline] |
Definition at line 200 of file drovector_small-functions.hpp.
{VERBOSE_REPORT; for(long k=0; k<l; k++){ array[k] =0.; } return *this; }
drovector_small<L>& drovector_small< l >::operator= | ( | const drovector_small< L > & | ) | [inline] |
std::ostream& operator<< | ( | std::ostream & | , |
const drovector_small< _l > & | |||
) | [friend] |
drovector_small<L>& operator+= | ( | drovector_small< L > & | , |
const drovector_small< L > & | |||
) | [friend] |
drovector_small<L>& operator-= | ( | drovector_small< L > & | , |
const drovector_small< L > & | |||
) | [friend] |
drovector_small<L>& operator*= | ( | drovector_small< L > & | , |
const double & | |||
) | [friend] |
drovector_small<L>& operator/= | ( | drovector_small< L > & | , |
const double & | |||
) | [friend] |
const drovector_small<L>& operator+ | ( | const drovector_small< L > & | ) | [friend] |
drovector_small<L> operator- | ( | const drovector_small< L > & | ) | [friend] |
drovector_small<L> operator+ | ( | const drovector_small< L > & | , |
const drovector_small< L > & | |||
) | [friend] |
drovector_small<L> operator- | ( | const drovector_small< L > & | , |
const drovector_small< L > & | |||
) | [friend] |
double operator* | ( | const drovector_small< L > & | , |
const dcovector_small< L > & | |||
) | [friend] |
drovector_small<N> operator* | ( | const drovector_small< M > & | , |
const dgematrix_small< M, N > & | |||
) | [friend] |
drovector_small<L> operator* | ( | const drovector_small< L > & | , |
const dsymatrix_small< L > & | |||
) | [friend] |
drovector_small<L> operator* | ( | const drovector_small< L > & | , |
const double & | |||
) | [friend] |
drovector_small<L> operator/ | ( | const drovector_small< L > & | , |
const double & | |||
) | [friend] |
drovector_small<L> operator* | ( | const double & | , |
const drovector_small< L > & | |||
) | [friend] |
double drovector_small< l >::array[l] |
Definition at line 9 of file drovector_small.hpp.