| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d9a57b6 commit 4e72875
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -392,7 +392,8 @@ namespace xt | |||
| 392 | 392 | ||
| 393 | 393 | static constexpr bool simd_interface() | |
| 394 | 394 | { | |
| 395 | - return has_simd_interface<E1, requested_value_type>() | ||
| 395 | + return data_interface_expression<E1> | ||
| 396 | + && has_simd_interface<E1, requested_value_type>() | ||
| 396 | 397 | && has_simd_interface<E2, requested_value_type>(); | |
| 397 | 398 | } | |
| 398 | 399 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -319,6 +319,16 @@ namespace xt | |||
| 319 | 319 | EXPECT_EQ(a(4, 4), cmplx(-123.321L, -123.321L)); | |
| 320 | 320 | } | |
| 321 | 321 | ||
| 322 | + TEST(xcomplex, assign_to_real_part) | ||
| 323 | + { | ||
| 324 | + using cpx = std::complex<double>; | ||
| 325 | + xt::xtensor<cpx, 1> a = {cpx(1, 2), cpx(3, 4), cpx(5, 6), cpx(7, 8), cpx(9, 10)}; | ||
| 326 | + xt::xtensor<double, 1> wr = {11, 12, 13, 14, 15}; | ||
| 327 | + xt::real(a) = wr; | ||
| 328 | + xt::xtensor<cpx, 1> expected = {cpx(11, 2), cpx(12, 4), cpx(13, 6), cpx(14, 8), cpx(15, 10)}; | ||
| 329 | + EXPECT_EQ(a, expected); | ||
| 330 | + } | ||
| 331 | + | ||
| 322 | 332 | TEST(xcomplex, build_from_double) | |
| 323 | 333 | { | |
| 324 | 334 | xt::xarray<double> r = {1., 2., 3.}; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments