CPPLapack
|
Samll Complex Double-precision General Dence Matrix Class. More...
#include <zgematrix_small.hpp>
Public Member Functions | |
zgematrix_small () | |
zgematrix_small (const zgematrix &) | |
zgematrix_small (const comple &) | |
~zgematrix_small () | |
_zgematrix | to_zgematrix () const |
comple & | operator() (const long &i, const long &j) |
comple | operator() (const long &i, const long &j) const |
zgematrix_small< m, n > & | set (const long &i, const long &j, const comple &v) |
void | read (const char *filename) |
void | write (const char *filename) const |
zgematrix_small< m, n > & | zero () |
zgematrix_small< m, n > & | identity () |
zcovector_small< m > | col (const long &j) const |
zrovector_small< n > | row (const long &i) const |
template<long M, long N> | |
zgematrix_small< M, N > & | operator= (const zgematrix_small< M, N > &) |
Public Attributes | |
comple | array [m *n] |
Friends | |
template<long _m, long _n> | |
std::ostream & | operator<< (std::ostream &, const zgematrix_small< _m, _n > &) |
template<long _m, long _n> | |
zgematrix_small< n, m > | t (const zgematrix_small< m, n > &) |
template<long M, long N> | |
zgematrix_small< M, N > & | operator+= (zgematrix_small< M, N > &, const zgematrix_small< M, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > & | operator-= (zgematrix_small< M, N > &, const zgematrix_small< M, N > &) |
template<long M, long L, long N> | |
zgematrix_small< M, N > & | operator*= (zgematrix_small< M, L > &, const zgematrix_small< L, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > & | operator*= (zgematrix_small< M, N > &, const comple &) |
template<long M, long N> | |
zgematrix_small< M, N > & | operator/= (zgematrix_small< M, N > &, const comple &) |
template<long M, long N> | |
const zgematrix_small< M, N > & | operator+ (const zgematrix_small< M, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator- (const zgematrix_small< M, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator+ (const zgematrix_small< M, N > &, const zgematrix_small< M, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator+ (const zgematrix_small< M, N > &, const zhematrix_small< N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator- (const zgematrix_small< M, N > &, const zgematrix_small< M, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator- (const zgematrix_small< M, N > &, const zhematrix_small< N > &) |
template<long M, long N> | |
zcovector_small< M > | operator* (const zgematrix_small< M, N > &, const zcovector_small< N > &) |
template<long M, long L, long N> | |
zgematrix_small< M, N > | operator* (const zgematrix_small< M, L > &, const zgematrix_small< L, N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator* (const zgematrix_small< M, N > &, const zhematrix_small< N > &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator* (const zgematrix_small< M, N > &, const comple &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator/ (const zgematrix_small< M, N > &, const comple &) |
template<long M, long N> | |
zgematrix_small< M, N > | operator* (const comple &, const zgematrix_small< M, N > &) |
Samll Complex Double-precision General Dence Matrix Class.
Definition at line 3 of file zgematrix_small.hpp.
zgematrix_small< m, n >::zgematrix_small | ( | ) | [inline] |
Definition at line 4 of file zgematrix_small-constructors.hpp.
{VERBOSE_REPORT; ; }
zgematrix_small< m, n >::zgematrix_small | ( | const zgematrix & | mat | ) | [inline, explicit] |
Definition at line 12 of file zgematrix_small-constructors.hpp.
References zgematrix::array, zgematrix::m, and zgematrix::n.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if( m!=mat.m || n!=mat.n ){ ERROR_REPORT; std::cerr << "Matrix sizes must be the same." << std::endl << "Your input was " << m << "x" << n << " and " << mat.m << "x" << mat.n << "." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long k=0; k<m*n; k++){ array[k] =mat.array[k]; } }
zgematrix_small< m, n >::zgematrix_small | ( | const comple & | x | ) | [inline] |
Definition at line 31 of file zgematrix_small-constructors.hpp.
{VERBOSE_REPORT; for(long k=0; k<m*n; k++){ array[k] =x; } }
zgematrix_small< m, n >::~zgematrix_small | ( | ) | [inline] |
Definition at line 45 of file zgematrix_small-constructors.hpp.
{VERBOSE_REPORT; ; }
_zgematrix zgematrix_small< m, n >::to_zgematrix | ( | ) | const [inline] |
comple & zgematrix_small< m, n >::operator() | ( | const long & | i, |
const long & | j | ||
) | [inline] |
Definition at line 22 of file zgematrix_small-functions.hpp.
comple zgematrix_small< m, n >::operator() | ( | const long & | i, |
const long & | j | ||
) | const [inline] |
Definition at line 30 of file zgematrix_small-functions.hpp.
zgematrix_small< m, n > & zgematrix_small< m, n >::set | ( | const long & | i, |
const long & | j, | ||
const comple & | v | ||
) | [inline] |
Definition at line 38 of file zgematrix_small-functions.hpp.
References i().
{VERBOSE_REPORT; (*this)(i,j) =v; return *this; }
void zgematrix_small< m, n >::read | ( | const char * | filename | ) | [inline] |
Definition at line 82 of file zgematrix_small-functions.hpp.
References i().
{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 != "zgematrix" && id != "#zgematrix" ){ ERROR_REPORT; std::cerr << "The type name of the file \"" << filename << "\" is not zgematrix." << std::endl << "Its type name was " << id << " ." << std::endl; exit(1); } long _m, _n; s >> _m >> _n; if(m!=_m || n!=_n){ ERROR_REPORT; std::cerr << "Matrix size is invalid." << std::endl; exit(1); } for(long i=0; i<m; i++){ for(long j=0; j<n; j++ ){ s >> operator()(i,j); } } 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; 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 zgematrix_small< m, n >::write | ( | const char * | filename | ) | const [inline] |
Definition at line 62 of file zgematrix_small-functions.hpp.
References i().
{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 << "#zgematrix" << " " << m << " " << n << std::endl; for(long i=0; i<m; i++){ for(long j=0; j<n; j++){ ofs << (*this)(i,j) << " "; } ofs << std::endl; } ofs.close(); }
zgematrix_small< m, n > & zgematrix_small< m, n >::zero | ( | ) | [inline] |
Definition at line 158 of file zgematrix_small-functions.hpp.
{VERBOSE_REPORT; for(long k=0; k<m*n; k++){ array[k] =comple(0.,0.); } return *this; }
zgematrix_small< m, n > & zgematrix_small< m, n >::identity | ( | ) | [inline] |
Definition at line 169 of file zgematrix_small-functions.hpp.
{VERBOSE_REPORT; zero(); for(long k=0; k<std::min(m,n); k++){ (*this)(k,k) =1.; } return *this; }
zcovector_small< m > zgematrix_small< m, n >::col | ( | const long & | j | ) | const [inline] |
Definition at line 181 of file zgematrix_small-functions.hpp.
References i().
zrovector_small< n > zgematrix_small< m, n >::row | ( | const long & | i | ) | const [inline] |
Definition at line 193 of file zgematrix_small-functions.hpp.
References i().
{VERBOSE_REPORT; zrovector_small<n> vec; for(long j=0; j<n; j++){ vec(j)=(*this)(i,j); } return vec; }
zgematrix_small<M,N>& zgematrix_small< m, n >::operator= | ( | const zgematrix_small< M, N > & | ) | [inline] |
std::ostream& operator<< | ( | std::ostream & | , |
const zgematrix_small< _m, _n > & | |||
) | [friend] |
zgematrix_small<n,m> t | ( | const zgematrix_small< m, n > & | A | ) | [friend] |
Definition at line 140 of file zgematrix_small-functions.hpp.
zgematrix_small<M,N>& operator+= | ( | zgematrix_small< M, N > & | , |
const zgematrix_small< M, N > & | |||
) | [friend] |
zgematrix_small<M,N>& operator-= | ( | zgematrix_small< M, N > & | , |
const zgematrix_small< M, N > & | |||
) | [friend] |
zgematrix_small<M,N>& operator*= | ( | zgematrix_small< M, L > & | , |
const zgematrix_small< L, N > & | |||
) | [friend] |
zgematrix_small<M,N>& operator*= | ( | zgematrix_small< M, N > & | , |
const comple & | |||
) | [friend] |
zgematrix_small<M,N>& operator/= | ( | zgematrix_small< M, N > & | , |
const comple & | |||
) | [friend] |
const zgematrix_small<M,N>& operator+ | ( | const zgematrix_small< M, N > & | ) | [friend] |
zgematrix_small<M,N> operator- | ( | const zgematrix_small< M, N > & | ) | [friend] |
zgematrix_small<M,N> operator+ | ( | const zgematrix_small< M, N > & | , |
const zgematrix_small< M, N > & | |||
) | [friend] |
zgematrix_small<M,N> operator+ | ( | const zgematrix_small< M, N > & | , |
const zhematrix_small< N > & | |||
) | [friend] |
zgematrix_small<M,N> operator- | ( | const zgematrix_small< M, N > & | , |
const zgematrix_small< M, N > & | |||
) | [friend] |
zgematrix_small<M,N> operator- | ( | const zgematrix_small< M, N > & | , |
const zhematrix_small< N > & | |||
) | [friend] |
zcovector_small< M > operator* | ( | const zgematrix_small< M, N > & | , |
const zcovector_small< N > & | |||
) | [friend] |
zgematrix_small<M,N> operator* | ( | const zgematrix_small< M, L > & | , |
const zgematrix_small< L, N > & | |||
) | [friend] |
zgematrix_small<M,N> operator* | ( | const zgematrix_small< M, N > & | , |
const zhematrix_small< N > & | |||
) | [friend] |
zgematrix_small<M,N> operator* | ( | const zgematrix_small< M, N > & | , |
const comple & | |||
) | [friend] |
zgematrix_small<M,N> operator/ | ( | const zgematrix_small< M, N > & | , |
const comple & | |||
) | [friend] |
zgematrix_small<M,N> operator* | ( | const comple & | , |
const zgematrix_small< M, N > & | |||
) | [friend] |
comple zgematrix_small< m, n >::array[m *n] |
Definition at line 9 of file zgematrix_small.hpp.
Referenced by operator*=(), operator+=(), operator-=(), and operator/=().