Function_whitney_umbrella_in_R3.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_WHITNEY_UMBRELLA_IN_R3_H_
12 #define FUNCTIONS_FUNCTION_WHITNEY_UMBRELLA_IN_R3_H_
13 
14 #include <cstdlib> // for std::size_t
15 
16 #include <Eigen/Dense>
17 
18 namespace Gudhi {
19 
20 namespace coxeter_triangulation {
21 
32  Eigen::VectorXd operator()(const Eigen::VectorXd& p) const {
33  double x = p(0) - off_[0], y = p(1) - off_[1], z = p(2) - off_[2];
34  Eigen::VectorXd result(cod_d());
35  result(0) = x * x - y * y * z;
36  return result;
37  }
38 
40  std::size_t amb_d() const { return 3; };
41 
43  std::size_t cod_d() const { return 1; };
44 
49  Eigen::VectorXd seed() const {
50  Eigen::Vector3d result(1 + off_[0], 1 + off_[1], 1 + off_[2]);
51  return result;
52  }
53 
58  Eigen::VectorXd seed2() const {
59  Eigen::Vector3d result(-1 + off_[0], -1 + off_[1], 1 + off_[2]);
60  return result;
61  }
62 
68  Function_whitney_umbrella_in_R3(Eigen::Vector3d off = Eigen::Vector3d::Zero()) : off_(off) {}
69 
70  private:
71  Eigen::Vector3d off_;
72 };
73 
74 } // namespace coxeter_triangulation
75 
76 } // namespace Gudhi
77 
78 #endif
Gudhi namespace.
Definition: SimplicialComplexForAlpha.h:14
A class that encodes the function, the zero-set of which is the Whitney umbrella surface embedded in ...
Definition: Function_whitney_umbrella_in_R3.h:27
std::size_t cod_d() const
Returns the codomain dimension.
Definition: Function_whitney_umbrella_in_R3.h:43
Eigen::VectorXd seed() const
Returns a point on the surface. This seed point is only one of two necessary seed points for the mani...
Definition: Function_whitney_umbrella_in_R3.h:49
Function_whitney_umbrella_in_R3(Eigen::Vector3d off=Eigen::Vector3d::Zero())
Constructor of the function that defines the Whitney umbrella in R^3.
Definition: Function_whitney_umbrella_in_R3.h:68
std::size_t amb_d() const
Returns the (ambient) domain dimension.
Definition: Function_whitney_umbrella_in_R3.h:40
Eigen::VectorXd operator()(const Eigen::VectorXd &p) const
Value of the function at a specified point.
Definition: Function_whitney_umbrella_in_R3.h:32
Eigen::VectorXd seed2() const
Returns a point on the surface. This seed point is only one of two necessary seed points for the mani...
Definition: Function_whitney_umbrella_in_R3.h:58