assign result to matrix to force evaluation

This commit is contained in:
conrad
2021-05-05 11:46:48 +10:00
parent 1f8ace7746
commit 65e247f87e
+3 -2
View File
@@ -22,7 +22,7 @@ using namespace arma;
TEST_CASE("fn_clamp_1")
{
mat A = randu<mat>(5,6);
mat A = randu<mat>(100,123);
mat B = clamp(A, 0.2, 0.8);
REQUIRE( B.min() == Approx(0.2) );
@@ -36,5 +36,6 @@ TEST_CASE("fn_clamp_1")
REQUIRE( D.min() == Approx(0.2) );
REQUIRE( D.max() == A.max() );
REQUIRE_THROWS( clamp(A, A.max(), A.min() ) );
mat E;
REQUIRE_THROWS( E = clamp(A, A.max(), A.min() ) );
}