SpikeGPU
1.0.0
|
Spike preconditioner. More...
#include <precond.h>
Public Types | |
typedef PrecVector::memory_space | MemorySpace |
typedef PrecVector::value_type | PrecValueType |
typedef PrecVector::iterator | PrecVectorIterator |
typedef cusp::array1d< int, MemorySpace > | IntVector |
typedef IntVector | MatrixMap |
typedef cusp::array1d < PrecValueType, MemorySpace > | MatrixMapF |
typedef cusp::array1d < PrecValueType, cusp::host_memory > | PrecVectorH |
typedef cusp::array1d< int, cusp::host_memory > | IntVectorH |
typedef IntVectorH | MatrixMapH |
typedef cusp::array1d < PrecValueType, cusp::host_memory > | MatrixMapFH |
typedef cusp::coo_matrix< int, PrecValueType, MemorySpace > | PrecMatrixCoo |
typedef cusp::coo_matrix< int, PrecValueType, cusp::host_memory > | PrecMatrixCooH |
Public Member Functions | |
Precond () | |
Precond (int numPart, bool reorder, bool doMC64, bool scale, double dropOff_frac, int maxBandwidth, FactorizationMethod factMethod, PreconditionerType precondType, bool safeFactorization, bool variableBandwidth, bool trackReordering) | |
Precond (const Precond &prec) | |
~Precond () | |
Precond & | operator= (const Precond &prec) |
double | getTimeReorder () const |
double | getTimeCPUAssemble () const |
double | getTimeTransfer () const |
double | getTimeToBanded () const |
double | getTimeCopyOffDiags () const |
double | getTimeBandLU () const |
double | getTimeBandUL () const |
double | gettimeAssembly () const |
double | getTimeFullLU () const |
double | getTimeShuffle () const |
int | getBandwidthReordering () const |
int | getBandwidthMC64 () const |
int | getBandwidth () const |
int | getNumPartitions () const |
double | getActualDropOff () const |
template<typename Matrix > | |
void | setup (const Matrix &A) |
void | update (const PrecVector &entries) |
This function updates the banded matrix and off-diagonal matrices based on the given entries. More... | |
void | solve (PrecVector &v, PrecVector &z) |
Spike preconditioner.
This class implements the Spike preconditioner.
PrecVector | is the vector type used in the preconditioner. (its underlying type defines the precision of the preconditioner). |
typedef cusp::array1d<int, MemorySpace> spike::Precond< PrecVector >::IntVector |
typedef cusp::array1d<int, cusp::host_memory> spike::Precond< PrecVector >::IntVectorH |
typedef IntVector spike::Precond< PrecVector >::MatrixMap |
typedef cusp::array1d<PrecValueType, MemorySpace> spike::Precond< PrecVector >::MatrixMapF |
typedef cusp::array1d<PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::MatrixMapFH |
typedef IntVectorH spike::Precond< PrecVector >::MatrixMapH |
typedef PrecVector::memory_space spike::Precond< PrecVector >::MemorySpace |
typedef cusp::coo_matrix<int, PrecValueType, MemorySpace> spike::Precond< PrecVector >::PrecMatrixCoo |
typedef cusp::coo_matrix<int, PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::PrecMatrixCooH |
typedef PrecVector::value_type spike::Precond< PrecVector >::PrecValueType |
typedef cusp::array1d<PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::PrecVectorH |
typedef PrecVector::iterator spike::Precond< PrecVector >::PrecVectorIterator |
spike::Precond< PrecVector >::Precond | ( | ) |
This is the default constructor for the Precond class.
spike::Precond< PrecVector >::Precond | ( | int | numPart, |
bool | reorder, | ||
bool | doMC64, | ||
bool | scale, | ||
double | dropOff_frac, | ||
int | maxBandwidth, | ||
FactorizationMethod | factMethod, | ||
PreconditionerType | precondType, | ||
bool | safeFactorization, | ||
bool | variableBandwidth, | ||
bool | trackReordering | ||
) |
This is the constructor for the Precond class.
spike::Precond< PrecVector >::Precond | ( | const Precond< PrecVector > & | prec | ) |
This is the copy constructor for the Precond class.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Precond< PrecVector > & spike::Precond< PrecVector >::operator= | ( | const Precond< PrecVector > & | prec | ) |
void spike::Precond< PrecVector >::setup | ( | const Matrix & | A | ) |
This function performs the initial preconditioner setup, based on the specified matrix: (1) Reorder the matrix (MC64 and/or RCM) (2) Element drop-off (optional) (3) LU factorization (4) Get the reduced matrix
void spike::Precond< PrecVector >::solve | ( | PrecVector & | v, |
PrecVector & | z | ||
) |
This function solves the system Mz=v, for a specified vector v, where M is the implicitly defined preconditioner matrix.
void spike::Precond< PrecVector >::update | ( | const PrecVector & | entries | ) |
This function updates the banded matrix and off-diagonal matrices based on the given entries.
Assume we are to solve many systems with exactly the same matrix pattern. When we have solved one, next time we don't bother doing permutation and scaling again. Instead, we keep track of the mapping from the sparse matrix to the banded ones and directly update them. This function is called when the solver has solved at least one system and during setup, the mapping is tracked. Otherwise report error and exit.