Changeset d4f44f in git
 Timestamp:
 Jul 15, 2009, 4:43:52 PM (14 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 0179d569cebe4081f964479a71818cd5d80626ee
 Parents:
 94aed9b17cc0b8aea93a2773b33dbebeeffffb02
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/general.lib
r94aed9 rd4f44f 3 3 //eric, added absValue 11.04.2002 4 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: general.lib,v 1.6 3 20090710 18:52:05motsak Exp $";5 version="$Id: general.lib,v 1.64 20090715 14:43:52 motsak Exp $"; 6 6 category="General purpose"; 7 7 info=" … … 744 744 entries of v must be pairwise distinct to get a permutation id. 745 745 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' 746 748 EXAMPLE: example sort; shows an example 747 749 " … … 765 767 if ( typeof(#[1])=="string" ) 766 768 { 767 if( typeof(id)=="matrix" )768 {769 module ID = lead(module(id));770 } else771 {772 def ID = lead(id);773 }774 769 execute("ring r1 =("+charstr(P)+"),("+varstr(P)+"),("+#[1]+");"); 775 def i = imap(P, ID);770 def i = imap(P,id); 776 771 v = sortvec(i); 777 772 setring P; … … 848 843 849 844 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]; 850 855 } 851 856 ///////////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.