LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
LMCAS::detail::ExactRootId结构体 参考

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

LMCAS::detail::ExactRootId 的协作图:

Public 成员函数

int compare (const ExactRootId &other) const
std::size_t hash () const

Public 属性

std::size_t index = 0
Polynomial< Rational > polynomial

详细描述

在文件 exact_root_id.hpp 第 10 行定义.

成员函数说明

◆ compare()

int LMCAS::detail::ExactRootId::compare ( const ExactRootId & other) const
inline

在文件 exact_root_id.hpp 第 23 行定义.

23 {
24 const auto common = std::min(
25 polynomial.coeffs.size(), other.polynomial.coeffs.size());
26 for (std::size_t position = common; position-- > 0;) {
27 const auto& left = polynomial.coeffs[position];
28 const auto& right = other.polynomial.coeffs[position];
29 if (left < right) return -1;
30 if (right < left) return 1;
31 }
32 if (polynomial.coeffs.size() != other.polynomial.coeffs.size()) {
33 return polynomial.coeffs.size() < other.polynomial.coeffs.size()
34 ? -1 : 1;
35 }
36 if (index == other.index) return 0;
37 return index < other.index ? -1 : 1;
38 }
std::vector< CoeffType > coeffs
系数数组,coeffs[i] 为 x^i 的系数
const ExprPtr & right
Polynomial< Rational > polynomial

引用了 LMCAS::Polynomial< CoeffType >::coeffs, index, polynomial , 以及 LMCAS::right.

被这些函数引用 LMCAS::RootOfNode::compare_same_type() , 以及 LMCAS::anonymous_namespace{residual_verification.cpp}::replace_exact_root().

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

◆ hash()

std::size_t LMCAS::detail::ExactRootId::hash ( ) const
inline

在文件 exact_root_id.hpp 第 14 行定义.

14 {
15 std::size_t seed = index;
16 for (const auto& coefficient : polynomial.coeffs) {
17 seed ^= coefficient.hash() + 0x9e3779b9U +
18 (seed << 6U) + (seed >> 2U);
19 }
20 return seed;
21 }

引用了 LMCAS::Polynomial< CoeffType >::coeffs, index , 以及 polynomial.

被这些函数引用 LMCAS::RootOfNode::compute_hash().

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

类成员变量说明

◆ index

std::size_t LMCAS::detail::ExactRootId::index = 0

◆ polynomial


该结构体的文档由以下文件生成: