12 #ifndef BOGUS_PRODUCT_GAUSS_SEIDEL_HPP
13 #define BOGUS_PRODUCT_GAUSS_SEIDEL_HPP
15 #include "GaussSeidelBase.hpp"
16 #include "ProductGaussSeidelUtils.hpp"
39 template <
typename BlockMatrixType,
typename DiagonalType =
typename BlockMatrixType::Scalar,
40 bool PrecomputeDMt = !( IsSame<DiagonalType, typename BlockMatrixType::Scalar>::Value ) >
48 typedef typename GlobalProblemTraits::Scalar Scalar ;
61 { setMatrix( matrix ) ; }
64 : Base(), m_diagonal( DiagWrapper( diagonal ) )
65 { setMatrix( matrix ) ; }
74 template <
typename NSLaw,
typename RhsT,
typename ResT >
75 Scalar solve(
const NSLaw &law,
const RhsT &b, ResT &x,
bool tryZeroAsWell =
true )
const ;
92 template <
typename NSLaw,
typename RhsT,
typename ResT,
typename LSDerived,
typename HDerived >
93 Scalar solveWithLinearConstraints(
const NSLaw &law,
97 const RhsT &b,
const RhsT &c,
99 bool tryZeroAsWell =
true,
unsigned solveEvery = 1)
const ;
114 template <
typename NSLaw,
typename RhsT,
typename ResT,
typename WDerived >
115 Scalar solveWithLinearConstraints(
const NSLaw &law,
117 const RhsT &b, ResT &x,
118 bool tryZeroAsWell =
true,
unsigned solveEvery = 1 )
const ;
122 DiagWrapper m_diagonal ;
125 void updateLocalMatrices();
127 template <
typename NSLaw,
typename VecT,
typename ResT >
129 bool parallelize,
const NSLaw &law,
const VecT& b,
130 std::vector< unsigned char > &skip, Scalar &ndxRef,
131 VecT& Mx, ResT &x )
const ;
133 typedef typename Base::Index Index ;
135 using Base::m_matrix ;
136 using Base::m_maxIters ;
138 using Base::m_scaling ;
139 using Base::m_maxThreads ;
140 using Base::m_evalEvery ;
141 using Base::m_skipTol ;
142 using Base::m_skipIters ;
143 using Base::m_localMatrices ;
144 using Base::m_regularization ;
Abstract Gauss-Seidel interface .
Definition: GaussSeidelBase.hpp:25
Definition: BlockSolvers.fwd.hpp:33
Matrix-free version of the GaussSeidel iterative solver.
Definition: ProductGaussSeidel.hpp:41
ProductGaussSeidel(const BlockObjectBase< BlockMatrixType > &matrix, const DiagonalType &diagonal)
Constructor with both the main matrix M and the diagonal D.
Definition: ProductGaussSeidel.hpp:63
Definition: CppTools.hpp:62
ProductGaussSeidel(const BlockObjectBase< BlockMatrixType > &matrix)
Constructor with the main system matrix M.
Definition: ProductGaussSeidel.hpp:59
ProductGaussSeidel()
Default constructor – you will have to call setMatrix() before using the solve() function.
Definition: ProductGaussSeidel.hpp:55