for (unsigned int r=0; r<rows; ++r)
for (unsigned int c=0; c<columns; ++c)
{
- sub_objects[r][c] = new SparseMatrix<number>();
- block(r,c).reinit (sparsity.block(r,c));
- };
+ SparseMatrix<number> *p = new SparseMatrix<number>();
+ p->reinit (sparsity.block(r,c));
+ sub_objects[r][c] = p;
+ }
}
= matrix->get_sparsity_pattern();
const unsigned int row_length = structure.row_length(row);
- inverses[row] = new FullMatrix<float> (row_length,
- row_length);
+
+ FullMatrix<float> &this_inverse = *new FullMatrix<float> (row_length,
+ row_length);
+ inverses[row] = &this_inverse;
// collect the dofs that couple
// with @p row
const unsigned int global_entry =
structure(local_indices[i], local_indices[j]);
if (global_entry != SparsityPattern::invalid_entry)
- (*inverses[row])(i,j) = matrix->global_entry(global_entry);
+ this_inverse(i,j) = matrix->global_entry(global_entry);
};
// Compute inverse
- inverses[row]->gauss_jordan();
+ this_inverse.gauss_jordan();
}
// allocate new objects
for (unsigned int i=0; i<rows; ++i)
for (unsigned int j=0; j<columns; ++j)
- sub_objects[i][j] = new SparsityPatternBase;
+ {
+ SparsityPatternBase *p = new SparsityPatternBase;
+ sub_objects[i][j] = p;
+ }
}