Skip to content

Commit 0aee299

Browse files
authored
Merge pull request #208 from DerThorsten/test_norm_float
added more tests for float norm
2 parents 56c5bb7 + b22f8ff commit 0aee299

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

test/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ set(XTENSOR_BLAS_TESTS
145145
test_dot.cpp
146146
test_dot_extended.cpp
147147
test_qr.cpp
148-
test_complex_float_norm.cpp
148+
test_float_norm.cpp
149149
)
150150

151151
add_executable(test_xtensor_blas ${XTENSOR_BLAS_TESTS} ${XTENSOR_BLAS_HEADERS} ${XTENSOR_HEADERS})

test/test_complex_float_norm.cpp renamed to test/test_float_norm.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,17 @@
2121
namespace xt
2222
{
2323

24-
TEST(xblas, norm_complex_float) {
25-
xt::xarray<std::complex<float>> a = {std::complex<float>(1.0f, 2.0f), std::complex<float>(3.0f, 4.0f)};
26-
auto res = linalg::norm(a);
24+
TEST(xblas, norm_complex_float) {
25+
xt::xarray<std::complex<float>> a = {std::complex<float>(1.0f, 2.0f), std::complex<float>(3.0f, 4.0f)};
26+
auto res = linalg::norm(a);
2727

28-
EXPECT_NEAR(res.real(), 5.4772f, 1e-3f);
29-
EXPECT_NEAR(res.imag(), 0.0f, 1e-3f);
30-
}
28+
EXPECT_NEAR(res.real(), 5.4772f, 1e-3f);
29+
EXPECT_NEAR(res.imag(), 0.0f, 1e-3f);
30+
}
31+
32+
TEST(xblas, norm_float_arange)
33+
{
34+
xt::linalg::norm(xt::arange<float>(15), 1);
35+
}
3136

3237
}

0 commit comments

Comments
 (0)