PolynomialValues.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_MATH_POLYNOMIALVALUES_H
17 #define SURGSIM_MATH_POLYNOMIALVALUES_H
18 
22 #include "SurgSim/Math/MinMax.h"
23 
24 namespace SurgSim
25 {
26 namespace Math
27 {
28 
33 template <typename T, int N> class PolynomialValues;
34 
37 template <class T>
38 class PolynomialValues<T, 0>
39 {
40 public:
43  explicit PolynomialValues(const Polynomial<T, 0>& p);
44 
46  const Polynomial<T, 0>& getPolynomial() const;
47 
51  Interval<T> valuesOverInterval(const Interval<T>& interval) const;
52 
53 private:
56 };
57 
60 template <class T>
61 class PolynomialValues<T, 1>
62 {
63 public:
66  explicit PolynomialValues(const Polynomial<T, 1>& p);
67 
69  const Polynomial<T, 1>& getPolynomial() const;
70 
74  Interval<T> valuesOverInterval(const Interval<T>& interval) const;
75 
76 private:
79 };
80 
83 template <class T>
84 class PolynomialValues<T, 2>
85 {
86 public:
89  explicit PolynomialValues(const Polynomial<T, 2>& p);
90 
92  const Polynomial<T, 2>& getPolynomial() const;
93 
95  const Polynomial<T, 1>& getDerivative() const;
96 
98  const PolynomialRoots<T, 1>& getLocationsOfExtrema() const;
99 
103  Interval<T> valuesOverInterval(const Interval<T>& interval) const;
104 
105 private:
108 
111 
114 };
115 
118 template <class T>
119 class PolynomialValues<T, 3>
120 {
121 public:
124  explicit PolynomialValues(const Polynomial<T, 3>& p);
125 
127  const Polynomial<T, 3>& getPolynomial() const;
128 
130  const Polynomial<T, 2>& getDerivative() const;
131 
133  const PolynomialRoots<T, 2>& getLocationsOfExtrema() const;
134 
138  Interval<T> valuesOverInterval(const Interval<T>& interval) const;
139 
140 private:
143 
146 
149 };
150 
159 template <class T, int N>
161 
162 }; // Math
163 }; // SurgSim
164 
166 
167 #endif // SURGSIM_MATH_POLYNOMIALVALUES_H
SurgSim::Math::PolynomialValues< T, 0 >::m_polynomial
Polynomial< T, 0 > m_polynomial
The polynomial under consideration.
Definition: PolynomialValues.h:55
PolynomialRoots.h
SurgSim::Math::valuesOverInterval
Interval< T > valuesOverInterval(const Polynomial< T, N > &p, const Interval< T > &interval)
Calculate the minimum and maximum values of the dependent variable over a specified range of the inde...
Definition: PolynomialValues-inl.h:148
SurgSim::Math::Polynomial< T, 0 >
Polynomial<T, 0> specializes the Polynomial class for degree 0 (constant polynomials)
Definition: Polynomial.h:57
SurgSim::Math::PolynomialValues< T, 3 >::m_polynomial
Polynomial< T, 3 > m_polynomial
The polynomial under consideration.
Definition: PolynomialValues.h:142
SurgSim::Math::PolynomialRoots< T, 1 >
PolynomialRoots<T, 1> specializes the PolynomialRoots class for degree 1 (linear polynomials)
Definition: PolynomialRoots.h:85
IntervalArithmetic.h
SurgSim::Math::PolynomialRoots< T, 2 >
PolynomialRoots<T, 2> specializes the PolynomialRoots class for degree 2 (quadratic polynomials)
Definition: PolynomialRoots.h:97
MinMax.h
SurgSim
Definition: CompoundShapeToGraphics.cpp:30
SurgSim::Math::PolynomialValues< T, 2 >::m_locationOfExtremum
PolynomialRoots< T, 1 > m_locationOfExtremum
Cached version of the locations of the extrema.
Definition: PolynomialValues.h:113
SurgSim::Math::PolynomialValues
Class to manage polynomial based calculations of interval boundaries.
Definition: PolynomialValues.h:33
PolynomialValues-inl.h
SurgSim::Math::Polynomial
Polynomial<T, N> defines the concept of an N degree polynomial with type T coefficients and provides ...
Definition: Polynomial.h:48
SurgSim::Math::Interval
Interval defines the concept of a mathematical interval and provides operations on it including arith...
Definition: IntervalArithmetic.h:35
SurgSim::Math::PolynomialValues< T, 2 >::m_derivative
Polynomial< T, 1 > m_derivative
Cached version of the derivative of the polynomial.
Definition: PolynomialValues.h:110
SurgSim::Math::Polynomial< T, 1 >
Polynomial<T, 1> specializes the Polynomial class for degree 1 (linear polynomials)
Definition: Polynomial.h:118
Polynomial.h
SurgSim::Math::Polynomial< T, 3 >
Polynomial<T, 3> specializes the Polynomial class for degree 3 (cubic polynomials)
Definition: Polynomial.h:256
SurgSim::Math::PolynomialValues< T, 1 >::m_polynomial
Polynomial< T, 1 > m_polynomial
The polynomial under consideration.
Definition: PolynomialValues.h:78
SurgSim::Math::PolynomialValues< T, 2 >::m_polynomial
Polynomial< T, 2 > m_polynomial
The polynomial under consideration.
Definition: PolynomialValues.h:107
SurgSim::Math::PolynomialValues< T, 3 >::m_derivative
Polynomial< T, 2 > m_derivative
Cached version of the derivative of the polynomial.
Definition: PolynomialValues.h:145
SurgSim::Math::PolynomialValues< T, 3 >::m_locationOfExtremum
PolynomialRoots< T, 2 > m_locationOfExtremum
Cached version of the locations of the extrema.
Definition: PolynomialValues.h:148
SurgSim::Math::Polynomial< T, 2 >
Polynomial<T, 2> specializes the Polynomial class for degree 2 (quadratic polynomials)
Definition: Polynomial.h:184