PolyFEM
|
#include <LazyCubicInterpolator.hpp>
Public Member Functions | |
LazyCubicInterpolator (const int dim, const double delta) | |
void | bicubic_interpolation (const Eigen::MatrixXd &corner_point, const std::vector< std::string > &keys, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const |
void | tricubic_interpolation (const Eigen::MatrixXd &corner_point, const std::vector< std::string > &keys, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const |
void | lazy_evaluate (std::function< void(const Eigen::MatrixXd &, double &)> compute_distance, const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) |
void | cache_grid (std::function< void(const Eigen::MatrixXd &, double &)> compute_distance, const Eigen::MatrixXd &point) |
void | evaluate (const Eigen::MatrixXd &point, double &val, Eigen::MatrixXd &grad) const |
Private Member Functions | |
void | build_corner_keys (const Eigen::MatrixXd &point, Eigen::MatrixXi &keys) const |
void | setup_key (const Eigen::VectorXi &key, std::string &key_string, Eigen::MatrixXd &clamped_point) const |
Private Attributes | |
int | dim_ |
double | delta_ |
std::unordered_map< std::string, double > | implicit_function_distance |
std::unordered_map< std::string, Eigen::VectorXd > | implicit_function_grads |
Eigen::MatrixXd | cubic_mat |
std::shared_mutex | distance_mutex_ |
std::shared_mutex | grad_mutex_ |
Definition at line 13 of file LazyCubicInterpolator.hpp.
|
inline |
Definition at line 16 of file LazyCubicInterpolator.hpp.
void polyfem::LazyCubicInterpolator::bicubic_interpolation | ( | const Eigen::MatrixXd & | corner_point, |
const std::vector< std::string > & | keys, | ||
const Eigen::MatrixXd & | point, | ||
double & | val, | ||
Eigen::MatrixXd & | grad | ||
) | const |
Definition at line 6 of file LazyCubicInterpolator.cpp.
References cubic_mat, delta_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, val, and x.
Referenced by evaluate().
|
inlineprivate |
Definition at line 115 of file LazyCubicInterpolator.hpp.
Referenced by cache_grid(), and evaluate().
void polyfem::LazyCubicInterpolator::cache_grid | ( | std::function< void(const Eigen::MatrixXd &, double &)> | compute_distance, |
const Eigen::MatrixXd & | point | ||
) |
Definition at line 112 of file LazyCubicInterpolator.cpp.
References build_corner_keys(), delta_, dim_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, and setup_key().
Referenced by lazy_evaluate().
void polyfem::LazyCubicInterpolator::evaluate | ( | const Eigen::MatrixXd & | point, |
double & | val, | ||
Eigen::MatrixXd & | grad | ||
) | const |
Definition at line 208 of file LazyCubicInterpolator.cpp.
References bicubic_interpolation(), build_corner_keys(), dim_, setup_key(), tricubic_interpolation(), and val.
Referenced by lazy_evaluate().
void polyfem::LazyCubicInterpolator::lazy_evaluate | ( | std::function< void(const Eigen::MatrixXd &, double &)> | compute_distance, |
const Eigen::MatrixXd & | point, | ||
double & | val, | ||
Eigen::MatrixXd & | grad | ||
) |
Definition at line 235 of file LazyCubicInterpolator.cpp.
References cache_grid(), evaluate(), and val.
|
inlineprivate |
Definition at line 142 of file LazyCubicInterpolator.hpp.
Referenced by cache_grid(), and evaluate().
void polyfem::LazyCubicInterpolator::tricubic_interpolation | ( | const Eigen::MatrixXd & | corner_point, |
const std::vector< std::string > & | keys, | ||
const Eigen::MatrixXd & | point, | ||
double & | val, | ||
Eigen::MatrixXd & | grad | ||
) | const |
Definition at line 53 of file LazyCubicInterpolator.cpp.
References cubic_mat, delta_, distance_mutex_, grad_mutex_, implicit_function_distance, implicit_function_grads, val, and x.
Referenced by evaluate().
|
private |
Definition at line 159 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), LazyCubicInterpolator(), and tricubic_interpolation().
|
private |
Definition at line 155 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), build_corner_keys(), cache_grid(), setup_key(), and tricubic_interpolation().
|
private |
Definition at line 154 of file LazyCubicInterpolator.hpp.
Referenced by build_corner_keys(), cache_grid(), evaluate(), LazyCubicInterpolator(), and setup_key().
|
mutableprivate |
Definition at line 161 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), cache_grid(), and tricubic_interpolation().
|
mutableprivate |
Definition at line 162 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), cache_grid(), and tricubic_interpolation().
|
private |
Definition at line 156 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), cache_grid(), and tricubic_interpolation().
|
private |
Definition at line 157 of file LazyCubicInterpolator.hpp.
Referenced by bicubic_interpolation(), cache_grid(), and tricubic_interpolation().