Changeset d4f44f in git


Ignore:
Timestamp:
Jul 15, 2009, 4:43:52 PM (14 years ago)
Author:
Motsak Oleksandr <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
Children:
0179d569cebe4081f964479a71818cd5d80626ee
Parents:
94aed9b17cc0b8aea93a2773b33dbebeeffffb02
Message:
the procedure sort is back to the original, description improvement & new example


git-svn-id: file:///usr/local/Singular/svn/trunk@11980 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/general.lib

    r94aed9 rd4f44f  
    33//eric, added absValue 11.04.2002
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: general.lib,v 1.63 2009-07-10 18:52:05 motsak Exp $";
     5version="$Id: general.lib,v 1.64 2009-07-15 14:43:52 motsak Exp $";
    66category="General purpose";
    77info="
     
    744744         entries of v must be pairwise distinct to get a permutation id.
    745745         Zero generators of ideal/module are deleted
     746         If 'o' is given, the input is sorted by considering leading terms
     747         w.r.t. the new ring ordering given by 'o'
    746748EXAMPLE: example sort; shows an example
    747749"
     
    765767      if ( typeof(#[1])=="string" )
    766768      {
    767          if( typeof(id)=="matrix" )
    768          {
    769            module ID = lead(module(id));
    770          } else
    771          {
    772            def ID = lead(id);
    773          }
    774769         execute("ring r1 =("+charstr(P)+"),("+varstr(P)+"),("+#[1]+");");
    775          def i = imap(P,ID);
     770         def i = imap(P,id);
    776771         v = sortvec(i);
    777772         setring P;
     
    848843
    849844   sort(v,"Dp",1)[1];   // sort v w.r.t (total sum, reverse lex)
     845
     846   // Note that in general: lead(sort(M)) != sort(lead(M)), e.g:
     847   module M = [0, 1, 1, 0], [1, 0, 0, 1]; M;
     848   sort(lead(M), "c, dp")[1];
     849   lead(sort(M, "c, dp")[1]); 
     850
     851   // In order to sort M wrt a NEW ordering by considering OLD leading
     852   // terms use one of the following equivalent commands:
     853   module( M[ sort(lead(M), "c,dp")[2] ] );
     854   sort( M, sort(lead(M), "c,dp")[2] )[1];
    850855}
    851856///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.