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

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

LMCAS::fglm_detail::GaussianEliminator 的协作图:

Public 成员函数

bool add_vector (const std::vector< Rational > &vector, std::vector< Rational > &combination)

Private 属性

size_t basis_count_ = 0
std::vector< std::vector< Rational > > combinations_
std::vector< size_t > pivots_
std::vector< std::vector< Rational > > rows_

详细描述

在文件 fglm_internal.hpp 第 30 行定义.

成员函数说明

◆ add_vector()

bool LMCAS::fglm_detail::GaussianEliminator::add_vector ( const std::vector< Rational > & vector,
std::vector< Rational > & combination )

在文件 fglm_linear.cpp 第 37 行定义.

38 {
39 size_t n = v.size();
40
41 for (auto& row : rows_) {
42 row.resize(n, Rational(0));
43 }
44
45 std::vector<Rational> working = v;
46
47 combination.assign(basis_count_, Rational(0));
48
49 for (size_t i = 0; i < pivots_.size(); ++i) {
50 size_t col = pivots_[i];
51 if (col >= working.size()) continue;
52 if (working[col].is_zero()) continue;
53
54 Rational factor = working[col] / rows_[i][col];
55 for (size_t j = 0; j < n; ++j) {
56 if (j < working.size() && j < rows_[i].size()) {
57 working[j] = working[j] - factor * rows_[i][j];
58 }
59 }
60
61 for (size_t j = 0; j < combinations_[i].size(); ++j) {
62 combination[j] =
63 combination[j] - factor * combinations_[i][j];
64 }
65 }
66
67 size_t pivot_col = n;
68 for (size_t j = 0; j < n; ++j) {
69 if (!working[j].is_zero()) {
70 pivot_col = j;
71 break;
72 }
73 }
74
75 if (pivot_col == n) {
76
77 for (auto& c : combination) {
78 c = -c;
79 }
80 return false;
81 }
82
83 Rational pivot_val = working[pivot_col];
84 for (size_t j = 0; j < n; ++j) {
85 working[j] = working[j] / pivot_val;
86 }
87
88 std::vector<Rational> comb_row(basis_count_ + 1, Rational(0));
89 for (size_t j = 0; j < combination.size(); ++j) {
90 comb_row[j] = combination[j] / pivot_val;
91 }
92
93 comb_row[basis_count_] = Rational(1) / pivot_val;
94
95 rows_.push_back(working);
96 pivots_.push_back(pivot_col);
97 combinations_.push_back(comb_row);
99
100 return true;
101 }
std::vector< std::vector< Rational > > rows_
std::vector< std::vector< Rational > > combinations_
bool is_zero(const SymbolicExpr &expression)
__attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) VectorCalculusExprResult surface_integral_scalar_checked(const std __attribute__((visibility("default"))) std const VectorField const std::string const std::string & v
@ Rational
Rational numbers
const VectorField const VectorField & c

引用了 basis_count_, LMCAS::c, combinations_, pivots_, rows_ , 以及 LMCAS::v.

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

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

类成员变量说明

◆ basis_count_

size_t LMCAS::fglm_detail::GaussianEliminator::basis_count_ = 0
private

在文件 fglm_internal.hpp 第 39 行定义.

被这些函数引用 add_vector().

◆ combinations_

std::vector<std::vector<Rational> > LMCAS::fglm_detail::GaussianEliminator::combinations_
private

在文件 fglm_internal.hpp 第 38 行定义.

被这些函数引用 add_vector().

◆ pivots_

std::vector<size_t> LMCAS::fglm_detail::GaussianEliminator::pivots_
private

在文件 fglm_internal.hpp 第 37 行定义.

被这些函数引用 add_vector().

◆ rows_

std::vector<std::vector<Rational> > LMCAS::fglm_detail::GaussianEliminator::rows_
private

在文件 fglm_internal.hpp 第 36 行定义.

被这些函数引用 add_vector().


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