36 diag_( C.giveNumberOfRows() )
49 for (
int i = 1; i <= n; i++ ) {
52 OOFEM_ERROR(
"failed, zero diagonal detected in equation %d", i);
64 for (
int i = 0; i < x.
giveSize(); i++ ) {
65 y(i) = x(i) *
diag(i);
75 for (
int i = 0; i < x.
giveSize(); i++ ) {
76 y(i) = x(i) *
diag(i);
Base class for all matrices stored in sparse format.
virtual double & at(int i, int j)=0
Returns coefficient at position (i,j).
void trans_solve(const FloatArray &rhs, FloatArray &solution) const
Solves the transposed system.
virtual void init(const SparseMtrx &a)
Initializes the receiver (constructs the preconditioning matrix M) of given matrix.
int giveNumberOfRows() const
Returns number of rows of receiver.
DiagPreconditioner()
Constructor. The user should call initializeFrom and init services in this given order to ensure cons...
const double & diag(int i) const
Class representing vector of real numbers.
Abstract class for IML++ compatible preconditioner.
void solve(const FloatArray &rhs, FloatArray &solution) const
Solves the linear system.
void zero()
Zeroes all coefficients of receiver.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
void resize(int s)
Resizes receiver towards requested size.