Changeset 7a8ca6 in git
- Timestamp:
- Feb 25, 2009, 7:51:26 PM (14 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 61944d0a0689203f1f85c43b1610be266ec31371
- Parents:
- 88542405b72b2e4e2770cdf6244a44221f9047a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/perron.lib
r8854240 r7a8ca6 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: perron.lib,v 1.1 1 2008-04-23 14:06:10 motsakExp $";2 version="$Id: perron.lib,v 1.12 2009-02-25 18:51:26 Singular Exp $"; 3 3 category="Noncommutative"; 4 4 info=" 5 5 LIBRARY: perron.lib computation of algebraic dependences 6 AUTHOR S: Oleksandr Motsak, {U@D}, where U={motsak}, D={mathematik.uni-kl.de}.6 AUTHOR: Oleksandr Motsak 7 7 8 8 PROCEDURES: … … 25 25 { 26 26 int N, D, i; 27 28 27 N = size(L); 29 30 28 if( N == 0 ) 31 { 32 ERROR( "Input ideal must be non-zero!" ); 33 } 34 29 { 30 ERROR( "Input ideal must be non-zero!" ); 31 } 35 32 intvec W; // weights 36 37 33 for ( i = N; i > 0; i-- ) 38 { 39 W[i] = deg(L[i]); 40 } 41 34 { 35 W[i] = deg(L[i]); 36 } 42 37 //////////////////////////////////////////////////////////////////////// 43 38 D = -1; 44 45 39 // Check whether the degree bound 'D' is given: 46 40 if( size(#)>0 ) 41 { 42 if ( typeof(#[1]) == typeof(D) ) 47 43 { 48 if ( typeof(#[1]) == typeof(D) ) 49 { 50 D = #[1]; 51 52 if( D <= 0 ) 53 { 54 ERROR( "An optional parameter D must be positive!" ); 55 } 56 } 44 D = #[1]; 45 if( D <= 0 ) 46 { 47 ERROR( "An optional parameter D must be positive!" ); 48 } 57 49 } 50 } 58 51 59 52 // , otherwise we try to estimate it according to Perron's Th: 60 53 if( D < 0 ) 54 { 55 D = 1; 56 int d; 57 int min = -1; 58 59 for ( i = size(L); i > 0 ; i-- ) 61 60 { 62 D = 1; 63 int d, min; 64 65 min = -1; 66 67 for ( i = size(L); i > 0 ; i-- ) 61 d = W[i]; 62 D = D * d; 63 if( min == -1) 64 { 65 min = d; 66 } 67 else 68 { 69 if( min > d ) 68 70 { 69 d = W[i]; 70 71 D = D * d; 72 if( min == -1) 73 { 74 min = d; 75 } else 76 { 77 if( min > d ) 78 { 79 min = d; 80 } 81 } 71 min = d; 82 72 } 83 84 if( (D == 0) or (min <= 0) ) 85 { 86 ERROR( "Wrong set of polynomials!" ); 87 } 88 89 D = D / min; 90 73 } 91 74 } 92 75 if( (D == 0) or (min <= 0) ) 76 { 77 ERROR( "Wrong set of polynomials!" ); 78 } 79 D = D / min; 80 } 93 81 //////////////////////////////////////////////////////////////////////// 94 95 82 def NCRING = basering; 96 97 83 def CurrentField = ringlist( NCRING )[1]; 98 99 // CurrentField;100 84 101 85 // We are going to construct a commutative ring in N variables F(i), … … 103 87 104 88 ring TEMPRING = 0, ( F(1..N) ), dp; 105 106 89 list RingList = ringlist( TEMPRING ); 107 108 90 setring NCRING; 109 110 91 111 92 if( !defined(RingList) ) … … 113 94 list RingList = imap( TEMPRING, RingList ); 114 95 } 115 116 117 96 RingList[1] = CurrentField; 118 119 // RingList;120 97 121 98 // New Commutative Ring with correct field! … … 147 124 148 125 if( (typeof(T) != "module") and (typeof(T) != "int" ) ) 126 { 127 ERROR( "Wrong output from function 'linearMapKernel'!" ); 128 } 129 130 if( typeof(T) == "int" ) 131 { 132 t = 1; 133 if( T != 0 ) 149 134 { 150 135 ERROR( "Wrong output from function 'linearMapKernel'!" ); 151 136 } 152 153 if( typeof(T) == "int" ) 154 { 155 t = 1; 156 if( T != 0 ) 157 { 158 ERROR( "Wrong output from function 'linearMapKernel'!" ); 159 } 160 } 137 } 161 138 162 139 //////////////////////////////////////////////////////////////////////// … … 168 145 169 146 if( t == 0 ) // T is a module 170 { 171 module KER = imap( NCRING, T ); 172 Relations = linearCombinations( PBWBasis, KER ); 173 174 } else 175 { // T == int(0) => all images are zero => 176 Relations = PBWBasis; 177 } 178 147 { 148 module KER = imap( NCRING, T ); 149 Relations = linearCombinations( PBWBasis, KER ); 150 } 151 else 152 { // T == int(0) => all images are zero => 153 Relations = PBWBasis; 154 } 179 155 180 156 ////////////////////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.