LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
LMCAS::PowerNode类 参考

幂运算节点,表示 base^exponent。 更多...

#include </home/runner/work/docs/docs/LMCAS/src/internal/symbolic_ast/arithmetic.hpp>

类 LMCAS::PowerNode 继承关系图:
LMCAS::PowerNode 的协作图:

Public 成员函数

void accept (LMCAS::detail::SymbolicVisitor &visitor) const override
const std::shared_ptr< const SymbolicNode > & base () const noexcept
std::shared_ptr< const SymbolicNode > clone () const override
int compare (const SymbolicNode &other) const
 与另一个节点进行全序比较.
bool equals (const SymbolicNode &other) const
 判断两个节点是否结构相等.
const std::shared_ptr< const SymbolicNode > & exponent () const noexcept
std::size_t hash () const
 获取节点哈希值(带缓存).
virtual bool is_number () const
virtual bool is_one () const
virtual bool is_positive () const
virtual bool is_zero () const
int type_priority () const override

Protected 成员函数

int compare_same_type (const SymbolicNode &other) const override
std::size_t compute_hash () const override

Protected 属性

std::atomic< std::size_t > cached_hash {0}
std::atomic< bool > hash_computed {false}

Private 成员函数

 PowerNode (std::shared_ptr< const SymbolicNode > b, std::shared_ptr< const SymbolicNode > e)

Private 属性

const std::shared_ptr< const SymbolicNode > base_
const std::shared_ptr< const SymbolicNode > exponent_
 LMCAS_AST_NODE_FACTORY_FRIEND

详细描述

幂运算节点,表示 base^exponent。

在文件 arithmetic.hpp 第 218 行定义.

构造及析构函数说明

◆ PowerNode()

LMCAS::PowerNode::PowerNode ( std::shared_ptr< const SymbolicNode > b,
std::shared_ptr< const SymbolicNode > e )
inlineprivate

在文件 arithmetic.hpp 第 225 行定义.

226 : base_(std::move(b)), exponent_(std::move(e)) {
227 if (!base_ || !exponent_) {
228 throw std::invalid_argument("PowerNode base and exponent cannot be null");
229 }
230 }
const std::shared_ptr< const SymbolicNode > exponent_
const std::shared_ptr< const SymbolicNode > base_
ExprResult e()
const MultiPoly & b

引用了 LMCAS::b, base_, LMCAS::e() , 以及 exponent_.

被这些函数引用 compare_same_type().

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

成员函数说明

◆ accept()

void LMCAS::PowerNode::accept ( LMCAS::detail::SymbolicVisitor & visitor) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 arithmetic.hpp 第 259 行定义.

259{ LMCAS::detail::SymbolicVisitor::DepthGuard guard(visitor); visitor.visit(*this); }
virtual void visit(const NumberNode &node)=0

引用了 LMCAS::detail::SymbolicVisitor::visit().

函数调用图:

◆ base()

const std::shared_ptr< const SymbolicNode > & LMCAS::PowerNode::base ( ) const
inlinenoexcept

在文件 arithmetic.hpp 第 233 行定义.

233{ return base_; }

引用了 base_.

被这些函数引用 LMCAS::NormalizationVisitor::can_combine_nested_power(), LMCAS::equivalence_detail::anonymous_namespace{equivalence_complex.cpp}::canonicalize_power(), LMCAS::anonymous_namespace{limit_result.cpp}::classify_infinite_power(), LMCAS::detail::anonymous_namespace{facts_query_rational.cpp}::closed_rational_power(), LMCAS::coefficient_power_radius(), LMCAS::anonymous_namespace{residual_verification.cpp}::FormalResidual::collect_integer_power(), LMCAS::collect_power_denominators(), LMCAS::anonymous_namespace{residual_verification.cpp}::FormalResidual::convert_integer_power(), LMCAS::anonymous_namespace{expr_number_domains.cpp}::domain_contains_fractional_power(), LMCAS::anonymous_namespace{expr_number_domains.cpp}::domain_contains_positive_integer_power(), LMCAS::anonymous_namespace{expr_number_domains.cpp}::domain_contains_power(), LMCAS::anonymous_namespace{expr_complex_evaluation.cpp}::evaluate_complex_power(), LMCAS::anonymous_namespace{integration_linearity.cpp}::integration_exponential_argument(), LMCAS::detail::series_support::laurent_power_of_power(), LMCAS::NormalizationVisitor::normalize_nested_imaginary_power(), LMCAS::NormalizationVisitor::normalize_nested_power(), LMCAS::detail::anonymous_namespace{interval_endpoint.cpp}::parse_surd_power(), LMCAS::anonymous_namespace{inference_engine_bounds.cpp}::BoundsPropagation::power_bounds(), LMCAS::anonymous_namespace{transcendental_solver_substitution.cpp}::power_candidate(), LMCAS::anonymous_namespace{limit_result.cpp}::power_continuous_structure(), LMCAS::solver_detail::anonymous_namespace{solver_imaginary.cpp}::power_is_imaginary(), LMCAS::detail::transcendental::anonymous_namespace{transcendental_patterns.cpp}::power_pattern(), LMCAS::detail::definite::rational_power_checked(), LMCAS::anonymous_namespace{integration_rational_collection.cpp}::rd_collect_power(), LMCAS::anonymous_namespace{rational_polynomial_recognition.cpp}::recognize_power(), LMCAS::anonymous_namespace{residual_verification.cpp}::replace_root_power(), LMCAS::detail::inequality_support::anonymous_namespace{inequality_solver_ordering.cpp}::root_power_sign(), LMCAS::separable_reciprocal(), LMCAS::symbolic_power_to_poly(), LMCAS::tf_power_degree(), LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit(), LMCAS::anonymous_namespace{mixed_transcendental_classification.cpp}::TranscendentalDetector::visit() , 以及 LMCAS::anonymous_namespace{integration_weierstrass.cpp}::weier_rational_power().

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

◆ clone()

std::shared_ptr< const SymbolicNode > LMCAS::PowerNode::clone ( ) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 arithmetic.hpp 第 260 行定义.

260 {
261 return LMCAS::detail::make_node<PowerNode>(base_->clone(), exponent_->clone());
262 }
std::shared_ptr< const Node > make_node(Args &&... args)

引用了 base_, exponent_ , 以及 LMCAS::detail::make_node().

函数调用图:

◆ compare()

int LMCAS::SymbolicNode::compare ( const SymbolicNode & other) const
inlineinherited

与另一个节点进行全序比较.

参数
other待比较的节点
返回
小于返回 -1,等于返回 0,大于返回 1

在文件 base.hpp 第 183 行定义.

183 {
184 if (type_priority() != other.type_priority()) {
185 return type_priority() < other.type_priority() ? -1 : 1;
186 }
187 return compare_same_type(other);
188 }
virtual int compare_same_type(const SymbolicNode &other) const =0
virtual int type_priority() const =0

引用了 SymbolicNode(), compare_same_type() , 以及 type_priority().

被这些函数引用 LMCAS::anonymous_namespace{symbolic_cancel.cpp}::combine_fraction_terms() , 以及 LMCAS::endpoints_equivalent().

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

◆ compare_same_type()

int LMCAS::PowerNode::compare_same_type ( const SymbolicNode & other) const
inlineoverrideprotectedvirtual

实现了 LMCAS::SymbolicNode.

在文件 arithmetic.hpp 第 249 行定义.

249 {
250 const auto& o = static_cast<const PowerNode&>(other);
251
252 int cmp_exp = exponent_->compare(*o.exponent_);
253 if (cmp_exp != 0) return cmp_exp > 0 ? -1 : 1;
254
255 return base_->compare(*o.base_);
256 }
PowerNode(std::shared_ptr< const SymbolicNode > b, std::shared_ptr< const SymbolicNode > e)

引用了 PowerNode(), LMCAS::SymbolicNode::SymbolicNode(), base_ , 以及 exponent_.

函数调用图:

◆ compute_hash()

std::size_t LMCAS::PowerNode::compute_hash ( ) const
inlineoverrideprotectedvirtual

实现了 LMCAS::SymbolicNode.

在文件 arithmetic.hpp 第 241 行定义.

241 {
242 std::size_t seed = 0;
244 hash_combine(seed, base_->hash());
245 hash_combine(seed, exponent_->hash());
246 return seed;
247 }
int type_priority() const override
void hash_combine(std::size_t &seed, std::size_t value)
将一个哈希值混合到种子中,用于组合多个字段的哈希.

引用了 base_, exponent_, LMCAS::hash_combine() , 以及 type_priority().

函数调用图:

◆ equals()

bool LMCAS::SymbolicNode::equals ( const SymbolicNode & other) const
inlineinherited

判断两个节点是否结构相等.

参数
other待比较的节点
返回
相等返回 true

在文件 base.hpp 第 195 行定义.

195 {
196 if (this == &other) return true;
197 if (hash() != other.hash()) return false;
198 if (type_priority() != other.type_priority()) return false;
199 return compare_same_type(other) == 0;
200 }
std::size_t hash() const
获取节点哈希值(带缓存).

引用了 SymbolicNode(), compare_same_type(), hash() , 以及 type_priority().

被这些函数引用 LMCAS::complementary_square(), LMCAS::anonymous_namespace{relation_store.cpp}::expr_equals(), LMCAS::match_recursive(), LMCAS::tf_remove_exp_factor() , 以及 LMCAS::tf_substitute_expr().

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

◆ exponent()

const std::shared_ptr< const SymbolicNode > & LMCAS::PowerNode::exponent ( ) const
inlinenoexcept

在文件 arithmetic.hpp 第 234 行定义.

234 {
235 return exponent_;
236 }

引用了 exponent_.

被这些函数引用 LMCAS::NormalizationVisitor::can_combine_nested_power(), LMCAS::equivalence_detail::anonymous_namespace{equivalence_complex.cpp}::canonicalize_power(), LMCAS::anonymous_namespace{limit_result.cpp}::classify_infinite_power(), LMCAS::detail::anonymous_namespace{facts_query_rational.cpp}::closed_rational_power(), LMCAS::coefficient_power_radius(), LMCAS::collect_power_denominators(), LMCAS::anonymous_namespace{expr_number_domains.cpp}::domain_contains_power(), LMCAS::anonymous_namespace{expr_complex_evaluation.cpp}::evaluate_complex_power(), LMCAS::detail::anonymous_namespace{numeric_evaluation_power.cpp}::exponent_parity(), LMCAS::anonymous_namespace{residual_verification.cpp}::FormalResidual::integer_power(), LMCAS::detail::series_support::laurent_power_of_power(), LMCAS::NormalizationVisitor::normalize_nested_imaginary_power(), LMCAS::NormalizationVisitor::normalize_nested_power(), LMCAS::detail::anonymous_namespace{interval_endpoint.cpp}::parse_surd_power(), LMCAS::anonymous_namespace{inference_engine_bounds.cpp}::BoundsPropagation::power_bounds(), LMCAS::anonymous_namespace{transcendental_solver_substitution.cpp}::power_candidate(), LMCAS::anonymous_namespace{limit_result.cpp}::power_continuous_structure(), LMCAS::solver_detail::anonymous_namespace{solver_imaginary.cpp}::power_is_imaginary(), LMCAS::detail::transcendental::anonymous_namespace{transcendental_patterns.cpp}::power_pattern(), LMCAS::detail::definite::rational_power_checked(), LMCAS::anonymous_namespace{integration_rational_collection.cpp}::rd_collect_power(), LMCAS::anonymous_namespace{rational_polynomial_recognition.cpp}::recognize_power(), LMCAS::anonymous_namespace{residual_verification.cpp}::replace_root_power(), LMCAS::detail::inequality_support::anonymous_namespace{inequality_solver_ordering.cpp}::root_power_sign(), LMCAS::separable_reciprocal(), LMCAS::symbolic_power_to_poly(), LMCAS::tf_power_degree(), LMCAS::anonymous_namespace{expr_serialization.cpp}::Writer::visit(), LMCAS::anonymous_namespace{mixed_transcendental_classification.cpp}::TranscendentalDetector::visit() , 以及 LMCAS::anonymous_namespace{integration_weierstrass.cpp}::weier_rational_power().

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

◆ hash()

std::size_t LMCAS::SymbolicNode::hash ( ) const
inlineinherited

获取节点哈希值(带缓存).

返回
哈希值

在文件 base.hpp 第 168 行定义.

168 {
169 if (!hash_computed.load(std::memory_order_acquire)) {
170 std::size_t h = compute_hash();
171 cached_hash.store(h, std::memory_order_relaxed);
172 hash_computed.store(true, std::memory_order_release);
173 return h;
174 }
175 return cached_hash.load(std::memory_order_relaxed);
176 }
virtual std::size_t compute_hash() const =0
std::atomic< std::size_t > cached_hash
std::atomic< bool > hash_computed

引用了 cached_hash, compute_hash() , 以及 hash_computed.

被这些函数引用 LMCAS::MatrixNode::compute_hash(), LMCAS::VariableNode::compute_hash() , 以及 equals().

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

◆ is_number()

virtual bool LMCAS::SymbolicNode::is_number ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 201 行定义.

201{ return false; }

◆ is_one()

virtual bool LMCAS::SymbolicNode::is_one ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 202 行定义.

202{ return false; }

◆ is_positive()

virtual bool LMCAS::SymbolicNode::is_positive ( ) const
inlinevirtualinherited

被 LMCAS::NumberNode 重载.

在文件 base.hpp 第 204 行定义.

204{ return false; }

◆ is_zero()

virtual bool LMCAS::SymbolicNode::is_zero ( ) const
inlinevirtualinherited

◆ type_priority()

int LMCAS::PowerNode::type_priority ( ) const
inlineoverridevirtual

实现了 LMCAS::SymbolicNode.

在文件 arithmetic.hpp 第 238 行定义.

238{ return 0; }

被这些函数引用 compute_hash().

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

类成员变量说明

◆ base_

const std::shared_ptr<const SymbolicNode> LMCAS::PowerNode::base_
private

在文件 arithmetic.hpp 第 222 行定义.

被这些函数引用 PowerNode(), base(), clone(), compare_same_type() , 以及 compute_hash().

◆ cached_hash

std::atomic<std::size_t> LMCAS::SymbolicNode::cached_hash {0}
mutableprotectedinherited

在文件 base.hpp 第 149 行定义.

被这些函数引用 SymbolicNode() , 以及 hash().

◆ exponent_

const std::shared_ptr<const SymbolicNode> LMCAS::PowerNode::exponent_
private

在文件 arithmetic.hpp 第 223 行定义.

被这些函数引用 PowerNode(), clone(), compare_same_type(), compute_hash() , 以及 exponent().

◆ hash_computed

std::atomic<bool> LMCAS::SymbolicNode::hash_computed {false}
mutableprotectedinherited

在文件 base.hpp 第 150 行定义.

被这些函数引用 SymbolicNode() , 以及 hash().

◆ LMCAS_AST_NODE_FACTORY_FRIEND

LMCAS::PowerNode::LMCAS_AST_NODE_FACTORY_FRIEND
private

在文件 arithmetic.hpp 第 220 行定义.


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