gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
6 #ifndef LINEAR_SYSTEM_CSR_H
7 #define LINEAR_SYSTEM_CSR_H
11 #include "GmshConfig.h"
35 std::vector<scalar> *
_b, *
_x;
60 scalar *a = (scalar *)
_a->
array;
66 int p1 = jptr[il + 1];
68 position = ((p0 + p1) / 2);
71 else if(ai[position] < ic)
78 for(position = p0; position < p1; position++) {
79 if(ai[position] >= ic) {
80 if(ai[position] == ic) {
90 if(ai[position] == ic) {
94 if(ptr[position] == 0)
break;
95 position = ptr[position];
123 Msg::Error(
"getFromMatrix not implemented for CSR");
128 if(val != scalar()) (*_b)[row] += val;
133 if(val != scalar()) (*_x)[row] += val;
149 scalar *a = (scalar *)
_a->
array;
150 for(
int i = 0; i < N; i++) a[i] = scalar();
155 for(std::size_t i = 0; i <
_b->size(); i++) (*
_b)[i] = scalar();
160 for(std::size_t i = 0; i <
_x->size(); i++) (*
_x)[i] = scalar();
167 for(std::size_t i = 0; i <
_b->size(); i++) {
168 temp = std::abs((*
_b)[i]);
169 if(nor < temp) nor = temp;
175 template <
class scalar>
191 #if !defined(HAVE_GMM)
193 Msg::Error(
"Gmm++ is not available in this version of Gmsh");
int CSRList_Nbr(CSRList_T *liste)
virtual double normInfRightHandSide() const
std::vector< scalar > * _b
std::vector< scalar > * _x
bool _entriesPreAllocated
virtual ~linearSystemCSRGmm()
void insertEntry(int i, int j)
static void Error(const char *fmt,...)
virtual void allocate(int)
virtual bool isAllocated() const
virtual ~linearSystemCSR()
virtual void getMatrix(INDEX_TYPE *&jptr, INDEX_TYPE *&ai, double *&a)
virtual void addToSolution(int row, const scalar &val)
sparsityPattern _sparsity
virtual void getFromMatrix(int row, int col, scalar &val) const
void CSRList_Add(CSRList_T *liste, const void *data)
virtual void zeroSolution()
virtual void insertInSparsityPattern(int i, int j)
virtual void getFromSolution(int row, scalar &val) const
virtual void preAllocateEntries()
virtual void addToRightHandSide(int row, const scalar &val, int ith=0)
virtual void zeroMatrix()
virtual void zeroRightHandSide()
virtual void addToMatrix(int il, int ic, const scalar &val)
linearSystemCSRGmm(const std::string &method="gmres", double tol=1e-8, int noisy=0)
virtual int systemSolve()
virtual void getFromRightHandSide(int row, scalar &val) const