Commit 81572177 authored by David Frank's avatar David Frank Committed by Tobias Lasser
Browse files

Removed aliases of Eigen::VectorX, also in tests (as it will not work with older Eigen versions).

parent 0347810b
Pipeline #210946 passed with stages
in 4 minutes and 41 seconds
This diff is collapsed.
...@@ -27,7 +27,7 @@ TEMPLATE_TEST_CASE("Scenario: Constructing DataHandlerMapCPU", "", float, double ...@@ -27,7 +27,7 @@ TEMPLATE_TEST_CASE("Scenario: Constructing DataHandlerMapCPU", "", float, double
WHEN("constructing with a given vector") WHEN("constructing with a given vector")
{ {
Eigen::VectorX<TestType> randVec{size * 2}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size * 2};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh{randVec}; const DataHandlerCPU<TestType> dh{randVec};
const auto dhMap = dh.getBlock(size / 3, size / 3); const auto dhMap = dh.getBlock(size / 3, size / 3);
...@@ -43,7 +43,7 @@ TEMPLATE_TEST_CASE("Scenario: Constructing DataHandlerMapCPU", "", float, double ...@@ -43,7 +43,7 @@ TEMPLATE_TEST_CASE("Scenario: Constructing DataHandlerMapCPU", "", float, double
WHEN("copy constructing") WHEN("copy constructing")
{ {
Eigen::VectorX<TestType> randVec{size * 2}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size * 2};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh{randVec}; const DataHandlerCPU<TestType> dh{randVec};
const auto dhMap = dh.getBlock(size / 3, size / 3); const auto dhMap = dh.getBlock(size / 3, size / 3);
...@@ -67,7 +67,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing equality operator on DataHandlerMapCPU", " ...@@ -67,7 +67,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing equality operator on DataHandlerMapCPU", "
GIVEN("some DataHandlerMapCPU") GIVEN("some DataHandlerMapCPU")
{ {
index_t size = 314; index_t size = 314;
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU realDh{randVec}; const DataHandlerCPU realDh{randVec};
const auto dhPtr = realDh.getBlock(0, size); const auto dhPtr = realDh.getBlock(0, size);
...@@ -153,7 +153,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -153,7 +153,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a DataHandlerCPU through base pointers") WHEN("copy assigning a DataHandlerCPU through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const std::unique_ptr<const DataHandler<TestType>> dh2Ptr = const std::unique_ptr<const DataHandler<TestType>> dh2Ptr =
std::make_unique<const DataHandlerCPU<TestType>>(randVec); std::make_unique<const DataHandlerCPU<TestType>>(randVec);
...@@ -183,7 +183,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -183,7 +183,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a partial DataHandlerMapCPU through base pointers") WHEN("copy assigning a partial DataHandlerMapCPU through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{2 * size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh2{randVec}; const DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -211,7 +211,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -211,7 +211,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh2{randVec}; const DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -238,7 +238,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -238,7 +238,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a DataHandlerMapCPU through base pointers") WHEN("\"move\" assigning a DataHandlerMapCPU through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const std::unique_ptr<DataHandler<TestType>> dh2Ptr = const std::unique_ptr<DataHandler<TestType>> dh2Ptr =
std::make_unique<DataHandlerCPU<TestType>>(randVec); std::make_unique<DataHandlerCPU<TestType>>(randVec);
...@@ -268,7 +268,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -268,7 +268,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a partial DataHandlerMapCPU through base pointers") WHEN("\"move\" assigning a partial DataHandlerMapCPU through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{2 * size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<TestType> dh2{randVec}; DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -296,7 +296,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -296,7 +296,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<TestType> dh2{randVec}; DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -358,7 +358,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -358,7 +358,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a DataHandlerMapCPU through base pointers") WHEN("copy assigning a DataHandlerMapCPU through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const std::unique_ptr<DataHandler<TestType>> dh2Ptr = const std::unique_ptr<DataHandler<TestType>> dh2Ptr =
std::make_unique<DataHandlerCPU<TestType>>(randVec); std::make_unique<DataHandlerCPU<TestType>>(randVec);
...@@ -386,7 +386,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -386,7 +386,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a partial DataHandlerMapCPU through base pointers") WHEN("copy assigning a partial DataHandlerMapCPU through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{2 * size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh2{randVec}; const DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -413,7 +413,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -413,7 +413,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<TestType> dh2{randVec}; const DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -440,7 +440,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -440,7 +440,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a DataHandlerCPU through base pointers") WHEN("\"move\" assigning a DataHandlerCPU through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const std::unique_ptr<DataHandler<TestType>> dh2Ptr = const std::unique_ptr<DataHandler<TestType>> dh2Ptr =
std::make_unique<DataHandlerCPU<TestType>>(randVec); std::make_unique<DataHandlerCPU<TestType>>(randVec);
...@@ -468,7 +468,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -468,7 +468,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a partial DataHandlerMapCPU through base pointers") WHEN("\"move\" assigning a partial DataHandlerMapCPU through base pointers")
{ {
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<TestType> randVec{2 * size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<TestType> dh2{randVec}; DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -495,7 +495,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double ...@@ -495,7 +495,7 @@ TEMPLATE_TEST_CASE("Scenario: Assigning to DataHandlerMapCPU", "", float, double
WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
Eigen::VectorX<TestType> randVec{size}; Eigen::Matrix<TestType, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<TestType> dh2{randVec}; DataHandlerCPU<TestType> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
......
...@@ -44,7 +44,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Constructing DataHandler", "", (DataHandle ...@@ -44,7 +44,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Constructing DataHandler", "", (DataHandle
WHEN("constructing with a given vector") WHEN("constructing with a given vector")
{ {
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const TestType dh{randVec}; const TestType dh{randVec};
...@@ -77,7 +77,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Constructing DataHandler", "", (DataHandle ...@@ -77,7 +77,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Constructing DataHandler", "", (DataHandle
WHEN("move constructing") WHEN("move constructing")
{ {
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
TestType dh{randVec}; TestType dh{randVec};
const auto dhView = dh.getBlock(0, size); const auto dhView = dh.getBlock(0, size);
...@@ -104,7 +104,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing equality operator on DataHandler", ...@@ -104,7 +104,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing equality operator on DataHandler",
GIVEN("some DataHandler") GIVEN("some DataHandler")
{ {
index_t size = 314; index_t size = 314;
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const TestType dh{randVec}; const TestType dh{randVec};
...@@ -164,7 +164,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -164,7 +164,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("copy assigning") WHEN("copy assigning")
{ {
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU dh2{randVec}; const DataHandlerCPU dh2{randVec};
const auto dh2Map = dh2.getBlock(size / 2, size / 3); const auto dh2Map = dh2.getBlock(size / 2, size / 3);
...@@ -186,7 +186,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -186,7 +186,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("move assigning") WHEN("move assigning")
{ {
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU dh2{randVec}; DataHandlerCPU dh2{randVec};
const auto dh2View = dh2.getBlock(0, size); const auto dh2View = dh2.getBlock(0, size);
...@@ -213,7 +213,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -213,7 +213,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("copy assigning a DataHandlerCPU through base pointers") WHEN("copy assigning a DataHandlerCPU through base pointers")
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const auto dh2Ptr = std::make_unique<const DataHandlerCPU<data_t>>(randVec); const auto dh2Ptr = std::make_unique<const DataHandlerCPU<data_t>>(randVec);
const auto dh2Map = dh2Ptr->getBlock(size / 2, size / 3); const auto dh2Map = dh2Ptr->getBlock(size / 2, size / 3);
...@@ -242,7 +242,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -242,7 +242,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<data_t> randVec{2 * size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<data_t> dh2{randVec}; const DataHandlerCPU<data_t> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -267,7 +267,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -267,7 +267,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("copy assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
const DataHandlerCPU<data_t> dh2{randVec}; const DataHandlerCPU<data_t> dh2{randVec};
const auto dh2View = dh2.getBlock(0, size); const auto dh2View = dh2.getBlock(0, size);
...@@ -297,7 +297,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -297,7 +297,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("move assigning a DataHandlerCPU through base pointers") WHEN("move assigning a DataHandlerCPU through base pointers")
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
std::unique_ptr<DataHandler<data_t>> dh2Ptr = std::unique_ptr<DataHandler<data_t>> dh2Ptr =
std::make_unique<DataHandlerCPU<data_t>>(randVec); std::make_unique<DataHandlerCPU<data_t>>(randVec);
...@@ -327,7 +327,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -327,7 +327,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
const auto dhCopy = dh; const auto dhCopy = dh;
Eigen::VectorX<data_t> randVec{2 * size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{2 * size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<data_t> dh2{randVec}; DataHandlerCPU<data_t> dh2{randVec};
const auto dh2Map = dh2.getBlock(0, size); const auto dh2Map = dh2.getBlock(0, size);
...@@ -351,7 +351,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan ...@@ -351,7 +351,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Assigning to DataHandlerCPU", "", (DataHan
WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers") WHEN("\"move\" assigning a full DataHandlerMapCPU (aka a view) through base pointers")
{ {
DataHandler<data_t>* dhPtr = &dh; DataHandler<data_t>* dhPtr = &dh;
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
DataHandlerCPU<data_t> dh2{randVec}; DataHandlerCPU<data_t> dh2{randVec};
const auto dh2View = dh2.getBlock(0, size); const auto dh2View = dh2.getBlock(0, size);
...@@ -418,7 +418,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan ...@@ -418,7 +418,7 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan
WHEN("putting in some random data") WHEN("putting in some random data")
{ {
Eigen::VectorX<data_t> randVec{size}; Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec{size};
randVec.setRandom(); randVec.setRandom();
TestType dh(randVec); TestType dh(randVec);
...@@ -429,7 +429,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan ...@@ -429,7 +429,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan
REQUIRE(dh.lInfNorm() == Approx(randVec.array().abs().maxCoeff())); REQUIRE(dh.lInfNorm() == Approx(randVec.array().abs().maxCoeff()));
REQUIRE(dh.squaredL2Norm() == Approx(randVec.squaredNorm())); REQUIRE(dh.squaredL2Norm() == Approx(randVec.squaredNorm()));
Eigen::VectorX<data_t> randVec2 = Eigen::VectorX<data_t>::Random(size); Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec2 =
Eigen::Matrix<data_t, Eigen::Dynamic, 1>::Random(size);
TestType dh2(randVec2); TestType dh2(randVec2);
REQUIRE(std::abs(dh.dot(dh2) - randVec.dot(randVec2)) == Approx(0.f)); REQUIRE(std::abs(dh.dot(dh2) - randVec.dot(randVec2)) == Approx(0.f));
...@@ -442,7 +443,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan ...@@ -442,7 +443,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the reduction operatios of DataHan
THEN("the dot product expects correctly sized arguments") THEN("the dot product expects correctly sized arguments")
{ {
index_t wrongSize = size - 1; index_t wrongSize = size - 1;
Eigen::VectorX<data_t> randVec2 = Eigen::VectorX<data_t>::Random(wrongSize); Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec2 =
Eigen::Matrix<data_t, Eigen::Dynamic, 1>::Random(wrongSize);
TestType dh2(randVec2); TestType dh2(randVec2);
REQUIRE_THROWS_AS(dh.dot(dh2), std::invalid_argument); REQUIRE_THROWS_AS(dh.dot(dh2), std::invalid_argument);
...@@ -463,14 +465,16 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the element-wise operations of Dat ...@@ -463,14 +465,16 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the element-wise operations of Dat
WHEN("putting in some random data") WHEN("putting in some random data")
{ {
Eigen::VectorX<data_t> randVec = Eigen::VectorX<data_t>::Random(size); Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec =
Eigen::Matrix<data_t, Eigen::Dynamic, 1>::Random(size);
TestType dh(randVec); TestType dh(randVec);
THEN("the element-wise binary vector operations work as expected") THEN("the element-wise binary vector operations work as expected")
{ {
TestType oldDh = dh; TestType oldDh = dh;
Eigen::VectorX<data_t> randVec2 = Eigen::VectorX<data_t>::Random(size); Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec2 =
Eigen::Matrix<data_t, Eigen::Dynamic, 1>::Random(size);
TestType dh2(randVec2); TestType dh2(randVec2);
auto dhMap = dh2.getBlock(0, dh2.getSize()); auto dhMap = dh2.getBlock(0, dh2.getSize());
...@@ -607,7 +611,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the copy-on-write mechanism", "", ...@@ -607,7 +611,8 @@ TEMPLATE_PRODUCT_TEST_CASE("Scenario: Testing the copy-on-write mechanism", "",
GIVEN("A random DataContainer") GIVEN("A random DataContainer")
{ {
Eigen::VectorX<data_t> randVec = Eigen::VectorX<data_t>::Random(42); Eigen::Matrix<data_t, Eigen::Dynamic, 1> randVec =
Eigen::Matrix<data_t, Eigen::Dynamic, 1>::Random(42);
TestType dh{randVec}; TestType dh{randVec};
WHEN("const manipulating a copy constructed shallow copy") WHEN("const manipulating a copy constructed shallow copy")
......
...@@ -396,7 +396,7 @@ TEMPLATE_TEST_CASE("Scenario: BlockLinearOperator applyAdjoint", "", float, doub ...@@ -396,7 +396,7 @@ TEMPLATE_TEST_CASE("Scenario: BlockLinearOperator applyAdjoint", "", float, doub
DataDescriptor rangeDesc(rangeIndex); DataDescriptor rangeDesc(rangeIndex);
const index_t n = rangeDesc.getNumberOfCoefficients(); const index_t n = rangeDesc.getNumberOfCoefficients();
Eigen::VectorX<TestType> rangeVec(n); Eigen::Matrix<TestType, Eigen::Dynamic, 1> rangeVec(n);
rangeVec.topRows(n / 3).setConstant(5); rangeVec.topRows(n / 3).setConstant(5);
rangeVec.middleRows(n / 3, 2 * n / 3).setConstant(7); rangeVec.middleRows(n / 3, 2 * n / 3).setConstant(7);
rangeVec.bottomRows(n / 3).setOnes(); rangeVec.bottomRows(n / 3).setOnes();
......
...@@ -27,12 +27,12 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with one regularization te ...@@ -27,12 +27,12 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with one regularization te
numCoeff << 23, 47; numCoeff << 23, 47;
DataDescriptor dd(numCoeff); DataDescriptor dd(numCoeff);
Eigen::VectorX<TestType> scaling(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> scaling(dd.getNumberOfCoefficients());
scaling.setRandom(); scaling.setRandom();
DataContainer<TestType> dcScaling(dd, scaling); DataContainer<TestType> dcScaling(dd, scaling);
Scaling scaleOp(dd, dcScaling); Scaling scaleOp(dd, dcScaling);
Eigen::VectorX<TestType> dataVec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> dataVec(dd.getNumberOfCoefficients());
dataVec.setRandom(); dataVec.setRandom();
DataContainer<TestType> dcData(dd, dataVec); DataContainer<TestType> dcData(dd, dataVec);
...@@ -101,7 +101,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with one regularization te ...@@ -101,7 +101,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with one regularization te
WHEN("setting up the TikhonovProblem with x0") WHEN("setting up the TikhonovProblem with x0")
{ {
Eigen::VectorX<TestType> x0Vec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> x0Vec(dd.getNumberOfCoefficients());
x0Vec.setRandom(); x0Vec.setRandom();
DataContainer<TestType> dcX0(dd, x0Vec); DataContainer<TestType> dcX0(dd, x0Vec);
...@@ -154,12 +154,12 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with several regularizatio ...@@ -154,12 +154,12 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with several regularizatio
numCoeff << 17, 33, 52; numCoeff << 17, 33, 52;
DataDescriptor dd(numCoeff); DataDescriptor dd(numCoeff);
Eigen::VectorX<TestType> scaling(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> scaling(dd.getNumberOfCoefficients());
scaling.setRandom(); scaling.setRandom();
DataContainer<TestType> dcScaling(dd, scaling); DataContainer<TestType> dcScaling(dd, scaling);
Scaling scaleOp(dd, dcScaling); Scaling scaleOp(dd, dcScaling);
Eigen::VectorX<TestType> dataVec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> dataVec(dd.getNumberOfCoefficients());
dataVec.setRandom(); dataVec.setRandom();
DataContainer<TestType> dcData(dd, dataVec); DataContainer<TestType> dcData(dd, dataVec);
...@@ -228,7 +228,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with several regularizatio ...@@ -228,7 +228,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing TikhonovProblem with several regularizatio
WHEN("setting up the TikhonovProblem with x0") WHEN("setting up the TikhonovProblem with x0")
{ {
Eigen::VectorX<TestType> x0Vec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> x0Vec(dd.getNumberOfCoefficients());
x0Vec.setRandom(); x0Vec.setRandom();
DataContainer<TestType> dcX0(dd, x0Vec); DataContainer<TestType> dcX0(dd, x0Vec);
......
...@@ -31,7 +31,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double) ...@@ -31,7 +31,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double)
numCoeff << 7, 13; numCoeff << 7, 13;
DataDescriptor dd(numCoeff); DataDescriptor dd(numCoeff);
Eigen::VectorX<TestType> bVec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> bVec(dd.getNumberOfCoefficients());
bVec.setRandom(); bVec.setRandom();
DataContainer<TestType> dcB(dd, bVec); DataContainer<TestType> dcB(dd, bVec);
...@@ -64,7 +64,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double) ...@@ -64,7 +64,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double)
WHEN("setting up a ls problem with x0") WHEN("setting up a ls problem with x0")
{ {
Eigen::VectorX<TestType> x0Vec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> x0Vec(dd.getNumberOfCoefficients());
x0Vec.setRandom(); x0Vec.setRandom();
DataContainer<TestType> dcX0(dd, x0Vec); DataContainer<TestType> dcX0(dd, x0Vec);
...@@ -97,13 +97,13 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double) ...@@ -97,13 +97,13 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double)
numCoeff << 7, 13, 17; numCoeff << 7, 13, 17;
DataDescriptor dd(numCoeff); DataDescriptor dd(numCoeff);
Eigen::VectorX<TestType> bVec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> bVec(dd.getNumberOfCoefficients());
bVec.setRandom(); bVec.setRandom();
DataContainer<TestType> dcB(dd, bVec); DataContainer<TestType> dcB(dd, bVec);
Identity<TestType> idOp(dd); Identity<TestType> idOp(dd);
Eigen::VectorX<TestType> weightsVec(dd.getNumberOfCoefficients()); Eigen::Matrix<TestType, Eigen::Dynamic, 1> weightsVec(dd.getNumberOfCoefficients());
weightsVec.setRandom(); weightsVec.setRandom();
DataContainer dcWeights(dd, weightsVec); DataContainer dcWeights(dd, weightsVec);
Scaling scaleOp(dd, dcWeights); Scaling scaleOp(dd, dcWeights);
...@@ -136,7 +136,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double) ...@@ -136,7 +136,7 @@ TEMPLATE_TEST_CASE("Scenario: Testing WLSProblem", "", float, double)