CPPLapack
Public Member Functions | Public Attributes | Friends
dcovector Class Reference

Real Double-precision Column Vector Class. More...

#include <dcovector.hpp>

List of all members.

Public Member Functions

 dcovector ()
 dcovector (const dcovector &)
 dcovector (const _dcovector &)
 dcovector (const long &, const long=0)
 dcovector (const char *)
 ~dcovector ()
_zcovector to_zcovector () const
double & operator() (const long &)
double operator() (const long &) const
dcovectorset (const long &, const double &)
void write (const char *) const
void read (const char *)
void clear ()
dcovectorzero ()
void chsign ()
void copy (const dcovector &)
void shallow_copy (const _dcovector &)
void alias (const dcovector &)
void unalias ()
dcovectorresize (const long &, const long=0)
void stretch (const long &)
dcovectoroperator= (const dcovector &)
dcovectoroperator= (const _dcovector &)
dcovectoroperator+= (const dcovector &)
dcovectoroperator+= (const _dcovector &)
dcovectoroperator-= (const dcovector &)
dcovectoroperator-= (const _dcovector &)
dcovectoroperator*= (const double &)
dcovectoroperator/= (const double &)

Public Attributes

long l
 vector size
long cap
 vector capacity
double * array
 1D array to store vector data

Friends

std::ostream & operator<< (std::ostream &, const dcovector &)
_drovector t (const dcovector &)
double nrm2 (const dcovector &)
long idamax (const dcovector &)
double damax (const dcovector &)
void swap (dcovector &, dcovector &)
_dcovector _ (dcovector &)
const dcovectoroperator+ (const dcovector &)
_dcovector operator- (const dcovector &)
_dcovector operator+ (const dcovector &, const dcovector &)
_dcovector operator+ (const dcovector &, const _dcovector &)
_dcovector operator- (const dcovector &, const dcovector &)
_dcovector operator- (const dcovector &, const _dcovector &)
_dgematrix operator* (const dcovector &, const drovector &)
_dgematrix operator* (const dcovector &, const _drovector &)
_dcovector operator* (const dcovector &, const double &)
_dcovector operator/ (const dcovector &, const double &)
double operator% (const dcovector &, const dcovector &)
double operator% (const dcovector &, const _dcovector &)
_dcovector operator* (const double &, const dcovector &)

Detailed Description

Real Double-precision Column Vector Class.

Definition at line 3 of file dcovector.hpp.


Constructor & Destructor Documentation

dcovector::dcovector ( ) [inline]

dcovector constructor

Definition at line 3 of file dcovector-constructor.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
  //////// initialize ////////
  l =0;
  cap =0;
  array =NULL;
}
dcovector::dcovector ( const dcovector vec) [inline]

dcovector copy constructor

Definition at line 13 of file dcovector-constructor.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
  //////// initialize ////////
  l =vec.l;
  cap =vec.cap;
  array =new double[cap];
  
  //////// copy ////////
  dcopy_(l, vec.array, 1, array, 1);
}
dcovector::dcovector ( const _dcovector vec) [inline]

dcovector constructor to cast _dcovector

Definition at line 26 of file dcovector-constructor.hpp.

References array, _dcovector::array, cap, _dcovector::cap, _dcovector::l, l, and _dcovector::nullify().

{VERBOSE_REPORT;
  //////// initialize ////////
  l =vec.l;
  cap =vec.cap;
  array =vec.array;
  
  vec.nullify();
}
dcovector::dcovector ( const long &  _l,
const long  margin = 0 
) [inline]

dcovector constructor with size specification

Definition at line 38 of file dcovector-constructor.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( _l<0 ){
    ERROR_REPORT;
    std::cerr << "Vector size must be positive integers. " << std::endl
              << "Your input was (" << _l << ")." << std::endl;
    exit(1);
  }
  if( margin<0 ){
    ERROR_REPORT;
    std::cerr << "Vector margin must be zero or above. " << std::endl
              << "Your input was (" << _l << ", " << margin << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  //////// initialize ////////
  l =_l;
  cap =l+margin;
  array =new double[cap];
}
dcovector::dcovector ( const char *  filename) [inline]

dcovector constructor with filename

Definition at line 63 of file dcovector-constructor.hpp.

References array, and read().

{VERBOSE_REPORT;
  array =NULL;
  read(filename);
}
dcovector::~dcovector ( ) [inline]

dcovector destructor

Definition at line 75 of file dcovector-constructor.hpp.

References array.

{VERBOSE_REPORT;
  //////// delete array ////////
  delete [] array;
}

Member Function Documentation

_zcovector dcovector::to_zcovector ( ) const [inline]

cast to _zcovector

Definition at line 3 of file dcovector-cast.hpp.

References _, zcovector::array, array, i(), and l.

{VERBOSE_REPORT;
  zcovector newvec(l);
  
  for(long i=0; i<l; i++){
    newvec.array[i] =comple(array[i], 0.);
  }
  
  return _(newvec);
}
double & dcovector::operator() ( const long &  i) [inline]

operator() for non-const object

Definition at line 3 of file dcovector-io.hpp.

References array, i(), and l.

Referenced by read(), and write().

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( i<0 || l<=i ){
    ERROR_REPORT;
    std::cerr << "The required component is out of the vector size." << std::endl
              << "Your input was (" << i << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  return array[i];
}
double dcovector::operator() ( const long &  i) const [inline]

operator() for const object

Definition at line 19 of file dcovector-io.hpp.

References array, i(), and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( i<0 || l<=i ){
    ERROR_REPORT;
    std::cerr << "The required component is out of the vector size." << std::endl
              << "Your input was (" << i << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  return array[i];
}
dcovector & dcovector::set ( const long &  i,
const double &  v 
) [inline]

set value for const object

Definition at line 39 of file dcovector-io.hpp.

References array, i(), and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( i<0 || l<=i ){
    ERROR_REPORT;
    std::cerr << "The required component is out of the vector size." << std::endl
              << "Your input was (" << i << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  array[i] =v;
  return *this;
}
void dcovector::write ( const char *  filename) const [inline]

Definition at line 73 of file dcovector-io.hpp.

References 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 << "#dcovector" << " " << l << std::endl;
  for(long i=0; i<l; i++){
    ofs << operator()(i) << std::endl;
  }
  
  ofs.close();
}
void dcovector::read ( const char *  filename) [inline]

Definition at line 90 of file dcovector-io.hpp.

References i(), l, operator()(), and resize().

Referenced by dcovector().

{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 != "dcovector" && id != "#dcovector" ){
    ERROR_REPORT;
    std::cerr << "The type name of the file \"" << filename << "\" is not dcovector." << std::endl
              << "Its type name was " << id << " ." << std::endl;
    exit(1);
  }
  
  s >> l;
  resize(l);
  for(long i=0; i<l; i++) { s >> operator()(i); }
  if(s.eof()){
    ERROR_REPORT;
    std::cerr << "There is something is wrong with the file \"" << filename << "\"." << std::endl
              << "Most likely, there is a lack of 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 dcovector::clear ( ) [inline]

clear vector

Definition at line 3 of file dcovector-misc.hpp.

References array, cap, and l.

Referenced by dgematrix::dgels(), dgematrix::dgelss(), and dgematrix::dgglse().

{VERBOSE_REPORT;
  l =0;
  cap =0;
  delete [] array;
  array =NULL;
}
dcovector & dcovector::zero ( ) [inline]

make vector into zero vector

Definition at line 13 of file dcovector-misc.hpp.

References array, i(), and l.

Referenced by dssmatrix::col(), dgsmatrix::col(), and operator*().

{VERBOSE_REPORT;
  for(long i=0; i<l; i++){ array[i] =0.0; }
  return *this;
}
void dcovector::chsign ( ) [inline]

change sign(+/-) of the vector

Definition at line 21 of file dcovector-misc.hpp.

References array, i(), and l.

{VERBOSE_REPORT;
  for(long i=0; i<l; i++){ array[i] =-array[i]; }
}
void dcovector::copy ( const dcovector vec) [inline]

make a deep copy of the dcovector

Definition at line 28 of file dcovector-misc.hpp.

References array, cap, and l.

Referenced by operator=().

{VERBOSE_REPORT;
  l =vec.l;
  cap =vec.cap;
  delete [] array;
  array =new double[cap];
  dcopy_(vec.l, vec.array, 1, array, 1);
}
void dcovector::shallow_copy ( const _dcovector vec) [inline]

make a shallow copy of the vector
This function is not desinged to be used in project codes.

Definition at line 40 of file dcovector-misc.hpp.

References array, _dcovector::array, cap, _dcovector::cap, _dcovector::l, l, and _dcovector::nullify().

Referenced by operator=().

{VERBOSE_REPORT;
  l =vec.l;
  cap =vec.cap;
  delete [] array;
  array =vec.array;
  
  vec.nullify();
}
void dcovector::alias ( const dcovector vec) [inline]

make an alias of the vector
Be carefull to use this function not to cause double free.

Definition at line 53 of file dcovector-misc.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
  l =vec.l;
  cap =vec.cap;
  delete [] array;
  array =vec.array;
}
void dcovector::unalias ( ) [inline]

unalias the vector

Definition at line 63 of file dcovector-misc.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
  l =0;
  cap =0;
  array =NULL;
}
dcovector & dcovector::resize ( const long &  _l,
const long  margin = 0 
) [inline]

resize vector

Definition at line 72 of file dcovector-misc.hpp.

References array, cap, and l.

Referenced by dgematrix::dgelss(), dgematrix::dgesvd(), dgematrix::dgglse(), read(), zgematrix::zgelss(), and zgematrix::zgesvd().

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( _l<0 ){
    ERROR_REPORT;
    std::cerr << "Vector size must be positive integers." << std::endl
              << "Your input was (" << _l << ", " << margin << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  l =_l;
  cap =l+margin;
  delete [] array;
  array =new double[cap];
  
  return *this;
}
void dcovector::stretch ( const long &  dl) [inline]

stretch or shrink vector

Definition at line 93 of file dcovector-misc.hpp.

References array, cap, and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l+dl<0 ){
    ERROR_REPORT;
    std::cerr << "Vector size must be positive integers." << std::endl
              << "Your input was (" << dl << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  //////// zero ////////
  if(dl==0){ return; }
  
  //////// non-zero ////////
  l +=dl;
  
  if(l>cap){
    while(l>cap){
      cap++;
      cap*=2;
    }
    double* newArray(new double[cap]);
    dcopy_(l-dl, array, 1, newArray, 1);
    delete [] array;
    array =newArray;
  }
}
dcovector & dcovector::operator= ( const dcovector vec) [inline]

dcovector=dcovector operator

Definition at line 3 of file dcovector-dcovector.hpp.

References array, and copy().

{VERBOSE_REPORT;
  if(array!=vec.array){ // if it is NOT self substitution
    copy(vec);
  }
  return *this;
}
dcovector & dcovector::operator= ( const _dcovector vec) [inline]

dcovector=_dcovector operator

Definition at line 3 of file dcovector-_dcovector.hpp.

References shallow_copy().

{VERBOSE_REPORT;
  shallow_copy(vec);
  return *this;
}
dcovector & dcovector::operator+= ( const dcovector vec) [inline]

dcovector+=dcovector operator

Definition at line 17 of file dcovector-dcovector.hpp.

References array, i(), and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l!=vec.l ){
    ERROR_REPORT;
    std::cerr << "These two vectors can not make a sumation." << std::endl
              << "Your input was (" << l << ") += (" << vec.l << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(long i=0; i<l; i++){ array[i]+=vec.array[i]; }
  
  return *this;
}
dcovector & dcovector::operator+= ( const _dcovector vec) [inline]

dcovector+=_dcovector operator

Definition at line 15 of file dcovector-_dcovector.hpp.

References array, _dcovector::array, _dcovector::destroy(), i(), l, and _dcovector::l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l!=vec.l ){
    ERROR_REPORT;
    std::cerr << "These two vectors can not make a sumation." << std::endl
              << "Your input was (" << l << ") += (" << vec.l << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(long i=0; i<l; i++){ array[i]+=vec.array[i]; }
  
  vec.destroy();
  return *this;
}
dcovector & dcovector::operator-= ( const dcovector vec) [inline]

dcovector operator-=

Definition at line 35 of file dcovector-dcovector.hpp.

References array, i(), and l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l!=vec.l ){
    ERROR_REPORT;
    std::cerr << "These two vectors can not make a subtraction." << std::endl
              << "Your input was (" << l << ") -= (" << vec.l << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(long i=0; i<l; i++){ array[i]-=vec.array[i]; }
  
  return *this;
}
dcovector & dcovector::operator-= ( const _dcovector vec) [inline]

dcovector operator-=

Definition at line 34 of file dcovector-_dcovector.hpp.

References array, _dcovector::array, _dcovector::destroy(), i(), l, and _dcovector::l.

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  if( l!=vec.l ){
    ERROR_REPORT;
    std::cerr << "These two vectors can not make a subtraction." << std::endl
              << "Your input was (" << l << ") -= (" << vec.l << ")." << std::endl;
    exit(1);
  }
#endif//CPPL_DEBUG
  
  for(long i=0; i<l; i++){ array[i]-=vec.array[i]; }
  
  vec.destroy();
  return *this;
}
dcovector & dcovector::operator*= ( const double &  d) [inline]

dcovector*=double operator

Definition at line 3 of file dcovector-double.hpp.

References array, and l.

{VERBOSE_REPORT;
  dscal_(l, d, array, 1);
  return *this;
}
dcovector & dcovector::operator/= ( const double &  d) [inline]

dcovector/=double operator

Definition at line 11 of file dcovector-double.hpp.

References array, and l.

{VERBOSE_REPORT;
  dscal_(l, 1./d, array, 1);
  return *this;
}

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  s,
const dcovector vec 
) [friend]

Definition at line 59 of file dcovector-io.hpp.

{VERBOSE_REPORT;
  for(long i=0; i<vec.l; i++){
    s << " " << vec.array[i] << std::endl;
  }
  
  return s;
}
_drovector t ( const dcovector covec) [friend]

return a transposed row vector

Definition at line 3 of file dcovector-calc.hpp.

{VERBOSE_REPORT;
  drovector rovec(covec.l);
  dcopy_(covec.l, covec.array, 1, rovec.array, 1);
  
  return _(rovec);
}
double nrm2 ( const dcovector vec) [friend]

return its Euclidean norm

Definition at line 13 of file dcovector-calc.hpp.

{VERBOSE_REPORT;
  return dnrm2_(vec.l, vec.array, 1);
}
long idamax ( const dcovector vec) [friend]

return the index of element having the largest absolute value in 0-based numbering system

Definition at line 21 of file dcovector-calc.hpp.

{VERBOSE_REPORT;
  return idamax_(vec.l, vec.array, 1) -1;
}
double damax ( const dcovector vec) [friend]

return its largest absolute value

Definition at line 28 of file dcovector-calc.hpp.

{VERBOSE_REPORT;
  return vec.array[idamax_(vec.l, vec.array, 1) -1];
}
void swap ( dcovector u,
dcovector v 
) [friend]

swap two vectors

Definition at line 124 of file dcovector-misc.hpp.

{VERBOSE_REPORT;
  long u_cap(u.cap), u_l(u.l);
  double* u_array(u.array);
  u.l=v.l; u.cap=v.cap; u.array=v.array;
  v.l=u_l; v.cap=u_cap; v.array=u_array;
}
_dcovector _ ( dcovector vec) [friend]

convert user object to smart-temporary object

Definition at line 134 of file dcovector-misc.hpp.

Referenced by to_zcovector().

{VERBOSE_REPORT;
  _dcovector newvec;
  
  //////// shallow copy ////////
  newvec.l =vec.l;
  newvec.cap =vec.cap;
  newvec.array =vec.array;
  
  //////// nullify ////////
  vec.l =0;
  vec.cap =0;
  vec.array =NULL;
  
  return newvec;
}
const dcovector& operator+ ( const dcovector vec) [friend]

+dcovector operator

Definition at line 3 of file dcovector-unary.hpp.

{VERBOSE_REPORT;
  return vec;
}
_dcovector operator- ( const dcovector vec) [friend]

-dcovector operator

Definition at line 10 of file dcovector-unary.hpp.

{VERBOSE_REPORT;
  dcovector newvec(vec.l);
  for(long i=0; i<newvec.l; i++){ newvec.array[i]=-vec.array[i]; }
  
  return _(newvec);
}
_dcovector operator+ ( const dcovector vecA,
const dcovector vecB 
) [friend]

dcovector+dcovector operator

Definition at line 57 of file dcovector-dcovector.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
  
  dcovector newvec(vecA.l);
  for(long i=0; i<newvec.l; i++){
    newvec.array[i] =vecA.array[i]+vecB.array[i];
  }
  
  return _(newvec);
}
_dcovector operator+ ( const dcovector vecA,
const _dcovector vecB 
) [friend]

dcovector+dcovector operator

Definition at line 57 of file dcovector-_dcovector.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++){ vecB.array[i]+=vecA.array[i]; }
  
  return vecB;
}
_dcovector operator- ( const dcovector vecA,
const dcovector vecB 
) [friend]

dcovector-dcovector operator

Definition at line 79 of file dcovector-dcovector.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
  
  dcovector newvec(vecA.l);
  for(long i=0; i<newvec.l; i++){
    newvec.array[i] =vecA.array[i]-vecB.array[i];
  }
  
  return _(newvec);
}
_dcovector operator- ( const dcovector vecA,
const _dcovector vecB 
) [friend]

dcovector-dcovector operator

Definition at line 76 of file dcovector-_dcovector.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++){
    vecB.array[i] =vecA.array[i]-vecB.array[i];
  }
  
  return vecB;
}
_dgematrix operator* ( const dcovector covec,
const drovector rovec 
) [friend]

dcovector*drovector operator

Definition at line 3 of file dcovector-drovector.hpp.

{VERBOSE_REPORT;
  dgematrix newmat(covec.l, rovec.l);
  for(long i=0; i<newmat.m; i++){ for(long j=0; j<newmat.n; j++){
    newmat(i,j) =covec(i)*rovec(j);
  }}
  
  return _(newmat);
}
_dgematrix operator* ( const dcovector covec,
const _drovector rovec 
) [friend]

dcovector*_drovector operator

Definition at line 3 of file dcovector-_drovector.hpp.

{VERBOSE_REPORT;
  dgematrix newmat(covec.l, rovec.l);
  for(long i=0; i<newmat.m; i++){
    for(long j=0; j<newmat.n; j++){
      newmat(i,j) =covec(i)*rovec(j);
    }
  }
  
  rovec.destroy();
  return _(newmat);
}
_dcovector operator* ( const dcovector vec,
const double &  d 
) [friend]

dcovector*double operator

Definition at line 23 of file dcovector-double.hpp.

{VERBOSE_REPORT;
  dcovector newvec(vec.l);
  for(long i=0; i<vec.l; i++){ newvec.array[i] =vec.array[i]*d; }
  
  return _(newvec);
}
_dcovector operator/ ( const dcovector vec,
const double &  d 
) [friend]

dcovector/double operator

Definition at line 33 of file dcovector-double.hpp.

{VERBOSE_REPORT;
  dcovector newvec(vec.l);
  for(long i=0; i<vec.l; i++){ newvec.array[i] =vec.array[i]/d; }
  
  return _(newvec);
}
double operator% ( const dcovector vecA,
const dcovector vecB 
) [friend]

dcovector^T*dcovector operator (inner product)

Definition at line 100 of file dcovector-dcovector.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
  
  double val( ddot_( vecA.l, vecA.array, 1, vecB.array, 1 ) );
  
  return val;
}
double operator% ( const dcovector vecA,
const _dcovector vecB 
) [friend]

dcovector^T*dcovector operator (inner product)

Definition at line 96 of file dcovector-_dcovector.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
  
  double val( ddot_( vecA.l, vecA.array, 1, vecB.array, 1 ) );
  
  vecB.destroy();
  return val;
}
_dcovector operator* ( const double &  d,
const dcovector vec 
) [friend]

double*dcovector operator

Definition at line 3 of file double-dcovector.hpp.

{VERBOSE_REPORT;
  dcovector newvec(vec.l);
  for(long i=0; i<vec.l; i++){ newvec.array[i] =d*vec.array[i]; }
  return _(newvec);
}

Member Data Documentation

vector capacity

Definition at line 10 of file dcovector.hpp.

Referenced by _(), alias(), clear(), copy(), dcovector(), resize(), shallow_copy(), stretch(), swap(), and unalias().


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