本文整理汇总了C++中SymEngine::emptyset方法的典型用法代码示例。如果您正苦于以下问题:C++ SymEngine::emptyset方法的具体用法?C++ SymEngine::emptyset怎么用?C++ SymEngine::emptyset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymEngine
的用法示例。
在下文中一共展示了SymEngine::emptyset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bpoly_
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
= UnivariateSeries::series(emptyset(), "x", 2);
REQUIRE(S->__str__() == "EmptySet + O(x**2)");
}
TEST_CASE("Adding two UnivariateSeries", "[UnivariateSeries]")
{
RCP<const Symbol> x = symbol("x");
map_int_Expr adict_ = {{0, 1}, {1, 2}, {2, 1}};
UExprDict apoly_(adict_);
map_int_Expr bdict_ = {{0, 2}, {1, 3}, {2, 4}};
UExprDict bpoly_(bdict_);
map_int_Expr ddict_ = {{0, 3}, {1, 5}, {2, 5}};
UExprDict dpoly_(ddict_);
RCP<const UnivariateSeries> a = UnivariateSeries::create(x, 5, apoly_);
RCP<const UnivariateSeries> b = UnivariateSeries::create(x, 4, bpoly_);