Loading...
Searching...
No Matches
Negation.h
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT.
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details.
* Author(s): Siargey Kachanovich
*
* Copyright (C) 2019 Inria
*
* Modification(s):
* - YYYY/MM Author: Description of the modification
*/
#ifndef FUNCTIONS_NEGATION_H_
#define FUNCTIONS_NEGATION_H_
#include <cstdlib> // for std::size_t
#include <Eigen/Dense>
namespace Gudhi {
namespace coxeter_triangulation {
template <class Function_>
struct Negation {
Eigen::VectorXd operator()(const Eigen::VectorXd& p) const {
Eigen::VectorXd result = -fun_(p);
return result;
}
std::size_t amb_d() const { return fun_.amb_d(); }
std::size_t cod_d() const { return fun_.cod_d(); }
Eigen::VectorXd seed() const {
Eigen::VectorXd result = fun_.seed();
return result;
}
Negation(const Function_& function) : fun_(function) {}
private:
Function_ fun_;
};
template <class Function_>
Negation<Function_> negation(const Function_& function) {
return Negation<Function_>(function);
}
} // namespace coxeter_triangulation
} // namespace Gudhi
#endif
Gudhi::coxeter_triangulation::negation
Negation< Function_ > negation(const Function_ &function)
Static constructor of the negative function.
Definition Negation.h:76
Gudhi
Gudhi namespace.
Definition SimplicialComplexForAlpha.h:14
Gudhi::coxeter_triangulation::Negation
Constructs the "minus" function. The zero-set is the same, but the values at other points are the neg...
Definition Negation.h:31
Gudhi::coxeter_triangulation::Negation::operator()
Eigen::VectorXd operator()(const Eigen::VectorXd &p) const
Value of the function at a specified point.
Definition Negation.h:36
Gudhi::coxeter_triangulation::Negation::Negation
Negation(const Function_ &function)
Constructor of the negative function.
Definition Negation.h:58
Gudhi::coxeter_triangulation::Negation::cod_d
std::size_t cod_d() const
Returns the codomain dimension.
Definition Negation.h:45
Gudhi::coxeter_triangulation::Negation::amb_d
std::size_t amb_d() const
Returns the domain (ambient) dimension.
Definition Negation.h:42
Gudhi::coxeter_triangulation::Negation::seed
Eigen::VectorXd seed() const
Returns a point on the zero-set.
Definition Negation.h:48