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

Go to the source code of this file.

Functions

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

Function Documentation

_dsymatrix t ( const _dsymatrix mat) [inline]

return transposed _dsymatrix

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

{VERBOSE_REPORT;
#ifdef  CPPL_DEBUG
  WARNING_REPORT;
  std::cerr << "This function call has no effect since the matrix is symmetric." << std::endl;
#endif//CPPL_DEBUG
  
  return mat;
}
_dsymatrix i ( const _dsymatrix mat) [inline]

return its inverse matrix

Definition at line 15 of file _dsymatrix-calc.hpp.

References _(), dsymatrix::array, dsymatrix::identity(), _dsymatrix::n, and dsymatrix::n.

{VERBOSE_REPORT;
  dsymatrix mat_cp(mat);
  dsymatrix mat_inv(mat_cp.n);
  mat_inv.identity();
  
  char UPLO('l');
  long NRHS(mat.n), LDA(mat.n), *IPIV(new long[mat.n]), LDB(mat.n), LWORK(-1), INFO(1);
  double *WORK( new double[1] );
  dsysv_(UPLO, mat_cp.n, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO);
  LWORK = long(WORK[0]);
  delete [] WORK;  WORK = new double[LWORK];
  dsysv_(UPLO, mat_cp.n, NRHS, mat_cp.array, LDA, IPIV, mat_inv.array, LDB, WORK, LWORK, INFO);
  delete [] WORK; delete [] IPIV;
  if(INFO!=0){
    WARNING_REPORT;
    std::cerr << "Serious trouble happend. INFO = " << INFO << "." << std::endl;
  }
  
  return _(mat_inv);
}
void idamax ( long &  i,
long &  j,
const _dsymatrix mat 
) [inline]

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

Definition at line 44 of file _dsymatrix-calc.hpp.

References idamax().

{VERBOSE_REPORT;
  dsymatrix newmat(mat);
  idamax(i, j, newmat);
}
double damax ( const _dsymatrix mat) [inline]

return its largest absolute value

Definition at line 52 of file _dsymatrix-calc.hpp.

References damax().

{VERBOSE_REPORT;
  dsymatrix newmat(mat);
  return damax(newmat);
}
 All Classes Files Functions Variables Friends