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)
_zgsmatrix conj (const zgsmatrix &mat)
_zgsmatrix conjt (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;
  zgsmatrix newmat(mat);
  std::swap(newmat.rows,newmat.cols);
  
  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat.data.end(); it++){
    std::swap(it->i,it->j);
  }
  
  return _(newmat);
}
_zgsmatrix conj ( const zgsmatrix mat) [inline]

return its conjugate matrix

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

References _(), conj(), and zgsmatrix::data.

{VERBOSE_REPORT;
  zgsmatrix newmat(mat);
  
  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat.data.end(); it++){
    it->v =std::conj(it->v);
  }
  
  return _(newmat);
}
_zgsmatrix conjt ( const zgsmatrix mat) [inline]

return its conjugate transposed matrix

Definition at line 34 of file zgsmatrix-calc.hpp.

References _(), zgsmatrix::cols, conj(), zgsmatrix::data, zgsmatrix::rows, and swap().

{VERBOSE_REPORT;
  zgsmatrix newmat(mat);
  std::swap(newmat.rows,newmat.cols);
  
  for(std::vector<zcomponent>::iterator it=newmat.data.begin(); it!=newmat.data.end(); it++){
    std::swap(it->i,it->j);
    it->v =std::conj(it->v);
  }
  
  return _(newmat);
}
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 53 of file zgsmatrix-calc.hpp.

References zgsmatrix::data.

{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;
}
comple damax ( const zgsmatrix mat) [inline]

return its largest absolute value

Definition at line 69 of file zgsmatrix-calc.hpp.

References zgsmatrix::data.

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