33 #ifndef __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__GAUSS__
34 #define __H__UG__LIB_DISC__OPERATOR__LINEAR_OPERATOR__GAUSS__
61 template<
typename TMatrixType,
typename TRowType>
65 for(
typename TMatrixType::const_row_iterator connij = A.begin_row(i); connij != A.end_row(i); ++connij)
67 const size_t j=connij.index();
68 row(connij.index()) = (i==j) ? 0.0 : connij.value();
81 template<
typename TRowType>
85 typedef typename TRowType::const_iterator const_iterator;
87 for(const_iterator conn = Ci.begin(); conn != Ci.end(); ++conn)
89 if(conn.index() == i)
continue;
92 if(d > dmax) dmax =
BlockNorm(conn.value());
95 for(const_iterator conn = Ci.begin(); conn != Ci.end(); ++conn)
97 if(conn.index() == i)
continue;
105 template<
typename matrix_type>
109 graph.
resize(A.num_rows());
111 for(
size_t i=0; i< A.num_rows(); i++)
114 if(A.is_isolated(i))
continue;
122 strong.
find(Ri, i, graph);
140 template<
typename TSparseMatrixType,
typename TVectorType>
148 typedef typename TSparseMatrixType::const_row_iterator const_row_iterator;
152 tmp.resize(indices.size()*
GetSize(b[0]));
153 tmp2.resize(indices.size()*
GetSize(b[0]));
154 for(
size_t i=0; i<indices.size(); i++)
157 smallvec_type
s = b[j];
159 for(const_row_iterator it = A.begin_row(j); it != A.end_row(j); ++it)
160 s -= it.value() * x[it.index()];
164 MatMult(tmp2, 1.0, AlocInv, tmp);
167 for(
size_t i=0; i<indices.size(); i++)
169 smallvec_type &xi = x[indices[i]];
170 for(
size_t j=0; j<
GetSize(xi); j++)
174 template<
typename TSparseMatrixType,
typename TVectorType>
177 std::vector<size_t> &indices)
195 template<
typename TSparseMatrixType,
typename TVectorType>
200 size_t blockSize =
GetSize(b[0]);
202 typedef typename TSparseMatrixType::const_row_iterator const_row_iterator;
206 tmp.
resize(indices.size()*blockSize);
207 tmp2.
resize(indices.size()*blockSize);
208 for(
size_t i=0; i<indices.size(); i++)
211 smallvec_type
s = b[j];
213 for(const_row_iterator it = A.begin_row(j); it != A.end_row(j); ++it)
214 s -= it.value() * x[it.index()];
218 ilut->solve(tmp2, tmp);
221 for(
size_t i=0; i<indices.size(); i++)
223 smallvec_type &xi = x[indices[i]];
224 for(
size_t j=0; j<
GetSize(xi); j++)
234 template<
typename TSparseMatrixType>
239 tmp.resize(indices.size(), indices.size());
245 template<
typename TSparseMatrixType>
258 template<
typename TSparseMatrixType>
259 void GetSliceSparse(
const TSparseMatrixType &A,
const std::vector<size_t> &indices,
262 size_t blockSize =
GetRows(A(0,0));
263 size_t numRows = indices.size();
264 size_t numCols = indices.size();
266 R.resize_and_clear(numRows*blockSize, numCols*blockSize);
267 for(
size_t ri=0; ri<indices.size(); ri++)
269 size_t r=indices[ri];
270 for(
size_t ci=0; ci<indices.size(); ci++)
272 size_t c = indices[ci];
273 if(A.has_connection(r, c))
276 for(
size_t j1=0; j1<blockSize; j1++)
277 for(
size_t j2=0; j2<blockSize; j2++)
278 R(ri*blockSize + j1, ci*blockSize + j2) =
BlockRef(m, j1, j2);
286 template<
typename TAlgebra>
320 std::vector<IndexLayout::Element> vIndex;
369 template <
typename TAlgebra,
bool backward,
bool forward>
418 std::vector< DenseMatrix<VariableArray2<double> > >
AlocInv;
430 virtual const char*
name()
const {
return "BlockGaussSeidel";}
435 size_t N =
A.num_rows();
445 for(
size_t i=0; i<N; i++)
448 std::vector<bool> bVisited(N,
false);
463 UG_LOG(
"Max Size = " << maxSize <<
"\n");
487 for(
size_t i=0; i<x.size(); i++)
495 for(
size_t i=x.size()-1; ; i--)
513 std::stringstream ss ; ss <<
"BlockGaussSeidel(depth = " <<
m_depth <<
")";
520 template <
typename TAlgebra,
bool backward,
bool forward>
571 std::vector< DenseMatrix<VariableArray2<double> > >
AlocInv;
584 virtual const char*
name()
const
586 if(backward&&forward)
return "SymmetricBlockGaussSeidelIterative";
587 else if(backward)
return "BackwardBlockGaussSeidelIterative";
588 return "BlockGaussSeidelIterative";
596 size_t N =
A.num_rows();
600 for(
size_t i=0; i<N; i++)
602 std::vector<bool> bVisited(N,
false);
605 maxSize = std::max(
indices[i].size(), maxSize);
607 UG_LOG(
"Max Size = " << maxSize <<
"\n");
625 s -= it.value() * x[it.index()];
634 for(
size_t k=0; k<
m_nu; k++)
635 for(
size_t j=0; j<
indices[i].size(); j++)
641 for(
size_t k=0; k<
m_nu; k++)
642 for(
int j=(
int)(
indices[i].size())-1; j>=0 ; j--)
658 for(
size_t i=0; i<x.size(); i++)
663 for(
size_t i=x.size()-1; ; i--)
685 std::stringstream ss ;
686 if(backward&&forward) ss <<
"Symmetric";
687 else if(backward) ss <<
"Backward";
688 ss <<
"BlockGaussSeidelIterative(depth = " <<
m_depth <<
", nu = " <<
m_nu <<
")";
701 template <
typename TAlgebra,
bool backward,
bool forward>
750 std::map<size_t, SmartPtr<ILUTPreconditioner<CPUAlgebra> > >
m_ilut;
754 std::map<size_t, SmartPtr<CPUAlgebra::matrix_type> >
Aloc;
765 virtual const char*
name()
const {
return "SparseBlockGaussSeidel";}
770 size_t N =
A.num_rows();
779 PROGRESS_START(prog, N,
"SparseBlockGaussSeidel: compute blocks");
783 std::vector<size_t> bVisited(N, 0);
784 std::vector<bool> bVisited2(N,
false);
786 std::vector<size_t> levels;
788 for(
size_t i=0; i<N; i++)
796 for(
size_t j=0; j<
indices[i].size(); j++)
815 UG_LOG(
"Max Size = " << maxSize <<
"\n");
839 for(
size_t i=0; i<x.size(); i++)
848 for(
size_t i=x.size()-1; ; i--)
868 std::stringstream ss ;
869 if(backward&&forward) ss <<
"Symmetric";
870 else if(backward) ss <<
"Backward";
871 ss <<
"SparseBlockGaussSeidel(depth = " <<
m_depth <<
")";
884 template <
typename TAlgebra,
bool backward,
bool forward>
931 std::map<size_t, SmartPtr<ILUTPreconditioner<CPUAlgebra> > >
m_ilut;
935 std::map<size_t, SmartPtr<CPUAlgebra::matrix_type> >
Aloc;
946 virtual const char*
name()
const {
return "SparseBlockGaussSeidel2";}
951 size_t N =
A.num_rows();
958 PROGRESS_START(prog, N,
"SparseBlockGaussSeidel: compute blocks");
965 for(
size_t i=0; i<graph.
size(); i++)
972 std::vector<int> iComponent(N, -1);
973 std::vector<std::vector<int> > components;
975 for(
size_t i=0; i<G.
size(); i++)
977 if(iComponent[i] != -1)
continue;
978 int myComponent = iComponent[i] = components.size();
979 components.resize(components.size()+1);
980 std::vector<int> &myComponents = components[myComponent];
981 myComponents.push_back(i);
982 for(
size_t c=0; c<myComponents.size(); c++)
984 int j = myComponents[c];
987 if(iComponent[*it] == myComponent)
continue;
988 myComponents.push_back(*it);
990 iComponent[*it] = myComponent;
994 for(
size_t i=0; i<N; i++)
996 for(
size_t c=0; c<components.size(); c++)
998 int i=components[c][0];
999 indices[i].insert(
indices[i].begin(), components[c].begin(), components[c].end());
1011 UG_LOG(
"Max Size = " << maxSize <<
"\n");
1035 for(
size_t i=0; i<x.size(); i++)
1044 for(
size_t i=x.size()-1; ; i--)
1064 std::stringstream ss ;
1065 if(backward&&forward) ss <<
"Symmetric";
1066 else if(backward) ss <<
"Backward";
1067 ss <<
"SparseBlockGaussSeidel(depth = " <<
m_depth <<
")";
Definition: smart_pointer.h:108
bool valid() const
returns true if the pointer is valid, false if not.
Definition: smart_pointer.h:206
Definition: block_gauss_seidel.h:371
vector_type::value_type smallvec_type
Definition: block_gauss_seidel.h:415
void set_depth(size_t d)
Definition: block_gauss_seidel.h:423
std::vector< DenseMatrix< VariableArray2< double > > > AlocInv
Definition: block_gauss_seidel.h:418
virtual bool postprocess()
cleans the operator
Definition: block_gauss_seidel.h:471
std::vector< std::vector< size_t > > indices
Definition: block_gauss_seidel.h:420
virtual const char * name() const
returns the name of iterator
Definition: block_gauss_seidel.h:430
matrix_type::value_type smallmat_type
Definition: block_gauss_seidel.h:414
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: block_gauss_seidel.h:472
BlockGaussSeidel()
Definition: block_gauss_seidel.h:395
matrix_type::const_row_iterator const_row_iterator
Definition: block_gauss_seidel.h:416
size_t m_depth
Definition: block_gauss_seidel.h:419
virtual bool block_preprocess(matrix_type &A)
Definition: block_gauss_seidel.h:433
virtual std::string config_string() const
Definition: block_gauss_seidel.h:511
IBlockJacobiPreconditioner< TAlgebra > base_type
Base type.
Definition: block_gauss_seidel.h:386
BlockGaussSeidel(int depth)
Definition: block_gauss_seidel.h:399
matrix_type::const_row_iterator matrix_const_row_iterator
Definition: block_gauss_seidel.h:467
BlockGaussSeidel< algebra_type, backward, forward > this_type
Definition: block_gauss_seidel.h:388
TAlgebra::matrix_type matrix_type
Definition: block_gauss_seidel.h:380
matrix_type::row_iterator matrix_row_iterator
Definition: block_gauss_seidel.h:468
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: block_gauss_seidel.h:383
matrix_type::value_type block_type
Definition: block_gauss_seidel.h:391
TAlgebra algebra_type
Definition: block_gauss_seidel.h:374
virtual SmartPtr< ILinearIterator< vector_type > > clone()
clone
Definition: block_gauss_seidel.h:409
TAlgebra::vector_type vector_type
Definition: block_gauss_seidel.h:377
BlockGaussSeidel(const this_type &parent)
Definition: block_gauss_seidel.h:403
virtual bool block_step(matrix_type &A, vector_type &c, const vector_type &d)
Definition: block_gauss_seidel.h:475
Definition: block_gauss_seidel.h:522
matrix_type::value_type block_type
Definition: block_gauss_seidel.h:542
virtual std::string config_string() const
Definition: block_gauss_seidel.h:683
matrix_type::value_type smallmat_type
Definition: block_gauss_seidel.h:567
void set_iterative_steps(size_t nu)
Definition: block_gauss_seidel.h:677
virtual bool postprocess()
cleans the operator
Definition: block_gauss_seidel.h:615
void correct_backward(size_t i, matrix_type &A, vector_type &x, const vector_type &b)
Definition: block_gauss_seidel.h:639
vector_type::value_type smallvec_type
Definition: block_gauss_seidel.h:568
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: block_gauss_seidel.h:616
std::vector< DenseMatrix< VariableArray2< double > > > AlocInv
Definition: block_gauss_seidel.h:571
void correct_forward(size_t i, matrix_type &A, vector_type &x, const vector_type &b)
Definition: block_gauss_seidel.h:632
virtual const char * name() const
returns the name of iterator
Definition: block_gauss_seidel.h:584
matrix_type::const_row_iterator const_row_iterator
Definition: block_gauss_seidel.h:569
virtual bool block_step(matrix_type &A, vector_type &c, const vector_type &d)
Definition: block_gauss_seidel.h:649
IBlockJacobiPreconditioner< TAlgebra > base_type
Base type.
Definition: block_gauss_seidel.h:537
size_t m_depth
Definition: block_gauss_seidel.h:572
std::vector< std::vector< size_t > > indices
Definition: block_gauss_seidel.h:573
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: block_gauss_seidel.h:534
void correct(size_t i, const matrix_type &A, vector_type &x, const vector_type &b)
Definition: block_gauss_seidel.h:619
void set_depth(size_t d)
Definition: block_gauss_seidel.h:576
TAlgebra::matrix_type matrix_type
Definition: block_gauss_seidel.h:531
BlockGaussSeidelIterative(int depth, int nu)
Definition: block_gauss_seidel.h:550
TAlgebra::vector_type vector_type
Definition: block_gauss_seidel.h:528
virtual bool block_preprocess(matrix_type &A)
Definition: block_gauss_seidel.h:594
TAlgebra algebra_type
Definition: block_gauss_seidel.h:525
matrix_type::row_iterator matrix_row_iterator
Definition: block_gauss_seidel.h:612
BlockGaussSeidelIterative< algebra_type, backward, forward > this_type
Definition: block_gauss_seidel.h:539
matrix_type::const_row_iterator matrix_const_row_iterator
Definition: block_gauss_seidel.h:611
virtual SmartPtr< ILinearIterator< vector_type > > clone()
clone
Definition: block_gauss_seidel.h:562
size_t m_nu
Definition: block_gauss_seidel.h:646
BlockGaussSeidelIterative(const this_type &parent)
Definition: block_gauss_seidel.h:555
BlockGaussSeidelIterative()
Definition: block_gauss_seidel.h:545
TAlgebra::vector_type vector_type
type of vector
Definition: debug_writer.h:360
TAlgebra::matrix_type matrix_type
type of matrix
Definition: debug_writer.h:363
Definition: densematrix.h:57
Definition: densevector.h:101
Definition: block_gauss_seidel.h:288
IBlockJacobiPreconditioner(const IBlockJacobiPreconditioner &parent)
Definition: block_gauss_seidel.h:303
IBlockJacobiPreconditioner()
Definition: block_gauss_seidel.h:302
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: block_gauss_seidel.h:334
SmartPtr< vector_type > m_spDtmp
Definition: block_gauss_seidel.h:336
TAlgebra::vector_type vector_type
Definition: block_gauss_seidel.h:294
TAlgebra algebra_type
Definition: block_gauss_seidel.h:291
virtual bool preprocess(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp)
initializes the preconditioner
Definition: block_gauss_seidel.h:310
matrix_type A
Definition: block_gauss_seidel.h:308
virtual bool step(SmartPtr< MatrixOperator< matrix_type, vector_type > > pOp, vector_type &c, const vector_type &d)
computes a new correction c = B*d
Definition: block_gauss_seidel.h:339
virtual bool block_preprocess(matrix_type &A)=0
TAlgebra::matrix_type matrix_type
Definition: block_gauss_seidel.h:297
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: block_gauss_seidel.h:300
virtual bool block_step(matrix_type &A, vector_type &c, const vector_type &d)=0
virtual bool postprocess()
cleans the operator
Definition: block_gauss_seidel.h:333
describes a linear iterator that is based on a matrix operator
Definition: preconditioner.h:103
Definition: matrix_operator.h:49
Wrapper for sequential matrices to handle them in parallel.
Definition: parallel_matrix.h:65
Definition: block_gauss_seidel.h:886
virtual bool postprocess()
cleans the operator
Definition: block_gauss_seidel.h:1019
SparseBlockGaussSeidel2(int depth)
Definition: block_gauss_seidel.h:912
TAlgebra::vector_type vector_type
Definition: block_gauss_seidel.h:892
void set_depth(size_t d)
Definition: block_gauss_seidel.h:938
SparseBlockGaussSeidel2()
Definition: block_gauss_seidel.h:908
virtual SmartPtr< ILinearIterator< vector_type > > clone()
clone
Definition: block_gauss_seidel.h:922
matrix_type::value_type smallmat_type
Definition: block_gauss_seidel.h:927
virtual const char * name() const
returns the name of iterator
Definition: block_gauss_seidel.h:946
matrix_type::const_row_iterator matrix_const_row_iterator
Definition: block_gauss_seidel.h:1015
virtual bool block_preprocess(matrix_type &A)
Definition: block_gauss_seidel.h:949
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: block_gauss_seidel.h:898
vector_type::value_type smallvec_type
Definition: block_gauss_seidel.h:928
matrix_type::const_row_iterator const_row_iterator
Definition: block_gauss_seidel.h:929
SparseBlockGaussSeidel2< TAlgebra, backward, forward > this_type
Definition: block_gauss_seidel.h:902
virtual std::string config_string() const
Definition: block_gauss_seidel.h:1062
std::map< size_t, SmartPtr< ILUTPreconditioner< CPUAlgebra > > > m_ilut
Definition: block_gauss_seidel.h:931
TAlgebra::matrix_type matrix_type
Definition: block_gauss_seidel.h:895
SparseBlockGaussSeidel2(const this_type &parent)
Definition: block_gauss_seidel.h:916
std::map< size_t, SmartPtr< CPUAlgebra::matrix_type > > Aloc
Definition: block_gauss_seidel.h:935
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: block_gauss_seidel.h:1020
size_t m_depth
Definition: block_gauss_seidel.h:933
std::vector< std::vector< size_t > > indices
Definition: block_gauss_seidel.h:934
matrix_type::row_iterator matrix_row_iterator
Definition: block_gauss_seidel.h:1016
virtual bool block_step(matrix_type &A, vector_type &c, const vector_type &d)
Definition: block_gauss_seidel.h:1023
matrix_type::value_type block_type
Definition: block_gauss_seidel.h:905
IBlockJacobiPreconditioner< TAlgebra > base_type
Base type.
Definition: block_gauss_seidel.h:901
TAlgebra algebra_type
Definition: block_gauss_seidel.h:889
Definition: block_gauss_seidel.h:703
std::map< size_t, SmartPtr< CPUAlgebra::matrix_type > > Aloc
Definition: block_gauss_seidel.h:754
virtual bool supports_parallel() const
returns if parallel solving is supported
Definition: block_gauss_seidel.h:824
SparseBlockGaussSeidel()
Definition: block_gauss_seidel.h:726
SparseBlockGaussSeidel(const this_type &parent)
Definition: block_gauss_seidel.h:734
SparseBlockGaussSeidel< TAlgebra, backward, forward > this_type
Definition: block_gauss_seidel.h:722
SparseBlockGaussSeidel(int depth)
Definition: block_gauss_seidel.h:730
virtual bool block_preprocess(matrix_type &A)
Definition: block_gauss_seidel.h:768
virtual SmartPtr< ILinearIterator< vector_type > > clone()
clone
Definition: block_gauss_seidel.h:740
vector_type::value_type smallvec_type
Definition: block_gauss_seidel.h:747
void set_depth(size_t d)
Definition: block_gauss_seidel.h:757
matrix_type::row_iterator matrix_row_iterator
Definition: block_gauss_seidel.h:820
size_t m_depth
Definition: block_gauss_seidel.h:752
TAlgebra::matrix_type matrix_type
Definition: block_gauss_seidel.h:712
matrix_type::value_type smallmat_type
Definition: block_gauss_seidel.h:746
matrix_type::const_row_iterator matrix_const_row_iterator
Definition: block_gauss_seidel.h:819
IBlockJacobiPreconditioner< TAlgebra > base_type
Base type.
Definition: block_gauss_seidel.h:718
virtual std::string config_string() const
Definition: block_gauss_seidel.h:866
matrix_type::const_row_iterator const_row_iterator
Definition: block_gauss_seidel.h:748
std::map< size_t, SmartPtr< ILUTPreconditioner< CPUAlgebra > > > m_ilut
Definition: block_gauss_seidel.h:750
matrix_type::value_type block_type
Definition: block_gauss_seidel.h:721
virtual const char * name() const
returns the name of iterator
Definition: block_gauss_seidel.h:765
TAlgebra algebra_type
Definition: block_gauss_seidel.h:706
virtual bool postprocess()
cleans the operator
Definition: block_gauss_seidel.h:823
IPreconditioner< TAlgebra >::matrix_operator_type matrix_operator_type
Matrix Operator type.
Definition: block_gauss_seidel.h:715
virtual bool block_step(matrix_type &A, vector_type &c, const vector_type &d)
Definition: block_gauss_seidel.h:827
TAlgebra::vector_type vector_type
Definition: block_gauss_seidel.h:709
std::vector< std::vector< size_t > > indices
Definition: block_gauss_seidel.h:753
Definition: sparse_vector.h:41
Adds 'strong negative connections' to graph.
Definition: block_gauss_seidel.h:75
double m_theta
Definition: block_gauss_seidel.h:77
StrongNegativeConnectionsByBlockNorm(double theta)
Definition: block_gauss_seidel.h:79
void find(const TRowType &Ci, size_t i, cgraph &graph)
Definition: block_gauss_seidel.h:82
Definition: variable_array.h:59
Definition: variable_array.h:139
void resize(size_t newSize, bool bCopyValues=true)
Definition: vector.h:109
Definition: new_graph.h:69
row_iterator begin_row(size_t row)
Definition: new_graph.h:168
row_iterator end_row(size_t row)
Definition: new_graph.h:175
size_t size() const
Definition: new_graph.h:287
size_t * row_iterator
Definition: new_graph.h:72
void resize(size_t n)
Definition: new_graph.h:88
void set_connection(size_t from, size_t to)
set a connection from "from" to "to" if not already there
Definition: new_graph.h:148
#define PRINT_VECTOR(v, msg)
Definition: debug_print.h:53
void MatAddSlaveRowsToMasterRowOverlap0(TMatrix &mat)
Generates a set of unique global algebra ids.
Definition: parallelization_util.h:106
@ PST_CONSISTENT
Definition: parallel_storage_type.h:68
@ PST_UNIQUE
Definition: parallel_storage_type.h:70
@ PST_ADDITIVE
Definition: parallel_storage_type.h:69
void GetNeighborhood(const TSparseMatrix &A, size_t node, size_t depth, std::vector< size_t > &indices, std::vector< bool > &bVisited, bool bResetVisitedFlags=true)
Definition: sparsematrix_util.h:495
void SetDirichletRow(TSparseMatrix &A, size_t i, size_t alpha)
Definition: sparsematrix_util.h:796
void CollectUniqueElements(std::vector< typename TLayout::Element > &elemsOut, const TLayout &layout)
writes all elements in the interfaces into the resulting vector. avoids doubles.
Definition: pcl_layout_util.h:142
#define UG_LOG(msg)
Definition: log.h:367
#define UG_COND_THROW(cond, msg)
UG_COND_THROW(cond, msg) : performs a UG_THROW(msg) if cond == true.
Definition: error.h:61
void GetSliceDenseInverse(const TSparseMatrixType &A, const std::vector< size_t > &indices, DenseMatrix< VariableArray2< double > > &AlocInv, DenseMatrix< VariableArray2< typename TSparseMatrixType::value_type > > &tmp)
Definition: block_gauss_seidel.h:235
double & BlockRef(T &vec, size_t i)
Definition: blocks.h:66
void BlockMatrixToDoubleMatrix(DenseMatrix< VariableArray2< double > > &Ad, TMatrix &Ab)
Definition: additional_math.h:193
void CopyOffDiagEntries(const TMatrixType &A, size_t i, TRowType &row, bool enforceNew=false)
Definition: block_gauss_seidel.h:62
bool GetLocalMatrix(const TGlobalMatrix &mat, TLocalMatrix &localMat)
Definition: local_helper.h:191
void GetBlockGSCorrectionILUT(const TSparseMatrixType &A, TVectorType &x, TVectorType &b, SmartPtr< ILUTPreconditioner< CPUAlgebra > > &ilut, std::vector< size_t > &indices, CPUAlgebra::vector_type &tmp, CPUAlgebra::vector_type &tmp2)
Definition: block_gauss_seidel.h:196
size_t GetRows(const T &t)
bool MatMult(vector_t &dest, const number &beta1, const matrix_t &A1, const vector_t &w1)
calculates dest = beta1 * A1;
Definition: operations_mat.h:59
bool InverseMatMult(number &dest, const double &beta, const TMat &mat, const TVec &vec)
you can implement this function with GetInverse and MatMult
size_t GetSize(const T &t)
double BlockNorm(const TYPE &v)
Definition: blocks.h:57
void GetSliceSparse(const TSparseMatrixType &A, const std::vector< size_t > &indices, CPUAlgebra::matrix_type &R)
Definition: block_gauss_seidel.h:259
void CreateStrongConnectionGraphForSystems(const matrix_type &A, cgraph &graph, double theta)
Definition: block_gauss_seidel.h:106
void GetBlockGSCorrection(const TSparseMatrixType &A, TVectorType &x, TVectorType &b, DenseMatrix< VariableArray2< double > > &AlocInv, std::vector< size_t > &indices, DenseVector< VariableArray1< double > > &tmp, DenseVector< VariableArray1< double > > &tmp2)
Definition: block_gauss_seidel.h:141
#define PROFILE_BEGIN(name)
Definition: profiler.h:254
#define PROFILE_FUNC()
Definition: profiler.h:257
#define PROGRESS_FINISH(progVarName)
Definition: progress.h:118
#define PROGRESS_START(progVarName, dSize, msg)
Definition: progress.h:111
#define PROGRESS_UPDATE(progVarName, d)
Definition: progress.h:117
SmartPtr< T, FreePolicy > make_sp(T *inst)
returns a SmartPtr for the passed raw pointer
Definition: smart_pointer.h:836
T value_type
Definition: sparsematrix_interface.h:2
size_t num_rows() const
Definition: sparsematrix_interface.h:38