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

函数

void append_array (std::string &result, const std::vector< Value > &values)
template<typename Exact>
LMCAS::Result< lmmc_real_t > exact_number_as_floating (const Exact &value)
std::string format_array (const std::vector< Value > &values)
std::string format_float (lmmc_real_t value)
const char * format_infinity (const int *sign)
std::string format_matrix (const std::vector< std::vector< Value > > &matrix)

函数说明

◆ append_array()

void LMCAS::anonymous_namespace{value.cpp}::append_array ( std::string & result,
const std::vector< Value > & values )

在文件 value.cpp 第 11 行定义.

11 {
12 result += "[";
13 for (size_t index = 0; index < values.size(); ++index) {
14 if (index) result += ", ";
15 result += values[index].to_string();
16 }
17 result += "]";
18}

引用了 append_array().

被这些函数引用 append_array(), format_array() , 以及 format_matrix().

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

◆ exact_number_as_floating()

template<typename Exact>
LMCAS::Result< lmmc_real_t > LMCAS::anonymous_namespace{value.cpp}::exact_number_as_floating ( const Exact & value)

在文件 value.cpp 第 48 行定义.

48 {
49 const auto range_failure = [] {
52 "exact numeric value is outside the floating-point range",
53 "Value::as_number_checked");
54 };
55 try {
56 const lmmc_real_t converted = value.to_double();
57 if (!std::isfinite(converted) ||
58 (converted == 0.0 && !value.is_zero())) {
59 return range_failure();
60 }
62 } catch (const std::overflow_error&) {
63 return range_failure();
64 } catch (const std::underflow_error&) {
65 return range_failure();
66 } catch (const std::out_of_range&) {
67 return range_failure();
68 } catch (const std::range_error&) {
69 return range_failure();
70 }
71}
static Result failure(CasErrc code, std::string message, std::string operation={})
static Result success(T value)
const std::string const ExprPtr & value

引用了 exact_number_as_floating(), LMCAS::Result< T >::failure(), LMCAS::NumericFailure, LMCAS::Result< T >::success() , 以及 LMCAS::value.

被这些函数引用 exact_number_as_floating().

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

◆ format_array()

std::string LMCAS::anonymous_namespace{value.cpp}::format_array ( const std::vector< Value > & values)

在文件 value.cpp 第 20 行定义.

20 {
21 std::string result;
22 append_array(result, values);
23 return result;
24}
void append_array(std::string &result, const std::vector< Value > &values)

引用了 append_array() , 以及 format_array().

被这些函数引用 format_array().

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

◆ format_float()

std::string LMCAS::anonymous_namespace{value.cpp}::format_float ( lmmc_real_t value)

在文件 value.cpp 第 36 行定义.

36 {
37 std::string result = std::to_string(value);
38 result.erase(result.find_last_not_of('0') + 1, std::string::npos);
39 result.erase(result.find_last_not_of('.') + 1, std::string::npos);
40 return result;
41}

引用了 format_float() , 以及 LMCAS::value.

被这些函数引用 format_float().

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

◆ format_infinity()

const char * LMCAS::anonymous_namespace{value.cpp}::format_infinity ( const int * sign)

在文件 value.cpp 第 43 行定义.

43 {
44 return sign && *sign > 0 ? "inf" : "-inf";
45}

引用了 format_infinity().

被这些函数引用 format_infinity().

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

◆ format_matrix()

std::string LMCAS::anonymous_namespace{value.cpp}::format_matrix ( const std::vector< std::vector< Value > > & matrix)

在文件 value.cpp 第 26 行定义.

26 {
27 std::string result = "[";
28 for (size_t row = 0; row < matrix.size(); ++row) {
29 if (row) result += ", ";
30 append_array(result, matrix[row]);
31 }
32 result += "]";
33 return result;
34}

引用了 append_array() , 以及 format_matrix().

被这些函数引用 format_matrix().

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