Class JAS::ParamIdeal
In: examples/jas.rb
Parent: Object

Represents a JAS polynomial ideal with polynomial coefficients.

Methods to compute comprehensive Groebner bases.

Methods

Public Class methods

Parametric ideal constructor.

[Source]

      # File examples/jas.rb, line 2298
2298:     def initialize(ring,polystr="",list=nil,gbsys=nil)
2299:         @ring = ring;
2300:         if list == nil and polystr != nil
2301:            sr = StringReader.new( polystr );
2302:            tok = GenPolynomialTokenizer.new(ring.ring,sr);
2303:            @list = tok.nextPolynomialList();
2304:         else
2305:            @list = rbarray2arraylist(list,rec=1);
2306:         end
2307:         @gbsys = gbsys;
2308:         @pset = OrderedPolynomialList.new(ring.ring,@list);
2309:     end

Public Instance methods

Compute a comprehensive Groebner base.

[Source]

      # File examples/jas.rb, line 2432
2432:     def CGB()
2433:         s = @pset;
2434:         ff = s.list;
2435:         t = System.currentTimeMillis();
2436:         if @gbsys == nil
2437:             @gbsys = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
2438:         end
2439:         gg = @gbsys.getCGB();
2440:         t = System.currentTimeMillis() - t;
2441:         puts "sequential comprehensive executed in #{t} ms\n"; 
2442:         return ParamIdeal.new(@ring,"",gg,@gbsys);
2443:     end

Compute a comprehensive Groebner system.

[Source]

      # File examples/jas.rb, line 2448
2448:     def CGBsystem()
2449:         s = @pset;
2450:         ff = s.list;
2451:         t = System.currentTimeMillis();
2452:         ss = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).GBsys(ff);
2453:         t = System.currentTimeMillis() - t;
2454:         puts "sequential comprehensive system executed in #{t} ms\n"; 
2455:         return ParamIdeal.new(@ring,nil,ff,ss);
2456:     end

Compute a Groebner base.

[Source]

      # File examples/jas.rb, line 2415
2415:     def GB()
2416:         ii = SimIdeal.new(@ring,"",@pset.list);
2417:         g = ii.GB();
2418:         return ParamIdeal.new(g.ring,"",g.pset.list);
2419:     end

Test if this is a comprehensive Groebner base.

[Source]

      # File examples/jas.rb, line 2461
2461:     def isCGB()
2462:         s = @pset;
2463:         ff = s.list;
2464:         t = System.currentTimeMillis();
2465:         b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGB(ff);
2466:         t = System.currentTimeMillis() - t;
2467:         puts "isCGB executed in #{t} ms\n"; 
2468:         return b;
2469:     end

Test if this is a comprehensive Groebner system.

[Source]

      # File examples/jas.rb, line 2474
2474:     def isCGBsystem()
2475:         s = @pset;
2476:         ss = @gbsys;
2477:         t = System.currentTimeMillis();
2478:         b = ComprehensiveGroebnerBaseSeq.new(@ring.ring.coFac).isGBsys(ss);
2479:         t = System.currentTimeMillis() - t;
2480:         puts "isCGBsystem executed in #{t} ms\n"; 
2481:         return b;
2482:     end

Test if this is a Groebner base.

[Source]

      # File examples/jas.rb, line 2424
2424:     def isGB()
2425:         ii = SimIdeal.new(@ring,"",@pset.list);
2426:         return ii.isGB();
2427:     end

Test if this is Groebner base over a regular ring.

[Source]

      # File examples/jas.rb, line 2526
2526:     def isRegularGB()
2527:         s = @pset;
2528:         ff = s.list;
2529:         t = System.currentTimeMillis();
2530:         b = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).isGB(ff);
2531:         t = System.currentTimeMillis() - t;
2532:         puts "isRegularGB executed in #{t} ms\n"; 
2533:         return b;
2534:     end

Optimize the term order on the variables of the coefficients.

[Source]

      # File examples/jas.rb, line 2326
2326:     def optimizeCoeff()
2327:         p = @pset;
2328:         o = TermOrderOptimization.optimizeTermOrderOnCoefficients(p);
2329:         r = Ring.new("",o.ring);
2330:         return ParamIdeal.new(r,"",o.list);
2331:     end

Optimize the term order on the variables of the quotient coefficients.

[Source]

      # File examples/jas.rb, line 2336
2336:     def optimizeCoeffQuot()
2337:         p = @pset;
2338:         l = p.list;
2339:         r = p.ring;
2340:         q = r.coFac;
2341:         c = q.ring;
2342:         rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
2343:         #puts "rc = ", rc;        
2344:         lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
2345:         #puts "lp = ", lp;
2346:         pp = PolynomialList.new(rc,lp);
2347:         #puts "pp = ", pp;        
2348:         oq = TermOrderOptimization.optimizeTermOrderOnCoefficients(pp);
2349:         oor = oq.ring;
2350:         qo = oor.coFac;
2351:         cq = QuotientRing.new( qo );
2352:         rq = GenPolynomialRing.new( cq, r.nvar, r.tord, r.vars );
2353:         #puts "rq = ", rq;        
2354:         o = PolyUfdUtil.quotientFromIntegralCoefficients(rq,oq.list);
2355:         r = Ring.new("",rq);
2356:         return ParamIdeal.new(r,"",o);
2357:     end

Compute a Groebner base over a regular ring.

[Source]

      # File examples/jas.rb, line 2513
2513:     def regularGB()
2514:         s = @pset;
2515:         ff = s.list;
2516:         t = System.currentTimeMillis();
2517:         gg = RGroebnerBasePseudoSeq.new(@ring.ring.coFac).GB(ff);
2518:         t = System.currentTimeMillis() - t;
2519:         puts "sequential regular GB executed in #{t} ms\n"; 
2520:         return ParamIdeal.new(@ring,nil,gg);
2521:     end

Convert Groebner system to a representation with regular ring coefficents.

[Source]

      # File examples/jas.rb, line 2487
2487:     def regularRepresentation()
2488:         if @gbsys == nil
2489:             return nil;
2490:         end
2491:         gg = PolyUtilApp.toProductRes(@gbsys.list);
2492:         ring = Ring.new(nil,gg[0].ring);
2493:         return ParamIdeal.new(ring,nil,gg);
2494:     end

Convert Groebner system to a boolean closed representation with regular ring coefficents.

[Source]

      # File examples/jas.rb, line 2499
2499:     def regularRepresentationBC()
2500:         if @gbsys == nil
2501:             return nil;
2502:         end
2503:         gg = PolyUtilApp.toProductRes(@gbsys.list);
2504:         ring = Ring.new(nil,gg[0].ring);
2505:         res = RReductionSeq.new();
2506:         gg = res.booleanClosure(gg);
2507:         return ParamIdeal.new(ring,nil,gg);
2508:     end

Get each component (slice) of regular ring coefficients separate.

[Source]

      # File examples/jas.rb, line 2539
2539:     def stringSlice()
2540:         s = @pset;
2541:         b = PolyUtilApp.productToString(s);
2542:         return b;
2543:     end

Convert rational function coefficients to integral function coefficients.

[Source]

      # File examples/jas.rb, line 2362
2362:     def toIntegralCoeff()
2363:         p = @pset;
2364:         l = p.list;
2365:         r = p.ring;
2366:         q = r.coFac;
2367:         c = q.ring;
2368:         rc = GenPolynomialRing.new( c, r.nvar, r.tord, r.vars );
2369:         #puts "rc = ", rc;        
2370:         lp = PolyUfdUtil.integralFromQuotientCoefficients(rc,l);
2371:         #puts "lp = ", lp;
2372:         r = Ring.new("",rc);
2373:         return ParamIdeal.new(r,"",lp);
2374:     end

Convert integral function coefficients to modular function coefficients.

[Source]

      # File examples/jas.rb, line 2379
2379:     def toModularCoeff(mf)
2380:         p = @pset;
2381:         l = p.list;
2382:         r = p.ring;
2383:         c = r.coFac;
2384:         #puts "c = ", c;
2385:         cm = GenPolynomialRing.new( mf, c.nvar, c.tord, c.vars );
2386:         #puts "cm = ", cm;
2387:         rm = GenPolynomialRing.new( cm, r.nvar, r.tord, r.vars );
2388:         #puts "rm = ", rm;
2389:         pm = PolyUfdUtil.fromIntegerCoefficients(rm,l);
2390:         r = Ring.new("",rm);
2391:         return ParamIdeal.new(r,"",pm);
2392:     end

Convert integral function coefficients to rational function coefficients.

[Source]

      # File examples/jas.rb, line 2397
2397:     def toQuotientCoeff()
2398:         p = @pset;
2399:         l = p.list;
2400:         r = p.ring;
2401:         c = r.coFac;
2402:         #puts "c = ", c;
2403:         q = QuotientRing.new(c);
2404:         #puts "q = ", q;
2405:         qm = GenPolynomialRing.new( q, r.nvar, r.tord, r.vars );
2406:         #puts "qm = ", qm;
2407:         pm = PolyUfdUtil.quotientFromIntegralCoefficients(qm,l);
2408:         r = Ring.new("",qm);
2409:         return ParamIdeal.new(r,"",pm);
2410:     end

Create a string representation.

[Source]

      # File examples/jas.rb, line 2314
2314:     def to_s()
2315:         if @gbsys == nil
2316:             return @pset.toScript();
2317:         else
2318: #            return @pset.toScript() + "\n" + @gbsys.toScript();
2319:             return @pset.toScript() + "\n" + @gbsys.to_s;
2320:         end
2321:     end

[Validate]