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

Go to the source code of this file.

Functions

_zgsmatrix t (const _zgsmatrix &mat)
void idamax (long &i, long &j, const _zgsmatrix &mat)
comple damax (const _zgsmatrix &mat)

Function Documentation

_zgsmatrix t ( const _zgsmatrix mat) [inline]

return transposed _zgsmatrix

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

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

{VERBOSE_REPORT;
  for(std::vector<zcomponent>::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 _zgsmatrix mat 
) [inline]

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

Definition at line 19 of file _zgsmatrix-calc.hpp.

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

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

return its largest absolute value

Definition at line 37 of file _zgsmatrix-calc.hpp.

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

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