*/
template<class VECTOR>
class InverseMatrixRichardson
+ :
+ public Subscriptor
{
public:
/**
inline void
InverseMatrixRichardson<VECTOR>::initialize (const MATRIX& m, const PRECONDITION& p)
{
- matrix = &m;
- precondition = &p;
+ if (matrix != 0)
+ delete matrix;
+ matrix = new PointerMatrix<MATRIX, VECTOR>(&m);
+ if (precondition != 0)
+ delete precondition;
+ precondition = new PointerMatrix<PRECONDITION, VECTOR>(&p);;
}
{
Assert (matrix != 0, ExcNotInitialized());
Assert (precondition != 0, ExcNotInitialized());
- solver.solve(*matrix, dst, src, *precondition);
+ dst = 0.;
+ try
+ {
+ solver.solve(*matrix, dst, src, *precondition);
+ }
+ catch(...)
+ {}
}
Assert (precondition != 0, ExcNotInitialized());
VECTOR* aux = mem.alloc();
aux->reinit(dst);
- solver.solve(*matrix, *aux, src, *precondition);
+ try
+ {
+ solver.solve(*matrix, *aux, src, *precondition);
+ }
+ catch(...)
+ {}
dst += *aux;
mem.free(aux);
}
{
Assert (matrix != 0, ExcNotInitialized());
Assert (precondition != 0, ExcNotInitialized());
- solver.Tsolve(*matrix, dst, src, *precondition);
+ dst = 0.;
+ try
+ {
+ solver.Tsolve(*matrix, dst, src, *precondition);
+ }
+ catch(...)
+ {}
}
Assert (precondition != 0, ExcNotInitialized());
VECTOR* aux = mem.alloc();
aux->reinit(dst);
- solver.Tsolve(*matrix, *aux, src, *precondition);
+ try
+ {
+ solver.Tsolve(*matrix, *aux, src, *precondition);
+ }
+ catch(...)
+ {}
dst += *aux;
mem.free(aux);
}