Skip to content

Commit b0ed5eb

Browse files
committed
fix: improve code formatting for better readability in RTree4D and OptimalInterpolation classes
1 parent 53d6645 commit b0ed5eb

2 files changed

Lines changed: 14 additions & 15 deletions

File tree

cxx/include/pyinterp/math/interpolate/optimal_interpolation.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ class OptimalInterpolation {
6464
///
6565
/// @param[in] obs_coords Observations, shape @c (n, 4).
6666
/// @param[in] obs_values Observed values, shape @c (n,).
67-
/// @param[in] obs_sigma2 Per-observation error variance @f$\sigma^2_\mathrm{obs}@f$,
67+
/// @param[in] obs_sigma2 Per-observation error variance
68+
/// @f$\sigma^2_\mathrm{obs}@f$,
6869
/// shape @c (n,). Must be strictly positive.
6970
/// @param[in] query Query point, shape @c (4,).
7071
/// @param[in] inv_L Element-wise inverse of the anisotropic decorrelation

cxx/include/pyinterp/pybind/rtree4d.hpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,8 @@ namespace pyinterp::pybind {
4545
/// (matches @ref pyinterp::math::interpolate::Observation::value /
4646
/// @ref ...::sigma2).
4747
template <std::floating_point T>
48-
class RTree4D
49-
: public geometry::RTree<geometry::Cartesian4D<T>,
50-
math::interpolate::Observation<T>> {
48+
class RTree4D : public geometry::RTree<geometry::Cartesian4D<T>,
49+
math::interpolate::Observation<T>> {
5150
public:
5251
/// Scalar type
5352
using value_type = T;
@@ -213,10 +212,9 @@ void RTree4D<T>::validate_inputs(
213212
}
214213

215214
template <std::floating_point T>
216-
void RTree4D<T>::packing(
217-
const Eigen::Ref<const CoordinateMatrix>& coordinates,
218-
const Eigen::Ref<const ValueVector>& values,
219-
const Eigen::Ref<const ValueVector>& sigma2) {
215+
void RTree4D<T>::packing(const Eigen::Ref<const CoordinateMatrix>& coordinates,
216+
const Eigen::Ref<const ValueVector>& values,
217+
const Eigen::Ref<const ValueVector>& sigma2) {
220218
validate_inputs(coordinates, values, sigma2);
221219

222220
std::vector<typename base_t::value_t> items;
@@ -229,10 +227,9 @@ void RTree4D<T>::packing(
229227
}
230228

231229
template <std::floating_point T>
232-
void RTree4D<T>::insert(
233-
const Eigen::Ref<const CoordinateMatrix>& coordinates,
234-
const Eigen::Ref<const ValueVector>& values,
235-
const Eigen::Ref<const ValueVector>& sigma2) {
230+
void RTree4D<T>::insert(const Eigen::Ref<const CoordinateMatrix>& coordinates,
231+
const Eigen::Ref<const ValueVector>& values,
232+
const Eigen::Ref<const ValueVector>& sigma2) {
236233
validate_inputs(coordinates, values, sigma2);
237234

238235
for (Eigen::Index i = 0; i < coordinates.rows(); ++i) {
@@ -304,7 +301,8 @@ auto RTree4D<T>::optimal_interpolation(
304301

305302
// Build a single estimator — its only state is the kernel pointer, safe to
306303
// share across worker threads.
307-
const math::interpolate::OptimalInterpolation<T> oi(config.covariance_model());
304+
const math::interpolate::OptimalInterpolation<T> oi(
305+
config.covariance_model());
308306

309307
ValueVector values(m);
310308
ValueVector errors(m);
@@ -330,8 +328,8 @@ auto RTree4D<T>::optimal_interpolation(
330328

331329
// `value()` returns (point, observation) pairs filtered by radius
332330
// — exactly what the OI math needs (coordinates + value + σ²).
333-
const auto pairs = base_t::value(pt, radius, k,
334-
config.boundary_check());
331+
const auto pairs =
332+
base_t::value(pt, radius, k, config.boundary_check());
335333
const auto np = static_cast<Eigen::Index>(pairs.size());
336334
if (np == 0) {
337335
continue; // values/errors stay NaN, neighbors stays 0.

0 commit comments

Comments
 (0)