Test Moore-Penrose conditions in the following first 4 tests See https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse#Definition
| 124 | // Test Moore-Penrose conditions in the following first 4 tests |
| 125 | // See https://en.wikipedia.org/wiki/Moore%E2%80%93Penrose_inverse#Definition |
| 126 | TYPED_TEST(Pinverse, AApinvA_A) { |
| 127 | SUPPORTED_TYPE_CHECK(TypeParam); |
| 128 | array in = readTestInput<TypeParam>( |
| 129 | string(TEST_DIR "/pinverse/pinverse10x8.test")); |
| 130 | array inpinv = pinverse(in); |
| 131 | array out = matmul(in, inpinv, in); |
| 132 | ASSERT_ARRAYS_NEAR(in, out, eps<TypeParam>()); |
| 133 | } |
| 134 | |
| 135 | TYPED_TEST(Pinverse, ApinvAApinv_Apinv) { |
| 136 | SUPPORTED_TYPE_CHECK(TypeParam); |