🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
ast::Polynomial类 参考

#include <Polynomial.hpp>

Public 成员函数

 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
 

Protected 属性

std::vector< double > coeffs_
 

详细描述

多项式类

成员函数说明

◆ parse() [1/2]

errc_t ast::Polynomial::parse ( StringView content)
inline

解析多项式表达式(默认变量名 "x")

参数
content多项式表达式字符串,例如 "2x^2 + 3x - 1"
返回
错误码

◆ parse() [2/2]

errc_t ast::Polynomial::parse ( StringView content,
StringView varname )
inline

解析多项式表达式

参数
content多项式表达式字符串,例如 "2x^2 + 3x - 1"
varname变量名,例如 "x"
返回
错误码

◆ toString()

std::string ast::Polynomial::toString ( StringView varname)
inline

将多项式表达式转换为字符串

参数
varname变量名
返回
多项式表达式字符串

该类的文档由以下文件生成: