source file of the Flower Library
- (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
+ (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "choleski.hh"
void
Choleski_decomposition::solve (Vector &x, Vector const &rhs) const
{
- if (L.band_b())
+ if (band_b_)
{
band_matrix_solve (x,rhs);
}
Real d = P(i,i) - sum;
D(i) = d;
}
- L.try_set_band();
- assert (L.band_i() == P.band_i ());
+ L.set_band();
+ band_b_ = true;
}
#ifdef PARANOID
assert ((P-P.transposed()).norm ()/P.norm () < EPS);
#endif
- if (P.band_b())
+ band_b_ = false;
+
+ int b = P.calc_band_i ();
+
+ if (b <= P.dim ()/2)
band_matrix_decompose (P);
else
full_matrix_decompose (P);
-
#ifdef PARANOID
assert ((original()-P).norm () / P.norm () < EPS);