cpp_robotics::Polynomial
多項式
#include <polynomial.hpp>
Public Functions
Name | |
---|---|
Polynomial() =default | |
Polynomial(std::initializer_list< double > coeff) | |
Polynomial(const std::vector< double > & coeff) | |
template <class IteratorType > |
Polynomial(IteratorType begin, IteratorType end) |
void | set_degree(size_t deg) |
size_t | size() const |
size_t | degree() const |
std::vector< double > | coeff() const |
double & | at(size_t i) |
double | at(size_t i) const |
double & | at_degree(size_t i) |
double | at_degree(size_t i) const |
double & | operator[](size_t i) |
double | operator[](size_t i) const |
double | evalute(double x) const |
void | swap(Polynomial & poly) |
double | operator()(double x) const |
Polynomial | operator+() const |
Polynomial | operator-() const |
Polynomial | operator+(double s) const |
Polynomial | operator-(double s) const |
Polynomial & | operator+=(double s) 多項式の0次の項に値を加算する |
Polynomial & | operator-=(double s) 多項式の0次の項に値を減算する |
Polynomial | operator*(double s) const 多項式をs倍した多項式を返す |
Polynomial & | operator*=(double s) 自身をs倍する |
Polynomial | operator/(double s) const 多項式を1/s倍した多項式を返す |
Polynomial & | operator/=(double s) 自身を1/s倍する |
Polynomial | operator*(const Polynomial & p) const 多項式同士の積を取る |
Polynomial & | operator*=(const Polynomial & p) |
Polynomial | operator+(Polynomial poly) const 多項式同士の和を取る |
Polynomial & | operator+=(Polynomial poly) 自身に他の多項式を加算する |
Polynomial | operator-(Polynomial poly) const |
Polynomial & | operator-=(Polynomial poly) 自身に他の多項式を減算する |
Polynomial | expand(std::vector< double > roots) |
Friends
Name | |
---|---|
Polynomial | operator*(double s, const Polynomial & poly) 多項式をs倍した多項式を返す |
bool | operator==(const Polynomial & lhs, const Polynomial & rhs) |
bool | operator!=(const Polynomial & lhs, const Polynomial & rhs) |
Public Functions Documentation
function Polynomial
Polynomial() =default
function Polynomial
inline Polynomial(
std::initializer_list< double > coeff
)
function Polynomial
inline Polynomial(
const std::vector< double > & coeff
)
function Polynomial
template <class IteratorType >
inline Polynomial(
IteratorType begin,
IteratorType end
)
function set_degree
inline void set_degree(
size_t deg
)
function size
inline size_t size() const
function degree
inline size_t degree() const
function coeff
inline std::vector< double > coeff() const
function at
inline double & at(
size_t i
)
function at
inline double at(
size_t i
) const
function at_degree
inline double & at_degree(
size_t i
)
function at_degree
inline double at_degree(
size_t i
) const
function operator[]
inline double & operator[](
size_t i
)
function operator[]
inline double operator[](
size_t i
) const
function evalute
inline double evalute(
double x
) const
function swap
inline void swap(
Polynomial & poly
)
function operator()
inline double operator()(
double x
) const
function operator+
inline Polynomial operator+() const
function operator-
inline Polynomial operator-() const
function operator+
inline Polynomial operator+(
double s
) const
function operator-
inline Polynomial operator-(
double s
) const
function operator+=
inline Polynomial & operator+=(
double s
)
多項式の0次の項に値を加算する
Parameters:
- s
Return: Polynomial&
function operator-=
inline Polynomial & operator-=(
double s
)
多項式の0次の項に値を減算する
Parameters:
- s
Return: Polynomial&
function operator*
inline Polynomial operator*(
double s
) const
多項式をs倍した多項式を返す
Parameters:
- s
Return: Polynomial
function operator*=
inline Polynomial & operator*=(
double s
)
自身をs倍する
Parameters:
- s
Return: Polynomial&
function operator/
inline Polynomial operator/(
double s
) const
多項式を1/s倍した多項式を返す
Parameters:
- s
Return: Polynomial
function operator/=
inline Polynomial & operator/=(
double s
)
自身を1/s倍する
Parameters:
- s
Return: Polynomial&
function operator*
inline Polynomial operator*(
const Polynomial & p
) const
多項式同士の積を取る
Parameters:
- p
Return: Polynomial
function operator*=
inline Polynomial & operator*=(
const Polynomial & p
)
function operator+
inline Polynomial operator+(
Polynomial poly
) const
多項式同士の和を取る
Parameters:
- poly
Return: Polynomial
function operator+=
inline Polynomial & operator+=(
Polynomial poly
)
自身に他の多項式を加算する
Parameters:
- poly
Return: Polynomial&
function operator-
inline Polynomial operator-(
Polynomial poly
) const
function operator-=
inline Polynomial & operator-=(
Polynomial poly
)
自身に他の多項式を減算する
Parameters:
- poly
Return: Polynomial&
function expand
static inline Polynomial expand(
std::vector< double > roots
)
Friends
friend operator*
friend Polynomial operator*(
double s,
const Polynomial & poly
);
多項式をs倍した多項式を返す
Parameters:
- s
- poly
Return: Polynomial
friend operator==
friend bool operator==(
const Polynomial & lhs,
const Polynomial & rhs
);
friend operator!=
friend bool operator!=(
const Polynomial & lhs,
const Polynomial & rhs
);
Updated on 2024-05-28 at 06:55:40 +0000