LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
LMCAS::anonymous_namespace{integration_linearity.cpp} 命名空间参考

函数

std::shared_ptr< const SymbolicNode > combine_integration_exponentials (const std::vector< std::shared_ptr< const SymbolicNode > > &dependents)
std::shared_ptr< const SymbolicNode > integration_exponential_argument (const std::shared_ptr< const SymbolicNode > &factor)

函数说明

◆ combine_integration_exponentials()

std::shared_ptr< const SymbolicNode > LMCAS::anonymous_namespace{integration_linearity.cpp}::combine_integration_exponentials ( const std::vector< std::shared_ptr< const SymbolicNode > > & dependents)

在文件 integration_linearity.cpp 第 27 行定义.

28 {
29 if (dependents.empty() || (dependents.size() == 1 &&
30 !dynamic_cast<const PowerNode*>(dependents[0].get()))) {
31 return nullptr;
32 }
33 std::vector<std::shared_ptr<const SymbolicNode>> exponents;
34 exponents.reserve(dependents.size());
35 for (const auto& dependent : dependents) {
36 auto argument = integration_exponential_argument(dependent);
37 if (!argument) { return nullptr; }
38 exponents.push_back(std::move(argument));
39 }
42 std::vector<std::shared_ptr<const SymbolicNode>>{
43 SymbolicFactory::create_add(std::move(exponents))});
44}
幂运算节点,表示 base^exponent。
static std::shared_ptr< const SymbolicNode > create_add(std::vector< std::shared_ptr< const SymbolicNode > > ops, detail::RewriteBudget *budget=nullptr)
创建加法节点,自动扁平化嵌套加法并消除零项.
std::shared_ptr< const SymbolicNode > integration_exponential_argument(const std::shared_ptr< const SymbolicNode > &factor)
std::shared_ptr< const Node > make_node(Args &&... args)

引用了 combine_integration_exponentials(), LMCAS::SymbolicFactory::create_add(), LMCAS::FunctionNode::Exp, integration_exponential_argument() , 以及 LMCAS::detail::make_node().

被这些函数引用 combine_integration_exponentials().

函数调用图:
这是这个函数的调用关系图:

◆ integration_exponential_argument()

std::shared_ptr< const SymbolicNode > LMCAS::anonymous_namespace{integration_linearity.cpp}::integration_exponential_argument ( const std::shared_ptr< const SymbolicNode > & factor)

在文件 integration_linearity.cpp 第 7 行定义.

8 {
9 const auto* power = dynamic_cast<const PowerNode*>(factor.get());
10 const auto& base = power ? power->base() : factor;
11 const auto* function = dynamic_cast<const FunctionNode*>(base.get());
13 function->arguments().size() != 1) {
14 return nullptr;
15 }
16 if (!power) { return function->arguments()[0]; }
17 BigInt integer;
19 std::dynamic_pointer_cast<const NumberNode>(power->exponent()), integer) ||
20 integer.is_zero()) {
21 return nullptr;
22 }
24 {power->exponent(), function->arguments()[0]});
25}
函数节点,表示数学函数调用(三角函数、对数、特殊函数等)。
const std::shared_ptr< const SymbolicNode > & base() const noexcept
ExprResult integer(Integer)=delete
bool try_get_integer_value(const std::shared_ptr< const NumberNode > &node, BigInt &value)
std::shared_ptr< const SymbolicNode > make_normalized_multiply_node(const std::vector< std::shared_ptr< const SymbolicNode > > &operands, detail::RewriteBudget *budget=nullptr)
ExprResult function(const std::string &name, std::vector< ExprPtr > arguments)

引用了 LMCAS::PowerNode::base(), LMCAS::FunctionNode::Exp, LMCAS::function(), LMCAS::integer, integration_exponential_argument(), LMCAS::make_normalized_multiply_node() , 以及 LMCAS::try_get_integer_value().

被这些函数引用 combine_integration_exponentials() , 以及 integration_exponential_argument().

函数调用图:
这是这个函数的调用关系图: