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

Go to the source code of this file.

Functions

_zrovector operator+ (const _zrovector &vecA, const _zrovector &vecB)
_zrovector operator- (const _zrovector &vecA, const _zrovector &vecB)
comple operator% (const _zrovector &vecA, const _zrovector &vecB)

Function Documentation

_zrovector operator+ ( const _zrovector vecA,
const _zrovector vecB 
) [inline]

_zrovector+_zrovector operator

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

References _zrovector::array, _zrovector::destroy(), i(), and _zrovector::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++){ vecA.array[i]+=vecB.array[i]; }
  
  vecB.destroy();
  return vecA;
}
_zrovector operator- ( const _zrovector vecA,
const _zrovector vecB 
) [inline]

_zrovector-_zrovector operator

Definition at line 23 of file _zrovector-_zrovector.hpp.

References _zrovector::array, _zrovector::destroy(), i(), and _zrovector::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++){ vecA.array[i]-=vecB.array[i]; }
  
  vecB.destroy();
  return vecA;
}
comple operator% ( const _zrovector vecA,
const _zrovector vecB 
) [inline]

_zrovector^T*_zrovector operator (inner product)

Definition at line 42 of file _zrovector-_zrovector.hpp.

References _zrovector::array, _zrovector::destroy(), and _zrovector::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
  
  comple val( zdotu_( vecA.l, vecA.array, 1, vecB.array, 1 ) );
  
  vecA.destroy();
  vecB.destroy();
  return val;
}
 All Classes Files Functions Variables Friends