SpikeGPU  1.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
spike::Precond< PrecVector > Class Template Reference

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 ()
 
Precondoperator= (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)
 

Detailed Description

template<typename PrecVector>
class spike::Precond< PrecVector >

Spike preconditioner.

This class implements the Spike preconditioner.

Template Parameters
PrecVectoris the vector type used in the preconditioner. (its underlying type defines the precision of the preconditioner).

Member Typedef Documentation

template<typename PrecVector>
typedef cusp::array1d<int, MemorySpace> spike::Precond< PrecVector >::IntVector
template<typename PrecVector>
typedef cusp::array1d<int, cusp::host_memory> spike::Precond< PrecVector >::IntVectorH
template<typename PrecVector>
typedef IntVector spike::Precond< PrecVector >::MatrixMap
template<typename PrecVector>
typedef cusp::array1d<PrecValueType, MemorySpace> spike::Precond< PrecVector >::MatrixMapF
template<typename PrecVector>
typedef cusp::array1d<PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::MatrixMapFH
template<typename PrecVector>
typedef IntVectorH spike::Precond< PrecVector >::MatrixMapH
template<typename PrecVector>
typedef PrecVector::memory_space spike::Precond< PrecVector >::MemorySpace
template<typename PrecVector>
typedef cusp::coo_matrix<int, PrecValueType, MemorySpace> spike::Precond< PrecVector >::PrecMatrixCoo
template<typename PrecVector>
typedef cusp::coo_matrix<int, PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::PrecMatrixCooH
template<typename PrecVector>
typedef PrecVector::value_type spike::Precond< PrecVector >::PrecValueType
template<typename PrecVector>
typedef cusp::array1d<PrecValueType, cusp::host_memory> spike::Precond< PrecVector >::PrecVectorH
template<typename PrecVector>
typedef PrecVector::iterator spike::Precond< PrecVector >::PrecVectorIterator

Constructor & Destructor Documentation

template<typename PrecVector >
spike::Precond< PrecVector >::Precond ( )

This is the default constructor for the Precond class.

template<typename PrecVector >
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.

template<typename PrecVector >
spike::Precond< PrecVector >::Precond ( const Precond< PrecVector > &  prec)

This is the copy constructor for the Precond class.

template<typename PrecVector>
spike::Precond< PrecVector >::~Precond ( )
inline

Member Function Documentation

template<typename PrecVector>
double spike::Precond< PrecVector >::getActualDropOff ( ) const
inline
template<typename PrecVector>
int spike::Precond< PrecVector >::getBandwidth ( ) const
inline
template<typename PrecVector>
int spike::Precond< PrecVector >::getBandwidthMC64 ( ) const
inline
template<typename PrecVector>
int spike::Precond< PrecVector >::getBandwidthReordering ( ) const
inline
template<typename PrecVector>
int spike::Precond< PrecVector >::getNumPartitions ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::gettimeAssembly ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeBandLU ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeBandUL ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeCopyOffDiags ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeCPUAssemble ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeFullLU ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeReorder ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeShuffle ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeToBanded ( ) const
inline
template<typename PrecVector>
double spike::Precond< PrecVector >::getTimeTransfer ( ) const
inline
template<typename PrecVector >
Precond< PrecVector > & spike::Precond< PrecVector >::operator= ( const Precond< PrecVector > &  prec)
template<typename PrecVector >
template<typename Matrix >
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

template<typename PrecVector >
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.

template<typename PrecVector >
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.


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