Changeset 4094445 in git
- Timestamp:
- Mar 28, 2014, 4:35:48 PM (9 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 921690ebf8f0d44823a8ac66bed9ad966eda11ec
- Parents:
- 4fccbc56dabb217a3412ff62cddfe3dc88be1da623a78e8b3bf0711bab934f457ec78ae86fbd64d7
- Files:
-
- 4 added
- 19 edited
- 10 moved
Legend:
- Unmodified
- Added
- Removed
-
Singular/claptmpl.cc
r4fccbc r4094445 117 117 /* next lines are templates used in new minor code */ 118 118 #include <list> 119 #include <kernel/ Minor.h>119 #include <kernel/linear_algebra/Minor.h> 120 120 #include <kernel/Cache.h> 121 121 -
Singular/eigenval_ip.cc
r4fccbc r4094445 23 23 #include <polys/matpol.h> 24 24 #include <polys/clapsing.h> 25 #include <kernel/ eigenval.h>25 #include <kernel/linear_algebra/eigenval.h> 26 26 #include <Singular/eigenval_ip.h> 27 27 -
Singular/eigenval_ip.h
r4fccbc r4094445 9 9 #define EIGENVAL_IP_H 10 10 #ifdef HAVE_EIGENVAL 11 #include <kernel/ eigenval.h>11 #include <kernel/linear_algebra/eigenval.h> 12 12 13 13 BOOLEAN evSwap(leftv res,leftv h); -
Singular/extra.cc
r4fccbc r4094445 75 75 76 76 #include <kernel/shiftgb.h> 77 #include <kernel/linear Algebra.h>77 #include <kernel/linear_algebra/linearAlgebra.h> 78 78 79 79 #include <kernel/combinatorics/hutil.h> -
Singular/iparith.cc
r4fccbc r4094445 50 50 #include <kernel/tgb.h> 51 51 #include <kernel/groebner_walk/walkProc.h> 52 #include <kernel/linear Algebra.h>52 #include <kernel/linear_algebra/linearAlgebra.h> 53 53 #include <kernel/syz.h> 54 54 #include <kernel/timer.h> … … 69 69 #include <Singular/attrib.h> 70 70 #include <Singular/links/silink.h> 71 #include <kernel/ MinorInterface.h>71 #include <kernel/linear_algebra/MinorInterface.h> 72 72 #include <Singular/misc_ip.h> 73 73 #include <Singular/linearAlgebra_ip.h> … … 7501 7501 { 7502 7502 /* compute two factors of h(x,y) modulo x^(d+1) in K[[x]][y], 7503 see a detailed documentation in /kernel/linear Algebra.h7503 see a detailed documentation in /kernel/linear_algebra/linearAlgebra.h 7504 7504 7505 7505 valid argument lists: -
Singular/ipid.cc
r23a78e r4094445 605 605 const char * piProcinfo(procinfov pi, const char *request) 606 606 { 607 if( pi == NULL) return "empty proc";607 if((pi == NULL)||(pi->language==LANG_NONE)) return "empty proc"; 608 608 else if (strcmp(request, "libname") == 0) return pi->libname; 609 609 else if (strcmp(request, "procname") == 0) return pi->procname; -
Singular/linearAlgebra_ip.cc
r4fccbc r4094445 4 4 #include <kernel/mod2.h> 5 5 #include <Singular/lists.h> 6 #include <kernel/linear Algebra.h>6 #include <kernel/linear_algebra/linearAlgebra.h> 7 7 8 8 /** -
Singular/linearAlgebra_ip.h
r4fccbc r4094445 2 2 #define LINEARALGEBRA_H 3 3 #include <Singular/lists.h> 4 #include <kernel/linear Algebra.h>4 #include <kernel/linear_algebra/linearAlgebra.h> 5 5 6 6 /** -
Singular/test.cc
r4fccbc r4094445 88 88 #include <kernel/spectrum/splist.h> 89 89 #include <kernel/spectrum/multicnt.h> 90 #include <kernel/ eigenval.h>90 #include <kernel/linear_algebra/eigenval.h> 91 91 #include <kernel/units.h> 92 92 #include <kernel/ratgring.h> … … 99 99 // #include "CCRing.h" // Too old! 100 100 #include <kernel/digitech.h> 101 #include <kernel/ eigenval.h>101 #include <kernel/linear_algebra/eigenval.h> 102 102 #include <kernel/fast_maps.h> 103 103 #include <kernel/fast_mult.h> … … 130 130 #include <kernel/khstd.h> 131 131 132 #include <kernel/linear Algebra.h>132 #include <kernel/linear_algebra/linearAlgebra.h> 133 133 134 134 -
Tst/Short/ok_s.lst
r23a78e r4094445 76 76 bug_idlen 77 77 bug_interpol 78 bug_misc 78 79 bug_mres 79 80 bug_napMultT -
configure.ac
r4fccbc r4094445 206 206 AC_CONFIG_FILES([kernel/combinatorics/Makefile]) 207 207 AC_CONFIG_FILES([kernel/spectrum/Makefile]) 208 AC_CONFIG_FILES([kernel/linear_algebra/Makefile]) 208 209 209 210 AC_CONFIG_SUBDIRS([gfanlib]) -
kernel/Makefile.am
r4fccbc r4094445 2 2 # TODO: use ${top_srcdir} instead of .. in the above? 3 3 4 SUBDIRS=sample numeric fglm groebner_walk combinatorics spectrum 4 SUBDIRS=sample numeric fglm groebner_walk combinatorics spectrum linear_algebra 5 5 # kernelsample 6 6 … … 22 22 syz.cc syz0.cc syz1.cc syz2.cc syz3.cc \ 23 23 timer.cc \ 24 eigenval.ccunits.cc \24 units.cc \ 25 25 fast_mult.cc digitech.cc \ 26 26 tgb.cc tgbgauss.cc ringgb.cc f5data.cc f5lists.cc f5gb.cc f5c.cc \ 27 27 ratgring.cc shiftgb.cc \ 28 linearAlgebra.ccpreimage.cc \28 preimage.cc \ 29 29 mod2.h \ 30 janet.cc interpolation.cc minpoly.cc \ 31 Minor.cc MinorInterface.cc MinorProcessor.cc 30 janet.cc interpolation.cc minpoly.cc 32 31 33 34 32 libkernel_la_SOURCES = $(SOURCES) 35 33 … … 42 40 kutil.h \ 43 41 khstd.h kstd1.h \ 44 eigenval.hunits.h \42 units.h \ 45 43 ratgring.h shiftgb.h nc.h \ 46 44 preimage.h timer.h kInline.h fast_mult.h \ 47 45 digitech.h tgb.h ringgb.h tgbgauss.h tgb_internal.h \ 48 linearAlgebra.h \49 46 f5c.h f5data.h f5gb.h f5lists.h \ 50 47 janet.h interpolation.h minpoly.h \ 51 Minor.h MinorInterface.h MinorProcessor.hCache.h CacheImplementation.h48 Cache.h CacheImplementation.h 52 49 53 50 libkernel_la_includedir =${includedir}/singular/kernel … … 61 58 ${builddir}/combinatorics/libcombinatorics.la \ 62 59 ${builddir}/spectrum/libspectrum.la \ 60 ${builddir}/linear_algebra/liblinear_algebra.la \ 63 61 ${USEPPROCSDYNAMICLDFLAGS} ${USEPPROCSDYNAMICLD} \ 64 62 ${abs_top_builddir}/libpolys/polys/libpolys.la -
kernel/ideals.cc
r23a78e r4094445 2099 2099 ring orig_ring=currRing; 2100 2100 ring syz_ring=rAssure_SyzComp(orig_ring, TRUE); rChangeCurrRing(syz_ring); 2101 rSetSyzComp(length, syz_ring); 2101 if (TEST_OPT_RETURN_SB) 2102 rSetSyzComp(id_RankFreeModule(temp,orig_ring), syz_ring); 2103 else 2104 rSetSyzComp(length, syz_ring); 2102 2105 ideal s_temp; 2103 2106 -
kernel/linear_algebra/Minor.cc
r4fccbc r4094445 4 4 #include <kernel/mod2.h> 5 5 6 #include "Minor.h"6 #include <kernel/linear_algebra/Minor.h> 7 7 8 8 #include <kernel/structs.h> -
kernel/linear_algebra/MinorInterface.cc
r4fccbc r4094445 7 7 // #include <cstdio> 8 8 9 #include "MinorInterface.h"10 #include "MinorProcessor.h"9 #include <kernel/linear_algebra/MinorInterface.h> 10 #include <kernel/linear_algebra/MinorProcessor.h> 11 11 12 12 #include <polys/simpleideals.h> -
kernel/linear_algebra/MinorProcessor.cc
r4fccbc r4094445 4 4 #include <kernel/mod2.h> 5 5 6 #include "MinorProcessor.h"6 #include <kernel/linear_algebra/MinorProcessor.h> 7 7 8 8 #include <polys/kbuckets.h> -
kernel/linear_algebra/MinorProcessor.h
r4fccbc r4094445 2 2 #define MINOR_PROCESSOR_H 3 3 4 #include "Cache.h"4 #include <kernel/Cache.h> 5 5 #include "Minor.h" 6 6 -
kernel/linear_algebra/eigenval.cc
r4fccbc r4094445 23 23 #include <polys/matpol.h> 24 24 #include <polys/clapsing.h> 25 #include <kernel/ eigenval.h>25 #include <kernel/linear_algebra/eigenval.h> 26 26 27 27 -
kernel/linear_algebra/linearAlgebra.cc
r4fccbc r4094445 19 19 #include "singularconfig.h" 20 20 #endif /* HAVE_CONFIG_H */ 21 #include "mod2.h"21 #include <kernel/mod2.h> 22 22 23 23 #include <coeffs/coeffs.h> … … 33 33 #include <kernel/structs.h> 34 34 #include <kernel/ideals.h> 35 #include <kernel/linear Algebra.h>35 #include <kernel/linear_algebra/linearAlgebra.h> 36 36 37 37 /** -
kernel/numeric/mpr_inout.cc
r23a78e r4094445 56 56 #define TIMING_EPR(t,msg) TIMING_END_AND_PRINT(t,msg);TIMING_RESET(t); 57 57 58 extern size_t gmp_output_digits;59 58 //<- 60 59 -
kernel/numeric/mpr_numeric.cc
r23a78e r4094445 43 43 //#include "longrat.h" 44 44 45 #include "mpr_base.h" 45 46 #include "mpr_numeric.h" 46 47 47 48 #include <math.h> 48 49 extern size_t gmp_output_digits;50 49 //<- 51 50 -
kernel/test.cc
r4fccbc r4094445 93 93 #include <kernel/spectrum/splist.h> 94 94 #include <kernel/spectrum/multicnt.h> 95 #include <kernel/ eigenval.h>95 #include <kernel/linear_algebra/eigenval.h> 96 96 #include <kernel/units.h> 97 97 #include <kernel/ratgring.h> … … 103 103 // #include "CCRing.h" // Too old! 104 104 #include <kernel/digitech.h> 105 #include <kernel/ eigenval.h>105 #include <kernel/linear_algebra/eigenval.h> 106 106 #include <kernel/fast_maps.h> 107 107 #include <kernel/fast_mult.h> … … 130 130 #include <kernel/khstd.h> 131 131 132 #include <kernel/linear Algebra.h>132 #include <kernel/linear_algebra/linearAlgebra.h> 133 133 134 134 … … 170 170 #include <kernel/minpoly.h> 171 171 172 #include <kernel/ Minor.h>173 #include <kernel/ MinorInterface.h>174 #include <kernel/ MinorProcessor.h>172 #include <kernel/linear_algebra/Minor.h> 173 #include <kernel/linear_algebra/MinorInterface.h> 174 #include <kernel/linear_algebra/MinorProcessor.h> 175 175 #include <kernel/Cache.h> 176 176 #include <kernel/CacheImplementation.h> -
libpolys/coeffs/coeffs.h
r23a78e r4094445 124 124 // or NULL 125 125 // general stuff 126 // if the ring has a meaningful Euclidean structure, hopefully 127 // supported by cfQuotRem, then 128 // IntMod, IntDiv should give the same result 129 // IntDiv(a,b) = QuotRem(a,b, &IntMod(a,b)) 130 // if the ring is not Euclidean, then IntMod should return 0 131 // and IntDiv the exact quotient. It is assumed that the function is 132 // ONLY called on Euclidean rings or in the case of an exact division. 133 // 134 // cfDiv does an exact division, but has to handle illegal input 135 // cfExactDiv does an exact division, but no error checking 136 // (I'm not sure I understant and even less that this makes sense) 126 137 numberfunc cfMult, cfSub ,cfAdd ,cfDiv, cfIntDiv, cfIntMod, cfExactDiv; 127 138 … … 159 170 void (*cfWriteShort)(number &a, const coeffs r); 160 171 172 // it is legal, but not always useful to have cfRead(s, a, r) 173 // just return s again. 174 // Useful application (read constants which are not an projection 175 // from int/bigint: 176 // Let ring r = R,x,dp; 177 // where R is a coeffs having "special" "named" elements (ie. 178 // the primitive element in some algebraic extension). 179 // If there is no interpreter variable of the same name, it is 180 // difficult to create non-trivial elements in R. 181 // Hence one can use the string to allow creation of R-elts using the 182 // unbound name of the special element. 161 183 const char * (*cfRead)(const char * s, number * a, const coeffs r); 184 162 185 void (*cfNormalize)(number &a, const coeffs r); 163 164 165 186 166 187 BOOLEAN (*cfGreater)(number a,number b, const coeffs r), … … 170 191 (*cfIsOne)(number a, const coeffs r), 171 192 (*cfIsMOne)(number a, const coeffs r), 193 //GreaterZero is used for printing of polynomials: 194 // a "+" is only printed in front of a coefficient 195 // if the element is >0. It is assumed that any element 196 // failing this will start printing with a leading "-" 172 197 (*cfGreaterZero)(number a, const coeffs r); 173 198 … … 175 200 number (*cfGetDenom)(number &n, const coeffs r); 176 201 number (*cfGetNumerator)(number &n, const coeffs r); 202 //CF: a Euclidean ring is a commutative, unitary ring with an Euclidean 203 // function f s.th. for all a,b in R, b ne 0, we can find q, r s.th. 204 // a = qb+r and either r=0 or f(r) < f(b) 205 // Note that neither q nor r nor f(r) are unique. 177 206 number (*cfGcd)(number a, number b, const coeffs r); 178 207 number (*cfExtGcd)(number a, number b, number *s, number *t,const coeffs r); 208 //given a and b in a Euclidean setting, return s,t,u,v sth. 209 // sa + tb = gcd 210 // ua + vb = 0 211 // sv + tu = 1 212 // ie. the 2x2 matrix (s t | u v) is unimodular and maps (a,b) to (g, 0) 213 //CF: note, in general, this cannot be derived from ExtGcd due to 214 // zero divisors 215 number (*cfXExtGcd)(number a, number b, number *s, number *t, number *u, number *v, const coeffs r); 216 //in a Euclidean ring, return the Euclidean norm as a bigint (of type number) 217 number (*cfEucNorm)(number a, const coeffs r); 218 //in a principal ideal ring (with zero divisors): the annihilator 219 number (*cfAnn)(number a, const coeffs r); 220 //find a "canonical representative of a modulo the units of r 221 //return NULL if a is already normalized 222 //otherwise, the factor. 223 //(for Z: make positive, for z/nZ make the gcd with n 224 //aparently it is GetUnit! 225 //in a Euclidean ring, return the quotient and compute the remainder 226 //rem can be NULL 227 number (*cfQuotRem)(number a, number b, number *rem, const coeffs r); 179 228 number (*cfLcm)(number a, number b, const coeffs r); 180 229 void (*cfDelete)(number * a, const coeffs r); 230 231 //CF: tries to find a canonical map from src -> dst 181 232 nMapFunc (*cfSetMap)(const coeffs src, const coeffs dst); 182 233 … … 199 250 number (*cfInit_bigint)(number i, const coeffs dummy, const coeffs dst); 200 251 201 /// rational reconstruction: best rational with mod p=n 252 /// rational reconstruction: "best" rational a/b with a/b = p mod n 253 // or a = bp mod n 254 // CF: no idea what this would be in general 255 // it seems to be extended to operate coefficient wise in extensions. 256 // I presume then n in coeffs_BIGINT while p in coeffs 202 257 number (*cfFarey)(number p, number n, const coeffs); 203 258 204 259 /// chinese remainder 205 260 /// returns X with X mod q[i]=x[i], i=0..rl-1 261 //CF: by the looks of it: q[i] in Z (coeffs_BIGINT) 262 // strange things happen in naChineseRemainder for example. 206 263 number (*cfChineseRemainder)(number *x, number *q,int rl, BOOLEAN sym,const coeffs); 207 264 … … 218 275 nCoeffsEnumeratorFunc cfClearDenominators; 219 276 277 /// conversion to CanonicalForm(factory) to number 220 278 number (*convFactoryNSingN)( const CanonicalForm n, const coeffs r); 221 279 CanonicalForm (*convSingNFactoryN)( number n, BOOLEAN setChar, const coeffs r ); … … 224 282 /// the 0 as constant, NULL by default 225 283 number nNULL; 226 int char_flag;227 284 int ref; 228 285 /// how many variables of factort are already used by this coeff … … 294 351 BOOLEAN (*cfIsUnit)(number a,const coeffs r); 295 352 number (*cfGetUnit)(number a,const coeffs r); 353 //CF: test if b divides a 296 354 BOOLEAN (*cfDivBy)(number a, number b, const coeffs r); 297 355 /* The following members are for representing the ring Z/n, … … 319 377 unsigned long mod2mMask; 320 378 #endif 379 /*CF: for blackbox rings */ 380 void * data; 321 381 #ifdef LDEBUG 322 382 // must be last entry: … … 441 501 /// in Z/2^kZ: largest odd divisor of n (taken in Z) 442 502 /// other cases: not implemented 503 // CF: shold imply that n/GetUnit(n) is normalized in Z/kZ 504 // it would make more sense to return the inverse... 443 505 static inline number n_GetUnit(number n, const coeffs r) 444 506 { assume(r != NULL); assume(r->cfGetUnit!=NULL); return r->cfGetUnit(n,r); } … … 490 552 491 553 /// write to the output buffer of the currently used reporter 554 //CF: the "&" should be removed, as one wants to write constants as well 492 555 static inline void n_WriteLong(number& n, const coeffs r) 493 556 { assume(r != NULL); assume(r->cfWriteLong!=NULL); r->cfWriteLong(n,r); } … … 558 621 /// in K(t_1, ..., t_n): return a/b 559 622 /// other fields: not implemented 623 // CF: see above: should be part of euclidean structure. 624 // Needs to be implemented as pnBin relies on it. 625 // Probably should default to Div. 560 626 static inline number n_IntDiv(number a, number b, const coeffs r) 561 627 { assume(r != NULL); assume(r->cfIntDiv!=NULL); return r->cfIntDiv(a,b,r); } … … 584 650 static inline number n_ExtGcd(number a, number b, number *s, number *t, const coeffs r) 585 651 { assume(r != NULL); assume(r->cfExtGcd!=NULL); return r->cfExtGcd (a,b,s,t,r); } 652 static inline number n_XExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r) 653 { assume(r != NULL); assume(r->cfXExtGcd!=NULL); return r->cfXExtGcd (a,b,s,t,u,v,r); } 654 static inline number n_EucNorm(number a, const coeffs r) 655 { assume(r != NULL); assume(r->cfEucNorm!=NULL); return r->cfEucNorm (a,r); } 656 static inline number n_Ann(number a, const coeffs r) 657 { assume(r != NULL); assume(r->cfAnn!=NULL); return r->cfAnn (a,r); } 658 static inline number n_QuotRem(number a, number b, number *q, const coeffs r) 659 { assume(r != NULL); assume(r->cfQuotRem!=NULL); return r->cfQuotRem (a,b,q,r); } 660 586 661 587 662 /// in Z: return the lcm of 'a' and 'b' -
libpolys/coeffs/longrat.h
r23a78e r4094445 99 99 100 100 number nlInit2 (int i, int j, const coeffs r); 101 number nlInit2gmp (mpz_t i, mpz_t j );101 number nlInit2gmp (mpz_t i, mpz_t j, const coeffs r); 102 102 103 103 // number nlInitMPZ(mpz_t m, const coeffs r);
Note: See TracChangeset
for help on using the changeset viewer.