const unsigned int row_length = structure.row_length(row);
- FullMatrix<float> &this_inverse = *new FullMatrix<float> (row_length,
- row_length);
- inverses[row] = &this_inverse;
+ inverses[row] = new FullMatrix<float> (row_length, row_length);
// collect the dofs that couple
// with @p row
local_indices[i] = structure.column_number(row, i);
// Build local matrix
- for (unsigned int i=0; i<row_length; ++i)
- for (unsigned int j=0; j<row_length; ++j)
- {
- // if DoFs local_index[i] and
- // local_index[j] couple with
- // each other, then get the
- // value from the global
- // matrix. if not, then leave
- // the value in the small
- // matrix at zero
- //
- // the explicit use of operator()
- // works around a bug in some gcc
- // versions (see PR 18803)
- const unsigned int global_entry =
- structure.operator()(local_indices[i], local_indices[j]);
- if (global_entry != SparsityPattern::invalid_entry)
- // the explicit use of operator()
- // works around a bug in some gcc
- // versions (see PR 18803)
- this_inverse.operator()(i,j) = matrix->global_entry(global_entry);
- }
+ inverses[row]->extract_submatrix_from (*matrix,
+ local_indices,
+ local_indices);
// Compute inverse
- this_inverse.gauss_jordan();
+ inverses[row]->gauss_jordan();
}