#include <Polynomial.hpp>
|
|
| Polynomial (const std::initializer_list< double > &init) |
| |
|
| Polynomial (const std::vector< double > &coeff) |
| |
| errc_t | parse (StringView content, StringView varname) |
| |
| errc_t | parse (StringView content) |
| |
| std::string | toString (StringView varname) |
| |
|
const std::vector< double > & | coeffs () const |
| |
|
std::vector< double > & | coeffs () |
| |
|
void | setCoeffs (const std::vector< double > &coeffs) |
| |
|
void | setCoeffs (std::vector< double > &&coeffs) |
| |
| double | eval (double x) const |
| |
|
|
std::vector< double > | coeffs_ |
| |
◆ parse() [1/2]
| errc_t ast::Polynomial::parse |
( |
StringView | content | ) |
|
|
inline |
解析多项式表达式(默认变量名 "x")
- 参数
-
| content | 多项式表达式字符串,例如 "2x^2 + 3x - 1" |
- 返回
- 错误码
◆ parse() [2/2]
解析多项式表达式
- 参数
-
| content | 多项式表达式字符串,例如 "2x^2 + 3x - 1" |
| varname | 变量名,例如 "x" |
- 返回
- 错误码
◆ toString()
| std::string ast::Polynomial::toString |
( |
StringView | varname | ) |
|
|
inline |
将多项式表达式转换为字符串
- 参数
-
- 返回
- 多项式表达式字符串
该类的文档由以下文件生成: