CPPLapack
|
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class More...
#include <_zrovector.hpp>
(DO NOT USE) Smart-temporary Complex Double-precision Row Vector Class
Definition at line 3 of file _zrovector.hpp.
_zrovector::_zrovector | ( | ) | [inline] |
_zrovector::_zrovector | ( | const _zrovector & | vec | ) | [inline] |
_zrovector::~_zrovector | ( | ) | [inline] |
_zrovector destructor
Definition at line 27 of file _zrovector-constructor.hpp.
References array.
{VERBOSE_REPORT; delete [] array; }
comple & _zrovector::operator() | ( | const long & | i | ) | const [inline] |
void _zrovector::write | ( | const char * | filename | ) | const [inline] |
Definition at line 36 of file _zrovector-io.hpp.
References destroy(), i(), l, and operator()().
{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 << "#zrovector" << " " << l << std::endl; for(long i=0; i<l; i++){ ofs << operator()(i) << " "; } ofs << std::endl; ofs.close(); destroy(); }
void _zrovector::nullify | ( | ) | const [inline] |
nullify all the vector data
Definition at line 3 of file _zrovector-misc.hpp.
Referenced by _zrovector(), zrovector::shallow_copy(), and zrovector::zrovector().
void _zrovector::destroy | ( | ) | const [inline] |
destroy all the vector data
Definition at line 11 of file _zrovector-misc.hpp.
References array.
Referenced by conjt(), damax(), idamax(), nrm2(), operator%(), operator*(), operator+(), zrovector::operator+=(), operator-(), zrovector::operator-=(), operator<<(), and write().
std::ostream& operator<< | ( | std::ostream & | s, |
const _zrovector & | vec | ||
) | [friend] |
_zcovector t | ( | const _zrovector & | rovec | ) | [friend] |
return a transposed column vector
Definition at line 3 of file _zrovector-calc.hpp.
_zrovector conj | ( | const _zrovector & | vec | ) | [friend] |
_zcovector conjt | ( | const _zrovector & | rovec | ) | [friend] |
double nrm2 | ( | const _zrovector & | vec | ) | [friend] |
return its Euclidean norm
Definition at line 38 of file _zrovector-calc.hpp.
long idamax | ( | const _zrovector & | vec | ) | [friend] |
comple damax | ( | const _zrovector & | vec | ) | [friend] |
const _zrovector& operator+ | ( | const _zrovector & | vec | ) | [friend] |
+_zrovector operator
Definition at line 3 of file _zrovector-unary.hpp.
{VERBOSE_REPORT;
return vec;
}
_zrovector operator- | ( | const _zrovector & | vec | ) | [friend] |
_zrovector operator+ | ( | const _zrovector & | vecA, |
const zrovector & | vecB | ||
) | [friend] |
_zrovector+zrovector operator
Definition at line 3 of file _zrovector-zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a sumation." << std::endl << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<vecA.l; i++){ vecA.array[i]+=vecB.array[i]; } return vecA; }
_zrovector operator+ | ( | const _zrovector & | vecA, |
const _zrovector & | vecB | ||
) | [friend] |
_zrovector+_zrovector operator
Definition at line 3 of file _zrovector-_zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a sumation." << std::endl << "Your input was (" << vecA.l << ") + (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<vecA.l; i++){ vecA.array[i]+=vecB.array[i]; } vecB.destroy(); return vecA; }
_zrovector operator- | ( | const _zrovector & | vecA, |
const zrovector & | vecB | ||
) | [friend] |
zrovector-zrovector operator
Definition at line 22 of file _zrovector-zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a subtraction." << std::endl << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<vecA.l; i++){ vecA.array[i]-=vecB.array[i]; } return vecA; }
_zrovector operator- | ( | const _zrovector & | vecA, |
const _zrovector & | vecB | ||
) | [friend] |
_zrovector-_zrovector operator
Definition at line 23 of file _zrovector-_zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a subtraction." << std::endl << "Your input was (" << vecA.l << ") - (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG for(long i=0; i<vecA.l; i++){ vecA.array[i]-=vecB.array[i]; } vecB.destroy(); return vecA; }
comple operator* | ( | const _zrovector & | rovec, |
const zcovector & | covec | ||
) | [friend] |
_zrovector*zcovector operator
Definition at line 3 of file _zrovector-zcovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(rovec.l!=covec.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a product." << std::endl << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG comple val( zdotu_( rovec.l, rovec.array, 1, covec.array, 1 ) ); rovec.destroy(); return val; }
comple operator* | ( | const _zrovector & | rovec, |
const _zcovector & | covec | ||
) | [friend] |
_zrovector*_zcovector operator
Definition at line 3 of file _zrovector-_zcovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(rovec.l!=covec.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a product." << std::endl << "Your input was (" << rovec.l << ") * (" << covec.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG comple val( zdotu_( rovec.l, rovec.array, 1, covec.array, 1 ) ); rovec.destroy(); covec.destroy(); return val; }
_zrovector operator* | ( | const _zrovector & | vec, |
const zgematrix & | mat | ||
) | [friend] |
_zrovector*zgematrix operator
Definition at line 3 of file _zrovector-zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zgemv_( 'T', mat.m, mat.n, comple(1.0,0.0), mat.array, mat.m, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const _zgematrix & | mat | ||
) | [friend] |
_zrovector*_zgematrix operator
Definition at line 3 of file _zrovector-_zgematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zgemv_( 'T', mat.m, mat.n, comple(1.0,0.0), mat.array, mat.m, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); mat.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const zhematrix & | mat | ||
) | [friend] |
_zrovector*zhematrix operator
Definition at line 3 of file _zrovector-zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.n){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zhemv_( 'l', mat.n, comple(1.0,0.0), mat.array, mat.n, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const _zhematrix & | mat | ||
) | [friend] |
_zrovector*_zhematrix operator
Definition at line 3 of file _zrovector-_zhematrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.n){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.n << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zhemv_( 'l', mat.n, comple(1.0,0.0), mat.array, mat.n, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); mat.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const zgbmatrix & | mat | ||
) | [friend] |
_zrovector*zgbmatrix operator
Definition at line 3 of file _zrovector-zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zgbmv_( 'T', mat.m, mat.n, mat.kl, mat.ku, comple(1.0,0.0), mat.array, mat.kl+mat.ku+1, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const _zgbmatrix & | mat | ||
) | [friend] |
_zrovector*_zgbmatrix operator
Definition at line 3 of file _zrovector-_zgbmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); zgbmv_( 'T', mat.m, mat.n, mat.kl, mat.ku, comple(1.0,0.0), mat.array, mat.kl+mat.ku+1, vec.array, 1, comple(0.0,0.0), newvec.array, 1 ); vec.destroy(); mat.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const zgsmatrix & | mat | ||
) | [friend] |
_zrovector*zgsmatrix operator
Definition at line 3 of file _zrovector-zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->j) += vec(it->i)*it->v; } vec.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const _zgsmatrix & | mat | ||
) | [friend] |
_zrovector*_zgsmatrix operator
Definition at line 3 of file _zrovector-_zgsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->j) += vec(it->i)*it->v; } vec.destroy(); mat.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const zhsmatrix & | mat | ||
) | [friend] |
_zrovector*zhsmatrix operator
Definition at line 3 of file _zrovector-zhsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->j) +=vec(it->i)*it->v; if(it->i!=it->j){ newvec(it->i) +=vec(it->j)*std::conj(it->v); } } vec.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const _zhsmatrix & | mat | ||
) | [friend] |
_zrovector*_zhsmatrix operator
Definition at line 3 of file _zrovector-_zhsmatrix.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vec.l!=mat.m){ ERROR_REPORT; std::cerr << "These vector and matrix can not make a product." << std::endl << "Your input was (" << vec.l << ") * (" << mat.m << "x" << mat.n << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG zrovector newvec(mat.n); newvec.zero(); for(std::vector<zcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){ newvec(it->j) +=vec(it->i)*it->v; if(it->i!=it->j){ newvec(it->i) +=vec(it->j)*std::conj(it->v); } } vec.destroy(); mat.destroy(); return _(newvec); }
_zrovector operator* | ( | const _zrovector & | vec, |
const double & | d | ||
) | [friend] |
_zrovector*double operator
Definition at line 3 of file _zrovector-double.hpp.
_zrovector operator* | ( | const _zrovector & | vec, |
const comple & | d | ||
) | [friend] |
_zrovector*comple operator
Definition at line 3 of file _zrovector-complex.hpp.
_zrovector operator/ | ( | const _zrovector & | vec, |
const double & | d | ||
) | [friend] |
_zrovector/double operator
Definition at line 11 of file _zrovector-double.hpp.
_zrovector operator/ | ( | const _zrovector & | vec, |
const comple & | d | ||
) | [friend] |
_zrovector/comple operator
Definition at line 11 of file _zrovector-complex.hpp.
comple operator% | ( | const _zrovector & | vecA, |
const zrovector & | vecB | ||
) | [friend] |
zrovector^T*zrovector operator (inner product)
Definition at line 40 of file _zrovector-zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a dot product." << std::endl << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG comple val( zdotu_( vecA.l, vecA.array, 1, vecB.array, 1 ) ); vecA.destroy(); return val; }
comple operator% | ( | const _zrovector & | vecA, |
const _zrovector & | vecB | ||
) | [friend] |
_zrovector^T*_zrovector operator (inner product)
Definition at line 42 of file _zrovector-_zrovector.hpp.
{VERBOSE_REPORT; #ifdef CPPL_DEBUG if(vecA.l!=vecB.l){ ERROR_REPORT; std::cerr << "These two vectors can not make a dot product." << std::endl << "Your input was (" << vecA.l << ") % (" << vecB.l << ")." << std::endl; exit(1); } #endif//CPPL_DEBUG comple val( zdotu_( vecA.l, vecA.array, 1, vecB.array, 1 ) ); vecA.destroy(); vecB.destroy(); return val; }
_zrovector operator* | ( | const double & | d, |
const _zrovector & | vec | ||
) | [friend] |
double*_zrovector operator
Definition at line 3 of file double-_zrovector.hpp.
_zrovector operator* | ( | const comple & | d, |
const _zrovector & | vec | ||
) | [friend] |
comple*_zrovector operator
Definition at line 3 of file complex-_zrovector.hpp.
long _zrovector::l [mutable] |
vector size
Definition at line 9 of file _zrovector.hpp.
Referenced by _(), _zrovector(), conj(), conjt(), damax(), idamax(), nrm2(), nullify(), operator%(), operator()(), operator*(), operator+(), zrovector::operator+=(), operator-(), zrovector::operator-=(), operator/(), operator<<(), zrovector::shallow_copy(), t(), write(), and zrovector::zrovector().
comple* _zrovector::array [mutable] |
1D array to store vector data
Definition at line 10 of file _zrovector.hpp.
Referenced by _(), _zrovector(), damax(), destroy(), idamax(), nrm2(), nullify(), operator%(), operator()(), operator*(), operator+(), zrovector::operator+=(), operator-(), zrovector::operator-=(), operator/(), operator<<(), zrovector::shallow_copy(), t(), zrovector::zrovector(), and ~_zrovector().