sym-ildl  1.2
Incomplete LDL' factorizations of indefinite symmetric and skew-symmetric matrices.
Public Types | Public Member Functions | Public Attributes | List of all members
symildl::solver< el_type, mat_type > Class Template Reference

Set of tools that facilitates conversion between different matrix formats. Also contains solver methods for matrices using a common interface. More...

#include <solver.h>

Collaboration diagram for symildl::solver< el_type, mat_type >:
Collaboration graph
[legend]

Public Types

typedef mat_type::pivot_type pivot_type
 

Public Member Functions

 solver ()
 Solver constructor, initializes default reordering scheme.
 
void load (std::string filename)
 Loads the matrix A into solver. A must be of matrix market format. More...
 
void load (const std::vector< int > &ptr, const std::vector< int > &row, const std::vector< el_type > &val)
 Loads the matrix A into solver. A must be of CSC format.
 
void load (const int *ptr, const int *row, const el_type *val, int dim)
 Loads the matrix A into solver. A must be of CSC format.
 
void set_rhs (vector< el_type > b)
 Loads a right hand side b into the solver. More...
 
void set_reorder_scheme (const char *ordering)
 Sets the reordering scheme for the solver.
 
void set_equil (const char *equil)
 Decides whether we should use equilibriation on the matrix or not.
 
void set_solver (const char *solver)
 Decides whether we perform a full solve or not.
 
void set_message_level (const char *msg)
 Controls how much information gets printed to stdout.
 
void set_inplace (bool inplace)
 Decides whether we perform the factorization inplace or not.
 
void set_pivot (const char *pivot)
 Decides the kind of partial pivoting we should use.
 
void solve (double fill_factor, double tol, double pp_tol, int max_iter=-1, double minres_tol=1e-6, double shift=0.0)
 Factors the matrix A into P' * S * A * S * P = LDL' in addition to printing some timing data to screen. More...
 
void minres (int max_iter=1000, double stop_tol=1e-6, double shift=0.0)
 Applies minres on A, preconditioning with factors L and D. More...
 
void sqmr (int max_iter=1000, double stop_tol=1e-6)
 Applies SMQR on A, preconditioning with factors L and D. More...
 
void save ()
 Save results of factorization (automatically saved into the output_matrices folder). More...
 
void display ()
 Prints the L and D factors to stdout.
 

Public Attributes

mat_type A
 The matrix to be factored.
 
mat_type L
 The lower triangular factor of A.
 
vector< int > perm
 A permutation vector containing all permutations on A.
 
block_diag_matrix< el_type > D
 The diagonal factor of A.
 
int reorder_type
 Set to to 0 for AMD, 1 for RCM, 2 for no reordering.
 
int piv_type
 Set to 0 for rook, 1 for bunch.
 
int equil_type
 The equilibration method used. Set to 1 for max-norm equilibriation.
 
int msg_lvl
 Controls the amount of output to stdout.
 
int solve_type
 
bool has_rhs
 Set to true if we have a right hand side that we expect to solve.
 
bool perform_inplace
 Set to true if we are factoring the matrix A inplace.
 
bool save_sol
 Set to true if we want to save the solution to a file.
 
vector< el_type > rhs
 The right hand side we'll solve for.
 
vector< el_type > sol_vec
 The solution vector.
 

Detailed Description

template<class el_type, class mat_type = lilc_matrix<el_type>>
class symildl::solver< el_type, mat_type >

Set of tools that facilitates conversion between different matrix formats. Also contains solver methods for matrices using a common interface.

Currently, the only matrix type accepted is the lilc_matrix (as no other matrix type has been created yet).

Member Function Documentation

template<class el_type , class mat_type = lilc_matrix<el_type>>
void symildl::solver< el_type, mat_type >::load ( std::string  filename)
inline

Loads the matrix A into solver. A must be of matrix market format.

Parameters
filenamethe filename of the matrix.
template<class el_type , class mat_type >
void solver::minres ( int  max_iter = 1000,
double  stop_tol = 1e-6,
double  shift = 0.0 
)

Applies minres on A, preconditioning with factors L and D.

Parameters
max_iterthe maximum number of minres iterations.
stop_tolthe stopping tolerance of minres. i.e. we stop as soon as the residual goes below stop_tol.
shiftshifts A by shift*(identity matrix) to make it more positive definite. This sometimes helps.
template<class el_type , class mat_type = lilc_matrix<el_type>>
void symildl::solver< el_type, mat_type >::save ( )
inline

Save results of factorization (automatically saved into the output_matrices folder).

The names of the output matrices follow the format out{}.mtx, where {} describes what the file contains (i.e. A, L, or D).

template<class el_type , class mat_type = lilc_matrix<el_type>>
void symildl::solver< el_type, mat_type >::set_rhs ( vector< el_type >  b)
inline

Loads a right hand side b into the solver.

Parameters
ba vector of the right hand side.
template<class el_type , class mat_type = lilc_matrix<el_type>>
void symildl::solver< el_type, mat_type >::solve ( double  fill_factor,
double  tol,
double  pp_tol,
int  max_iter = -1,
double  minres_tol = 1e-6,
double  shift = 0.0 
)
inline

Factors the matrix A into P' * S * A * S * P = LDL' in addition to printing some timing data to screen.

More information about the parameters can be found in the documentation for the ildl() function.

Parameters
fill_factora factor controling memory usage of factorization.
tola factor controling accuracy of factorization.
pp_tola factor controling the aggresiveness of Bunch-Kaufman pivoting.
max_iterthe maximum number of iterations for minres (ignored if no right hand side).
template<class el_type , class mat_type >
void solver::sqmr ( int  max_iter = 1000,
double  stop_tol = 1e-6 
)

Applies SMQR on A, preconditioning with factors L and D.

Parameters
max_iterthe maximum number of minres iterations.
stop_tolthe stopping tolerance of minres. i.e. we stop as soon as the residual goes below stop_tol.

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