carl  24.04
Computer ARithmetic Library
cyclic.h
Go to the documentation of this file.
1 /**
2  * @file: cyclic.h
3  * @author: Sebastian Junges
4  *
5  * @since November 4, 2014
6  */
7 
8 #pragma once
9 
10 #include <cassert>
12 #include <carl-io/StringParser.h>
13 
14 namespace carl
15 {
16  namespace benchmarks
17  {
18 
19 template<typename C, typename O, typename P>
20 std::vector<MultivariatePolynomial<C, O, P>> cyclic2()
21 {
23  sp.setVariables({"x", "y"});
24  std::vector<MultivariatePolynomial<C, O, P>> res;
25  // x + y
26  res.push_back(sp.parseMultivariatePolynomial<C, O, P>("x + y"));
27  // x*y - 1
28  res.push_back(sp.parseMultivariatePolynomial<C, O, P>("x*y + -1"));
29  return res;
30 }
31 
32 template<typename C, typename O, typename P>
33 std::vector<MultivariatePolynomial<C, O, P>> cyclic3()
34 {
36  sp.setVariables({"x", "y", "z"});
37  std::vector<MultivariatePolynomial<C, O, P>> res;
38  // x + y + z
39  res.push_back(sp.parseMultivariatePolynomial<C, O, P>("x + y + z"));
40  // x*y + x*z + y*z
41  res.push_back(sp.parseMultivariatePolynomial<C, O, P>("x*y + x*z + y*z"));
42  // x*y*z - 1
43  res.push_back(sp.parseMultivariatePolynomial<C, O, P>("x*y*z + -1"));
44  return res;
45 }
46 
47 
48 
49 #define run_cyclic_case(INDEX) case INDEX: return cyclic##INDEX<C, O, P>()
50 
51 template<typename C, typename O, typename P>
52 std::vector<MultivariatePolynomial<C, O, P>> cyclic(unsigned index)
53 {
54  switch(index)
55  {
56  run_cyclic_case(2);
57  run_cyclic_case(3);
58  //run_katsura_case(4);
59  //run_katsura_case(5);
60  //run_katsura_case(6);
61  //run_katsura_case(4);
62  default:
63  assert(index > 1);
64  assert(index < 4);
65  }
66  return std::vector<MultivariatePolynomial<C, O, P>>();
67 }
68 
69 
70  }
71 }
#define run_cyclic_case(INDEX)
Definition: cyclic.h:49
carl is the main namespace for the library.
std::vector< MultivariatePolynomial< C, O, P > > cyclic(unsigned index)
Definition: cyclic.h:52
std::vector< MultivariatePolynomial< C, O, P > > cyclic2()
Definition: cyclic.h:20
std::vector< MultivariatePolynomial< C, O, P > > cyclic3()
Definition: cyclic.h:33
void setVariables(std::list< std::string > variables)
Definition: StringParser.h:90
MultivariatePolynomial< C, O, P > parseMultivariatePolynomial(const std::string &inputString) const
Definition: StringParser.h:160