Changeset fba6f18 in git
- Timestamp:
- May 5, 2011, 2:41:36 PM (12 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- ba23594edc15991ab3d4bd71e011e4139bb72c92
- Parents:
- ce3f53c9db13dc43a04d51988cc1a5ea929e0f6d
- git-author:
- Frank Seelisch <seelisch@mathematik.uni-kl.de>2011-05-05 14:41:36+02:00
- git-committer:
- Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:31:38+01:00
- Location:
- libpolys
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libpolys/coeffs/coeffs.h
rce3f53c rfba6f18 63 63 { 64 64 coeffs next; 65 unsigned int ringtype; /* 0 => coefficient field, 1 => coeffs from Z/2^m */ 65 unsigned int ringtype; /* =0 => coefficient field, 66 !=0 => coeffs from one of the rings */ 66 67 67 68 // general properties: … … 297 298 { assume(r != NULL); assume(r->cfInit!=NULL); return r->cfInit(i,r); } 298 299 300 /// conversion to int; 0 if not possible 301 static inline int n_Int(number n, const coeffs r) 302 { assume(r != NULL); assume(r->cfInt!=NULL); return r->cfInt(n,r); } 303 299 304 /// changes argument inline: a:= -a 300 305 static inline number n_Neg(number n, const coeffs r) … … 436 441 437 442 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r) 438 { assume(r != NULL); return (r->ringtype == 0) && (r->ch < -1); } 443 { 444 assume(r != NULL); 445 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1); 446 } 439 447 440 448 static inline BOOLEAN nCoeff_is_Zp_a(const coeffs r, int p) 441 { assume(r != NULL); return (r->ringtype == 0) && (r->ch < -1 ) && (-(r->ch) == ABS(p)); } 449 { 450 assume(r != NULL); 451 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch < -1 ) 452 && (-(r->ch) == ABS(p)); 453 } 442 454 443 455 static inline BOOLEAN nCoeff_is_Q_a(const coeffs r) 444 { assume(r != NULL); return (r->ringtype == 0) && (r->ch == 1); } 456 { 457 assume(r != NULL); 458 return (r->ringtype == 0) && (getCoeffType(r)==n_Ext) && (r->ch == 0); 459 } 445 460 446 461 static inline BOOLEAN nCoeff_is_long_R(const coeffs r) … … 485 500 486 501 // Missing wrappers for: 487 // cfIntMod, cf Int, cfRePart, cfImPart, cfRead, cfName, cfInit_bigint502 // cfIntMod, cfRePart, cfImPart, cfRead, cfName, cfInit_bigint 488 503 // HAVE_RINGS: cfDivComp, cfExtGcd... cfDivBy 489 504 -
libpolys/polys/Makefile.am
rce3f53c rfba6f18 38 38 kbuckets.cc sbuckets.cc weight.cc weight0.c simpleideals.cc matpol.cc \ 39 39 ${USE_P_PROCS_STATIC_CC} ${USE_P_PROCS_DYNAMIC_CC} templates/mod_raw.cc \ 40 clapsing.cc40 clapsing.cc ext_fields/algext.cc 41 41 42 42 BUILT_SOURCES = templates/p_Procs.inc … … 53 53 monomials/p_polys.h monomials/polys-impl.h monomials/maps.h polys.h prCopy.h prCopyMacros.h \ 54 54 kbuckets.h sbuckets.h simpleideals.h weight.h matpol.h \ 55 clapsing.h 55 clapsing.h ext_fields/algext.h 56 56 57 57 P_PROCS_CPPFLAGS_COMMON = -DHAVE_CONFIG_H -DDYNAMIC_VERSION -
libpolys/polys/simpleideals.cc
rce3f53c rfba6f18 25 25 #include "sbuckets.h" 26 26 27 omBin sip_sideal_bin ;27 omBin sip_sideal_bin = omGetSpecBin(sizeof(sip_sideal)); 28 28 29 29 static poly * idpower; -
libpolys/tests/polys_test.h
rce3f53c rfba6f18 15 15 #include <coeffs/rintegers.h> 16 16 17 17 #include <polys/ext_fields/algext.h> 18 18 #include <polys/monomials/ring.h> 19 19 #include <polys/monomials/p_polys.h> 20 20 21 22 21 #include <polys/simpleideals.h> 23 22 24 23 class MyGlobalPrintingFixture : public GlobalPrintingFixture … … 335 334 rDelete(r); // kills 'cf' as well! 336 335 } 337 336 337 void test_Q_Ext_a() 338 { 339 clog << "Start by creating Q[a]..." << endl; 340 341 char* n[] = {"a"}; 342 ring r = rDefault( 0, 1, n); // Q[a] 343 TS_ASSERT_DIFFERS( r, NULLp ); 344 345 PrintRing(r); 346 347 TS_ASSERT( rField_is_Domain(r) ); 348 TS_ASSERT( rField_is_Q(r) ); 349 350 TS_ASSERT( !rField_is_Zp(r) ); 351 TS_ASSERT( !rField_is_Zp(r, 11) ); 352 353 TS_ASSERT_EQUALS( rVar(r), 1); 354 355 poly minPoly = p_ISet(1, r); // minPoly = 1 356 p_SetExp(minPoly, 1, 2, r); p_Setm(minPoly, r); // minPoly = a^2 357 minPoly = p_Add_q(minPoly, p_ISet(1, r), r); // minPoly = a^2 + 1 358 ideal minIdeal = idInit(1); // minIdeal = < 0 > 359 minIdeal->m[0] = minPoly; // minIdeal = < a^2 + 1 > 360 361 n_coeffType type = nRegister(n_Ext, naInitChar); 362 TS_ASSERT(type == n_Ext); 363 364 ExtInfo extParam; 365 extParam.r = r; 366 extParam.i = minIdeal; 367 368 clog << "Next create the extension field Q[a]/<a2+1>..." << endl; 369 370 const coeffs cf = nInitChar(type, &extParam); // Q[a]/<a2+1> 371 372 TS_ASSERT_DIFFERS( cf->cfCoeffWrite, NULLp ); 373 374 if( cf->cfCoeffWrite != NULL ) 375 { 376 clog << "Coeff-domain: " << endl; 377 n_CoeffWrite(cf); PrintLn(); 378 } 379 380 clog << "Finally create the polynomial ring (Q[a]/<a2+1>)[x, y]..." 381 << endl; 382 383 char* m[] = {"x", "y"}; 384 ring s = rDefault(cf, 2, m); // (Q[a]/<a2+1>)[x, y] 385 TS_ASSERT_DIFFERS(s, NULLp); 386 387 PrintRing(s); 388 389 TS_ASSERT( rField_is_Domain(s) ); 390 TS_ASSERT( !rField_is_Q(s) ); 391 TS_ASSERT( !rField_is_Zp(s) ); 392 TS_ASSERT( !rField_is_Zp(s, 11) ); 393 TS_ASSERT( !rField_is_Zp(s, 13) ); 394 TS_ASSERT( !rField_is_GF(s) ); 395 TS_ASSERT( rField_is_Extension(s) ); 396 TS_ASSERT( !rField_is_GF(s, 25) ); 397 TS_ASSERT_EQUALS(rVar(s), 2); 398 399 //Test(s); 400 401 rDelete(s); // kills 'cf' and 'r' as well 402 } 338 403 }; 339 404
Note: See TracChangeset
for help on using the changeset viewer.