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

Go to the source code of this file.

Functions

_dgsmatrix t (const _dgsmatrix &mat)
void idamax (long &i, long &j, const _dgsmatrix &mat)
double damax (const _dgsmatrix &mat)

Function Documentation

_dgsmatrix t ( const _dgsmatrix mat) [inline]

return transposed _dgsmatrix

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

References _dgsmatrix::cols, _dgsmatrix::data, _dgsmatrix::rows, and swap().

{VERBOSE_REPORT;
  for(std::vector<dcomponent>::iterator it=mat.data.begin(); it!=mat.data.end(); it++){
    std::swap(it->i,it->j);
  }
  std::swap(mat.rows,mat.cols);
  
  return mat;
}
void idamax ( long &  i,
long &  j,
const _dgsmatrix mat 
) [inline]

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

Definition at line 20 of file _dgsmatrix-calc.hpp.

References _dgsmatrix::data, and _dgsmatrix::destroy().

{VERBOSE_REPORT;
  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
  double vmax(0);
  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
    if(vmax < it->v){
      vmax=fabs(it->v);
      itx=it;
    }
  }
  i=itx->i;
  j=itx->j;
  
  mat.destroy();
}
double damax ( const _dgsmatrix mat) [inline]

return its largest absolute value

Definition at line 38 of file _dgsmatrix-calc.hpp.

References _dgsmatrix::data, and _dgsmatrix::destroy().

{VERBOSE_REPORT;
  std::vector<dcomponent>::const_iterator itx(mat.data.begin());
  double vmax(0);
  for(std::vector<dcomponent>::const_iterator it=mat.data.begin(); it!=mat.data.end(); it++){
    if(vmax < it->v){
      vmax=fabs(it->v);
      itx=it;
    }
  }
  
  mat.destroy();
  return itx->v;
}
 All Classes Files Functions Variables Friends