1 #ifndef MATH_LINEAR_ALGEBRA_H 2 #define MATH_LINEAR_ALGEBRA_H 10 enum Type { Jacobi, GaussSeidel, SOR };
13 void InitialRandom(
Vector& x0,Real xmin=-One,Real xmax=One)
const;
14 void InitialOnes(
Vector& x0)
const;
15 bool Solve(Type type,
Vector& x0,
int& maxIters,Real& tol)
const;
17 bool IsValid_Jacobi()
const;
18 bool IsValid_GaussSeidel()
const;
19 bool IsValid_SOR()
const;
21 void Iterate_Jacobi(
Vector& x)
const;
22 void Iterate_GaussSeidel(
Vector& x)
const;
23 void Iterate_SOR(
Vector& x)
const;
36 bool Solve(
Vector& x)
const;
37 bool Solve_Cholesky(
Vector& x)
const;
38 bool Solve_LU(
Vector& x)
const;
39 bool Solve_SVD(
Vector& x)
const;
40 bool Solve_Jacobi(
Vector& x,
int maxIters=100,Real tol=Epsilon)
const;
41 bool Solve_GaussSeidel(
Vector& x,
int maxIters=100,Real tol=Epsilon)
const;
42 bool Solve_SOR(
Vector& x,Real omega=1.25,
int maxIters=100,Real tol=Epsilon)
const;
45 bool LeastSquares(
Vector& x)
const;
46 bool LeastSquares_Cholesky(
Vector& x)
const;
47 bool LeastSquares_QR(
Vector& x)
const;
48 bool LeastSquares_SVD(
Vector& x)
const;
49 bool LeastSquares_GaussSeidel(
Vector& x,
int maxIters=100,Real tol=Epsilon)
const;
53 bool LBackSubstitute(
Vector& x)
const;
54 bool UBackSubstitute(
Vector& x)
const;
55 bool LTBackSubstitute(
Vector& x)
const;
62 inline bool IsValid()
const {
return A.m == b.n; }
63 inline void Residual(
const Vector& x,
Vector& r)
const { r.setNegative(b); A.madd(x,r); }
Definition: linalgebra.h:8
Definition: linalgebra.h:31
Contains all definitions in the Math package.
Definition: WorkspaceBound.h:12