Function_moment_curve_in_Rd.h
1 /* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
2  * See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
3  * Author(s): Siargey Kachanovich
4  *
5  * Copyright (C) 2019 Inria
6  *
7  * Modification(s):
8  * - YYYY/MM Author: Description of the modification
9  */
10 
11 #ifndef FUNCTIONS_FUNCTION_MOMENT_CURVE_IN_RD_H_
12 #define FUNCTIONS_FUNCTION_MOMENT_CURVE_IN_RD_H_
13 
14 #include <cstdlib> // for std::size_t
15 
16 #include <Eigen/Dense>
17 
18 namespace Gudhi {
19 
20 namespace coxeter_triangulation {
21 
31  Eigen::VectorXd operator()(const Eigen::VectorXd& p) const {
32  Eigen::VectorXd result(k_);
33  for (std::size_t i = 1; i < d_; ++i) result(i - 1) = p(i) - p(0) * p(i - 1);
34  return result;
35  }
36 
38  std::size_t amb_d() const { return d_; };
39 
41  std::size_t cod_d() const { return k_; };
42 
44  Eigen::VectorXd seed() const {
45  Eigen::VectorXd result = Eigen::VectorXd::Zero(d_);
46  return result;
47  }
48 
50  double get_radius() const{
51  return r_;
52  }
53 
61  Function_moment_curve_in_Rd(double r, std::size_t d) : k_(d - 1), d_(d), r_(r) {}
62 
71  Function_moment_curve_in_Rd(double r, std::size_t d, Eigen::VectorXd& offset)
72  : k_(d - 1), d_(d), r_(r), off_(offset) {}
73 
74  private:
75  std::size_t k_, d_;
76  double r_;
77  Eigen::VectorXd off_;
78 };
79 
80 } // namespace coxeter_triangulation
81 
82 } // namespace Gudhi
83 
84 #endif
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
A class for the function that defines an implicit moment curve in the d-dimensional Euclidean space.
Definition: Function_moment_curve_in_Rd.h:27
Function_moment_curve_in_Rd(double r, std::size_t d, Eigen::VectorXd &offset)
Constructor of the function that defines an implicit moment curve in the d-dimensional Euclidean spac...
Definition: Function_moment_curve_in_Rd.h:71
std::size_t cod_d() const
Returns the codomain dimension.
Definition: Function_moment_curve_in_Rd.h:41
double get_radius() const
Returns the radius of the moment curve.
Definition: Function_moment_curve_in_Rd.h:50
std::size_t amb_d() const
Returns the domain (ambient) dimension..
Definition: Function_moment_curve_in_Rd.h:38
Eigen::VectorXd seed() const
Returns a point on the moment curve.
Definition: Function_moment_curve_in_Rd.h:44
Function_moment_curve_in_Rd(double r, std::size_t d)
Constructor of the function that defines an implicit moment curve in the d-dimensional Euclidean spac...
Definition: Function_moment_curve_in_Rd.h:61
Eigen::VectorXd operator()(const Eigen::VectorXd &p) const
Value of the function at a specified point.
Definition: Function_moment_curve_in_Rd.h:31