QCMatrix Class Reference

#include <QCMatrix.hpp>

Inheritance diagram for QCMatrix:

Inheritance graph
[legend]
List of all members.

Detailed Description

class QCMatrix

Definition at line 39 of file QCMatrix.hpp.

Public Member Functions

void axpy (const QCFloat &scaleFactor, const QCMatrix &__restrict__ A)
void calculateNumericalDerivatives (const QCMatrix &matrix2, const QCFloat &__restrict__ inv2DeltaQ, const int dim1, const int dim2)
void calculateNumericalDerivatives (const QCMatrix &matrix2, const QCFloat &__restrict__ inv2DeltaQ)
void copy (const QCMatrix &otherMatrix)
QCFloat deltaElemMax (const QCMatrix &otherMatrix) const
QCFloat elemMax (void) const
void extractSubMatrix (QCMatrix &__restrict__ subMatrix, const int row, const int nbRows, const int column, const int nbColumns) const
int getDim (void) const
QCFloat *__restrict__ getElems (void) const
int getNbElems (void) const
QCFloat *__restrict__ *__restrict__ getVectorPtr (void) const
bool giveBackTmpMem (QCMemory &__restrict__ memoryInst)
void initClean (void)
void insertSubMatrix (const QCMatrix &__restrict__ subMatrix, const int row, const int nbRows, const int column, const int nbColumns)
void mult (QCMemory &__restrict__ memoryInst, const QCSymMatrix &matrixA, const QCSymMatrix &matrixB, const QCFloat &alpha=QC_ONE, const QCFloat &beta=QC_ZERO)
void mult (QCMemory &__restrict__ memoryInst, const QCMatrix &matrixA, const QCSymMatrix &matrixB, const QCFloat &alpha=QC_ONE, const QCFloat &beta=QC_ZERO)
void mult (QCMemory &__restrict__ memoryInst, const QCSymMatrix &matrixA, const QCMatrix &matrixB, const QCFloat &alpha=QC_ONE, const QCFloat &beta=QC_ZERO)
void mult (QCMemory &__restrict__ memoryInst, const QCMatrix &matrixA, const QCMatrix &matrixB, const QCFloat &alpha=QC_ONE, const QCFloat &beta=QC_ZERO)
QCMatrix &__restrict__ operator= (const QCMatrix &__restrict__ aMatrix)
QCFloat *__restrict__ operator[] (int i) const
void pack (const int &longDim)
void print (char *matrixName, const int &dim1, const int &dim2) const
void print (const std::string &matrixName, std::ofstream &out) const
void print (char *matrixName) const
void printInFile (const char *preFileName, bool date=true)
 QCMatrix (const int &dimMatrix)
 QCMatrix (void)
void sampleDistanceInFile (const char *preFileName)
void sampleInFile (const char *preFileName)
void scale (const QCFloat &scaleFactor)
void scaleAndCopy (const QCFloat &scaleFactor, const QCMatrix &__restrict__ A)
void setDim (const int &dimMatrix)
bool setDimAndAllocate (const int &dimMatrix)
void setVectorPtr (const int indexOfTheVectorPtr, const int indexInTheElemsArray)
void swap (QCMatrix &otherMatrix)
bool takeTmpMem (QCMemory &__restrict__ memoryInst)
QCFloat trace (void) const
void transpose (const QCMatrix &__restrict__ matrixToTranspose, const int nbRowInMatrixToTranspose, const int nbColInMatrixToTranspose)
void transpose (const QCMatrix &__restrict__ matrixToTranspose)
void unpack (const int &longDim)
template<class TPManager>
void writeLikeBands (TPManager &QCRestrict managerInst) const
template<class TPManager>
void writeLikeBands (TPManager &__restrict__ managerInst) const
virtual ~QCMatrix (void)

Protected Attributes

bool allocateByNew
int dim
QCFloat *__restrict__ elems
int nbElems
QCFloat *__restrict__ *__restrict__ vectorPtr


Constructor & Destructor Documentation

QCMatrix::QCMatrix void   ) 
 

Definition at line 28 of file QCMatrix.cpp.

QCMatrix::QCMatrix const int &  dimMatrix  ) 
 

Constructor with one parameter, it takes charge of the sizing and of the memory allocation because it recieves the dim.

Definition at line 42 of file QCMatrix.cpp.

References dim, and setDimAndAllocate().

Here is the call graph for this function:

QCMatrix::~QCMatrix void   )  [virtual]
 

Definition at line 58 of file QCMatrix.cpp.

References allocateByNew, elems, and vectorPtr.


Member Function Documentation

void QCMatrix::axpy const QCFloat scaleFactor,
const QCMatrix &__restrict__  A
[inline]
 

It performs C <- C + scaleFactor A

Definition at line 750 of file QCMatrix.hpp.

References elems, nbElems, and QCCBlas.

Referenced by QCSubDomain::modifyMatricesAndEnergy(), and QCSCFAlgo::optimalDamping().

void QCMatrix::calculateNumericalDerivatives const QCMatrix matrix2,
const QCFloat &__restrict__  inv2DeltaQ,
const int  dim1,
const int  dim2
[inline]
 

Calculation of the numerical derivation

Definition at line 680 of file QCMatrix.hpp.

References nbElems, QC_ZERO, and vectorPtr.

void QCMatrix::calculateNumericalDerivatives const QCMatrix matrix2,
const QCFloat &__restrict__  inv2DeltaQ
[inline]
 

Calculation of the numerical derivation

Definition at line 639 of file QCMatrix.hpp.

References elems, nbElems, and QC_ZERO.

Referenced by QCRepInterElec::computeDerivatives().

void QCMatrix::copy const QCMatrix otherMatrix  )  [inline]
 

The copy. Be carreful,the 2 matrices must be of the same size otherwise it aborts

Definition at line 395 of file QCMatrix.hpp.

References dim, elems, getDim(), and nbElems.

Referenced by operator=().

Here is the call graph for this function:

QCFloat QCMatrix::deltaElemMax const QCMatrix otherMatrix  )  const
 

Return the maximum of the difference between 2 elements of the matrix

Definition at line 486 of file QCMatrix.cpp.

References elems, getDim(), nbElems, QC_ZERO, and QCAbs.

Here is the call graph for this function:

QCFloat QCMatrix::elemMax void   )  const
 

Return the max of the elements of the matrix, i. e. the infinite norm of the matrix

Definition at line 515 of file QCMatrix.cpp.

References nbElems, QC_ZERO, and QCAbs.

void QCMatrix::extractSubMatrix QCMatrix &__restrict__  subMatrix,
const int  row,
const int  nbRows,
const int  column,
const int  nbColumns
const [inline]
 

Extract a sub-matrix of this

Definition at line 504 of file QCMatrix.hpp.

References vectorPtr.

int QCMatrix::getDim void   )  const [inline]
 

Accessors

Definition at line 105 of file QCMatrix.hpp.

References dim.

Referenced by QCSymMatrix::copy(), copy(), QCSymMatrix::copyIn(), deltaElemMax(), QCRepInterElec::expandOverDim16(), QCMDSystem< TPSolver >::readDistDensityFromFileAscii(), readGlobalDensityFromAsciiFileSEQ(), readGlobalDensityFromAsciiFileSHARED(), QCMDSystem< TPSolver >::readSharedDensityFromFileAscii(), swap(), QCSymMatrix::traceProduct(), QCGlobalSystem< TPSolver >::writeDensityOnFileAscii(), QCGlobalSystem< TPSolver >::writeDensityOnFileBinary(), QCTrace::writeEigenValue(), and QCTrace::writeEigenValuesAndEigenVectors().

QCFloat* __restrict__ QCMatrix::getElems void   )  const [inline]
 

Definition at line 107 of file QCMatrix.hpp.

References elems.

Referenced by QCRepInterElec::computeElems(), QCSymMatrix::copy(), QCSymMatrix::copyIn(), QCFockGtr< TPMatrix >::diagonalize(), and QCSymMatrix::traceProduct().

int QCMatrix::getNbElems void   )  const [inline]
 

Definition at line 106 of file QCMatrix.hpp.

References nbElems.

Referenced by QCSymMatrix::traceProduct().

QCFloat* __restrict__* __restrict__ QCMatrix::getVectorPtr void   )  const [inline]
 

Definition at line 108 of file QCMatrix.hpp.

References vectorPtr.

Referenced by QCSymMatrix::copy(), and QCSymMatrix::copyIn().

bool QCMatrix::giveBackTmpMem QCMemory &__restrict__  memoryInst  ) 
 

Restoration of temp memory by the matrix

Referenced by QCModelMatrices::buildMatrices(), QCGlobalSystem< TPSolver >::computeEnergyDerivatives(), and QCSCFAlgo::optimalDamping().

void QCMatrix::initClean void   ) 
 

Initialization of the matrix by zeros

Definition at line 287 of file QCMatrix.cpp.

References nbElems.

Referenced by QCSymMatrix::setDimAndAllocate(), and setDimAndAllocate().

void QCMatrix::insertSubMatrix const QCMatrix &__restrict__  subMatrix,
const int  row,
const int  nbRows,
const int  column,
const int  nbColumns
[inline]
 

Insert a sub-matrix in this

Definition at line 541 of file QCMatrix.hpp.

References vectorPtr.

void QCMatrix::mult QCMemory &__restrict__  memoryInst,
const QCSymMatrix matrixA,
const QCSymMatrix matrixB,
const QCFloat alpha = QC_ONE,
const QCFloat beta = QC_ZERO
 

Multiplication of matrices. matrixA and matrixB are QCSymMatrix

void QCMatrix::mult QCMemory &__restrict__  memoryInst,
const QCMatrix matrixA,
const QCSymMatrix matrixB,
const QCFloat alpha = QC_ONE,
const QCFloat beta = QC_ZERO
[inline]
 

Multiplication of matrices. matrixB is a QCSymMatrix

Definition at line 450 of file QCMatrix.hpp.

References mult().

Here is the call graph for this function:

void QCMatrix::mult QCMemory &__restrict__  memoryInst,
const QCSymMatrix matrixA,
const QCMatrix matrixB,
const QCFloat alpha = QC_ONE,
const QCFloat beta = QC_ZERO
 

Multiplication of matrices. matrixA is a QCSymMatrix

void QCMatrix::mult QCMemory &__restrict__  memoryInst,
const QCMatrix matrixA,
const QCMatrix matrixB,
const QCFloat alpha = QC_ONE,
const QCFloat beta = QC_ZERO
[inline]
 

Multiplication of matrices. Performs C <- alpha A B + beta C

Referenced by mult().

QCMatrix& __restrict__ QCMatrix::operator= const QCMatrix &__restrict__  aMatrix  )  [inline]
 

The operator =

Definition at line 149 of file QCMatrix.hpp.

References copy().

Here is the call graph for this function:

QCFloat* __restrict__ QCMatrix::operator[] int  i  )  const [inline]
 

The operator []. I do an overload of this operator to obtain the right behavior for the [][].

Reimplemented in QCSymMatrix.

Definition at line 143 of file QCMatrix.hpp.

References vectorPtr.

void QCMatrix::pack const int &  longDim  )  [inline]
 

Method to pack a matrix. A packed matrix is a matrix without holes. Significant data are stored continuously. It's used before to store data on hard disk to save memory.

Definition at line 579 of file QCMatrix.hpp.

References vectorPtr.

Referenced by QCRepInterElec::computeElems().

void QCMatrix::print char *  matrixName,
const int &  dim1,
const int &  dim2
const
 

Definition at line 319 of file QCMatrix.cpp.

void QCMatrix::print const std::string &  matrixName,
std::ofstream &  out
const
 

Definition at line 306 of file QCMatrix.cpp.

References vectorPtr.

void QCMatrix::print char *  matrixName  )  const
 

Methods for printing

Reimplemented in QCSymMatrix.

Definition at line 294 of file QCMatrix.cpp.

References vectorPtr.

Referenced by QCTrace::writeEigenValuesAndEigenVectors().

void QCMatrix::printInFile const char *  preFileName,
bool  date = true
 

Method to print in a file with a date in the name if the date parameter is true.

Reimplemented in QCSymMatrix.

Definition at line 337 of file QCMatrix.cpp.

References QCCommon::getTimeStr(), QCCommon::outdir, OUTPUT_SUFFIX(), PATH_SEPARATOR(), and vectorPtr.

Here is the call graph for this function:

void QCMatrix::sampleDistanceInFile const char *  preFileName  ) 
 

Sampling of a distance matrix This is used to get an idea of its sparsity profile.

Definition at line 367 of file QCMatrix.cpp.

References nbElems, OUTPUT_SUFFIX(), and QCAbs.

Here is the call graph for this function:

void QCMatrix::sampleInFile const char *  preFileName  ) 
 

Sampling of a matrix This is used to get an idea of its sparsity profile.

Definition at line 429 of file QCMatrix.cpp.

References nbElems, OUTPUT_SUFFIX(), and QCAbs.

Here is the call graph for this function:

void QCMatrix::scale const QCFloat scaleFactor  )  [inline]
 

It performs C <- scaleFactor C

Definition at line 725 of file QCMatrix.hpp.

References elems, nbElems, and QCCBlas.

Referenced by QCSubDomain::modifyMatricesAndEnergy(), and QCSCFAlgo::optimalDamping().

void QCMatrix::scaleAndCopy const QCFloat scaleFactor,
const QCMatrix &__restrict__  A
[inline]
 

It performs C <- scaleFactor A

Definition at line 736 of file QCMatrix.hpp.

References elems, and nbElems.

void QCMatrix::setDim const int &  dimMatrix  ) 
 

Assign dim and nbElems.

Reimplemented in QCSymMatrix.

Definition at line 98 of file QCMatrix.cpp.

References dim, and nbElems.

bool QCMatrix::setDimAndAllocate const int &  dimMatrix  ) 
 

Method to assign dim and to reserve the space memory.

Reimplemented in QCSymMatrix.

Definition at line 199 of file QCMatrix.cpp.

References initClean(), nbElems, and vectorPtr.

Referenced by QCMatrix().

Here is the call graph for this function:

void QCMatrix::setVectorPtr const int  indexOfTheVectorPtr,
const int  indexInTheElemsArray
 

Indicates elems[indexInTheElemsArray] to line pointer vectorPtr[indexOfTheVectorPtr].

Definition at line 112 of file QCMatrix.cpp.

References elems, and vectorPtr.

void QCMatrix::swap QCMatrix otherMatrix  )  [inline]
 

Be careful, the 2 matrices must be of the same size otherwise, it aborts. When you wish to avoid a copy operation, use this method to swap the memory space inside the 2 QCMatrix.

Definition at line 468 of file QCMatrix.hpp.

References dim, elems, getDim(), QCRestrict, and vectorPtr.

Here is the call graph for this function:

bool QCMatrix::takeTmpMem QCMemory &__restrict__  memoryInst  ) 
 

Demand of temp memory for the matrix

Reimplemented in QCSymMatrix.

QCFloat QCMatrix::trace void   )  const
 

Return the matrix trace

Definition at line 530 of file QCMatrix.cpp.

References QC_ZERO, and vectorPtr.

Referenced by QCSymMatrix::traceProduct().

void QCMatrix::transpose const QCMatrix &__restrict__  matrixToTranspose,
const int  nbRowInMatrixToTranspose,
const int  nbColInMatrixToTranspose
[inline]
 

Definition at line 615 of file QCMatrix.hpp.

References vectorPtr.

void QCMatrix::transpose const QCMatrix &__restrict__  matrixToTranspose  )  [inline]
 

Methods to transpose a matrix

Definition at line 602 of file QCMatrix.hpp.

References dim, and vectorPtr.

void QCMatrix::unpack const int &  longDim  )  [inline]
 

Method to unpack a matrix.

Definition at line 588 of file QCMatrix.hpp.

References vectorPtr.

Referenced by QCRepInterElec::computeElems().

template<class TPManager>
void QCMatrix::writeLikeBands TPManager &QCRestrict  managerInst  )  const
 

Ecriture de la matrice sous forme de bandes. Chaque bande caracterise un atome

Definition at line 547 of file QCMatrix.cpp.

template<class TPManager>
void QCMatrix::writeLikeBands TPManager &__restrict__  managerInst  )  const
 

Writing of the matrix in a band format. Each band characterize an atom.


Member Data Documentation

bool QCMatrix::allocateByNew [protected]
 

A flag to know if the matrix has been allocated dynamically or if the memory had been given by the temporary memory manager. It is significant to keep the trace of the origin of the memory, to return it correctly.

Definition at line 380 of file QCMatrix.hpp.

Referenced by ~QCMatrix().

int QCMatrix::dim [protected]
 

Dimension of the matrix.

Definition at line 365 of file QCMatrix.hpp.

Referenced by QCSymMatrix::copy(), copy(), QCSymMatrix::copyIn(), QCSymMatrix::copyInAndFill(), getDim(), QCSymMatrix::power(), QCSymMatrix::print(), QCSymMatrix::printFullInFile(), QCSymMatrix::printInFile(), QCMatrix(), QCSymMatrix::setDim(), setDim(), QCSymMatrix::setDimAndAllocate(), QCSymMatrix::setDimAndElems(), swap(), QCSymMatrix::traceProduct(), transpose(), and QCSymMatrix::unsetElems().

QCFloat* __restrict__ QCMatrix::elems [protected]
 

The array of the elements of the matrix.

Definition at line 359 of file QCMatrix.hpp.

Referenced by axpy(), calculateNumericalDerivatives(), QCSymMatrix::copy(), copy(), QCSymMatrix::copyIn(), deltaElemMax(), getElems(), scale(), scaleAndCopy(), QCSymMatrix::setDimAndAllocate(), QCSymMatrix::setDimAndElems(), setVectorPtr(), swap(), QCSymMatrix::traceProduct(), QCSymMatrix::unsetElems(), and ~QCMatrix().

int QCMatrix::nbElems [protected]
 

Number of the elements of the array elems.

Definition at line 371 of file QCMatrix.hpp.

Referenced by axpy(), calculateNumericalDerivatives(), copy(), deltaElemMax(), elemMax(), getNbElems(), initClean(), sampleDistanceInFile(), sampleInFile(), scale(), scaleAndCopy(), QCSymMatrix::setDim(), setDim(), QCSymMatrix::setDimAndAllocate(), setDimAndAllocate(), QCSymMatrix::setDimAndElems(), QCSymMatrix::traceProduct(), and QCSymMatrix::unsetElems().

QCFloat* __restrict__* __restrict__ QCMatrix::vectorPtr [protected]
 

The array of pointers towards vectors that indicates the rows of the matrices and that allows an easily readable access thanks to the [][] operator.

Definition at line 353 of file QCMatrix.hpp.

Referenced by calculateNumericalDerivatives(), QCSymMatrix::completeSubTriangle(), QCSymMatrix::copy(), QCSymMatrix::copyIn(), QCSymMatrix::copyInAndFill(), extractSubMatrix(), QCSymMatrix::extractSubTriangle(), QCSymMatrix::extractSubTriangleInSquare(), getVectorPtr(), insertSubMatrix(), QCSymMatrix::insertSubTriangle(), QCSymMatrix::operator[](), operator[](), pack(), QCSymMatrix::print(), print(), QCSymMatrix::printFullInFile(), QCSymMatrix::printInFile(), printInFile(), QCSymMatrix::setDimAndAllocate(), setDimAndAllocate(), QCSymMatrix::setDimAndElems(), setVectorPtr(), swap(), trace(), QCSymMatrix::traceProduct(), transpose(), unpack(), and ~QCMatrix().


The documentation for this class was generated from the following files:
Generated on Sat Jan 28 21:07:34 2006 for QC++ by  doxygen 1.4.4