14 for (
unsigned j = 0; j < t.ncols(); j++) {
15 SYMENGINE_ASSERT(is_a<Integer>(*t.get(0, j)));
17 = down_cast<const Integer &>(*t.get(0, j)).as_integer_class();
19 SYMENGINE_ASSERT(is_a<Integer>(*basis[k].get(0, j)));
20 integer_class b_ = down_cast<const Integer &>(*basis[k].get(0, j))
41 return not order(t, basis, n - 1) and is_minimum(t, basis, n - 1);
51 void homogeneous_lde(
std::vector<DenseMatrix> &basis, const DenseMatrix &A)
53 unsigned p = A.nrows();
54 unsigned q = A.ncols();
56 SYMENGINE_ASSERT(p > 0 and q > 1);
58 DenseMatrix row_zero(1, q);
61 DenseMatrix col_zero(p, 1);
68 for (
unsigned j = 0; j < q; j++) {
74 DenseMatrix t, transpose, product, T;
75 RCP<const Integer> dot;
77 product = DenseMatrix(p, 1);
78 transpose = DenseMatrix(q, 1);
80 while (P.
size() > 0) {
81 auto n = P.
size() - 1;
85 t.transpose(transpose);
86 A.mul_matrix(transpose, product);
88 if (product.eq(col_zero) and not t.eq(row_zero)) {
91 for (
unsigned i = 0; i < q; i++) {
96 for (
unsigned i = 0; i < q; i++) {
97 SYMENGINE_ASSERT(is_a<Integer>(*T.get(0, i)));
99 down_cast<const Integer &>(*T.get(0, i)).addint(*one));
102 SYMENGINE_ASSERT(is_a<Integer>(*T.get(0, i - 1)));
104 down_cast<const Integer &>(*T.get(0, i - 1))
109 for (
unsigned j = 0; j < p; j++) {
110 SYMENGINE_ASSERT(is_a<Integer>(*product.get(j, 0)));
111 RCP<const Integer> p_j0
112 = rcp_static_cast<const Integer>(product.get(j, 0));
114 SYMENGINE_ASSERT(is_a<Integer>(*A.get(j, i)));
115 RCP<const Integer> A_ji
116 = rcp_static_cast<const Integer>(A.get(j, i));
118 dot = dot->addint(*p_j0->mulint(*A_ji));
122 and ((dot->is_negative()
123 and is_minimum(T, basis,
124 numeric_cast<unsigned>(basis.size())))
125 or t.eq(row_zero))) {
129 for (
unsigned j = 0; j < q; j++) {
130 Frozen[n - 1][j] = F[j];
Classes and functions relating to the binary operation of addition.
Main namespace for SymEngine package.
bool eq(const Basic &a, const Basic &b)
Checks equality for a and b