12 #ifndef BOGUS_BLOCK_GAUSS_SEIDEL_HPP
13 #define BOGUS_BLOCK_GAUSS_SEIDEL_HPP
15 #include "GaussSeidelBase.hpp"
16 #include "Coloring.hpp"
42 template <
typename BlockMatrixType >
49 typedef typename GlobalProblemTraits::Scalar Scalar ;
82 template <
typename NSLaw,
typename RhsT,
typename ResT >
83 Scalar
solve(
const NSLaw &law,
const RhsT &b, ResT &x,
bool tryZeroAsWell =
true )
const ;
100 template <
typename NSLaw,
typename RhsT,
typename ResT,
typename LSDerived,
typename HDerived >
105 const RhsT &b,
const RhsT &c,
107 bool tryZeroAsWell =
true,
unsigned solveEvery = 1)
const ;
122 template <
typename NSLaw,
typename RhsT,
typename ResT,
typename WDerived >
125 const RhsT &b, ResT &x,
126 bool tryZeroAsWell =
true,
unsigned solveEvery = 1 )
const ;
135 void updateLocalMatrices() ;
137 template <
typename NSLaw,
typename RhsT,
typename ResT >
139 bool parallelize,
const NSLaw &law,
const RhsT& b,
140 std::vector< unsigned char > &skip, Scalar &ndxRef,
143 typedef typename Base::Index Index ;
148 using Base::m_scaling ;
153 using Base::m_localMatrices ;
154 using Base::m_regularization ;
Coloring m_coloring
Definition: GaussSeidel.hpp:157
Scalar m_tol
See setTol()
Definition: BlockSolverBase.hpp:70
Abstract Gauss-Seidel interface .
Definition: GaussSeidelBase.hpp:25
Scalar m_skipTol
See setSkipTol(). Defaults to 1.e-6.
Definition: GaussSeidelBase.hpp:140
unsigned m_skipIters
See setSkipIters() Defaults to 10.
Definition: GaussSeidelBase.hpp:142
Definition: BlockSolvers.fwd.hpp:33
Scalar solve(const NSLaw &law, const RhsT &b, ResT &x, bool tryZeroAsWell=true) const
Finds an approximate solution for a constrained linear problem.
GaussSeidel()
Default constructor – you will have to call setMatrix() before using the solve() function.
Definition: GaussSeidel.hpp:52
unsigned m_maxThreads
See setMaxThreads(). Defaults to 0 .
Definition: GaussSeidelBase.hpp:135
const BlockObjectBase< BlockMatrixType > * m_matrix
Pointer to the matrix of the system.
Definition: BlockSolverBase.hpp:65
Coloring & coloring()
Access to the current Coloring. Will be reset whenever the matrix is changed.
Definition: GaussSeidel.hpp:132
Projected Gauss-Seidel iterative solver.
Definition: GaussSeidel.hpp:43
Coloring algorithm to determine which rows of a matrix can be treated in parallel.
Definition: Coloring.hpp:20
unsigned m_evalEvery
See setEvalEvery(). Defaults to 25.
Definition: GaussSeidelBase.hpp:138
GaussSeidel & setMatrix(const BlockObjectBase< BlockMatrixType > &matrix)
Sets the system matrix and initializes internal structures.
unsigned m_maxIters
See setMaxIters()
Definition: BlockSolverBase.hpp:68
GaussSeidel(const BlockObjectBase< BlockMatrixType > &matrix)
Constructor with the system matrix.
Definition: GaussSeidel.hpp:54
Scalar solveWithLinearConstraints(const NSLaw &law, const BlockObjectBase< LSDerived > &Cinv, const BlockObjectBase< HDerived > &H, const Scalar alpha, const RhsT &b, const RhsT &c, ResT &x, bool tryZeroAsWell=true, unsigned solveEvery=1) const