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

函数

bool matching_matrix_shapes (const std::vector< std::shared_ptr< const SymbolicNode > > &operands, std::size_t rows, std::size_t cols)
std::shared_ptr< const SymbolicNode > matrix_element (const MatrixNode &matrix, std::size_t index)

函数说明

◆ matching_matrix_shapes()

bool LMCAS::anonymous_namespace{normalization_matrices.cpp}::matching_matrix_shapes ( const std::vector< std::shared_ptr< const SymbolicNode > > & operands,
std::size_t rows,
std::size_t cols )

在文件 normalization_matrices.cpp 第 22 行定义.

23 {
24 for (const auto& operand : operands) {
25 const auto matrix = std::dynamic_pointer_cast<const MatrixNode>(operand);
26 if (!matrix || matrix->rows() != rows || matrix->cols() != cols) {
27 return false;
28 }
29 }
30 return true;
31}

引用了 matching_matrix_shapes().

被这些函数引用 matching_matrix_shapes().

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

◆ matrix_element()

std::shared_ptr< const SymbolicNode > LMCAS::anonymous_namespace{normalization_matrices.cpp}::matrix_element ( const MatrixNode & matrix,
std::size_t index )

在文件 normalization_matrices.cpp 第 6 行定义.

6 {
7 std::shared_ptr<const SymbolicNode> value;
8 if (const auto* dense = std::get_if<MatrixNode::DenseStorage>(&matrix.storage())) {
9 if (index < dense->size()) {
10 value = (*dense)[index];
11 }
12 } else {
13 const auto& sparse = std::get<MatrixNode::SparseStorage>(matrix.storage());
14 const auto found = sparse.find(index);
15 if (found != sparse.end()) {
16 value = found->second;
17 }
18 }
19 return value ? value : detail::make_node<NumberNode>(BigInt(0));
20}
const std::variant< DenseStorage, SparseStorage > & storage() const noexcept
std::shared_ptr< const Node > make_node(Args &&... args)
const std::string const ExprPtr & value

引用了 LMCAS::detail::make_node(), matrix_element(), LMCAS::MatrixNode::storage() , 以及 LMCAS::value.

被这些函数引用 matrix_element().

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