Loading...
Searching...
No Matches
Function_affine_plane_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_AFFINE_PLANE_IN_RD_H_
12#define FUNCTIONS_FUNCTION_AFFINE_PLANE_IN_RD_H_
13
14#include <cstdlib> // for std::size_t
15
16#include <Eigen/Dense>
17
18namespace Gudhi {
19
20namespace coxeter_triangulation {
21
32 Eigen::VectorXd operator()(const Eigen::VectorXd& p) const {
33 Eigen::VectorXd result = normal_matrix_.transpose() * (p - off_);
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 = off_;
46 return result;
47 }
48
59 Function_affine_plane_in_Rd(const Eigen::MatrixXd& normal_matrix, const Eigen::VectorXd& offset)
60 : normal_matrix_(normal_matrix), d_(normal_matrix.rows()), k_(normal_matrix.cols()), off_(offset) {
61 normal_matrix_.colwise().normalize();
62 }
63
72 Function_affine_plane_in_Rd(const Eigen::MatrixXd& normal_matrix)
73 : normal_matrix_(normal_matrix),
74 d_(normal_matrix.rows()),
75 k_(normal_matrix.cols()),
76 off_(Eigen::VectorXd::Zero(d_)) {
77 normal_matrix_.colwise().normalize();
78 }
79
80 private:
81 Eigen::MatrixXd normal_matrix_;
82 std::size_t d_, k_;
83 Eigen::VectorXd off_;
84};
85
86} // namespace coxeter_triangulation
87
88} // namespace Gudhi
89
90#endif
A class for the function that defines an m-dimensional implicit affine plane embedded in d-dimensiona...
Definition: Function_affine_plane_in_Rd.h:27
Eigen::VectorXd operator()(const Eigen::VectorXd &p) const
Value of the function at a specified point.
Definition: Function_affine_plane_in_Rd.h:32
std::size_t cod_d() const
Returns the codomain dimension. Same as the codimension of the sphere.
Definition: Function_affine_plane_in_Rd.h:41
Function_affine_plane_in_Rd(const Eigen::MatrixXd &normal_matrix)
Constructor of the function that defines an m-dimensional implicit affine plane in the d-dimensional ...
Definition: Function_affine_plane_in_Rd.h:72
Eigen::VectorXd seed() const
Returns a point on the affine plane.
Definition: Function_affine_plane_in_Rd.h:44
std::size_t amb_d() const
Returns the domain dimension. Same as the ambient dimension of the sphere.
Definition: Function_affine_plane_in_Rd.h:38
Function_affine_plane_in_Rd(const Eigen::MatrixXd &normal_matrix, const Eigen::VectorXd &offset)
Constructor of the function that defines an m-dimensional implicit affine plane in the d-dimensional ...
Definition: Function_affine_plane_in_Rd.h:59