Annotate noexcept and constexpr with HEDLEY, and add interval containment, ChaCha, and the dyadic range tables.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
875f09fec1
commit
0d8a5a8131
97 changed files with 9212 additions and 1159 deletions
|
|
@ -835,6 +835,33 @@ TEST(OffsetHorner, HornerOfOpenedCoefficientsMatchesValue)
|
|||
EXPECT_EQ(y, gold<D>(center, eta, knots, coeff));
|
||||
}
|
||||
|
||||
TEST(OffsetHorner, OpenedSharesAreNotHornerInputs)
|
||||
{
|
||||
constexpr std::size_t D = 2;
|
||||
const std::vector<uint8_t> knots{0, 50, 150};
|
||||
const auto coeff = take_degree<D>(pad3({
|
||||
{1, 0, 0, 0},
|
||||
{0, 4, 1, 0},
|
||||
{8, 0, 0, 0},
|
||||
}));
|
||||
const uint8_t center = 10;
|
||||
const uint8_t eta = 60;
|
||||
auto mat = grotto::make_offset_horner_keys<uint8_t, D>(center);
|
||||
const auto c = open_coeffs<D>(mat, knots, coeff, eta);
|
||||
uint64_t sum = 0;
|
||||
for (uint64_t ck : c)
|
||||
sum += ck;
|
||||
const uint64_t value = gold<D>(center, eta, knots, coeff);
|
||||
EXPECT_EQ(sum, value);
|
||||
EXPECT_EQ(value, 5180u);
|
||||
|
||||
uint64_t horner = c[D];
|
||||
const uint64_t limb = lift(center);
|
||||
for (std::size_t k = D; k-- > 0; )
|
||||
horner = horner * limb + c[k];
|
||||
EXPECT_NE(horner, value);
|
||||
}
|
||||
|
||||
template <std::size_t Degree, typename T>
|
||||
void expect_wrapped(const grotto::offset_horner_keys<T, Degree> & mat,
|
||||
const std::vector<T> & knots,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue