95{
96
97 int nonzero = -1;
98 for (
int i = 0; i <
M->n_rows(); ++i)
99 {
100 bool flag = false;
101 for (
int j = 0; j <
M->n_cols(); ++j)
102 {
103 if (!
R->is_zero(
M->elem(i, j)))
104 {
105 if (!flag)
106 {
107 flag = true;
110 }
112 }
113 }
114 }
116 for (
int minor_size = 1; minor_size <
p; ++minor_size)
117 {
118 for (
int top_row =
p - (minor_size + 1);
119 top_row <= n_nonzero_rows - minor_size;
120 ++top_row)
121 {
124 {
127 if (pp <= top_row)
128 {
129 continue;
130 }
132 {
133 for (const auto &[Didx, Dval] : map)
134 {
135
136 const std::vector<int> &Dcols = Didx.second;
137 int xcol =
x.first.second[0];
138 auto col_find =
139 std::find(Dcols.begin(), Dcols.end(), xcol);
140 if (col_find != Dcols.end())
141 {
142 continue;
143 }
144
146 newKey.first.insert(newKey.first.begin(),
148
149 auto xcol_position = std::upper_bound(
150 newKey.second.begin(), newKey.second.end(), xcol);
151 newKey.second.insert(xcol_position, xcol);
153 ((xcol_position - newKey.second.begin()) % 2 != 0);
154
155 auto search =
158 {
160 {newKey,
R->mult(
x.second, Dval)});
161 if (negate)
162 {
165 }
166 }
167 else
168 {
169 if (!negate)
170 {
173 R->mult(
x.second, Dval));
174 }
175 else
176 {
179 R->mult(
x.second, Dval));
180 }
181 }
182 }
183 }
184 }
185 }
186 }
188}
std::pair< std::vector< int >, std::vector< int > > ColRowIndices
MinorsCache dynamic_cache
std::map< int, int > row_lookup
bool system_interrupted()
mpreal & negate(mpreal &x)
TermIterator< Nterm > end(Nterm *)