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

常数及根式包围区间共用的内部算术策略。 保守界覆盖未约分 Rational 的交叉乘积及结果;受检入口统一捕获 CasError,仅返回完整结果。 更多...

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

LMCAS::detail::ExactBoundArithmetic 的协作图:

Public 成员函数

 ExactBoundArithmetic (ComputationContext &context, const char *operation)
Rational add (const Rational &a, const Rational &b) const
void bits (std::size_t count) const
Rational div (const Rational &a, const Rational &b) const
BigInt dyadic_scale (std::size_t precision) const
std::size_t growth (std::size_t a, std::size_t b) const
bool less (const Rational &a, const Rational &b) const
Rational mul (const Rational &a, const Rational &b) const
void operands (const Rational &a, const Rational &b, bool addition=false) const
void require (Result< void > result) const
void step () const
Rational sub (const Rational &a, const Rational &b) const

Private 属性

ComputationContext & context_
const char * operation_

详细描述

常数及根式包围区间共用的内部算术策略。 保守界覆盖未约分 Rational 的交叉乘积及结果;受检入口统一捕获 CasError,仅返回完整结果。

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

构造及析构函数说明

◆ ExactBoundArithmetic()

LMCAS::detail::ExactBoundArithmetic::ExactBoundArithmetic ( ComputationContext & context,
const char * operation )
inline

在文件 exact_constant_bounds.hpp 第 25 行定义.

ComputationContext const std::string & operation
std::size_t std::size_t ComputationContext & context

引用了 LMCAS::detail::context, context_, LMCAS::detail::operation , 以及 operation_.

成员函数说明

◆ add()

Rational LMCAS::detail::ExactBoundArithmetic::add ( const Rational & a,
const Rational & b ) const
inline

在文件 exact_constant_bounds.hpp 第 51 行定义.

51 {
52 operands(a, b, true); return a + b;
53 }
void operands(const Rational &a, const Rational &b, bool addition=false) const
const MultiPoly & b
__attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult curve_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string const std::shared_ptr< SymbolicExpr > & a

引用了 LMCAS::a, LMCAS::b , 以及 operands().

被这些函数引用 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::atan_bounds(), LMCAS::detail::closed_rational_value(), LMCAS::detail::exact_e_bounds() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ bits()

void LMCAS::detail::ExactBoundArithmetic::bits ( std::size_t count) const
inline

在文件 exact_constant_bounds.hpp 第 32 行定义.

32 {
34 }
Result< void > require_integer_bits(std::size_t amount, const std::string &operation={}) const
void require(Result< void > result) const

引用了 context_, operation_, require() , 以及 LMCAS::ComputationContext::require_integer_bits().

被这些函数引用 LMCAS::detail::closed_rational_value(), growth(), LMCAS::Irrational::EnclosureRound::power() , 以及 LMCAS::Irrational::EnclosureRound::validate_terms().

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

◆ div()

Rational LMCAS::detail::ExactBoundArithmetic::div ( const Rational & a,
const Rational & b ) const
inline

在文件 exact_constant_bounds.hpp 第 60 行定义.

60 {
61 operands(a, b);
62 if (b.is_zero())
63 throw CasError{CasErrc::DomainError, "zero enclosure divisor", operation_};
64 return a / b;
65 }

引用了 LMCAS::a, LMCAS::b, LMCAS::DomainError, operands() , 以及 operation_.

被这些函数引用 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::atan_bounds(), LMCAS::detail::anonymous_namespace{facts_query_rational.cpp}::closed_rational_power(), LMCAS::detail::exact_e_bounds(), LMCAS::Irrational::EnclosureRound::power() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ dyadic_scale()

BigInt LMCAS::detail::ExactBoundArithmetic::dyadic_scale ( std::size_t precision) const
inline

在文件 exact_constant_bounds.hpp 第 69 行定义.

69 {
70 step();
71 growth(precision, 1);
72 if (precision > std::numeric_limits<mp_size_t>::max())
73 throw CasError{CasErrc::ResourceLimit, "shift size overflow", operation_};
74 return BigInt(1) << static_cast<mp_size_t>(precision);
75 }
std::size_t growth(std::size_t a, std::size_t b) const

引用了 growth(), operation_, LMCAS::ResourceLimit , 以及 step().

被这些函数引用 LMCAS::detail::exact_e_bounds(), LMCAS::Irrational::EnclosureRound::radical() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ growth()

std::size_t LMCAS::detail::ExactBoundArithmetic::growth ( std::size_t a,
std::size_t b ) const
inline

在文件 exact_constant_bounds.hpp 第 35 行定义.

35 {
36 if (b > std::numeric_limits<std::size_t>::max() - a)
37 throw CasError{CasErrc::ResourceLimit, "integer size overflow", operation_};
38 const auto size = a + b;
39 bits(size);
40 return size;
41 }

引用了 LMCAS::a, LMCAS::b, bits(), operation_ , 以及 LMCAS::ResourceLimit.

被这些函数引用 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::atan_bounds(), dyadic_scale(), LMCAS::detail::exact_e_bounds(), operands(), LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::pi_bounds(), LMCAS::Irrational::EnclosureRound::radical() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ less()

bool LMCAS::detail::ExactBoundArithmetic::less ( const Rational & a,
const Rational & b ) const
inline

在文件 exact_constant_bounds.hpp 第 66 行定义.

66 {
67 operands(a, b); return a < b;
68 }

引用了 LMCAS::a, LMCAS::b , 以及 operands().

被这些函数引用 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::atan_bounds(), LMCAS::detail::exact_e_bounds() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ mul()

Rational LMCAS::detail::ExactBoundArithmetic::mul ( const Rational & a,
const Rational & b ) const
inline

在文件 exact_constant_bounds.hpp 第 57 行定义.

57 {
58 operands(a, b); return a * b;
59 }

引用了 LMCAS::a, LMCAS::b , 以及 operands().

被这些函数引用 LMCAS::detail::anonymous_namespace{facts_query_rational.cpp}::closed_rational_power(), LMCAS::detail::closed_rational_value(), LMCAS::Irrational::EnclosureRound::multiply_positive(), LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::pi_bounds() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

◆ operands()

void LMCAS::detail::ExactBoundArithmetic::operands ( const Rational & a,
const Rational & b,
bool addition = false ) const
inline

在文件 exact_constant_bounds.hpp 第 42 行定义.

42 {
43 step();
44 const auto a_bits = std::max(a.get_numerator().bit_length(),
45 a.get_denominator().bit_length());
46 const auto b_bits = std::max(b.get_numerator().bit_length(),
47 b.get_denominator().bit_length());
48 const auto size = growth(a_bits, b_bits);
49 if (addition) growth(size, 1);
50 }

引用了 LMCAS::a, LMCAS::b, growth() , 以及 step().

被这些函数引用 add(), div(), less(), mul() , 以及 sub().

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

◆ require()

void LMCAS::detail::ExactBoundArithmetic::require ( Result< void > result) const
inline

在文件 exact_constant_bounds.hpp 第 28 行定义.

28 {
29 if (!result) throw result.error();
30 }

引用了 LMCAS::Result< T >::error().

被这些函数引用 bits(), LMCAS::detail::closed_rational_value() , 以及 step().

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

◆ step()

void LMCAS::detail::ExactBoundArithmetic::step ( ) const
inline

◆ sub()

Rational LMCAS::detail::ExactBoundArithmetic::sub ( const Rational & a,
const Rational & b ) const
inline

在文件 exact_constant_bounds.hpp 第 54 行定义.

54 {
55 operands(a, b, true); return a - b;
56 }

引用了 LMCAS::a, LMCAS::b , 以及 operands().

被这些函数引用 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::atan_bounds(), LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::pi_bounds() , 以及 LMCAS::detail::anonymous_namespace{exact_constant_bounds.cpp}::small_atan().

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

类成员变量说明

◆ context_

ComputationContext& LMCAS::detail::ExactBoundArithmetic::context_
private

在文件 exact_constant_bounds.hpp 第 77 行定义.

被这些函数引用 ExactBoundArithmetic(), bits() , 以及 step().

◆ operation_

const char* LMCAS::detail::ExactBoundArithmetic::operation_
private

在文件 exact_constant_bounds.hpp 第 78 行定义.

被这些函数引用 ExactBoundArithmetic(), bits(), div(), dyadic_scale(), growth() , 以及 step().


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