126{
127 int col, row;
129 col=0;
130 row=0;
136
137
139
141 {
143 {
145 pn--;
147 }
148
149 }
152 {
154
155 }
156 int last_area=-1;
158 {
160 assume(this_area>=last_area);
161 if(this_area>last_area)
162 {
164 for(
j=last_area+1;
j<=this_area;
j++)
166 last_area=this_area;
167 }
168 }
169 for(
i=last_area+1;
i<=max_area_index;
i++)
170 {
172 }
173 while(row<pn-1)
174 {
175
176
177
178
179
180
181
182 int max_in_area;
183 {
185 assume(tai<=max_area_index);
186 if(tai==max_area_index)
187 max_in_area=pn-1;
188 else
189 max_in_area=area[tai+1]-1;
190 }
192 col=row_cache[row];
193
195 int found_in_row;
196
197 found_in_row=row;
199 assume(pn<=mat->get_rows());
200 for(
i=row+1;
i<=max_in_area;
i++)
201 {
202 int first;
206 if(first<col)
207 {
208 col=first;
211 }
212 else
213 {
214 if(first==col)
216 }
217 }
218
220 if(must_reduce)
221 {
222 for(
i=found_in_row+1;
i<=max_in_area;
i++)
223 {
226#ifndef SING_NDEBUG
227 int first=row_cache[
i];
229#endif
230
231 int nz;
233 {
235 act_l=nz;
236 }
237
238 }
239 }
241 int h=row_cache[row];
242 row_cache[row]=row_cache[found_in_row];
243 row_cache[found_in_row]=
h;
244
245 if(!must_reduce)
246 {
247 row++;
248 continue;
249 }
250
251
253
254
255
256 for(
i=max_in_area;
i>row;
i--)
257 {
259 assume(col_area_index<=max_area_index);
262#ifndef SING_NDEBUG
263 int first=row_cache[
i];
265#endif
266 if(row_cache[
i]==col)
267 {
268
269 number c1=mat->
get(
i,col);
270 number c2=mat->
get(row,col);
271 number n1=c1;
272 number n2=c2;
273
275
284 if(row_cache[
i]==matcol)
285 {
288 int last_in_area;
289 int this_cai=col_area_index;
290 while(this_cai<max_area_index)
291 {
292 last_in_area=area[this_cai+1]-1;
293 int h_c=row_cache[last_in_area];
294 row_cache[last_in_area]=row_cache[
index];
295 row_cache[
index]=h_c;
298 this_cai++;
299 area[this_cai]--;
300 }
302 row_cache[
index]=row_cache[pn-1];
303 row_cache[pn-1]=matcol;
304 pn--;
305 }
306 else
307 {
310 int last_in_area;
311 int this_cai=col_area_index;
313 assume(final_cai<=max_area_index);
314 while(this_cai<final_cai)
315 {
316 last_in_area=area[this_cai+1]-1;
317 int h_c=row_cache[last_in_area];
318 row_cache[last_in_area]=row_cache[
index];
319 row_cache[
index]=h_c;
322 this_cai++;
323 area[this_cai]--;
324 }
325 }
326 }
327 else
329 }
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345#ifdef TGB_DEBUG
346 {
349 {
352 }
354 {
356 }
357 }
358#endif
359 row++;
360 }
363}
BOOLEAN is_zero_entry(int i, int j)
int min_col_not_zero_in_row(int row)
void add_lambda_times_row(int add_to, int summand, number factor)
BOOLEAN zero_row(int row)
void perm_rows(int i, int j)
int non_zero_entries(int row)
void mult_row(int row, number factor)
void row_content(int row)
int ksCheckCoeff(number *a, number *b, const coeffs r)
static int index(p_Length length, p_Ord ord)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static const int bundle_size