Skip to content

Commit 57ff6c6

Browse files
authored
Merge pull request #6431 from hjmjohnson/update-vnl-fd75e8b
ENH: Update vendored VNL to for/itk-vxl-master-7829892 (vnl_math:: deprecation + sqrteps fix)
2 parents e59c2b4 + 574c34b commit 57ff6c6

34 files changed

Lines changed: 700 additions & 535 deletions

Modules/ThirdParty/VNL/UpdateFromUpstream.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ readonly name='VXL'
88
readonly ownership='Insight Software Consortium Maintainers <https://discourse.itk.org/>'
99
readonly subtree="Modules/ThirdParty/VNL/src/vxl"
1010
readonly repo="https://github.com/InsightSoftwareConsortium/vxl.git"
11-
readonly tag="for/itk-vxl-master-272c3f1" # 2026-06-09 (272c3f1: linkage fixes + config-option removals)
11+
readonly tag="for/itk-vxl-master-7829892" # 2026-06-10 (7829892: vnl_math:: deprecation campaign + sqrteps 0x1p-26)
1212
readonly shortlog=false
1313
readonly exact_tree_match=false
1414
readonly paths="

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_integral.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class gaussian_integrant : public vnl_analytic_integrant
2727
, p0_(p0)
2828
, oneoversr2_(1.0 / sr_ / sr_)
2929
, oneoversz2_(1.0 / sz_ / sz_)
30-
, normalizer_(-sr_ * sr_ / (sz_ * 2 * vnl_math::sqrt2pi))
30+
, normalizer_(-sr_ * sr_ / (sz_ * 2 * vnl_math::detail::sqrt2pi))
3131
{}
3232

3333
void

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/tests/test_qsvd.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#include <cstdio>
2-
#include "vnl/vnl_math.h" // vnl_math::abs()
2+
#include "vnl/vnl_math.h" // vnl_math::detail::abs()
33
#include "testlib/testlib_test.h"
44
#undef printf // to work around a bug in libintl.h
55

@@ -76,13 +76,13 @@ test_qsvd()
7676
AA[8]);
7777

7878
TEST("D1 must be (0.6,0.8,0.6)",
79-
vnl_math::abs(Alpha[0] - 0.6) < 1e-6 && vnl_math::abs(Alpha[1] - 0.8) < 1e-6 &&
80-
vnl_math::abs(Alpha[2] - 0.6) < 1e-6,
79+
vnl_math::detail::abs(Alpha[0] - 0.6) < 1e-6 && vnl_math::detail::abs(Alpha[1] - 0.8) < 1e-6 &&
80+
vnl_math::detail::abs(Alpha[2] - 0.6) < 1e-6,
8181
true);
8282

8383
TEST("D2 must be (0.8,0.6,0.8)",
84-
vnl_math::abs(Beta[0] - 0.8) < 1e-6 && vnl_math::abs(Beta[1] - 0.6) < 1e-6 &&
85-
vnl_math::abs(Beta[2] - 0.8) < 1e-6,
84+
vnl_math::detail::abs(Beta[0] - 0.8) < 1e-6 && vnl_math::detail::abs(Beta[1] - 0.6) < 1e-6 &&
85+
vnl_math::detail::abs(Beta[2] - 0.8) < 1e-6,
8686
true);
8787
}
8888

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_amoeba.cxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct vnl_amoebaFit : public vnl_amoeba
9090
int
9191
vnl_amoeba_SimplexCorner::compare(const vnl_amoeba_SimplexCorner & s1, const vnl_amoeba_SimplexCorner & s2)
9292
{
93-
return vnl_math::sgn(s1.fv - s2.fv);
93+
return vnl_math::detail::sgn(s1.fv - s2.fv);
9494
}
9595

9696
static int
@@ -112,7 +112,7 @@ maxabsdiff(const vnl_vector<double> & a, const vnl_vector<double> & b)
112112
double v = 0;
113113
for (unsigned i = 0; i < a.size(); ++i)
114114
{
115-
const double ad = vnl_math::abs(a[i] - b[i]);
115+
const double ad = vnl_math::detail::abs(a[i] - b[i]);
116116
if (ad > v)
117117
v = ad;
118118
}
@@ -180,7 +180,7 @@ vnl_amoebaFit::set_up_simplex_relative(std::vector<vnl_amoeba_SimplexCorner> & s
180180
s->v = x;
181181

182182
// perturb s->v(j)
183-
if (vnl_math::abs(s->v[j]) > zero_term_delta)
183+
if (vnl_math::detail::abs(s->v[j]) > zero_term_delta)
184184
s->v[j] = (1 + usual_delta) * s->v[j];
185185
else
186186
s->v[j] = zero_term_delta;

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_powell.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ vnl_powell::minimize(vnl_vector<double> & p)
169169
report_eval(fret);
170170
if (fptt < fp)
171171
{
172-
const double t = 2.0 * (fp - 2.0 * fret + fptt) * vnl_math::sqr(fp - fret - del) - del * vnl_math::sqr(fp - fptt);
172+
const double t = 2.0 * (fp - 2.0 * fret + fptt) * vnl_math::detail::sqr(fp - fret - del) - del * vnl_math::detail::sqr(fp - fptt);
173173
if (t < 0.0)
174174
{
175175
f1d.init(p, xit);

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_qr.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# include <vcl_msvc_warnings.h>
1515
#endif
1616
#include <vnl/vnl_math.h>
17-
#include <vnl/vnl_complex.h> // vnl_math::squared_magnitude()
17+
#include <vnl/vnl_complex.h> // vnl_math::detail::squared_magnitude()
1818
#include <vnl/vnl_matlab_print.h>
1919
#include <vnl/vnl_complex_traits.h>
2020
#include <vnl/algo/vnl_netlib.h> // dqrdc_(), dqrsl_()
@@ -124,11 +124,11 @@ vnl_qr<T>::Q() const
124124
continue;
125125
// Make housevec v, and accumulate norm at the same time.
126126
v[k] = qraux_[k];
127-
abs_t sq = vnl_math::squared_magnitude(v[k]);
127+
abs_t sq = vnl_math::detail::squared_magnitude(v[k]);
128128
for (int j = k + 1; j < m; ++j)
129129
{
130130
v[j] = qrdc_out_(k, j);
131-
sq += vnl_math::squared_magnitude(v[j]);
131+
sq += vnl_math::detail::squared_magnitude(v[j]);
132132
}
133133
if (verbose)
134134
vnl_matlab_print(std::cerr, v, "v");

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ vnl_svd<T>::vnl_svd(vnl_matrix<T> const & M, double zero_out_tol)
146146
using abs_t = typename vnl_numeric_traits<T>::abs_t;
147147
const abs_t recomposition_residual = std::abs((recompose() - M).fro_norm());
148148
const abs_t n = std::abs(M.fro_norm());
149-
const abs_t thresh = abs_t(m_) * abs_t(vnl_math::eps) * n;
149+
const abs_t thresh = abs_t(m_) * abs_t(vnl_math::detail::eps) * n;
150150
if (recomposition_residual > thresh)
151151
{
152152
std::cerr << "vnl_svd<T>::vnl_svd<T>() -- Warning, recomposition_residual = " << recomposition_residual

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd_fixed.hxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ vnl_svd_fixed<T, R, C>::vnl_svd_fixed(vnl_matrix_fixed<T, R, C> const & M, doubl
136136
using abs_t = typename vnl_numeric_traits<T>::abs_t;
137137
const abs_t recomposition_residual = std::abs((recompose() - M).fro_norm());
138138
const abs_t n = std::abs(M.fro_norm());
139-
const abs_t thresh = abs_t(R) * abs_t(vnl_math::eps) * n;
139+
const abs_t thresh = abs_t(R) * abs_t(vnl_math::detail::eps) * n;
140140
if (recomposition_residual > thresh)
141141
{
142142
std::cerr << "vnl_svd_fixed<T>::vnl_svd_fixed<T>() -- Warning, recomposition_residual = "

Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_symmetric_eigensystem.hxx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ vnl_symmetric_eigensystem_compute_eigenvals(T M11, T M12, T M13, T M22, T M23, T
5656
// complex conjugate roots as numerically inaccurate repeated roots.
5757

5858
// first check we are not too numerically inaccurate
59-
assert((g2 - f3) / vnl_math::sqr(vnl_math::cube(b)) < 1e-8);
59+
assert((g2 - f3) / vnl_math::detail::sqr(vnl_math::detail::cube(b)) < 1e-8);
6060

6161
if (g2 >= f3)
6262
{
@@ -78,8 +78,8 @@ vnl_symmetric_eigensystem_compute_eigenvals(T M11, T M12, T M13, T M22, T M23, T
7878
const T k = std::acos(g / sqrt_f3) / 3;
7979
const T j = 2 * sqrt_f;
8080
l1 = j * std::cos(k) - b_3;
81-
l2 = j * std::cos(k + T(vnl_math::twopi / 3.0)) - b_3;
82-
l3 = j * std::cos(k - T(vnl_math::twopi / 3.0)) - b_3;
81+
l2 = j * std::cos(k + T(vnl_math::detail::twopi / 3.0)) - b_3;
82+
l3 = j * std::cos(k - T(vnl_math::detail::twopi / 3.0)) - b_3;
8383

8484
if (l2 < l1)
8585
std::swap(l2, l1);

Modules/ThirdParty/VNL/src/vxl/core/vnl/tests/test_alignment.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test_euclid_dist_sq(const vnl_vector<float> & vec, const vnl_vector<float> & vec
5959
const unsigned n = vec.size();
6060
float correct(0);
6161
for (unsigned i = 0; i < n; ++i)
62-
correct += vnl_math::sqr(vec(i) - vec2(i));
62+
correct += vnl_math::detail::sqr(vec(i) - vec2(i));
6363

6464
const float err = std::abs(correct - val);
6565
const float neps = float(n) * std::sqrt(std::numeric_limits<float>::epsilon());

0 commit comments

Comments
 (0)