#include <lac/sparsity_pattern.h>
#include <lac/compressed_sparsity_pattern.h>
#include <lac/compressed_set_sparsity_pattern.h>
+#include <lac/chunk_sparsity_pattern.h>
#include <lac/full_matrix.h>
#include "testmatrix.h"
#include <fstream>
const unsigned int N = 15;
+unsigned int chunk_size = 1;
// reinitialize sparsity patterns for 5-point star
}
+void do_reinit (ChunkSparsityPattern &sp)
+{
+ sp.reinit((N-1)*(N-1), (N-1)*(N-1), 5, chunk_size);
+}
+
+
void do_reinit (CompressedSparsityPattern &sp)
{
sp.reinit((N-1)*(N-1), (N-1)*(N-1));
for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
deallog << sparsity_pattern.row_length(i) << std::endl;
+
+ deallog << "OK" << std::endl;
}
build_sparsity (sparsity_pattern);
sparsity_pattern.print_gnuplot(deallog.get_file_stream());
+
+ deallog << "OK" << std::endl;
}
build_sparsity (sparsity_pattern);
sparsity_pattern.print(deallog.get_file_stream());
+
+ deallog << "OK" << std::endl;
}
for (unsigned int i=0; i<sp2.n_rows(); ++i)
deallog << sp2.row_length(i) << std::endl;
sp2.print_gnuplot(deallog.get_file_stream());
+
+ deallog << "OK" << std::endl;
}
for (unsigned int i=0; i<sp3.n_rows(); ++i)
deallog << sp3.row_length(i) << std::endl;
sp3.print_gnuplot(deallog.get_file_stream());
+
+ deallog << "OK" << std::endl;
}
sparsity_pattern.matrix_position(i).second)
== true,
ExcInternalError());
+
+ deallog << "OK" << std::endl;
}
for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
ExcInternalError());
+
+ deallog << "OK" << std::endl;
}
for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
Assert (sparsity_pattern.exists(i,j) == sp4.exists (i,j),
ExcInternalError());
+
+ deallog << "OK" << std::endl;
}
Assert (sp4.exists (i,j)
== true,
ExcInternalError());
+
+ deallog << "OK" << std::endl;
}
Assert (sparsity_pattern.matrix_position(sparsity_pattern(row,col)) ==
std::make_pair(row,col),
ExcInternalError());
+
+ deallog << "OK" << std::endl;
}
<< (sparsity_pattern.is_compressed() ^ sp5.is_compressed()) << ' '
<< std::endl;
- for (unsigned int row=0; row<sparsity_pattern.n_rows(); ++row)
- {
- const unsigned int
- *sparsity_pattern_p=sparsity_pattern.get_column_numbers()+sparsity_pattern.get_rowstart_indices()[row];
- const unsigned int
- *sp5_p=sp5.get_column_numbers()+sp5.get_rowstart_indices()[row];
- for (; sparsity_pattern_p != (sparsity_pattern.get_column_numbers() +
- sparsity_pattern.get_rowstart_indices()[row+1]);
- ++sparsity_pattern_p, ++sp5_p)
- Assert (*sparsity_pattern_p == *sp5_p, ExcInternalError());
- }
+ for (unsigned int i=0; i<sparsity_pattern.n_rows(); ++i)
+ for (unsigned int j=0; j<sparsity_pattern.n_cols(); ++j)
+ Assert (sparsity_pattern.exists(i,j) == sp5.exists (i,j),
+ ExcInternalError());
+
+ deallog << "OK" << std::endl;
}