Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "4C_config.hpp"

#include "4C_linalg_utlis_quaternion_interpolation.hpp"
#include "4C_linalg_utils_quaternion_interpolation.hpp"

#include "4C_linalg_fixedsizematrix.hpp"
#include "4C_linalg_utils_scalar_interpolation.hpp"
Expand Down Expand Up @@ -563,4 +563,4 @@ void Core::LinAlg::GeneralizedSphericalLinearInterpolator<loc_dim>::right_orthon
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<1>;
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<2>;
template class Core::LinAlg::GeneralizedSphericalLinearInterpolator<3>;
FOUR_C_NAMESPACE_CLOSE
FOUR_C_NAMESPACE_CLOSE
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
//
// SPDX-License-Identifier: LGPL-3.0-or-later

#ifndef FOUR_C_LINALG_UTLIS_QUATERNION_INTERPOLATION_HPP
#define FOUR_C_LINALG_UTLIS_QUATERNION_INTERPOLATION_HPP
#ifndef FOUR_C_LINALG_UTILS_QUATERNION_INTERPOLATION_HPP
#define FOUR_C_LINALG_UTILS_QUATERNION_INTERPOLATION_HPP

#include "4C_config.hpp"

Expand Down Expand Up @@ -220,4 +220,4 @@ namespace Core

FOUR_C_NAMESPACE_CLOSE

#endif
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ template <unsigned int loc_dim, unsigned int poly_order, unsigned int num_coeffi
std::vector<double> Core::LinAlg::ScalarInterpolator<loc_dim, poly_order,
num_coefficients>::logarithmic_weighted_average(const std::vector<std::vector<double>>&
scalar_data,
const std::vector<double>& weights)
const std::vector<double>& weights) const
{
const size_t field_size = scalar_data[0].size();
std::vector<double> log_sum(field_size, 0.0);
Expand Down Expand Up @@ -336,7 +336,7 @@ std::vector<double>
Core::LinAlg::ScalarInterpolator<loc_dim, poly_order, num_coefficients>::moving_least_square(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights) const
{
const size_t field_size = scalar_data[0].size();
std::vector<double> interp_scalar(field_size, 0.0);
Expand Down Expand Up @@ -409,7 +409,7 @@ std::vector<double> Core::LinAlg::ScalarInterpolator<loc_dim, poly_order,
num_coefficients>::logarithmic_moving_least_squares(const std::vector<std::vector<double>>&
scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights) const
{
std::vector<double> interp_scalar(scalar_data[0].size(), 0.0);

Expand Down Expand Up @@ -450,7 +450,7 @@ std::vector<double>
Core::LinAlg::ScalarInterpolator<loc_dim, poly_order, num_coefficients>::get_interpolated_scalar(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc)
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc) const
{
// Check for size consistency
if (scalar_data.empty()) FOUR_C_THROW("Scalar data vector is empty.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ namespace Core::LinAlg
*/
std::vector<double> get_interpolated_scalar(const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc) const;

private:
/**
Expand All @@ -179,7 +179,8 @@ namespace Core::LinAlg
*/
std::vector<double> moving_least_square(const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc,
const std::vector<double>& weights) const;

/**
* @brief Computes the logarithmic interpolation of scalar data using the provided weights.
Expand All @@ -193,7 +194,8 @@ namespace Core::LinAlg
* @return A vector of doubles representing the logarithmic interpolation results.
*/
std::vector<double> logarithmic_weighted_average(
const std::vector<std::vector<double>>& scalar_data, const std::vector<double>& weights);
const std::vector<std::vector<double>>& scalar_data,
const std::vector<double>& weights) const;

/**
* @brief Computes the log moving least squares interpolation for scalar data.
Expand All @@ -213,7 +215,8 @@ namespace Core::LinAlg
std::vector<double> logarithmic_moving_least_squares(
const std::vector<std::vector<double>>& scalar_data,
const std::vector<Core::LinAlg::Matrix<loc_dim, 1>>& ref_locs,
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc, const std::vector<double>& weights);
const Core::LinAlg::Matrix<loc_dim, 1>& interp_loc,
const std::vector<double>& weights) const;

const ScalarInterpolationType scalar_interp_type_;
const ScalarInterpolationWeightingFunction weight_func_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@

#include <gtest/gtest.h>

#include "4C_linalg_utils_quaternion_interpolation.hpp"

#include "4C_linalg_fixedsizematrix.hpp"
#include "4C_linalg_utils_scalar_interpolation.hpp"
#include "4C_linalg_utlis_quaternion_interpolation.hpp"
#include "4C_unittest_utils_assertions_test.hpp"
#include "4C_utils_exceptions.hpp"

Expand Down Expand Up @@ -391,4 +392,4 @@ TEST(QuaternionInterpolationTest, SlerpWeighted_AnalyticalCheck)
ASSERT_NEAR(result(3, 0), w_expected, 1e-12); // w
}

FOUR_C_NAMESPACE_CLOSE
FOUR_C_NAMESPACE_CLOSE
Loading
Loading