12 #ifndef BOGUS_PRODUCT_GAUSS_SEIDEL_UTILS_HPP
13 #define BOGUS_PRODUCT_GAUSS_SEIDEL_UTILS_HPP
15 #include "../Utils/CppTools.hpp"
21 namespace block_solvers_impl {
31 template <
typename Type,
bool IsScalar >
39 bool valid()
const {
return true; }
47 template<
typename Type >
50 typedef typename Type::Index Index ;
51 typedef typename Type::BlockPtr BlockPtr ;
54 : m_matrixPtr( BOGUS_NULL_PTR(
const Type) )
58 { computeBlockIndices() ; }
60 bool valid()
const {
return m_matrixPtr; }
61 const Type&
get()
const {
68 void computeBlockIndices() ;
70 inline bool has_element(
const Index i )
const
71 {
return m_blockIndices[i] != Type::InvalidBlockPtr ; }
74 inline const typename Type::BlockType& operator[](
const Index i )
const
75 {
return m_matrixPtr->block(m_blockIndices[i]) ; }
78 const Type* m_matrixPtr ;
79 std::vector< BlockPtr > m_blockIndices ;
83 template <
typename MType,
typename DType,
bool Precompute >
87 : m_M( BOGUS_NULL_PTR(
const MType) ),
88 m_D( BOGUS_NULL_PTR(
const DType) )
91 void compute(
const MType& M,
const DType& D ) {
96 template<
typename Rhs,
typename Intermediate,
typename Res >
97 void multiply(
const Rhs& rhs, Intermediate &itm, Res& res )
const ;
99 template<
typename Rhs,
typename Res >
100 void colMultiply(
typename MType::Index col,
const Rhs& rhs, Res & res )
const ;
101 template<
typename Rhs,
typename Res >
102 void rowMultiply(
typename MType::Index row,
const Rhs& rhs, Res & res )
const ;
108 template <
typename MType,
typename DType >
112 : m_M( BOGUS_NULL_PTR(
const MType) )
115 void compute(
const MType& M,
const DType& D );
117 template<
typename Rhs,
typename Intermediate,
typename Res >
118 void multiply(
const Rhs& rhs, Intermediate &itm, Res& res )
const ;
120 template<
typename Rhs,
typename Res >
121 void colMultiply(
typename MType::Index col,
const Rhs& rhs, Res & res )
const ;
122 template<
typename Rhs,
typename Res >
123 void rowMultiply(
typename MType::Index row,
const Rhs& rhs, Res & res )
const ;
127 typedef typename MType::template MutableImpl< typename MType::TransposeBlockType, false, true >::Type DMtType ;
Utility struct to precompute or reference the (D M') part of the product.
Definition: ProductGaussSeidelUtils.hpp:84
Wrapper for the block-diagonal matrix of the ProductGaussSeidel solver.
Definition: ProductGaussSeidelUtils.hpp:32
Definition: CppTools.hpp:221