Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions include/boost/math/interpolators/cubic_hermite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#define BOOST_MATH_INTERPOLATORS_CUBIC_HERMITE_HPP
#include <memory>
#include <boost/math/interpolators/detail/cubic_hermite_detail.hpp>
#include <cstdint>

namespace boost {
namespace math {
Expand Down Expand Up @@ -41,7 +42,7 @@ class cubic_hermite {
impl_->push_back(x, y, dydx);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -80,7 +81,7 @@ class cardinal_cubic_hermite {
return os;
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -121,7 +122,7 @@ class cardinal_cubic_hermite_aos {
return os;
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <utility> // for std::move
#include <algorithm> // for std::is_sorted
#include <string>
#include <cstdint>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/tools/assert.hpp>

Expand Down Expand Up @@ -100,22 +101,22 @@ template<class Real>
void barycentric_rational_imp<Real>::calculate_weights(size_t approximation_order)
{
using std::abs;
int64_t n = m_x.size();
std::int64_t n = m_x.size();
m_w.resize(n, 0);
for(int64_t k = 0; k < n; ++k)
for(std::int64_t k = 0; k < n; ++k)
{
int64_t i_min = (std::max)(k - static_cast<int64_t>(approximation_order), static_cast<int64_t>(0));
int64_t i_max = k;
std::int64_t i_min = (std::max)(k - static_cast<std::int64_t>(approximation_order), static_cast<std::int64_t>(0));
std::int64_t i_max = k;
if (k >= n - (std::ptrdiff_t)approximation_order)
{
i_max = n - approximation_order - 1;
}

for(int64_t i = i_min; i <= i_max; ++i)
for(std::int64_t i = i_min; i <= i_max; ++i)
{
Real inv_product = 1;
int64_t j_max = (std::min)(static_cast<int64_t>(i + approximation_order), static_cast<int64_t>(n - 1));
for(int64_t j = i; j <= j_max; ++j)
std::int64_t j_max = (std::min)(static_cast<std::int64_t>(i + approximation_order), static_cast<std::int64_t>(n - 1));
for(std::int64_t j = i; j <= j_max; ++j)
{
if (j == k)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifndef BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_DETAIL_HPP
#define BOOST_MATH_INTERPOLATORS_CARDINAL_QUINTIC_B_SPLINE_DETAIL_HPP
#include <cmath>
#include <cstdint>
#include <vector>
#include <utility>
#include <boost/math/special_functions/cardinal_b_spline.hpp>
Expand Down Expand Up @@ -157,7 +158,7 @@ class cardinal_quintic_b_spline_detail

m_alpha[n+3] = rhs[n+3]/diagonal[n+3];
m_alpha[n+2] = rhs[n+2] - first_superdiagonal[n+2]*m_alpha[n+3];
for (int64_t i = int64_t(n+1); i >= 0; --i) {
for (std::int64_t i = std::int64_t(n+1); i >= 0; --i) {
m_alpha[i] = rhs[i] - first_superdiagonal[i]*m_alpha[i+1] - second_superdiagonal[i]*m_alpha[i+2];
}

Expand All @@ -176,10 +177,10 @@ class cardinal_quintic_b_spline_detail
Real x = (t-m_t0)*m_inv_h;
// Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5.
// TODO: Zero pad m_alpha so that only the domain check is necessary.
int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1)));
int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) );
std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1)));
std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) );
Real s = 0;
for (int64_t j = j_min; j <= j_max; ++j) {
for (std::int64_t j = j_min; j <= j_max; ++j) {
// TODO: Use Cox 1972 to generate all integer translates of B5 simultaneously.
s += m_alpha[j]*cardinal_b_spline<5, Real>(x - j + 2);
}
Expand All @@ -196,10 +197,10 @@ class cardinal_quintic_b_spline_detail
}
Real x = (t-m_t0)*m_inv_h;
// Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5
int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1)));
int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) );
std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1)));
std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) );
Real s = 0;
for (int64_t j = j_min; j <= j_max; ++j) {
for (std::int64_t j = j_min; j <= j_max; ++j) {
s += m_alpha[j]*cardinal_b_spline_prime<5, Real>(x - j + 2);
}
return s*m_inv_h;
Expand All @@ -216,10 +217,10 @@ class cardinal_quintic_b_spline_detail
}
Real x = (t-m_t0)*m_inv_h;
// Support of B_5 is [-3, 3]. So -3 < x - j + 2 < 3, so x-1 < j < x+5
int64_t j_min = (std::max)(int64_t(0), int64_t(ceil(x-1)));
int64_t j_max = (std::min)(int64_t(m_alpha.size() - 1), int64_t(floor(x+5)) );
std::int64_t j_min = (std::max)(std::int64_t(0), std::int64_t(ceil(x-1)));
std::int64_t j_max = (std::min)(std::int64_t(m_alpha.size() - 1), std::int64_t(floor(x+5)) );
Real s = 0;
for (int64_t j = j_min; j <= j_max; ++j) {
for (std::int64_t j = j_min; j <= j_max; ++j) {
s += m_alpha[j]*cardinal_b_spline_double_prime<5, Real>(x - j + 2);
}
return s*m_inv_h*m_inv_h;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <iostream>
#include <sstream>
#include <limits>
#include <cstdint>

namespace boost {
namespace math {
Expand Down Expand Up @@ -154,7 +155,7 @@ class cubic_hermite_detail {
return x_.size();
}

int64_t bytes() const
std::int64_t bytes() const
{
return 3*x_.size()*sizeof(Real) + 3*sizeof(x_);
}
Expand Down Expand Up @@ -278,7 +279,7 @@ class cardinal_cubic_hermite_detail {
return y_.size();
}

int64_t bytes() const
std::int64_t bytes() const
{
return 2*y_.size()*sizeof(Real) + 2*sizeof(y_) + 2*sizeof(Real);
}
Expand Down Expand Up @@ -413,7 +414,7 @@ class cardinal_cubic_hermite_detail_aos {
return dat_.size();
}

int64_t bytes() const
std::int64_t bytes() const
{
return dat_.size()*dat_[0].size()*sizeof(Real) + sizeof(dat_) + 2*sizeof(Real);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sstream>
#include <limits>
#include <cmath>
#include <cstdint>

namespace boost {
namespace math {
Expand Down Expand Up @@ -193,7 +194,7 @@ class quintic_hermite_detail {
return os;
}

int64_t bytes() const
std::int64_t bytes() const
{
return 4*x_.size()*sizeof(x_);
}
Expand Down Expand Up @@ -380,7 +381,7 @@ class cardinal_quintic_hermite_detail {
return d2ydx2;
}

int64_t bytes() const
std::int64_t bytes() const
{
return 3*y_.size()*sizeof(Real) + 2*sizeof(Real);
}
Expand Down Expand Up @@ -561,7 +562,7 @@ class cardinal_quintic_hermite_detail_aos {
return d2ydx2;
}

int64_t bytes() const
std::int64_t bytes() const
{
return data_.size()*data_[0].size()*sizeof(Real) + 2*sizeof(Real);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <sstream>
#include <limits>
#include <cmath>
#include <cstdint>

namespace boost {
namespace math {
Expand Down Expand Up @@ -189,7 +190,7 @@ class septic_hermite_detail {
return os;
}

int64_t bytes()
std::int64_t bytes()
{
return 5*x_.size()*sizeof(Real) + 5*sizeof(x_);
}
Expand Down Expand Up @@ -419,7 +420,7 @@ class cardinal_septic_hermite_detail {
return d2ydx2;
}

int64_t bytes() const
std::int64_t bytes() const
{
return 4*y_.size()*sizeof(Real) + 2*sizeof(Real) + 4*sizeof(y_);
}
Expand Down Expand Up @@ -629,7 +630,7 @@ class cardinal_septic_hermite_detail_aos {
return d2ydx2;
}

int64_t bytes() const
std::int64_t bytes() const
{
return data_.size()*data_[0].size()*sizeof(Real) + 2*sizeof(Real) + sizeof(data_);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#ifndef BOOST_MATH_INTERPOLATORS_VECTOR_BARYCENTRIC_RATIONAL_DETAIL_HPP
#define BOOST_MATH_INTERPOLATORS_VECTOR_BARYCENTRIC_RATIONAL_DETAIL_HPP

#include <cstdint>
#include <cmath>
#include <vector>
#include <utility> // for std::move
Expand Down Expand Up @@ -64,22 +65,22 @@ void vector_barycentric_rational_imp<TimeContainer, SpaceContainer>::calculate_w
{
using Real = typename TimeContainer::value_type;
using std::abs;
int64_t n = t_.size();
std::int64_t n = t_.size();
w_.resize(n, Real(0));
for(int64_t k = 0; k < n; ++k)
for(std::int64_t k = 0; k < n; ++k)
{
int64_t i_min = (std::max)(k - static_cast<int64_t>(approximation_order), static_cast<int64_t>(0));
int64_t i_max = k;
std::int64_t i_min = (std::max)(k - static_cast<std::int64_t>(approximation_order), static_cast<std::int64_t>(0));
std::int64_t i_max = k;
if (k >= n - (std::ptrdiff_t)approximation_order)
{
i_max = n - approximation_order - 1;
}

for(int64_t i = i_min; i <= i_max; ++i)
for(std::int64_t i = i_min; i <= i_max; ++i)
{
Real inv_product = 1;
int64_t j_max = (std::min)(static_cast<int64_t>(i + approximation_order), static_cast<int64_t>(n - 1));
for(int64_t j = i; j <= j_max; ++j)
std::int64_t j_max = (std::min)(static_cast<std::int64_t>(i + approximation_order), static_cast<std::int64_t>(n - 1));
for(std::int64_t j = i; j <= j_max; ++j)
{
if (j == k)
{
Expand Down
7 changes: 4 additions & 3 deletions include/boost/math/interpolators/quintic_hermite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <algorithm>
#include <stdexcept>
#include <memory>
#include <cstdint>
#include <boost/math/interpolators/detail/quintic_hermite_detail.hpp>

namespace boost {
Expand Down Expand Up @@ -50,7 +51,7 @@ class quintic_hermite {
impl_->push_back(x, y, dydx, d2ydx2);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -85,7 +86,7 @@ class cardinal_quintic_hermite {
return impl_->double_prime(x);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -123,7 +124,7 @@ class cardinal_quintic_hermite_aos {
return impl_->double_prime(x);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down
7 changes: 4 additions & 3 deletions include/boost/math/interpolators/septic_hermite.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <algorithm>
#include <stdexcept>
#include <memory>
#include <cstdint>
#include <boost/math/interpolators/detail/septic_hermite_detail.hpp>

namespace boost {
Expand Down Expand Up @@ -47,7 +48,7 @@ class septic_hermite
return os;
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -87,7 +88,7 @@ class cardinal_septic_hermite
return impl_->double_prime(x);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_->bytes() + sizeof(impl_);
}
Expand Down Expand Up @@ -126,7 +127,7 @@ class cardinal_septic_hermite_aos {
return impl_->double_prime(x);
}

int64_t bytes() const
std::int64_t bytes() const
{
return impl_.size() + sizeof(impl_);
}
Expand Down
Loading