@@ -101,12 +101,31 @@ TYPED_TEST(SolveSparseTestsAll, SolveCSR) {
101
101
for (index_t j = 0 ; j < 2 ; j++) {
102
102
if constexpr (is_complex_v<TestType>) {
103
103
ASSERT_NEAR (X (i, j).real (), E (i, j).real (), this ->thresh );
104
- ASSERT_NEAR (X (i, j).imag (), E (i,j ).imag (), this ->thresh );
104
+ ASSERT_NEAR (X (i, j).imag (), E (i, j ).imag (), this ->thresh );
105
105
}
106
106
else {
107
107
ASSERT_NEAR (X (i, j), E (i, j), this ->thresh );
108
108
}
109
+ }
110
+ }
111
+
112
+ // Allow dense computations (pre-/post-solve).
113
+ TestType C3 = static_cast <TestType>(3 );
114
+ TestType C5 = static_cast <TestType>(5 );
115
+ (Y = (Y - C3)).run (exec);
116
+ (X = solve (S, Y + C3) + C5).run (exec);
109
117
118
+ // Verify result.
119
+ exec.sync ();
120
+ for (index_t i = 0 ; i < 4 ; i++) {
121
+ for (index_t j = 0 ; j < 2 ; j++) {
122
+ if constexpr (is_complex_v<TestType>) {
123
+ ASSERT_NEAR ((X (i, j) - C5).real (), E (i, j).real (), this ->thresh );
124
+ ASSERT_NEAR ((X (i, j) - C5).imag (), E (i, j).imag (), this ->thresh );
125
+ }
126
+ else {
127
+ ASSERT_NEAR (X (i, j) - C5, E (i, j), this ->thresh );
128
+ }
110
129
}
111
130
}
112
131
0 commit comments