1 #ifndef ORG_EEROS_MATH_FRACTION_HPP_
2 #define ORG_EEROS_MATH_FRACTION_HPP_
12 template <
int ORDER >
17 explicit Fraction(
const std::vector<double> n) :
20 Fraction(
const std::vector<double>& n,
const std::vector<double>& d) :
23 template <
int RORDER >
38 template <
int RORDER >
57 template <
int ORDER >
60 static constexpr
int N = (ORDER + 1);
61 static constexpr
int MAX(
int x,
int y) {
return (x > y) ? x : y; }
64 for (
int i = 0;
i <
N;
i++)
71 for (
int i = 0;
i <
N;
i++)
78 template <
int RORDER >
82 for (
int i = 0;
i <
N;
i++)
84 this->
c[
i] = copy.
c[
i];
89 template <
int RORDER >
94 for (
int i = 0;
i <
N;
i++)
95 for (
int j = 0;
j < M;
j++)
104 for (
int i = 0;
i <
N;
i++)
110 template <
int RORDER >
116 for (
int i = 0;
i < n;
i++) {
118 p.
c[
i] =
c[
i] + right.
c[
i];
130 p.
c[0] =
c[0] + right;
134 template <
int RORDER >
148 #endif // ORG_EEROS_MATH_FRACTION_HPP_
Definition: Fraction.hpp:10
Polynome< ORDER > denominator
Definition: Fraction.hpp:54
Polynome< MAX(ORDER, RORDER)> operator+(const Polynome< RORDER > right)
Definition: Fraction.hpp:111
Fraction(const std::vector< double > n)
Definition: Fraction.hpp:17
Polynome< ORDER > numerator
Definition: Fraction.hpp:53
Polynome()
Definition: Fraction.hpp:63
Fraction()
Definition: Fraction.hpp:15
Polynome< ORDER+RORDER > operator*(const Polynome< RORDER > right)
Definition: Fraction.hpp:90
static constexpr int N
Definition: Fraction.hpp:60
Fraction< ORDER+RORDER > operator+(const Fraction< RORDER > right)
Definition: Fraction.hpp:39
Fraction< ORDER+RORDER > operator*(const Fraction< RORDER > right)
Definition: Fraction.hpp:24
Definition: Fraction.hpp:13
Polynome(const std::vector< double > &c)
Definition: Fraction.hpp:68
int j
Definition: RingBufferTest.cpp:13
int i
Definition: RingBufferTest.cpp:12
Fraction(const std::vector< double > &n, const std::vector< double > &d)
Definition: Fraction.hpp:20
static constexpr int MAX(int x, int y)
Definition: Fraction.hpp:61
Polynome(const Polynome< RORDER > ©)
Definition: Fraction.hpp:79
Fraction< MAX(ORDER, RORDER)> operator/(const Polynome< RORDER > right)
Definition: Fraction.hpp:135
double c[N]
Definition: Fraction.hpp:142