source: git/Tst/Manual/sort.tst @ 6fb723

spielwiese
Last change on this file since 6fb723 was 894057, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Tests from online manual (res+stat on mamawutz): short ones Tst/Manual/s.lst
  • Property mode set to 100644
File size: 926 bytes
Line 
1LIB "tst.lib"; tst_init();
2LIB "general.lib";
3ring r0 = 0,(x,y,z,t),lp;
4ideal i = x3,z3,xyz;
5sort(i);            //sorts using lex ordering, smaller polys come first
6sort(i,3..1);
7sort(i,"ls")[1];     //sort w.r.t. negative lex ordering
8intvec v =1,10..5,2..4;v;
9sort(v)[1];          // sort v lexicographically
10sort(v,"Dp",1)[1];   // sort v w.r.t (total sum, reverse lex)
11// Note that in general: lead(sort(M)) != sort(lead(M)), e.g:
12module M = [0, 1, 1, 0], [1, 0, 0, 1]; M;
13sort(lead(M), "c, dp")[1];
14lead(sort(M, "c, dp")[1]);
15// In order to sort M wrt a NEW ordering by considering OLD leading
16// terms use one of the following equivalent commands:
17module( M[ sort(lead(M), "c,dp")[2] ] );
18sort( M, sort(lead(M), "c,dp")[2] )[1];
19// BUG: Please, don't use this sort for integer vectors or lists
20// with them if there can be negative integers!
21// TODO: for some HiWi
22sort(3..-3)[1];
23sort(list(-v, v))[1];
24tst_status(1);$
Note: See TracBrowser for help on using the repository browser.