Top
Back: product
Forward: sum
FastBack: compregb_lib
FastForward: grobcov_lib
Up: general_lib
Top: Singular Manual
Contents: Table of Contents
Index: Index
About: About this document

D.2.3.14 sort

Procedure from library general.lib (see general_lib).

Usage:
sort(id[,v,o,n]); id = ideal/module/intvec/list
sort may be called with 1, 2 or 3 arguments in the following way:
sort(id[,v,n]); v=intvec of positive integers, n=integer,
sort(id[,o,n]); o=string (any allowed ordstr of a ring), n=integer

Return:
a list l of two elements:
 
        l[1]: object of same type as input but sorted in the following way:
           - if id=ideal/module: generators of id are sorted w.r.t. intvec v
             (id[v[1]] becomes 1-st, id[v[2]]  2-nd element, etc.). If no v is
             present, id is sorted w.r.t. ordering o (if o is given) or w.r.t.
             actual monomial ordering (if no o is given):
             NOTE: generators with SMALLER(!) leading term come FIRST
             (e.g. sort(id); sorts backwards to actual monomial ordering)
           - if id=list or intvec: sorted w.r.t. < (indep. of other arguments)
           - if n!=0 the ordering is inverse, i.e. w.r.t. v(size(v)..1)
             default: n=0
         l[2]: intvec, describing the permutation of the input (hence l[2]=v
             if v is given (with positive integers))

Note:
If v is given id may be any simply indexed object (e.g. any list or string); if v[i]<0 and i<=size(id) v[i] is set internally to i; entries of v must be pairwise distinct to get a permutation id. Zero generators of ideal/module are deleted
If 'o' is given, the input is sorted by considering leading terms w.r.t. the new ring ordering given by 'o'

Example:
 


Top Back: product Forward: sum FastBack: compregb_lib FastForward: grobcov_lib Up: general_lib Top: Singular Manual Contents: Table of Contents Index: Index About: About this document
            User manual for Singular version 3-1-6, Dec 2012, generated by texi2html.