* sub-objects.
*/
BlockIndices<columns> column_indices;
+
+ /**
+ * Make the block sparse matrix a
+ * friend, so that it can use our
+ * #row_indices# and
+ * #column_indices# objects.
+ */
+ template <typename number, int r, int c>
+ friend class BlockSparseMatrix;
};
BlockSparsityPattern<rows,columns>::compress ()
{
for (unsigned int i=0; i<rows; ++i)
- for (unsigned int j=0; j<rows; ++j)
+ for (unsigned int j=0; j<columns; ++j)
sub_objects[i][j].compress ();
};
BlockSparsityPattern<rows,columns>::empty () const
{
for (unsigned int i=0; i<rows; ++i)
- for (unsigned int j=0; j<rows; ++j)
+ for (unsigned int j=0; j<columns; ++j)
if (sub_objects[i][j].empty () == false)
return false;
return true;
{
unsigned int count = 0;
for (unsigned int i=0; i<rows; ++i)
- for (unsigned int j=0; j<rows; ++j)
+ for (unsigned int j=0; j<columns; ++j)
count += sub_objects[i][j].n_nonzero_elements ();
return count;
};
BlockSparsityPattern<rows,columns>::is_compressed () const
{
for (unsigned int i=0; i<rows; ++i)
- for (unsigned int j=0; j<rows; ++j)
+ for (unsigned int j=0; j<columns; ++j)
if (sub_objects[i][j].is_compressed () == false)
return false;
return true;