9 pInvDiag=std::make_shared<TArray1<T>>(pMatrix->shape(0));
10 pDiagIdx=std::make_shared<TArray1<int>>(pMatrix.shape(0));
17 pInvDiag=std::make_shared<TArray1<T>>(A.
shape(0));
18 pDiagIdx=std::make_shared<TArray1<int>>(A.
shape(0));
26 return std::make_shared<TPreconILU<T>>(pA);
45 for (
int i=0; i<n; i++)
47 for (
int j=IA(i);j<IA(i+1);j++)
56 for (
int i=0; i<n; i++)
59 for(
int j=ID(i)+1;j<IA(i+1);j++)
63 for(k=IA(JA(j));k<IA(JA(j)+1);k++)
71 if (found) XD(JA(j))-=A(k)*XD(i)*A(j);
90 for (
int i=0; i<n; i++)
93 for(
int j=IA(i);j<ID(i);j++)
95 Sol(i)=XD(i)*(Rhs(i)-x);
98 for (
int i=n-1; i>=0; i--)
101 for(
int j=ID(i)+1;j<IA(i+1);j++)
102 x += Sol(JA(j))*A(j);
std::shared_ptr< TArray1< int > > pJA
Column indices.
Sparse matrix class using CRS storage scheme.
TPreconILU(const std::shared_ptr< TSparseMatrix< T >> pA)
Create Preconditioner.
TArray is the common template base class for arrays and dense matrices of the numcxx project...
size_t size() const
Obtain size of array.
static std::shared_ptr< TPreconILU< T > > create(const std::shared_ptr< TSparseMatrix< T >> pA)
Create preconditioner.
bool pattern_changed() const
Check if pattern has changed after last solver update.
virtual void update(void)
std::shared_ptr< TArray1< T > > pA
Entries.
void solve(TArray< T > &Sol, const TArray< T > &Rhs) const
Solve preconditioning system.
index shape(int idim) const
Return the shape od the matrix.
void resize(size_t n)
Resize array.
std::shared_ptr< TArray1< int > > pIA
Row pointers.