35#include <boost/test/unit_test.hpp>
40#include <boost/test/tools/floating_point_comparison.hpp>
41#include <boost/test/unit_test.hpp>
64 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
66 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
68 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
70 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
72 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
74 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
88 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
90 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
92 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
94 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
109 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
111 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
113 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
124 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
132 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
138 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
140 BOOST_CHECK_EQUAL(std::numeric_limits<unsigned int>::max(),
154 NekDouble buf[] = {0, 0, 1, 4, 0, 2, 5, 8, 3, 6, 9, 11, 7, 10, 12, 0};
157 BOOST_CHECK_EQUAL(1, m(0, 0));
158 m.SetValue(0, 0, 19);
159 BOOST_CHECK_EQUAL(19, m(0, 0));
160 BOOST_CHECK_EQUAL(2, m(0, 1));
161 m.SetValue(0, 1, 20);
162 BOOST_CHECK_EQUAL(20, m(0, 1));
163 BOOST_CHECK_EQUAL(3, m(0, 2));
164 m.SetValue(0, 2, 21);
165 BOOST_CHECK_EQUAL(21, m(0, 2));
166 BOOST_CHECK_EQUAL(0, m(0, 3));
169 BOOST_CHECK_EQUAL(4, m(1, 0));
170 m.SetValue(1, 0, 22);
171 BOOST_CHECK_EQUAL(22, m(1, 0));
172 BOOST_CHECK_EQUAL(5, m(1, 1));
173 m.SetValue(1, 1, 23);
174 BOOST_CHECK_EQUAL(23, m(1, 1));
175 BOOST_CHECK_EQUAL(6, m(1, 2));
176 m.SetValue(1, 2, 24);
177 BOOST_CHECK_EQUAL(24, m(1, 2));
178 BOOST_CHECK_EQUAL(7, m(1, 3));
179 m.SetValue(1, 3, 25);
180 BOOST_CHECK_EQUAL(25, m(1, 3));
182 BOOST_CHECK_EQUAL(0, m(2, 0));
184 BOOST_CHECK_EQUAL(8, m(2, 1));
185 m.SetValue(2, 1, 26);
186 BOOST_CHECK_EQUAL(26, m(2, 1));
187 BOOST_CHECK_EQUAL(9, m(2, 2));
188 m.SetValue(2, 2, 27);
189 BOOST_CHECK_EQUAL(27, m(2, 2));
190 BOOST_CHECK_EQUAL(10, m(2, 3));
191 m.SetValue(2, 3, 28);
192 BOOST_CHECK_EQUAL(28, m(2, 3));
194 BOOST_CHECK_EQUAL(0, m(3, 0));
196 BOOST_CHECK_EQUAL(0, m(3, 1));
198 BOOST_CHECK_EQUAL(11, m(3, 2));
199 m.SetValue(3, 2, 29);
200 BOOST_CHECK_EQUAL(29, m(3, 2));
201 BOOST_CHECK_EQUAL(12, m(3, 3));
202 m.SetValue(3, 3, 30);
203 BOOST_CHECK_EQUAL(30, m(3, 3));
BOOST_AUTO_TEST_CASE(TestCalculateStorageSizeAndCalculateNumberOfRows)
void RedirectCerrIfNeeded()
static unsigned int CalculateNumberOfRows(unsigned int totalRows, unsigned int subDiags, unsigned int superDiags)
static unsigned int CalculateIndex(unsigned int totalRows, unsigned int totalColumns, unsigned int row, unsigned int column, unsigned int sub, unsigned int super)
static unsigned int GetRequiredStorageSize(unsigned int totalRows, unsigned int totalColumns, unsigned int subDiags, unsigned int superDiags)
Calculates and returns the storage size required.