Constant_function.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_CONSTANT_FUNCTION_H_
12 #define FUNCTIONS_CONSTANT_FUNCTION_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  return value_;
33  }
34 
36  std::size_t amb_d() const { return d_; };
37 
39  std::size_t cod_d() const { return k_; };
40 
42  Eigen::VectorXd seed() const { throw "Seed invoked on a constant function.\n"; }
43 
45 
53  Constant_function(std::size_t d, std::size_t k, const Eigen::VectorXd& value) : d_(d), k_(k), value_(value) {}
54 
55  private:
56  std::size_t d_, k_;
57  Eigen::VectorXd value_;
58 };
59 
60 } // namespace coxeter_triangulation
61 
62 } // namespace Gudhi
63 
64 #endif
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
A class that encodes a constant function from R^d to R^k. This class does not have any implicit manif...
Definition: Constant_function.h:27
Constant_function(std::size_t d, std::size_t k, const Eigen::VectorXd &value)
Constructor of a constant function from R^d to R^m.
Definition: Constant_function.h:53
Eigen::VectorXd seed() const
No seed point is available. Throws an exception on evocation.
Definition: Constant_function.h:42
Eigen::VectorXd operator()(const Eigen::VectorXd &p) const
Value of the function at a specified point. The value is constant.
Definition: Constant_function.h:31
std::size_t cod_d() const
Returns the codomain dimension. Same as the codimension of the sphere.
Definition: Constant_function.h:39
std::size_t amb_d() const
Returns the domain dimension. Same as the ambient dimension of the sphere.
Definition: Constant_function.h:36