84SymCompCol :: SymCompCol(
int n) :
CompCol(n)
92std::unique_ptr<SparseMtrx> SymCompCol :: clone()
const
94 return std::make_unique<SymCompCol>(*
this);
105 std :: vector< std :: set< int > > columns(neq);
110 elem->giveLocationArray(loc, s);
112 for (
int ii : loc ) {
114 for (
int jj : loc ) {
115 if ( jj > 0 && ii >= jj ) {
116 columns [ jj - 1 ].insert(ii - 1);
124 std :: vector< IntArray >r_locs;
125 std :: vector< IntArray >c_locs;
127 for (
auto &gbc : domain->
giveBcs() ) {
131 for ( std :: size_t k = 0; k < r_locs.size(); k++ ) {
134 for (
int ii : krloc ) {
136 for (
int jj : kcloc ) {
137 if ( jj > 0 && ii >= jj ) {
138 columns [ jj - 1 ].insert(ii - 1);
150 for (
auto &in: eModel->giveIntegralList()) {
152 for (
auto &elem: in->set->giveElementList()) {
154 in->getElementTermCodeNumbers (locr, locc, domain->
giveElement(elem), *in->term, s) ;
155 for (
int ii : locr ) {
157 for (
int jj : locc ) {
158 if ( jj > 0 && ii >= jj ) {
159 columns [ jj - 1 ].insert(ii - 1);
169 for (
auto &
val : columns ) {
170 this->
nz +=
val.size();
177 for (
int j = 0; j < neq; j++ ) {
179 for (
int row: columns [ j ] ) {
204 if ( x.
giveSize() != this->giveNumberOfColumns() ) {
224void SymCompCol :: times(
double x)
238 OOFEM_ERROR(
"dimension of 'k' and 'loc' mismatch");
242 for (
int j = 0; j < dim; j++ ) {
245 int cstart =
colptr[jj - 1];
247 int last_ii = this->
nRows + 1;
248 for (
int i = 0; i < dim; i++ ) {
254 else if ( ii > last_ii )
256 for ( ;
rowind[t] < ii - 1; t++ ) {
259 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
280 for (
int j = 0; j < dim2; j++ ) {
283 int cstart =
colptr[jj - 1];
285 int last_ii = this->
nRows + 1;
286 for (
int i = 0; i < dim1; i++ ) {
292 else if ( ii > last_ii )
294 for ( ;
rowind[t] < ii - 1; t++ ) {
297 OOFEM_ERROR(
"Couldn't find row %d in the sparse structure", ii);
313void SymCompCol :: zero()
321double &SymCompCol :: at(
int i,
int j)
330 if (
rowind[t] == ( i - 1 ) ) {
335 OOFEM_ERROR(
"Array accessing exception -- out of bounds");
339double SymCompCol :: at(
int i,
int j)
const
346 if (
rowind[t] == ( i - 1 ) ) {
354 OOFEM_ERROR(
"Array accessing exception -- index out of bounds (%d,%d)", i, j);
358double SymCompCol :: operator() (
int i,
int j)
const
373 OOFEM_ERROR(
"Array accessing exception, index out of bounds (%d,%d)", i, j);
377double &SymCompCol :: operator() (
int i,
int j)
391 OOFEM_ERROR(
"Array element (%d,%d) not in sparse structure -- cannot assign", i, j);
#define REGISTER_SparseMtrx(class, type)
virtual void giveLocationArrays(std ::vector< IntArray > &rows, std ::vector< IntArray > &cols, CharType type, const UnknownNumberingScheme &r_s, const UnknownNumberingScheme &c_s)
std ::vector< std ::unique_ptr< GeneralBoundaryCondition > > & giveBcs()
Element * giveElement(int n)
std ::vector< std ::unique_ptr< Element > > & giveElements()
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Domain * giveDomain(int n)
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
int giveNumberOfColumns() const
Returns number of columns of receiver.
int giveNumberOfRows() const
Returns number of rows of receiver.
int nColumns
Number of columns.
SparseMtrxVersionType version
int giveNumberOfRows() const
Returns number of rows of receiver.
int giveNumberOfColumns() const
Returns number of columns of receiver.
#define OOFEM_LOG_INFO(...)
double sum(const FloatArray &x)
@ SMT_SymCompCol
Symmetric compressed column.