Skip to content
Snippets Groups Projects
Commit 9c229a3a authored by Lukas Cejka's avatar Lukas Cejka
Browse files

In SparseMatrixCopyTest.h:

	Set appropriate row lengths in the setup of the Uneven Row Size matrix.
parent b3acbedc
No related branches found
No related tags found
1 merge request!16Matrices
...@@ -46,8 +46,13 @@ void setupUnevenRowSizeMatrix( Matrix& m ) ...@@ -46,8 +46,13 @@ void setupUnevenRowSizeMatrix( Matrix& m )
typename Matrix::CompressedRowLengthsVector rowLengths; typename Matrix::CompressedRowLengthsVector rowLengths;
rowLengths.setSize( rows ); rowLengths.setSize( rows );
rowLengths.setValue( 5 ); rowLengths.setValue( 5 );
// rowLengths.setElement( 0, 4); rowLengths.setElement( 0, 2 );
// rowLengths.setElement( 1, 4 ); rowLengths.setElement( 1, 3 );
rowLengths.setElement( 2, 3 );
rowLengths.setElement( 5, 2 );
rowLengths.setElement( 6, 1 );
rowLengths.setElement( 7, 1 );
rowLengths.setElement( 9, 1 );
m.setCompressedRowLengths( rowLengths ); m.setCompressedRowLengths( rowLengths );
int value = 1; int value = 1;
...@@ -335,57 +340,57 @@ void checkTriDiagMatrix( Matrix& m ) ...@@ -335,57 +340,57 @@ void checkTriDiagMatrix( Matrix& m )
template< typename Matrix1, typename Matrix2 > template< typename Matrix1, typename Matrix2 >
void testCopyAssignment() void testCopyAssignment()
{ {
Matrix1 m1; // Matrix1 m1;
setupTriDiagMatrix( m1 ); // setupTriDiagMatrix( m1 );
checkTriDiagMatrix( m1 ); // checkTriDiagMatrix( m1 );
// Matrix1 m11; // Matrix1 m11;
// setupAntiTriDiagMatrix( m11 ); // setupAntiTriDiagMatrix( m11 );
// checkAntiTriDiagMatrix( m11 ); // checkAntiTriDiagMatrix( m11 );
// Matrix1 m111; Matrix1 m111;
// setupUnevenRowSizeMatrix( m111 ); setupUnevenRowSizeMatrix( m111 );
// checkUnevenRowSizeMatrix( m111 ); checkUnevenRowSizeMatrix( m111 );
Matrix2 m2; // Matrix2 m2;
m2 = m1; // m2 = m1;
checkTriDiagMatrix( m2 ); // checkTriDiagMatrix( m2 );
// Matrix2 m22; // Matrix2 m22;
// m22 = m11; // m22 = m11;
// checkAntiTriDiagMatrix( m22 ); // checkAntiTriDiagMatrix( m22 );
// Matrix2 m222; Matrix2 m222;
// m222 = m111; m222 = m111;
// checkUnevenRowSizeMatrix( m222 ); checkUnevenRowSizeMatrix( m222 );
} }
template< typename Matrix1, typename Matrix2 > template< typename Matrix1, typename Matrix2 >
void testConversion() void testConversion()
{ {
Matrix1 m1; // Matrix1 m1;
setupTriDiagMatrix( m1 ); // setupTriDiagMatrix( m1 );
checkTriDiagMatrix( m1 ); // checkTriDiagMatrix( m1 );
// Matrix1 m11; // Matrix1 m11;
// setupAntiTriDiagMatrix( m11 ); // setupAntiTriDiagMatrix( m11 );
// checkAntiTriDiagMatrix( m11 ); // checkAntiTriDiagMatrix( m11 );
// Matrix1 m111; Matrix1 m111;
// setupUnevenRowSizeMatrix( m111 ); setupUnevenRowSizeMatrix( m111 );
// checkUnevenRowSizeMatrix( m111 ); checkUnevenRowSizeMatrix( m111 );
Matrix2 m2; // Matrix2 m2;
TNL::Matrices::copySparseMatrix( m2, m1 ); // TNL::Matrices::copySparseMatrix( m2, m1 );
checkTriDiagMatrix( m2 ); // checkTriDiagMatrix( m2 );
// Matrix2 m22; // Matrix2 m22;
// TNL::Matrices::copySparseMatrix( m22, m11 ); // TNL::Matrices::copySparseMatrix( m22, m11 );
// checkAntiTriDiagMatrix( m22 ); // checkAntiTriDiagMatrix( m22 );
// Matrix2 m222; Matrix2 m222;
// TNL::Matrices::copySparseMatrix( m222, m111 ); TNL::Matrices::copySparseMatrix( m222, m111 );
// checkUnevenRowSizeMatrix( m222 ); checkUnevenRowSizeMatrix( m222 );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment