hops
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimplexFactory.hpp
Go to the documentation of this file.
1 #ifndef HOPS_SIMPLEXFACTORY_HPP
2 #define HOPS_SIMPLEXFACTORY_HPP
3 
4 namespace hops {
5 
11  template<typename Matrix, typename Vector>
13  public:
14 
20  static std::tuple<Matrix, Vector> createSimplex(long numberOfDimensions) {
21  assert(numberOfDimensions > 0);
22  Matrix A(numberOfDimensions + 1, numberOfDimensions);
23  A << -Eigen::Matrix<typename Matrix::Scalar, Eigen::Dynamic, Eigen::Dynamic>::Identity(numberOfDimensions,
24  numberOfDimensions),
25  Eigen::Matrix<typename Matrix::Scalar, Eigen::Dynamic, Eigen::Dynamic>::Ones(1, numberOfDimensions);
26  Vector b(numberOfDimensions + 1);
27  b << Eigen::Matrix<typename Matrix::Scalar, Eigen::Dynamic, 1>::Zero(numberOfDimensions),
28  1;
29  return std::make_tuple(A, b);
30  }
31  };
32 }
33 #endif //HOPS_SIMPLEXFACTORY_HPP
hops::SimplexFactory::createSimplex
static std::tuple< Matrix, Vector > createSimplex(long numberOfDimensions)
Creates and such that is a simplex.
Definition: SimplexFactory.hpp:20
hops::SimplexFactory
Factory for creating simplices.
Definition: SimplexFactory.hpp:12
hops
Definition: CsvReader.hpp:8