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

Impletemented Types for SORIteration test.

parent cc3a9bdc
No related branches found
No related tags found
1 merge request!16Matrices
...@@ -565,31 +565,38 @@ void test_PerformSORIteration() ...@@ -565,31 +565,38 @@ void test_PerformSORIteration()
m.setElement( 3, 2, 1.0 ); // 3rd row m.setElement( 3, 2, 1.0 ); // 3rd row
m.setElement( 3, 3, 4.0 ); m.setElement( 3, 3, 4.0 );
float bVector [ 4 ] = { 1.0, 1.0, 1.0, 1.0 }; typedef typename Matrix::RealType RealType;
float xVector [ 4 ] = { 1.0, 1.0, 1.0, 1.0 }; typedef typename Matrix::DeviceType DeviceType;
typedef typename Matrix::IndexType IndexType;
RealType bVector [ 4 ] = { 1, 1, 1, 1 };
RealType xVector [ 4 ] = { 1, 1, 1, 1 };
IndexType row = 0;
RealType omega = 1;
m.performSORIteration( bVector, 0, xVector, 1); m.performSORIteration( bVector, row++, xVector, omega);
EXPECT_EQ( xVector[ 0 ], 0.0 ); EXPECT_EQ( xVector[ 0 ], 0.0 );
EXPECT_EQ( xVector[ 1 ], 1.0 ); EXPECT_EQ( xVector[ 1 ], 1.0 );
EXPECT_EQ( xVector[ 2 ], 1.0 ); EXPECT_EQ( xVector[ 2 ], 1.0 );
EXPECT_EQ( xVector[ 3 ], 1.0 ); EXPECT_EQ( xVector[ 3 ], 1.0 );
m.performSORIteration( bVector, 1, xVector, 1); m.performSORIteration( bVector, row++, xVector, omega);
EXPECT_EQ( xVector[ 0 ], 0.0 ); EXPECT_EQ( xVector[ 0 ], 0.0 );
EXPECT_EQ( xVector[ 1 ], 0.0 ); EXPECT_EQ( xVector[ 1 ], 0.0 );
EXPECT_EQ( xVector[ 2 ], 1.0 ); EXPECT_EQ( xVector[ 2 ], 1.0 );
EXPECT_EQ( xVector[ 3 ], 1.0 ); EXPECT_EQ( xVector[ 3 ], 1.0 );
m.performSORIteration( bVector, 2, xVector, 1); m.performSORIteration( bVector, row++, xVector, omega);
EXPECT_EQ( xVector[ 0 ], 0.0 ); EXPECT_EQ( xVector[ 0 ], 0.0 );
EXPECT_EQ( xVector[ 1 ], 0.0 ); EXPECT_EQ( xVector[ 1 ], 0.0 );
EXPECT_EQ( xVector[ 2 ], 0.0 ); EXPECT_EQ( xVector[ 2 ], 0.0 );
EXPECT_EQ( xVector[ 3 ], 1.0 ); EXPECT_EQ( xVector[ 3 ], 1.0 );
m.performSORIteration( bVector, 3, xVector, 1); m.performSORIteration( bVector, row++, xVector, omega);
EXPECT_EQ( xVector[ 0 ], 0.0 ); EXPECT_EQ( xVector[ 0 ], 0.0 );
EXPECT_EQ( xVector[ 1 ], 0.0 ); EXPECT_EQ( xVector[ 1 ], 0.0 );
......
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