Skip to content

Commit 9563557

Browse files
committed
Remove internal "standardize" for nsp to avoid possible confusion
1 parent 4986982 commit 9563557

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

inst/CITATION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ bibentry(
88
),
99
year = "2025",
1010
url = "https://CRAN.R-project.org/package=splines2",
11-
note = "R package version 0.5.4"
11+
note = "R package version 0.5.5.9000"
1212
)
1313

1414
bibentry(

inst/include/splines2Armadillo/NaturalSpline.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ namespace splines2 {
4646
// get null space vector for the second derivatives
4747
// of B-spline basis on boundary knotsn
4848
// the results depend on knot sequence only
49-
inline virtual void set_null_colvecs(const bool standardize = true)
49+
inline virtual void set_null_colvecs()
5050
{
5151
// initialize null_colvecs or
5252
// update null_colvecs_ if the knot sequence has been updated
@@ -71,9 +71,9 @@ namespace splines2 {
7171
const double w3 { w1 + w2 };
7272
null_colvecs_(0, 0) = 1.0 + w1 / w3;
7373
null_colvecs_(1, 0) = 1.0;
74-
null_colvecs_(1, 1) = 1.0 / (1.0 + w3 / w1);
74+
null_colvecs_(1, 1) = w1 / (w1 + w3);
7575
null_colvecs_(2, 1) = 1.0;
76-
null_colvecs_(3, 1) = 1.0 / (1.0 + w3 / w2);
76+
null_colvecs_(3, 1) = w2 / (w2 + w3);
7777
null_colvecs_(3, 2) = 1.0;
7878
null_colvecs_(4, 2) = 1.0 + w2 / w3;
7979
} else {
@@ -97,11 +97,9 @@ namespace splines2 {
9797
}
9898
}
9999
// standardize coefficient for each column
100-
if (standardize) {
101-
size_t ncol_out { null_colvecs_.n_cols };
102-
for (size_t j {0}; j < ncol_out; ++j) {
103-
null_colvecs_.col(j) /= arma::sum(null_colvecs_.col(j));
104-
}
100+
size_t ncol_out { null_colvecs_.n_cols };
101+
for (size_t j {0}; j < ncol_out; ++j) {
102+
null_colvecs_.col(j) /= arma::sum(null_colvecs_.col(j));
105103
}
106104
}
107105

inst/include/splines2Armadillo/NaturalSplineK.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818
#ifndef SPLINES2_NATURALSPLINEK_H
1919
#define SPLINES2_NATURALSPLINEK_H
2020

21-
#include <stdexcept>
22-
2321
#include "common.h"
24-
#include "utils.h"
2522
#include "NaturalSpline.h"
2623

2724
namespace splines2 {
@@ -33,7 +30,7 @@ namespace splines2 {
3330

3431
// compute the transformation matrix so that only one of the basis
3532
// functions attains one at the internal and boundary knots
36-
inline void set_null_colvecs(const bool standardize = true) override
33+
inline void set_null_colvecs() override
3734
{
3835
// get natural spline basis functions at knots
3936
NaturalSpline nsp_obj { this };

0 commit comments

Comments
 (0)