Array2D< T > Class Template Reference

A 2-dimensional template for making arrays. More...

#include <Array2D.h>

List of all members.

Public Member Functions

T * array ()
 Gets a pointer to an array containing the array elements.
int dim1 () const
 Gets the number of elements in the array's first dimension.
int dim2 () const
 Gets the number of elements in the array's second dimension.
int size () const
 Gets the total number of elements in the array.
void allocate (int i, int j)
 Allocates memory for the array.
void deallocate ()
 Deallocates memory for the array.
void setupMatrixMultiply (const Array2D< T > &rhs, Array2D< T > &result, const bool rhsIsTransposed) const
void gemm (const Array2D< T > &rhs, Array2D< T > &result, const bool rhsIsTransposed) const
dotAllElectrons (const Array2D< T > &rhs)
 Calculates a dot product between all the elements in one Array2D and all the elements in another Array2D.
dotOneElectron (const Array2D< T > &rhs, int whichElectron)
 Calculates a dot product between all the elements in one row from one Array2D and one row in another Array2D.
void operator+= (const Array2D< T > &rhs)
Array2D< T > operator* (const Array2D< T > &rhs) const
void setToIdentity (int i)
void setToIdentity ()
bool isIdentity ()
void transpose ()
 Transpose the matrix.
double nonSymmetry ()
 A measurement of how far this matrix is from being symmetric.
template<class _RHS>
double compare (const Array2D< _RHS > &rhs, double reallyBad, bool print, bool &same)
 Compare two Array2D objects to see if they're the same.
bool operator== (const Array2D &rhs)
 Checks whether two Array2D objects are the same, to within a certain tolerance, 1e-8.
void operator= (const Array2D &rhs)
template<class _RHS>
void operator= (const Array2D< _RHS > &rhs)
 Sets two arrays equal.
void operator= (const T C)
 Sets all of the elements in an array equal to the same value.
double addLL ()
Array2D operator* (const T C)
 Returns the product of an array and a scalar.
Array2D< T > operator- (const Array2D< T > &rhs) const
 Returns the difference between two Array2Ds.
Array2D< T > operator+ (const Array2D< T > &rhs) const
 Returns the sum of two Array2Ds.
void operator*= (const T C)
 Sets this array equal to itself times a scalar value.
void operator/= (const T C)
 Sets this array equal to itself divided by a scalar value.
 Array2D ()
 Creates an array.
 Array2D (int i, int j)
 Creates an array and allocates memory.
 Array2D (int i, int j, double shift, double range, long &iseed)
 Create a random matrix.
 Array2D (const Array2D< T > &rhs)
 Creates an array and sets it equal to another array.
void setRow (int whichRow, Array1D< T > &rhs)
 This function makes it easy to replace a row with an Array1D.
void setRows (int to, int from, int numRows, const Array2D< T > &rhs)
 This function takes advantage of the row-major format of the matricies to copy numRows worth of data from one Array2D to another.
void swapRows (int i, int j)
void setColumn (int to, int from, const Array2D< T > &rhs)
 Copies a column from one Array2D to another.
 ~Array2D ()
 Destroy's the array and cleans up the memory.
int map (int i, int j) const
 This particular choice indicates row-major format.
T * operator[] (int row)
T & operator() (int i, int j)
 Accesses element (i,j) of the array.
get (int i, int j) const
 Accesses element (i,j) of the array, except this prevents modification of that element.
double frobeniusNorm ()
double pInfNorm ()
double p1Norm ()
void printArray2D (ostream &strm, int numSigFig, int columnSpace, int maxJ, char sep, bool sci) const
 This makes it easier to print out the Array2D for input into Mathematica.
void ludcmp (double *d, bool *calcOK)
 LU decomposition using the algorithm in numerical recipes for a dense matrix.
void lubksb (Array1D< T > &b)
 LU backsubstitution using the algorithm in numerical recipes for a dense matrix.
void mprove (const Array2D< T > &A, Array2D< T > &inv)
 This method is supposed to improve the numerical precision of the inverse.
void determinant_and_inverse (Array2D< T > &inv, double &det, bool *calcOK)
 Calculates the inverse and determinant of a matrix using a dense LU solver.
template<class _RHS>
double inverseUpdateOneRow (int row, Array2D< _RHS > &newD, int rowInD)
template<class _RHS>
double inverseUpdateOneColumn (int column, Array2D< _RHS > &newD, int columnInD)
void rref ()
 Interpret this Array2D has a system of equations, and by using elementary row operations, convert it to its row reduced echelon form.
void rref (int t)
 Interpret this Array2D as a system of equations, and solve for one variable (column index).
int numDependent ()
int isDependent (int column)
int constraintUsed (int r)
 This function is useful in conjunction with rref(int).
void generalizedEigenvectors (Array2D< double > A, Array2D< double > B, Array1D< Complex > &eigval)
 Solves: A x = lambda B x.
Array1D< double > eigenvaluesRS ()
 Find the eigenvalues for a real, symmetric matrix.

Private Attributes

int n_1
 Number of elements in the array's first dimension.
int n_2
 Number of elements in the array's second dimension.
T * pArray
 Array containing the data.
Array1D< T > diCol
 These three arrays are used in the determinant/inverse calculations.
Array1D< int > diINDX
Array1D< T > diVV

Friends

ostream & operator<< (ostream &strm, const Array2D< T > &rhs)
 Try to fit as many columns as possible in a width approximately that of a terminal.


Detailed Description

template<class T>
class Array2D< T >

A 2-dimensional template for making arrays.

All of the memory allocation and deallocation details are dealt with by the class. Some of the operators require the Array2D to contain doubles or floats.

Definition at line 95 of file Array2D.h.


Constructor & Destructor Documentation

template<class T>
Array2D< T >::Array2D (  )  [inline]

Creates an array.

Definition at line 889 of file Array2D.h.

template<class T>
Array2D< T >::Array2D ( int  i,
int  j 
) [inline]

Creates an array and allocates memory.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.

Definition at line 900 of file Array2D.h.

template<class T>
Array2D< T >::Array2D ( int  i,
int  j,
double  shift,
double  range,
long &  iseed 
) [inline]

Create a random matrix.

It uses the UNIX rand function, which will produce a uniform random number, [0,1)

Parameters:
shift will be added to the random value
range after adding shift, we'll multiply by range
iseed will be used to initialize srand, if iseed > 0

Definition at line 916 of file Array2D.h.

template<class T>
Array2D< T >::Array2D ( const Array2D< T > &  rhs  )  [inline]

Creates an array and sets it equal to another array.

Parameters:
rhs array to set this array equal to.

Definition at line 937 of file Array2D.h.

template<class T>
Array2D< T >::~Array2D (  )  [inline]

Destroy's the array and cleans up the memory.

Definition at line 1011 of file Array2D.h.


Member Function Documentation

template<class T>
T* Array2D< T >::array (  )  [inline]

template<class T>
int Array2D< T >::dim1 (  )  const [inline]

Gets the number of elements in the array's first dimension.

Returns:
number of elements in the array's first dimension.

Definition at line 139 of file Array2D.h.

Referenced by _SVDecompose(), _SVDFwBackSubst(), QMCBasisFunction::angularGrid(), Array2D< QMCProperty >::Array2D(), QMCBasisFunction::basisFunctionsOnGrid(), QMCMikesBetterWalkerInitialization::BoundGradOccupations(), QMCPotential_Energy::calc_P_ee(), QMCPotential_Energy::calc_P_en(), QMCPotential_Energy::calc_P_nn(), QMCSlater::calculate_DerivativeRatios(), QMCSCFJastrow::calculate_Modified_Grad_PsiRatio(), QMCWalker::calculateObservables(), QMCWalker::calculateReverseGreensFunctionImportanceSampling(), QMCThreeBodyCorrelationFunctionParameters::checkCuspAndSymmetry(), Array2D< QMCProperty >::compare(), QMCSurfer::equipotentialSurface(), QMCJastrowElectronNuclear::evaluate(), QMCBasisFunction::evaluateBasisFunctions(), QMCMolecule::evaluatePotential(), QMCPotential_Energy::evaluatePsuedoPotential(), QMCMikesBetterWalkerInitialization::FixConstraints(), QMCManager::gatherExtraProperties(), QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix(), QMCWavefunction::getDataForCI(), QMCNuclearForces::getDensities(), QMCMolecule::getGrid(), QMCWavefunction::getNumberOrbitals(), QMCDerivativeProperties::getParameterGradient(), QMCDerivativeProperties::getParameterHamiltonian(), QMCDerivativeProperties::getParameterHessian(), QMCDerivativeProperties::getParameterOverlap(), QMCEigenSearch::getParameters(), QMCNuclearForces::getTemperTerm(), QMCWalker::initialize(), QMCPotential_Energy::initialize(), QMCJastrow::initialize(), QMCWalker::initializePropagation(), QMCAmosBoringWalkerInitialization::initializeWalkerPosition(), QMCSurfer::interparticleDistanceMatrix(), Array2D< QMCProperty >::inverseUpdateOneColumn(), Array2D< QMCProperty >::inverseUpdateOneRow(), Array2D< QMCProperty >::isDependent(), QMCThreeBodyJastrow::jastrowOnGrid(), QMCJastrowElectronNuclear::jastrowOnGrid(), QMCJastrowElectronElectron::jastrowOnGrid(), QMCWavefunction::makeCoefficients(), QMCPropertyArrays::matchParametersTo(), QMCWalker::moveElectronsImportanceSampling(), QMCWalker::moveElectronsNoImportanceSampling(), QMCMikesBetterWalkerInitialization::MoveOccupations(), operator<<(), QMCWalker::operator=(), Array2D< QMCProperty >::operator=(), QMCLineSearch::optimize(), QMCNuclearForces::printCubeLengths(), QMCNuclearForces::printPoints(), QMCNuclearForces::randomlyRotate(), QMCConfigIO::readCorrelatedSamplingConfiguration(), QMCWalker::readXML(), QMCElectronNucleusCusp::replaceCusps(), QMCWalker::resetFutureWalking(), QMCSurfer::scanEnergies(), QMCWalker::setR(), Array2D< QMCProperty >::setRows(), Array2D< QMCProperty >::setupMatrixMultiply(), QMCWalker::toXML(), Array2D< QMCProperty >::transpose(), QMCSlater::update_Ds(), QMCThreeBodyJastrow::updateAll(), QMCJastrowElectronElectron::updateAll(), QMCWalkerData::updateDistances(), QMCThreeBodyJastrow::updateOne(), QMCJastrowElectronElectron::updateOne(), QMCNuclearForces::waveMemorization(), QMCConfigIO::writeCorrelatedSamplingConfiguration(), QMCJastrow::~QMCJastrow(), QMCNuclearForces::~QMCNuclearForces(), and QMCWalker::~QMCWalker().

template<class T>
int Array2D< T >::dim2 (  )  const [inline]

Gets the number of elements in the array's second dimension.

Returns:
number of elements in the array's second dimension.

Definition at line 149 of file Array2D.h.

Referenced by _SVDecompose(), _SVDFwBackSubst(), Array2D< QMCProperty >::Array2D(), QMCMikesBetterWalkerInitialization::BoundGradOccupations(), QMCSlater::calculate_DerivativeRatios(), QMCSCFJastrow::calculate_Modified_Grad_PsiRatio(), QMCWalker::calculateObservables(), QMCWalker::calculateReverseGreensFunctionImportanceSampling(), Array2D< QMCProperty >::compare(), QMCMikesBetterWalkerInitialization::FixConstraints(), QMCManager::gatherExtraProperties(), QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix(), QMCWavefunction::getDataForCI(), QMCWavefunction::getNumberOrbitals(), QMCDerivativeProperties::getParameterGradient(), QMCWalker::initialize(), QMCJastrow::initialize(), QMCAmosBoringWalkerInitialization::initializeWalkerPosition(), Array2D< QMCProperty >::inverseUpdateOneColumn(), Array2D< QMCProperty >::inverseUpdateOneRow(), QMCPropertyArrays::matchParametersTo(), QMCWalker::moveElectronsImportanceSampling(), QMCWalker::moveElectronsNoImportanceSampling(), QMCMikesBetterWalkerInitialization::MoveOccupations(), Array2D< QMCProperty >::numDependent(), operator<<(), QMCWalker::operator=(), Array2D< QMCProperty >::operator=(), QMCLineSearch::optimize(), QMCWalker::readXML(), QMCWalker::resetFutureWalking(), QMCWalker::setR(), Array2D< QMCProperty >::setRows(), Array2D< QMCProperty >::setupMatrixMultiply(), QMCWalker::toXML(), Array2D< QMCProperty >::transpose(), QMCSlater::update_Ds(), QMCJastrow::~QMCJastrow(), QMCNuclearForces::~QMCNuclearForces(), and QMCWalker::~QMCWalker().

template<class T>
int Array2D< T >::size (  )  const [inline]

Gets the total number of elements in the array.

Returns:
total number of elements in the array.

Definition at line 159 of file Array2D.h.

template<class T>
void Array2D< T >::allocate ( int  i,
int  j 
) [inline]

Allocates memory for the array.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.

Definition at line 171 of file Array2D.h.

Referenced by QMCSlater::allocate(), QMCSlater::allocateIteration(), Array2D< QMCProperty >::Array2D(), QMCSlater::calculate_DerivativeRatios(), QMCNuclearForces::calculateNuclearContributions(), Array2D< QMCProperty >::determinant_and_inverse(), QMCPotential_Energy::evaluatePsuedoPotential(), QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix(), Array2D< QMCProperty >::generalizedEigenvectors(), QMCNuclearForces::generateCube(), QMCDerivativeProperties::getParameterHamiltonian(), QMCDerivativeProperties::getParameterHessian(), QMCDerivativeProperties::getParameterOverlap(), QMCWalkerData::initialize(), QMCWalker::initialize(), QMCReadAndEvaluateConfigs::initialize(), QMCNuclearForces::initialize(), QMCJastrow::initialize(), QMCHartreeFock::Initialize(), QMCElectronNucleusCusp::initialize(), QMCDansWalkerInitialization::initializeArrays(), QMCBasisFunction::initializeInterpolations(), CambridgeThreeBodyCorrelationFunction::initializeParameters(), QMCDansWalkerInitialization::initializeWalkerPosition(), QMCWavefunction::makeCoefficients(), QMCThreeBodyCorrelationFunctionParameters::makeParamDepMatrix(), QMCWalker::operator=(), Array2D< QMCProperty >::operator=(), operator>>(), QMCEquilibrationArray::QMCEquilibrationArray(), QMCMolecule::readPsuedoPotential(), Array2D< QMCProperty >::setupMatrixMultiply(), QMCNuclearForces::waveMemorization(), and QMCPropertyArrays::zeroOut().

template<class T>
void Array2D< T >::deallocate (  )  [inline]

template<class T>
void Array2D< T >::setupMatrixMultiply ( const Array2D< T > &  rhs,
Array2D< T > &  result,
const bool  rhsIsTransposed 
) const [inline]

Definition at line 218 of file Array2D.h.

Referenced by Array2D< QMCProperty >::gemm().

template<class T>
void Array2D< T >::gemm ( const Array2D< T > &  rhs,
Array2D< T > &  result,
const bool  rhsIsTransposed 
) const [inline]

template<class T>
T Array2D< T >::dotAllElectrons ( const Array2D< T > &  rhs  )  [inline]

Calculates a dot product between all the elements in one Array2D and all the elements in another Array2D.

Definition at line 510 of file Array2D.h.

Referenced by QMCWalker::calculateObservables().

template<class T>
T Array2D< T >::dotOneElectron ( const Array2D< T > &  rhs,
int  whichElectron 
) [inline]

Calculates a dot product between all the elements in one row from one Array2D and one row in another Array2D.

Definition at line 522 of file Array2D.h.

template<class T>
void Array2D< T >::operator+= ( const Array2D< T > &  rhs  )  [inline]

Definition at line 532 of file Array2D.h.

template<class T>
Array2D<T> Array2D< T >::operator* ( const Array2D< T > &  rhs  )  const [inline]

Definition at line 540 of file Array2D.h.

template<class T>
void Array2D< T >::setToIdentity ( int  i  )  [inline]

template<class T>
void Array2D< T >::setToIdentity (  )  [inline]

Definition at line 558 of file Array2D.h.

template<class T>
bool Array2D< T >::isIdentity (  )  [inline]

Definition at line 565 of file Array2D.h.

template<class T>
void Array2D< T >::transpose (  )  [inline]

Transpose the matrix.

Definition at line 580 of file Array2D.h.

Referenced by QMCThreeBodyCorrelationFunctionParameters::checkCuspAndSymmetry().

template<class T>
double Array2D< T >::nonSymmetry (  )  [inline]

A measurement of how far this matrix is from being symmetric.

A returned value of 0.0 means it is perfectly symmetric.

Definition at line 598 of file Array2D.h.

Referenced by Array2D< QMCProperty >::eigenvaluesRS(), and QMCLineSearch::optimize().

template<class T>
template<class _RHS>
double Array2D< T >::compare ( const Array2D< _RHS > &  rhs,
double  reallyBad,
bool  print,
bool &  same 
) [inline]

Compare two Array2D objects to see if they're the same.

Parameters:
reallyBad is the cutoff at which we'll print out the two values
print if false, this function will not print anything.
Returns:
the relative error, averaged over all the comparisons.

Definition at line 634 of file Array2D.h.

Referenced by Array2D< QMCProperty >::operator==().

template<class T>
bool Array2D< T >::operator== ( const Array2D< T > &  rhs  )  [inline]

Checks whether two Array2D objects are the same, to within a certain tolerance, 1e-8.

Definition at line 722 of file Array2D.h.

template<class T>
void Array2D< T >::operator= ( const Array2D< T > &  rhs  )  [inline]

Definition at line 729 of file Array2D.h.

Referenced by Array2D< QMCProperty >::Array2D().

template<class T>
template<class _RHS>
void Array2D< T >::operator= ( const Array2D< _RHS > &  rhs  )  [inline]

Sets two arrays equal.

memcpy would probably break if T is a class. is this a problem? if you want to set to Array2D's containing a class equal, then use the (i,j) operator.

Definition at line 742 of file Array2D.h.

template<class T>
void Array2D< T >::operator= ( const T  C  )  [inline]

Sets all of the elements in an array equal to the same value.

There's an obvious shortcut if the constant happens to be 0. in retrospect, while memset works well for doubles, floats, etc, using this operator would probably crash the program if T was a class.

Definition at line 757 of file Array2D.h.

template<class T>
double Array2D< T >::addLL (  )  [inline]

Definition at line 778 of file Array2D.h.

template<class T>
Array2D Array2D< T >::operator* ( const T  C  )  [inline]

Returns the product of an array and a scalar.

Definition at line 790 of file Array2D.h.

template<class T>
Array2D<T> Array2D< T >::operator- ( const Array2D< T > &  rhs  )  const [inline]

Returns the difference between two Array2Ds.

Definition at line 810 of file Array2D.h.

template<class T>
Array2D<T> Array2D< T >::operator+ ( const Array2D< T > &  rhs  )  const [inline]

Returns the sum of two Array2Ds.

Definition at line 829 of file Array2D.h.

template<class T>
void Array2D< T >::operator*= ( const T  C  )  [inline]

Sets this array equal to itself times a scalar value.

Definition at line 848 of file Array2D.h.

Referenced by Array2D< QMCProperty >::operator/=().

template<class T>
void Array2D< T >::operator/= ( const T  C  )  [inline]

Sets this array equal to itself divided by a scalar value.

Definition at line 866 of file Array2D.h.

template<class T>
void Array2D< T >::setRow ( int  whichRow,
Array1D< T > &  rhs 
) [inline]

This function makes it easy to replace a row with an Array1D.

Definition at line 949 of file Array2D.h.

template<class T>
void Array2D< T >::setRows ( int  to,
int  from,
int  numRows,
const Array2D< T > &  rhs 
) [inline]

This function takes advantage of the row-major format of the matricies to copy numRows worth of data from one Array2D to another.

Definition at line 964 of file Array2D.h.

Referenced by QMCWavefunction::makeCoefficients(), Array2D< QMCProperty >::swapRows(), QMCWavefunction::unlinkDeterminants(), QMCWavefunction::unlinkOrbitals(), and QMCSlater::update_Ds().

template<class T>
void Array2D< T >::swapRows ( int  i,
int  j 
) [inline]

Definition at line 992 of file Array2D.h.

Referenced by Array2D< QMCProperty >::rref().

template<class T>
void Array2D< T >::setColumn ( int  to,
int  from,
const Array2D< T > &  rhs 
) [inline]

Copies a column from one Array2D to another.

Definition at line 1002 of file Array2D.h.

template<class T>
int Array2D< T >::map ( int  i,
int  j 
) const [inline]

template<class T>
T* Array2D< T >::operator[] ( int  row  )  [inline]

Definition at line 1041 of file Array2D.h.

template<class T>
T& Array2D< T >::operator() ( int  i,
int  j 
) [inline]

Accesses element (i,j) of the array.

Definition at line 1058 of file Array2D.h.

template<class T>
T Array2D< T >::get ( int  i,
int  j 
) const [inline]

template<class T>
double Array2D< T >::frobeniusNorm (  )  [inline]

Definition at line 1100 of file Array2D.h.

template<class T>
double Array2D< T >::pInfNorm (  )  [inline]

Definition at line 1108 of file Array2D.h.

template<class T>
double Array2D< T >::p1Norm (  )  [inline]

Definition at line 1124 of file Array2D.h.

template<class T>
void Array2D< T >::printArray2D ( ostream &  strm,
int  numSigFig,
int  columnSpace,
int  maxJ,
char  sep,
bool  sci 
) const [inline]

This makes it easier to print out the Array2D for input into Mathematica.

In Mathematica, you will still have to replace all the scientific notational "e" with "*^".

Definition at line 1164 of file Array2D.h.

Referenced by QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix(), QMCEigenSearch::getParameters(), and QMCLineSearch::optimize().

template<class T>
void Array2D< T >::ludcmp ( double *  d,
bool *  calcOK 
) [inline]

LU decomposition using the algorithm in numerical recipes for a dense matrix.

Parameters:
a a $N \times N$ matrix which is destroyed during the operation. The resulting LU decompositon is placed here.
indx a $N$ dimensional array which records the row permutation from partial pivoting.
d used to give det(a) the correct sign
calcOK returns false if the calculation is singular and true otherwise

Definition at line 1204 of file Array2D.h.

Referenced by Array2D< QMCProperty >::determinant_and_inverse().

template<class T>
void Array2D< T >::lubksb ( Array1D< T > &  b  )  [inline]

LU backsubstitution using the algorithm in numerical recipes for a dense matrix.

Parameters:
a the LU decomposition of a matrix produced by ludcmp
indx a $N$ dimensional array which records the row permutation from partial pivoting generated by ludcmp
b the $N$ dimensional array right hand side of the system of equations to solve

Definition at line 1352 of file Array2D.h.

Referenced by Array2D< QMCProperty >::determinant_and_inverse(), and Array2D< QMCProperty >::mprove().

template<class T>
void Array2D< T >::mprove ( const Array2D< T > &  A,
Array2D< T > &  inv 
) [inline]

This method is supposed to improve the numerical precision of the inverse.

Call this only *after* you've already decomposed the matrix into L and U.

Definition at line 1428 of file Array2D.h.

template<class T>
void Array2D< T >::determinant_and_inverse ( Array2D< T > &  inv,
double &  det,
bool *  calcOK 
) [inline]

Calculates the inverse and determinant of a matrix using a dense LU solver.

This method scales as $O(1 N^3)$.

Parameters:
a a $N \times N$ matrix
inv inverse of a is returned here
det determinant of a is returned here
calcOK returns false if the calculation is singular and true otherwise this is O(1*N^3) I originally had several of the arrays here as function-static variables, but this was causing the program to randomly crash in other parts of the code. I don't know why.

Definition at line 1521 of file Array2D.h.

Referenced by QMCNuclearForces::calcCoefficients(), QMCSlater::calculate_DerivativeRatios(), and QMCLineSearch::optimize().

template<class T>
template<class _RHS>
double Array2D< T >::inverseUpdateOneRow ( int  row,
Array2D< _RHS > &  newD,
int  rowInD 
) [inline]

Definition at line 1567 of file Array2D.h.

Referenced by QMCSlater::calculate_DerivativeRatios().

template<class T>
template<class _RHS>
double Array2D< T >::inverseUpdateOneColumn ( int  column,
Array2D< _RHS > &  newD,
int  columnInD 
) [inline]

Definition at line 1628 of file Array2D.h.

Referenced by QMCSlater::calculate_DerivativeRatios().

template<class T>
void Array2D< T >::rref (  )  [inline]

Interpret this Array2D has a system of equations, and by using elementary row operations, convert it to its row reduced echelon form.

If rank(n_1) = n_2, then this should produce the identity matrix.

If rank(n_1) > n_2, then you'll get row(s) of zeros since the system is overdetermined.

If rank(n_1) < n_2, then you'll get an identity matrix the size of rank(n_1), and columns containing data for the remaining unconstrained variables.

Note: this function does not have the same improvements that rref(int) has.

Definition at line 1690 of file Array2D.h.

Referenced by QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix().

template<class T>
void Array2D< T >::rref ( int  t  )  [inline]

Interpret this Array2D as a system of equations, and solve for one variable (column index).

This will turn the column into all 0.0 and one 1.0, causing this variable to be entirely dependend upon the other variables.

We can eliminate at most as many independent variables as the rank of the matrix, rank(n_1) <= n_1. If you solve for more, then the code will arbitrarily choose others to "unsolve".

Note, this will replace column t with 0.0s and one 1.0. The position of the 1.0 is arbitrary.

Parameters:
t the variable to make completely dependent

Definition at line 1780 of file Array2D.h.

template<class T>
int Array2D< T >::numDependent (  )  [inline]

template<class T>
int Array2D< T >::isDependent ( int  column  )  [inline]

template<class T>
int Array2D< T >::constraintUsed ( int  r  )  [inline]

This function is useful in conjunction with rref(int).

It will determine whether a particular row (interpreted as a constraint) has been used to make a variable dependent. If it has, then it will return the index of the dependent variable that uses this constraint.

Definition at line 1956 of file Array2D.h.

Referenced by QMCThreeBodyCorrelationFunctionParameters::gaussianParamDepMatrix(), and Array2D< QMCProperty >::rref().

template<class T>
void Array2D< T >::generalizedEigenvectors ( Array2D< double >  A,
Array2D< double >  B,
Array1D< Complex > &  eigval 
) [inline]

Solves: A x = lambda B x.

Where lambda is the eigenvalue that corresponds to the (right-side) eigenvector x.

The eigenvectors are stored as rows in this->pArray

Notice: A and B are over written.

Definition at line 1976 of file Array2D.h.

Referenced by QMCEigenSearch::getParameters().

template<class T>
Array1D<double> Array2D< T >::eigenvaluesRS (  )  [inline]

Find the eigenvalues for a real, symmetric matrix.

I found this routine at: http://www3.telus.net/thothworks/EigRSvaloCPP0.html

Definition at line 2044 of file Array2D.h.

Referenced by QMCLineSearch::optimize().


Friends And Related Function Documentation

template<class T>
ostream& operator<< ( ostream &  strm,
const Array2D< T > &  rhs 
) [friend]

Try to fit as many columns as possible in a width approximately that of a terminal.

Also, try to print as many significant figures as possible.

These settings are very approximate.

Definition at line 1147 of file Array2D.h.


Member Data Documentation

template<class T>
int Array2D< T >::n_1 [private]

template<class T>
int Array2D< T >::n_2 [private]

Number of elements in the array's second dimension.

Definition at line 109 of file Array2D.h.

Referenced by Array2D< QMCProperty >::addLL(), Array2D< QMCProperty >::allocate(), Array2D< QMCProperty >::Array2D(), Array2D< QMCProperty >::compare(), Array2D< QMCProperty >::constraintUsed(), Array2D< QMCProperty >::deallocate(), Array2D< QMCProperty >::dim2(), Array2D< QMCProperty >::dotAllElectrons(), Array2D< QMCProperty >::dotOneElectron(), Array2D< QMCProperty >::eigenvaluesRS(), Array2D< QMCProperty >::frobeniusNorm(), Array2D< QMCProperty >::gemm(), Array2D< QMCProperty >::get(), Array2D< QMCProperty >::inverseUpdateOneColumn(), Array2D< QMCProperty >::inverseUpdateOneRow(), Array2D< QMCProperty >::isIdentity(), Array2D< QMCProperty >::map(), Array2D< QMCProperty >::mprove(), Array2D< QMCProperty >::nonSymmetry(), Array2D< QMCProperty >::operator()(), Array2D< QMCProperty >::operator*(), Array2D< QMCProperty >::operator*=(), Array2D< QMCProperty >::operator+(), Array2D< QMCProperty >::operator+=(), Array2D< QMCProperty >::operator-(), Array2D< QMCProperty >::operator/=(), Array2D< QMCProperty >::operator=(), Array2D< QMCProperty >::operator[](), Array2D< QMCProperty >::p1Norm(), Array2D< QMCProperty >::pInfNorm(), Array2D< QMCProperty >::printArray2D(), Array2D< QMCProperty >::rref(), Array2D< QMCProperty >::setRow(), Array2D< QMCProperty >::setRows(), Array2D< QMCProperty >::setToIdentity(), Array2D< QMCProperty >::setupMatrixMultiply(), Array2D< QMCProperty >::size(), and Array2D< QMCProperty >::transpose().

template<class T>
T* Array2D< T >::pArray [private]

template<class T>
Array1D<T> Array2D< T >::diCol [private]

These three arrays are used in the determinant/inverse calculations.

Definition at line 120 of file Array2D.h.

Referenced by Array2D< QMCProperty >::deallocate(), and Array2D< QMCProperty >::determinant_and_inverse().

template<class T>
Array1D<int> Array2D< T >::diINDX [private]

template<class T>
Array1D<T> Array2D< T >::diVV [private]


The documentation for this class was generated from the following file:

Generated on Sat Jul 5 16:14:00 2008 for QMcBeaver by  doxygen 1.5.6