本文整理汇总了C++中SymEngine::univariate_series方法的典型用法代码示例。如果您正苦于以下问题:C++ SymEngine::univariate_series方法的具体用法?C++ SymEngine::univariate_series怎么用?C++ SymEngine::univariate_series使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymEngine
的用法示例。
在下文中一共展示了SymEngine::univariate_series方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apoly_
using SymEngine::umap_int_basic;
using SymEngine::pi;
using SymEngine::I;
using SymEngine::DomainError;
using SymEngine::NotImplementedError;
using SymEngine::SymEngineException;
using SymEngine::gamma;
using namespace SymEngine::literals;
TEST_CASE("Create UnivariateSeries", "[UnivariateSeries]")
{
RCP<const Symbol> x = symbol("x");
map_int_Expr adict_ = {{0, 1}, {1, 2}, {2, 1}};
UExprDict apoly_(adict_);
RCP<const UnivariateSeries> P = univariate_series(x, 2, apoly_);
REQUIRE(P->__str__() == "x**2 + 2*x + 1 + O(x**2)");
map_int_Expr bdict_ = {{0, 1}, {1, 0}, {2, 2}, {3, 1}};
UExprDict bpoly_(bdict_);
RCP<const UnivariateSeries> Q = UnivariateSeries::create(x, 5, bpoly_);
REQUIRE(Q->__str__() == "x**3 + 2*x**2 + 1 + O(x**5)");
map_int_Expr cdict_
= {{0, symbol("c")}, {1, symbol("b")}, {2, symbol("a")}};
UExprDict cpoly_(cdict_);
RCP<const UnivariateSeries> R = UnivariateSeries::create(x, 3, cpoly_);
REQUIRE(R->__str__() == "a*x**2 + b*x + c + O(x**3)");
// check if unknown types are handled by visitor
RCP<const UnivariateSeries> S