CPPLapack
 All Classes Files Functions Variables Friends
Functions
dcovector-_dcovector.hpp File Reference

Go to the source code of this file.

Functions

_dcovector operator+ (const dcovector &vecA, const _dcovector &vecB)
_dcovector operator- (const dcovector &vecA, const _dcovector &vecB)
double operator% (const dcovector &vecA, const _dcovector &vecB)

Function Documentation

_dcovector operator+ ( const dcovector vecA,
const _dcovector vecB 
) [inline]

dcovector+dcovector operator

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

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

{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 
) [inline]

dcovector-dcovector operator

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

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

{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;
}
double operator% ( const dcovector vecA,
const _dcovector vecB 
) [inline]

dcovector^T*dcovector operator (inner product)

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

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

{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;
}
 All Classes Files Functions Variables Friends