mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 08:17:13 +02:00
Added chi2 to fit results (#131)
- fit_gaus and fit_pol1 now return a dict - calculate chi2 after fit - cleaned up code
This commit is contained in:
@ -379,4 +379,32 @@ TEST_CASE("Elementwise operations on images") {
|
||||
REQUIRE(A(i) == a_val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Assign an std::array to a 1D NDArray") {
|
||||
NDArray<int, 1> a{{5}, 0};
|
||||
std::array<int, 5> b{1, 2, 3, 4, 5};
|
||||
a = b;
|
||||
for (uint32_t i = 0; i < a.size(); ++i) {
|
||||
REQUIRE(a(i) == b[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Assign an std::array to a 1D NDArray of a different size") {
|
||||
NDArray<int, 1> a{{3}, 0};
|
||||
std::array<int, 5> b{1, 2, 3, 4, 5};
|
||||
a = b;
|
||||
|
||||
REQUIRE(a.size() == 5);
|
||||
for (uint32_t i = 0; i < a.size(); ++i) {
|
||||
REQUIRE(a(i) == b[i]);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("Construct an NDArray from an std::array") {
|
||||
std::array<int, 5> b{1, 2, 3, 4, 5};
|
||||
NDArray<int, 1> a(b);
|
||||
for (uint32_t i = 0; i < a.size(); ++i) {
|
||||
REQUIRE(a(i) == b[i]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user