CPPLapack
Public Member Functions | Public Attributes | Friends
zcovector_small< l > Class Template Reference

Samll Complex Double-precision Column Vector Class. More...

#include <zcovector_small.hpp>

List of all members.

Public Member Functions

 zcovector_small ()
 zcovector_small (const zcovector &)
 zcovector_small (const comple &)
 zcovector_small (const comple &, const comple &)
 zcovector_small (const comple &, const comple &, const comple &)
 ~zcovector_small ()
_zcovector to_zcovector () const
comple & operator() (const long &)
comple operator() (const long &) const
zcovector_small< l > & set (const long &, const comple &)
void read (const char *filename)
void write (const char *filename) const
zcovector_small< l > & zero ()
template<long L>
zcovector_small< L > & operator= (const zcovector_small< L > &)

Public Attributes

comple array [l]

Friends

template<long _l>
std::ostream & operator<< (std::ostream &, const zcovector_small< _l > &)
template<long _l>
zrovector_small< _l > t (const zcovector_small< _l > &)
template<long _l>
comple nrm2 (const zcovector_small< _l > &)
template<long _l>
long idamax (const zcovector_small< _l > &)
template<long _l>
comple damax (const zcovector_small< _l > &)
template<long L>
zcovector_small< L > & operator+= (zcovector_small< L > &, const zcovector_small< L > &)
template<long L>
zcovector_small< L > & operator-= (zcovector_small< L > &, const zcovector_small< L > &)
template<long L>
zcovector_small< L > & operator*= (zcovector_small< L > &, const comple &)
template<long L>
zcovector_small< L > & operator/= (zcovector_small< L > &, const comple &)
template<long L>
const zcovector_small< L > & operator+ (const zcovector_small< L > &)
template<long L>
zcovector_small< L > operator- (const zcovector_small< L > &)
template<long L>
zcovector_small< L > operator+ (const zcovector_small< L > &, const zcovector_small< L > &)
template<long L>
zcovector_small< L > operator- (const zcovector_small< L > &, const zcovector_small< L > &)
template<long M, long N>
zgematrix_small< M, N > operator* (const zcovector_small< M > &, const zrovector_small< N > &)
template<long L>
zcovector_small< L > operator* (const zcovector_small< L > &, const comple &)
template<long L>
zcovector_small< L > operator/ (const zcovector_small< L > &, const comple &)
template<long L>
zcovector_small< L > operator* (const comple &, const zcovector_small< L > &)

Detailed Description

template<long l>
class zcovector_small< l >

Samll Complex Double-precision Column Vector Class.

Definition at line 3 of file zcovector_small.hpp.


Constructor & Destructor Documentation

template<long l>
zcovector_small< l >::zcovector_small ( ) [inline]

Definition at line 4 of file zcovector_small-constructors.hpp.

{VERBOSE_REPORT;
  ;
}
template<long l>
zcovector_small< l >::zcovector_small ( const zcovector vec) [inline, explicit]

Definition at line 12 of file zcovector_small-constructors.hpp.

References zcovector::array, and zcovector::l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l!=vec.l ){
    ERROR_REPORT;
    std::cerr << "Vector sizes must be the same." << std::endl
              << "Your input was " << l << " and " << vec.l << "." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(long k=0; k<l; k++){
    array[k] =vec.array[k];
  }
}
template<long l>
zcovector_small< l >::zcovector_small ( const comple &  x) [inline]

Definition at line 31 of file zcovector_small-constructors.hpp.

{VERBOSE_REPORT;
  for(long k=0; k<l; k++){
    array[k] =x;
  }
}
template<long l>
zcovector_small< l >::zcovector_small ( const comple &  x,
const comple &  y 
) [inline]

Definition at line 41 of file zcovector_small-constructors.hpp.

{VERBOSE_REPORT;
  array[0] =x;
  array[1] =y;
}
template<long l>
zcovector_small< l >::zcovector_small ( const comple &  x,
const comple &  y,
const comple &  z 
) [inline]

Definition at line 50 of file zcovector_small-constructors.hpp.

{VERBOSE_REPORT;
  array[0] =x;
  array[1] =y;
  array[2] =z;
}
template<long l>
zcovector_small< l >::~zcovector_small ( ) [inline]

Definition at line 64 of file zcovector_small-constructors.hpp.

{VERBOSE_REPORT;
  ;
}

Member Function Documentation

template<long l>
_zcovector zcovector_small< l >::to_zcovector ( ) const [inline]

Definition at line 4 of file zcovector_small-functions.hpp.

References _().

{VERBOSE_REPORT;
  zcovector vec(l);
  for(long k=0; k<l; k++){
    vec(k) =(*this)(k);
  }
  return _(vec);
}
template<long l>
comple & zcovector_small< l >::operator() ( const long &  k) [inline]

Definition at line 20 of file zcovector_small-functions.hpp.

{VERBOSE_REPORT;
  return array[k];
}
template<long l>
comple zcovector_small< l >::operator() ( const long &  k) const [inline]

Definition at line 28 of file zcovector_small-functions.hpp.

{VERBOSE_REPORT;
  return array[k];
}
template<long l>
zcovector_small< l > & zcovector_small< l >::set ( const long &  k,
const comple &  v 
) [inline]

Definition at line 36 of file zcovector_small-functions.hpp.

{VERBOSE_REPORT;
  (*this)(k) =v;
  return *this;
}
template<long l>
void zcovector_small< l >::read ( const char *  filename) [inline]

Definition at line 75 of file zcovector_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 != "zcovector" && id != "#zcovector" ){
    ERROR_REPORT;
    std::cerr << "The type name of the file \"" << filename << "\" is not zcovector." << 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();    
}
template<long l>
void zcovector_small< l >::write ( const char *  filename) const [inline]

Definition at line 57 of file zcovector_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 << "#zcovector" << " " << l << std::endl;
  for(long k=0; k<l; k++){
    ofs << (*this)(k) << std::endl;
  }
  ofs.close();
}
template<long l>
zcovector_small< l > & zcovector_small< l >::zero ( ) [inline]

Definition at line 196 of file zcovector_small-functions.hpp.

{VERBOSE_REPORT;
  for(long k=0; k<l; k++){
    array[k] =0.;
  }
  return *this;
}
template<long l>
template<long L>
zcovector_small<L>& zcovector_small< l >::operator= ( const zcovector_small< L > &  ) [inline]

Friends And Related Function Documentation

template<long l>
template<long _l>
std::ostream& operator<< ( std::ostream &  ,
const zcovector_small< _l > &   
) [friend]
template<long l>
template<long _l>
zrovector_small<_l> t ( const zcovector_small< _l > &  ) [friend]
template<long l>
template<long _l>
comple nrm2 ( const zcovector_small< _l > &  ) [friend]
template<long l>
template<long _l>
long idamax ( const zcovector_small< _l > &  ) [friend]
template<long l>
template<long _l>
comple damax ( const zcovector_small< _l > &  ) [friend]
template<long l>
template<long L>
zcovector_small<L>& operator+= ( zcovector_small< L > &  ,
const zcovector_small< L > &   
) [friend]
template<long l>
template<long L>
zcovector_small<L>& operator-= ( zcovector_small< L > &  ,
const zcovector_small< L > &   
) [friend]
template<long l>
template<long L>
zcovector_small<L>& operator*= ( zcovector_small< L > &  ,
const comple &   
) [friend]
template<long l>
template<long L>
zcovector_small<L>& operator/= ( zcovector_small< L > &  ,
const comple &   
) [friend]
template<long l>
template<long L>
const zcovector_small<L>& operator+ ( const zcovector_small< L > &  ) [friend]
template<long l>
template<long L>
zcovector_small<L> operator- ( const zcovector_small< L > &  ) [friend]
template<long l>
template<long L>
zcovector_small<L> operator+ ( const zcovector_small< L > &  ,
const zcovector_small< L > &   
) [friend]
template<long l>
template<long L>
zcovector_small<L> operator- ( const zcovector_small< L > &  ,
const zcovector_small< L > &   
) [friend]
template<long l>
template<long M, long N>
zgematrix_small<M,N> operator* ( const zcovector_small< M > &  ,
const zrovector_small< N > &   
) [friend]
template<long l>
template<long L>
zcovector_small<L> operator* ( const zcovector_small< L > &  ,
const comple &   
) [friend]
template<long l>
template<long L>
zcovector_small<L> operator/ ( const zcovector_small< L > &  ,
const comple &   
) [friend]
template<long l>
template<long L>
zcovector_small<L> operator* ( const comple &  ,
const zcovector_small< L > &   
) [friend]

Member Data Documentation

template<long l>
comple zcovector_small< l >::array[l]

Definition at line 9 of file zcovector_small.hpp.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Friends