├── .gitattributes ├── .gitignore ├── COPYING ├── COPYING.jas ├── COPYING.lgpl ├── COPYING.lgpl.jas ├── GBManifest.MF ├── Makefile ├── README ├── build.gradle ├── build.xml ├── buildfile ├── commons-math_adapter ├── .gitignore ├── Makefile ├── manifest.mf ├── overview.html └── src │ └── edu │ └── jas │ └── commons │ └── math │ ├── CMField.java │ ├── CMFieldElement.java │ ├── CMFieldElementTest.java │ ├── CMFieldElementUtil.java │ ├── GaussElimination.java │ ├── MatrixExamples.java │ └── Roots.java ├── doc ├── .gitignore ├── COPYING ├── COPYING.jas ├── COPYING.lgpl ├── COPYING.lgpl.jas ├── Dockerfile ├── TODO ├── acknowledge.html ├── algo-ca-book.html ├── contribute.html ├── design.html ├── download.html ├── faq.html ├── findbugs.html ├── gb-book.html ├── guide.html ├── html.css ├── index.html ├── jas-log.html ├── jas.1 ├── javancss-summary.txt ├── jdepend-report.txt ├── overview.html ├── packages.html ├── problems.html ├── publications.html └── related.html ├── examples ├── .gitignore ├── 0dim_primary-decomp.py ├── 0dim_primary-decomp.rb ├── 0dim_prime-decomp.py ├── 0dim_prime-decomp.rb ├── 0dim_radical.py ├── 0dim_radical.rb ├── 0dim_real_roots.py ├── 0dim_real_roots.rb ├── ChineseRemainder.py ├── ChineseRemainder.rb ├── RingElemTest.py ├── algNum.py ├── algNum.rb ├── alg_stat_1.py ├── alg_stat_1.rb ├── alg_stat_1p.py ├── alg_stat_1p.rb ├── alg_surface.py ├── alg_surface.rb ├── all_rings.py ├── all_rings.rb ├── arith.py ├── arith.rb ├── armbruster.py ├── armbruster.rb ├── ascm_demo.py ├── ascm_demo.rb ├── atan.py ├── atan.rb ├── basic_sigbased_gb.py ├── boolean_cgb.py ├── boolean_cgb.rb ├── boolean_gb.py ├── boolean_gb.rb ├── bueso_quantum.py ├── bueso_quantum.rb ├── cgb_0.py ├── cgb_0.rb ├── cgb_2.py ├── cgb_2.rb ├── cgb_3.py ├── cgb_3.rb ├── cgb_4.py ├── cgb_4.rb ├── cgbmmn15.py ├── cgbmmn15.rb ├── charset.py ├── charset.rb ├── chebyshev.py ├── chebyshev.rb ├── contFrac.py ├── contFrac.rb ├── cyclic.py ├── cyclic.rb ├── cyclic5.jas ├── cyclic5_complex_roots.py ├── cyclic5_complex_roots.rb ├── cyclic5_real_roots.py ├── cyclic5_real_roots.rb ├── cyclic6.jas ├── cyclic6_opt.py ├── cyclic7.jas ├── cyclic8.jas ├── cyclic9.jas ├── e-gb.py ├── e-gb.rb ├── eliminate.py ├── eliminate.rb ├── exterior.py ├── exterior.rb ├── exteriorPlanes.py ├── exteriorPlanes.rb ├── factors.py ├── factors.rb ├── factors_abs.py ├── factors_abs.rb ├── factors_abs_complex.py ├── factors_abs_complex.rb ├── factors_abs_mult.py ├── factors_abs_mult.rb ├── factors_algeb.py ├── factors_algeb.rb ├── factors_algeb_2.py ├── factors_algeb_2.rb ├── factors_algeb_trans.py ├── factors_algeb_trans.rb ├── factors_algeb_trans_algeb_charp.py ├── factors_algeb_trans_build.py ├── factors_algeb_trans_build.rb ├── factors_algeb_trans_charp.py ├── factors_algebp_trans_charp.py ├── factors_compl.py ├── factors_compl_algeb.py ├── factors_me.py ├── factors_mod.py ├── factors_mod.rb ├── factors_mod_abs.py ├── factors_mod_abs.rb ├── factors_mod_ins.py ├── factors_mod_ins.rb ├── factors_mult.py ├── factors_mult.rb ├── factors_poly.py ├── factors_poly.rb ├── factors_rat.py ├── factors_rat.rb ├── finitefield.py ├── finitefield.rb ├── freealg-C_417_X.py ├── freealg-C_417_X.rb ├── gbisc97.rb ├── gbks.jas ├── gbs.py ├── gbs.rb ├── gcd.py ├── gcd.rb ├── gens_define.rb ├── getstart-factor.py ├── getstart-factor.rb ├── getstart-gb.py ├── getstart-gb.rb ├── getstart.py ├── getstart.rb ├── hawes2.py ├── hawes2.rb ├── hawes2_c.py ├── hawes2_gens.py ├── hawes2_gens.rb ├── hawes2_gens_quot.py ├── hawes2_int.py ├── hawes2mod.py ├── hawes2modpars.py ├── hawes2modpars.rb ├── hawes2opt.py ├── hermite.py ├── hermite.rb ├── ideal_one.jas ├── ideal_zero.jas ├── igcd.py ├── igcd.rb ├── integrate.py ├── integrate.rb ├── integro-differential-tab1.rb ├── intersect.py ├── intersect.rb ├── intprog.py ├── intprog.rb ├── intprog2.py ├── intprog3.py ├── intprog4.py ├── intprog4a.py ├── jas.groovy ├── jas.py ├── jas.rb ├── katsura.py ├── katsura.rb ├── katsura10m.jas ├── katsura11m.jas ├── katsura12m.jas ├── katsura13m.jas ├── katsura14m.jas ├── katsura2.jas ├── katsura3.jas ├── katsura4.jas ├── katsura5.jas ├── katsura5s.jas ├── katsura5w.jas ├── katsura6.jas ├── katsura6w.jas ├── katsura7.jas ├── katsura7i.jas ├── katsura7m.jas ├── katsura8.jas ├── katsura8m.jas ├── katsura9m.jas ├── katsura_opt.py ├── kw_18.jas ├── legendre.py ├── legendre.rb ├── lewis.py ├── lie_field.rb ├── linalg.py ├── linalg.rb ├── logic.py ├── logic.rb ├── machines.localhost ├── machines.test ├── mark.py ├── mark.rb ├── mark_kr.py ├── mark_kr.rb ├── mkplot.py ├── mkplotold.py ├── mkplotold2.py ├── mmt.rb ├── module.py ├── module.rb ├── montes_ex111.py ├── montes_ex111.rb ├── montes_ex112.py ├── montes_ex112.rb ├── montes_ex113.py ├── montes_ex113.rb ├── montes_ex114.py ├── montes_ex114.rb ├── montes_ex51.py ├── montes_ex51.rb ├── montes_ex51s.py ├── montes_ex51s.rb ├── nabeshima_cgbF0.py ├── nabeshima_cgbF0.rb ├── nabeshima_cgbF00.py ├── nabeshima_cgbF00.rb ├── nabeshima_cgbF01.py ├── nabeshima_cgbF01.rb ├── nabeshima_cgbF1.py ├── nabeshima_cgbF1.rb ├── nabeshima_cgbF2.py ├── nabeshima_cgbF2.rb ├── nabeshima_cgbF3.py ├── nabeshima_cgbF3.rb ├── nabeshima_cgbF4.py ├── nabeshima_cgbF4.rb ├── nabeshima_cgbF5.py ├── nabeshima_cgbF5.rb ├── nabeshima_cgbF6.py ├── nabeshima_cgbF6.rb ├── nabeshima_cgbF7.py ├── nabeshima_cgbF7.rb ├── nabeshima_cgbF8.py ├── nabeshima_cgbF8.rb ├── ncmat.rb ├── ncmatj.py ├── ncmatj.rb ├── optimize.py ├── orderexam.py ├── orderexam.rb ├── ordermon.rb ├── ore_t.jas ├── perfAnaly.rb ├── polynomial.py ├── polynomial.rb ├── polypower.py ├── polypower.rb ├── powerseries.py ├── powerseries.rb ├── powerseries_multi.py ├── powerseries_multi.rb ├── pppj2006.py ├── pppj2006.rb ├── preimage.py ├── primary-decomp-charp.py ├── primary-decomp-charp.rb ├── primary-decomp.py ├── primary-decomp.rb ├── prime-decomp-charp.py ├── prime-decomp-charp.rb ├── prime-decomp-h.py ├── prime-decomp-h.rb ├── prime-decomp.py ├── prime-decomp.rb ├── prime-decomp_algeb_trans-plain.py ├── prime-decomp_algeb_trans-plain.rb ├── prime-decomp_algeb_trans.py ├── prime-decomp_algeb_trans.rb ├── primes.py ├── primes.rb ├── quantumplane_rgb.py ├── quantumplane_syz.py ├── radical-decomp.py ├── radical-decomp.rb ├── radical-decomp_charp.py ├── radical-decomp_charp.rb ├── radical-decomp_charp_ex816.py ├── radical-decomp_charp_ex816.rb ├── radical-decomp_charp_ex816_algeb.py ├── radical-decomp_charp_ex816_algeb.rb ├── radical-decomp_charp_infin.py ├── radical-decomp_charp_infin.rb ├── radical-decomp_charp_infin_0dim.py ├── radical-decomp_charp_infin_0dim.rb ├── raksanyi.py ├── raksanyi.rb ├── raksanyi_c.py ├── raksanyi_c.rb ├── raksanyi_cr.py ├── raksanyi_cr.rb ├── raksanyi_int.py ├── raksanyi_int.rb ├── real_roots_ideal.py ├── real_roots_ideal.rb ├── roots_complex.py ├── roots_complex.rb ├── roots_complex_ideal.py ├── roots_complex_ideal.rb ├── roots_rat.py ├── roots_rat.rb ├── roots_real_ideal.py ├── roots_real_ideal.rb ├── roots_real_tower.py ├── roots_real_tower.rb ├── roots_simplify.py ├── roots_simplify.rb ├── rose.jas ├── rose.py ├── rose.rb ├── rose_fac.py ├── rose_fac.rb ├── rose_modular.py ├── rose_part.py ├── sd.ini ├── sdexam.py ├── sdexam.rb ├── sdjas.py ├── sdjas.rb ├── series_poly.rb ├── sgb.jas ├── sicora.py ├── sicora.rb ├── solv_cgb_0.py ├── solv_cgb_0.rb ├── solv_cgb_nabeshima_1.py ├── solv_cgb_nabeshima_1.rb ├── solv_cgb_nabeshima_2.py ├── solv_cgb_nabeshima_2.rb ├── solv_hawes2.py ├── solv_hawes2.rb ├── solv_loca_ore_iter.py ├── solv_loca_ore_iter.rb ├── solv_locres_ore_iter.py ├── solv_locres_ore_iter.rb ├── solv_module_ts.py ├── solv_module_ts.rb ├── solv_ore.py ├── solv_ore.rb ├── solv_ore_iter.py ├── solv_ore_iter.rb ├── solv_ore_iter_gb.py ├── solv_ore_iter_gb.rb ├── solv_ore_iter_locres.rb ├── solv_ore_iter_syz.py ├── solv_ore_iter_syz.rb ├── solv_ore_syz.py ├── solv_ore_syz.rb ├── solv_quot_locres.rb ├── solv_resi_ore_iter.py ├── solv_resi_ore_iter.rb ├── solv_syz_mod.py ├── solvable.py ├── solvable.rb ├── solvablemodule.py ├── solvablemodule.rb ├── solvablepolynomial.py ├── solvablepolynomial.rb ├── solvmodright.py ├── solvmodright.rb ├── squarefree.py ├── squarefree.rb ├── squarefree_finite.py ├── squarefree_finite.rb ├── squarefree_finite_alg.py ├── squarefree_finite_alg.rb ├── squarefree_infinite.py ├── squarefree_infinite.rb ├── squarefree_poly.py ├── squarefree_poly.rb ├── staggered_linear_basis.py ├── std.py ├── std.rb ├── subring.py ├── subring.rb ├── suzukiSato_ex1.py ├── suzukiSato_ex1.rb ├── sys-bio.py ├── sys-bio.rb ├── sys-bio2.py ├── syz.py ├── syz.rb ├── syz_script.py ├── syz_script.rb ├── syzsolv.py ├── syzsolv.rb ├── syzy2.py ├── syzy2.rb ├── syzy3.py ├── syzy3.rb ├── testunit.py ├── trinks.groovy ├── trinks.py ├── trinks.rb ├── trinks6.jas ├── trinks7.jas ├── trinksTest.py ├── trinks_s.py ├── trinks_sigbased_gb.py ├── trinks_str.py ├── trinks_str.rb ├── trinks_sym.py ├── tuzun.py ├── tuzun.rb ├── u_2_wa_1.py ├── u_sl_2.py ├── u_sl_2.rb ├── u_sl_2_e.py ├── u_sl_2_e.rb ├── u_sl_2_f.py ├── u_sl_2_wa_1.py ├── u_sl_3.jas ├── u_sl_3.py ├── u_sl_3.rb ├── u_sl_3_prod.py ├── u_sl_3_prod.rb ├── u_so_3.py ├── vw.jas ├── wa_1.jas ├── wa_1.py ├── wa_1r.jas ├── wa_32.jas ├── wa_32.py ├── wa_32_syz.py ├── wa_34.jas ├── wa_39.jas ├── wa_41.jas ├── wa_61.jas ├── weyl_iter.py ├── weyl_iter.rb ├── weyl_sunwang_E.rb ├── weyl_sunwang_E1.rb ├── weyl_sunwang_E2.rb ├── weyl_sunwang_E3.rb ├── weyl_sunwang_E4.rb ├── weyl_sunwang_E5.rb ├── weyl_sunwang_E6.rb ├── weyl_sunwang_E7.rb ├── word_evans.py ├── word_evans.rb ├── word_exterior.py ├── word_exterior.rb ├── word_hawes2.py ├── word_hawes2.rb ├── word_residu_exterior.py ├── word_residu_exterior.rb ├── word_simple.py ├── word_simple.rb ├── word_solvable.py ├── word_solvable.rb ├── word_solvable_trans.py └── word_solvable_trans.rb ├── html.css ├── images ├── PackageOverview.png ├── device-2012-11-18-jas-examples-thumb.png ├── device-2012-11-18-jas-examples.png ├── device-2012-11-18-jas-trinks-out-big-part-thumb.png ├── device-2012-11-18-jas-trinks-out-big-part.png ├── device-2012-11-18-jas-trinks-out-big-thumb.png ├── device-2012-11-18-jas-trinks-out-big.png ├── device-2012-11-18-jas-trinks-out-thumb.png ├── device-2012-11-18-jas-trinks-out.png ├── device-2012-11-18-jas-trinks-thumb.png ├── device-2012-11-18-jas-trinks.png ├── eclipse-legendre.png ├── jas-pack-over.png ├── jas-poly-over.png ├── jas-py.desktop ├── jas-rb.desktop ├── jas.png ├── jas.xpm ├── mathlibre-jas-py-rb_deb.png ├── overview-methods.png ├── overview-recursive.png ├── poly-over.png └── poly-ring-over.png ├── index.html ├── intro.html ├── ivy.xml ├── ivysettings.xml ├── jas ├── jlinalg_adapter ├── .gitignore ├── Makefile ├── manifest.mf ├── overview.html └── src │ └── edu │ └── jas │ └── jlinalg │ ├── GaussElimination.java │ ├── JLAdapter.java │ ├── JLAdapterFactory.java │ ├── JLAdapterTest.java │ ├── JLAdapterUtil.java │ └── MatrixExamples.java ├── jruby_tests.sh ├── jython ├── .gitignore ├── Makefile ├── manifest.mf ├── overview.html ├── services │ └── javax.script.ScriptEngineFactory └── src │ └── edu │ └── jas │ ├── gb │ ├── GBSigBased.java │ └── GBSigBasedTest.java │ └── kern │ ├── PyScriptEngine.java │ ├── PyScriptEngineFactory.java │ └── ScriptingExample.java ├── jython_tests.sh ├── log4j2.properties ├── machines.localhost ├── meditor ├── .gitignore ├── Makefile ├── manifest.mf ├── meditor ├── services │ └── jscl.editor.EngineFactory └── src │ └── edu │ └── jas │ └── editorengine │ ├── EditorEngine.java │ └── EditorEngineFactory.java ├── mpi ├── .gitignore ├── Makefile ├── machines ├── manifest.mf ├── overview.html └── src │ └── edu │ └── jas │ ├── application │ └── RunMPIGB.java │ ├── gb │ ├── GroebnerBaseDistHybridMPITest.java │ ├── GroebnerBaseDistMPITest.java │ ├── GroebnerBaseDistributedHybridMPI.java │ └── GroebnerBaseDistributedMPI.java │ ├── kern │ ├── MPIEngine.java │ └── MPIEngineTest.java │ └── util │ ├── DistHashTableMPI.java │ ├── DistHashTableMPITest.java │ └── MPIChannel.java ├── mpj ├── .gitignore ├── Makefile ├── machines ├── manifest.mf ├── overview.html └── src │ └── edu │ └── jas │ ├── application │ └── RunMPJGB.java │ ├── gb │ ├── GroebnerBaseDistHybridMPJTest.java │ ├── GroebnerBaseDistMPJTest.java │ ├── GroebnerBaseDistributedHybridMPJ.java │ └── GroebnerBaseDistributedMPJ.java │ ├── kern │ ├── MPJEngine.java │ └── MPJEngineTest.java │ └── util │ ├── DistHashTableMPJ.java │ ├── DistHashTableMPJTest.java │ └── MPJChannel.java ├── navigate.html ├── pom.xml ├── sample.jythonrc ├── settings.gradle ├── spin ├── README ├── dgb.spin └── pgb.spin ├── src └── edu │ └── jas │ ├── application │ ├── AlgebraicRootsPrimElem.java │ ├── CPair.java │ ├── CReductionSeq.java │ ├── ColorPolynomial.java │ ├── ColoredSystem.java │ ├── ComprehensiveGroebnerBaseSeq.java │ ├── Condition.java │ ├── Dimension.java │ ├── Examples.java │ ├── ExamplesGeoTheorems.java │ ├── ExtensionFieldBuilder.java │ ├── FactorAlgebraicPrim.java │ ├── FactorFactory.java │ ├── FactorRealReal.java │ ├── GBAlgorithmBuilder.java │ ├── GroebnerSystem.java │ ├── Ideal.java │ ├── IdealWithComplexAlgebraicRoots.java │ ├── IdealWithComplexRoots.java │ ├── IdealWithRealAlgebraicRoots.java │ ├── IdealWithRealRoots.java │ ├── IdealWithUniv.java │ ├── IntegerProgram.java │ ├── IntegerProgramExamples.java │ ├── Local.java │ ├── LocalRing.java │ ├── LocalSolvablePolynomial.java │ ├── LocalSolvablePolynomialRing.java │ ├── OrderedCPairlist.java │ ├── PolyUtilApp.java │ ├── PrimaryComponent.java │ ├── PrimitiveElement.java │ ├── RealAlgebraicNumber.java │ ├── RealAlgebraicRing.java │ ├── Residue.java │ ├── ResidueRing.java │ ├── ResidueSolvablePolynomial.java │ ├── ResidueSolvablePolynomialRing.java │ ├── ResidueSolvableWordPolynomial.java │ ├── ResidueSolvableWordPolynomialRing.java │ ├── RingFactoryTokenizer.java │ ├── RootFactoryApp.java │ ├── RunGB.java │ ├── RunSGB.java │ ├── SolvableIdeal.java │ ├── SolvableLocal.java │ ├── SolvableLocalResidue.java │ ├── SolvableLocalResidueRing.java │ ├── SolvableLocalRing.java │ ├── SolvableResidue.java │ ├── SolvableResidueRing.java │ ├── WordIdeal.java │ ├── WordResidue.java │ ├── WordResidueRing.java │ └── package.html │ ├── arith │ ├── ArithUtil.java │ ├── BigComplex.java │ ├── BigDecimal.java │ ├── BigDecimalComplex.java │ ├── BigInteger.java │ ├── BigOctonion.java │ ├── BigQuaternion.java │ ├── BigQuaternionInteger.java │ ├── BigQuaternionRing.java │ ├── BigRational.java │ ├── Combinatoric.java │ ├── ModInt.java │ ├── ModIntRing.java │ ├── ModInteger.java │ ├── ModIntegerRing.java │ ├── ModLong.java │ ├── ModLongRing.java │ ├── Modular.java │ ├── ModularNotInvertibleException.java │ ├── ModularRingFactory.java │ ├── PrimeInteger.java │ ├── PrimeList.java │ ├── Product.java │ ├── ProductRing.java │ ├── Rational.java │ ├── Roots.java │ └── package.html │ ├── fd │ ├── FDUtil.java │ ├── GreatestCommonDivisor.java │ ├── GreatestCommonDivisorAbstract.java │ ├── GreatestCommonDivisorFake.java │ ├── GreatestCommonDivisorPrimitive.java │ ├── GreatestCommonDivisorSimple.java │ ├── GreatestCommonDivisorSyzygy.java │ ├── QuotSolvablePolynomial.java │ ├── QuotSolvablePolynomialRing.java │ ├── SGCDFactory.java │ ├── SGCDParallelProxy.java │ ├── SolvableQuotient.java │ ├── SolvableQuotientRing.java │ └── package.html │ ├── gb │ ├── AbstractPair.java │ ├── CriticalPair.java │ ├── CriticalPairComparator.java │ ├── CriticalPairList.java │ ├── Cyclic.java │ ├── DGroebnerBaseSeq.java │ ├── DReduction.java │ ├── DReductionSeq.java │ ├── EGroebnerBaseSeq.java │ ├── EReduction.java │ ├── EReductionSeq.java │ ├── ExtendedGB.java │ ├── GBDistSP.java │ ├── GBOptimized.java │ ├── GBProxy.java │ ├── GBTransportMess.java │ ├── GroebnerBase.java │ ├── GroebnerBaseAbstract.java │ ├── GroebnerBaseArriSigSeqIter.java │ ├── GroebnerBaseDistributedEC.java │ ├── GroebnerBaseDistributedHybridEC.java │ ├── GroebnerBaseF5zSigSeqIter.java │ ├── GroebnerBaseGGVSigSeqIter.java │ ├── GroebnerBaseParIter.java │ ├── GroebnerBaseParallel.java │ ├── GroebnerBaseSeq.java │ ├── GroebnerBaseSeqIter.java │ ├── GroebnerBaseSeqPairDistributed.java │ ├── GroebnerBaseSeqPairParallel.java │ ├── GroebnerBaseSeqPairSeq.java │ ├── GroebnerBaseSigSeqIter.java │ ├── Katsura.java │ ├── MiReducerServer.java │ ├── OrderedDPairlist.java │ ├── OrderedMinPairlist.java │ ├── OrderedPairlist.java │ ├── OrderedSyzPairlist.java │ ├── OrderedWordPairlist.java │ ├── Pair.java │ ├── PairList.java │ ├── Reduction.java │ ├── ReductionAbstract.java │ ├── ReductionPar.java │ ├── ReductionSeq.java │ ├── SGBProxy.java │ ├── SigPair.java │ ├── SigPoly.java │ ├── SigReduction.java │ ├── SigReductionSeq.java │ ├── SolvableExtendedGB.java │ ├── SolvableGroebnerBase.java │ ├── SolvableGroebnerBaseAbstract.java │ ├── SolvableGroebnerBaseParallel.java │ ├── SolvableGroebnerBaseSeq.java │ ├── SolvableGroebnerBaseSeqPairParallel.java │ ├── SolvableReduction.java │ ├── SolvableReductionAbstract.java │ ├── SolvableReductionPar.java │ ├── SolvableReductionSeq.java │ ├── WordGroebnerBase.java │ ├── WordGroebnerBaseAbstract.java │ ├── WordGroebnerBaseSeq.java │ ├── WordPair.java │ ├── WordPairList.java │ ├── WordReduction.java │ ├── WordReductionAbstract.java │ ├── WordReductionSeq.java │ └── package.html │ ├── gbmod │ ├── ModGroebnerBase.java │ ├── ModGroebnerBaseAbstract.java │ ├── ModGroebnerBasePar.java │ ├── ModGroebnerBaseSeq.java │ ├── ModSolvableGroebnerBase.java │ ├── ModSolvableGroebnerBaseAbstract.java │ ├── ModSolvableGroebnerBasePar.java │ ├── ModSolvableGroebnerBaseSeq.java │ └── package.html │ ├── gbufd │ ├── CharacteristicSet.java │ ├── CharacteristicSetSimple.java │ ├── CharacteristicSetWu.java │ ├── Examples.java │ ├── GBFactory.java │ ├── GroebnerBaseFGLM.java │ ├── GroebnerBaseFGLMExamples.java │ ├── GroebnerBasePartial.java │ ├── GroebnerBasePseudoParallel.java │ ├── GroebnerBasePseudoRecParallel.java │ ├── GroebnerBasePseudoRecSeq.java │ ├── GroebnerBasePseudoSeq.java │ ├── GroebnerBaseQuotient.java │ ├── GroebnerBaseRational.java │ ├── GroebnerBaseWalk.java │ ├── MultiplicativeSet.java │ ├── MultiplicativeSetCoPrime.java │ ├── MultiplicativeSetFactors.java │ ├── MultiplicativeSetSquarefree.java │ ├── OrderedRPairlist.java │ ├── PolyGBUtil.java │ ├── PolyModUtil.java │ ├── PseudoReduction.java │ ├── PseudoReductionEntry.java │ ├── PseudoReductionPar.java │ ├── PseudoReductionSeq.java │ ├── RGroebnerBasePseudoSeq.java │ ├── RGroebnerBaseSeq.java │ ├── RPseudoReduction.java │ ├── RPseudoReductionSeq.java │ ├── RReduction.java │ ├── RReductionSeq.java │ ├── SGBFactory.java │ ├── SolvableGroebnerBasePseudoRecSeq.java │ ├── SolvableGroebnerBasePseudoSeq.java │ ├── SolvablePseudoReduction.java │ ├── SolvablePseudoReductionSeq.java │ ├── SolvableSyzygy.java │ ├── SolvableSyzygyAbstract.java │ ├── SolvableSyzygySeq.java │ ├── Syzygy.java │ ├── SyzygyAbstract.java │ ├── SyzygySeq.java │ ├── WordGroebnerBasePseudoRecSeq.java │ ├── WordGroebnerBasePseudoSeq.java │ ├── WordPseudoReduction.java │ ├── WordPseudoReductionEntry.java │ ├── WordPseudoReductionSeq.java │ └── package.html │ ├── integrate │ ├── ElementaryIntegration.java │ ├── ElementaryIntegrationBernoulli.java │ ├── ElementaryIntegrationCzichowski.java │ ├── ElementaryIntegrationLazard.java │ ├── Examples.java │ ├── ExamplesMore.java │ ├── Integral.java │ ├── LogIntegral.java │ ├── QuotIntegral.java │ └── package.html │ ├── kern │ ├── ComputerThreads.java │ ├── JASConfig.java │ ├── LocalTimeStatus.java │ ├── PreemptStatus.java │ ├── PreemptingException.java │ ├── PrettyPrint.java │ ├── Scripting.java │ ├── StringUtil.java │ ├── TimeExceededException.java │ ├── TimeStatus.java │ └── package.html │ ├── poly │ ├── AlgebraicNotInvertibleException.java │ ├── AlgebraicNumber.java │ ├── AlgebraicNumberRing.java │ ├── Complex.java │ ├── ComplexRing.java │ ├── Examples.java │ ├── ExpVector.java │ ├── ExpVectorByte.java │ ├── ExpVectorInteger.java │ ├── ExpVectorLong.java │ ├── ExpVectorPair.java │ ├── ExpVectorShort.java │ ├── GenExteriorPolynomial.java │ ├── GenExteriorPolynomialRing.java │ ├── GenPolynomial.java │ ├── GenPolynomialRing.java │ ├── GenPolynomialTokenizer.java │ ├── GenSolvablePolynomial.java │ ├── GenSolvablePolynomialRing.java │ ├── GenWordPolynomial.java │ ├── GenWordPolynomialRing.java │ ├── IndexFactory.java │ ├── IndexList.java │ ├── IndexListMonomial.java │ ├── IndexListPolyIterator.java │ ├── InvalidExpressionException.java │ ├── Local.java │ ├── LocalRing.java │ ├── ModuleList.java │ ├── Monomial.java │ ├── OptimizedModuleList.java │ ├── OptimizedPolynomialList.java │ ├── OrderedModuleList.java │ ├── OrderedPolynomialList.java │ ├── Overlap.java │ ├── OverlapList.java │ ├── PolyIterator.java │ ├── PolySpliterator.java │ ├── PolyUtil.java │ ├── Polynomial.java │ ├── PolynomialComparator.java │ ├── PolynomialList.java │ ├── PolynomialRing.java │ ├── QLRSolvablePolynomial.java │ ├── QLRSolvablePolynomialRing.java │ ├── Quotient.java │ ├── QuotientRing.java │ ├── RecSolvablePolynomial.java │ ├── RecSolvablePolynomialRing.java │ ├── RecSolvableWordPolynomial.java │ ├── RecSolvableWordPolynomialRing.java │ ├── RelationGenerator.java │ ├── RelationTable.java │ ├── Residue.java │ ├── ResidueRing.java │ ├── TableRelation.java │ ├── TermOrder.java │ ├── TermOrderByName.java │ ├── TermOrderOptimization.java │ ├── WeylRelations.java │ ├── WeylRelationsIterated.java │ ├── Word.java │ ├── WordFactory.java │ ├── WordMonomial.java │ ├── WordPolyIterator.java │ └── package.html │ ├── ps │ ├── Coefficients.java │ ├── Examples.java │ ├── ExamplesMulti.java │ ├── ExpVectorIterable.java │ ├── MultiVarCoefficients.java │ ├── MultiVarPowerSeries.java │ ├── MultiVarPowerSeriesMap.java │ ├── MultiVarPowerSeriesRing.java │ ├── OrderedPairlist.java │ ├── PSUtil.java │ ├── Pair.java │ ├── PolynomialTaylorFunction.java │ ├── ReductionSeq.java │ ├── StandardBaseSeq.java │ ├── TaylorFunction.java │ ├── TaylorFunctionAdapter.java │ ├── UnivPowerSeries.java │ ├── UnivPowerSeriesMap.java │ ├── UnivPowerSeriesRing.java │ └── package.html │ ├── root │ ├── AlgebraicRoots.java │ ├── Boundary.java │ ├── ComplexAlgebraicNumber.java │ ├── ComplexAlgebraicRing.java │ ├── ComplexRoots.java │ ├── ComplexRootsAbstract.java │ ├── ComplexRootsSturm.java │ ├── DecimalRoots.java │ ├── Interval.java │ ├── InvalidBoundaryException.java │ ├── NoConvergenceException.java │ ├── PolyUtilRoot.java │ ├── RealAlgebraicNumber.java │ ├── RealAlgebraicRing.java │ ├── RealArithUtil.java │ ├── RealRootTuple.java │ ├── RealRoots.java │ ├── RealRootsAbstract.java │ ├── RealRootsSturm.java │ ├── Rectangle.java │ ├── RootFactory.java │ ├── RootUtil.java │ └── package.html │ ├── structure │ ├── AbelianGroupElem.java │ ├── AbelianGroupFactory.java │ ├── AlgebraElem.java │ ├── AlgebraFactory.java │ ├── BinaryFunctor.java │ ├── ElemFactory.java │ ├── Element.java │ ├── FieldElem.java │ ├── FieldFactory.java │ ├── GcdRingElem.java │ ├── ModulElem.java │ ├── ModulFactory.java │ ├── MonoidElem.java │ ├── MonoidFactory.java │ ├── NoncomRingElem.java │ ├── NotDivisibleException.java │ ├── NotInvertibleException.java │ ├── Power.java │ ├── QuotPair.java │ ├── QuotPairFactory.java │ ├── RegularRingElem.java │ ├── RingElem.java │ ├── RingFactory.java │ ├── Selector.java │ ├── StarRingElem.java │ ├── UnaryFunctor.java │ ├── Value.java │ ├── ValueFactory.java │ └── package.html │ ├── ufd │ ├── CycloUtil.java │ ├── EvalPoints.java │ ├── Examples.java │ ├── ExamplesPartialFraction.java │ ├── FactorAbsolute.java │ ├── FactorAbstract.java │ ├── FactorAlgebraic.java │ ├── FactorComplex.java │ ├── FactorFactory.java │ ├── FactorFraction.java │ ├── FactorInteger.java │ ├── FactorModular.java │ ├── FactorModularBerlekamp.java │ ├── FactorQuotient.java │ ├── FactorRational.java │ ├── Factorization.java │ ├── Factors.java │ ├── FactorsList.java │ ├── FactorsMap.java │ ├── GCDFactory.java │ ├── GCDProxy.java │ ├── GreatestCommonDivisor.java │ ├── GreatestCommonDivisorAbstract.java │ ├── GreatestCommonDivisorFake.java │ ├── GreatestCommonDivisorHensel.java │ ├── GreatestCommonDivisorModEval.java │ ├── GreatestCommonDivisorModular.java │ ├── GreatestCommonDivisorPrimitive.java │ ├── GreatestCommonDivisorSimple.java │ ├── GreatestCommonDivisorSubres.java │ ├── HenselApprox.java │ ├── HenselMultUtil.java │ ├── HenselUtil.java │ ├── NoLiftingException.java │ ├── PartialFraction.java │ ├── PolyUfdUtil.java │ ├── Quotient.java │ ├── QuotientRing.java │ ├── QuotientTaylorFunction.java │ ├── Squarefree.java │ ├── SquarefreeAbstract.java │ ├── SquarefreeFactory.java │ ├── SquarefreeFieldChar0.java │ ├── SquarefreeFieldChar0Yun.java │ ├── SquarefreeFieldCharP.java │ ├── SquarefreeFiniteFieldCharP.java │ ├── SquarefreeInfiniteAlgebraicFieldCharP.java │ ├── SquarefreeInfiniteFieldCharP.java │ ├── SquarefreeRingChar0.java │ └── package.html │ ├── ufdroot │ ├── FactorRealAlgebraic.java │ └── package.html │ ├── util │ ├── ArrayUtil.java │ ├── CartesianProduct.java │ ├── CartesianProductInfinite.java │ ├── CartesianProductLong.java │ ├── CatReader.java │ ├── ChannelFactory.java │ ├── DHTTransport.java │ ├── DistHashTable.java │ ├── DistHashTableServer.java │ ├── DistThreadPool.java │ ├── DistributedList.java │ ├── DistributedListServer.java │ ├── ExecutableChannels.java │ ├── ExecutableServer.java │ ├── KsubSet.java │ ├── ListUtil.java │ ├── LongIterable.java │ ├── MapEntry.java │ ├── PowerSet.java │ ├── RemoteExecutable.java │ ├── SocketChannel.java │ ├── StrategyEnumeration.java │ ├── TaggedSocketChannel.java │ ├── Terminator.java │ ├── ThreadPool.java │ ├── machines │ ├── machines.localhost │ └── package.html │ └── vector │ ├── BasicLinAlg.java │ ├── Examples.java │ ├── GenMatrix.java │ ├── GenMatrixRing.java │ ├── GenVector.java │ ├── GenVectorModul.java │ ├── LinAlg.java │ └── package.html └── trc └── edu └── jas ├── application ├── CGBSeqTest.java ├── ComplexRootTest.java ├── ExtensionFieldBuilderTest.java ├── FactorAlgebraicPrimTest.java ├── FactorRealRealTest.java ├── FactorTest.java ├── GBAlgorithmBuilderTest.java ├── HenselMultUtilTest.java ├── IdealTest.java ├── IntegerProgramTest.java ├── LocalResidueSolvablePolynomialQLRTest.java ├── LocalSolvablePolynomialQLRTest.java ├── LocalSolvablePolynomialTest.java ├── LocalTest.java ├── PolyUtilAppTest.java ├── QuotientSolvablePolynomialQLRTest.java ├── RealAlgebraicTest.java ├── ReductionTest.java ├── ResidueSolvablePolynomialQLRTest.java ├── ResidueSolvablePolynomialTest.java ├── ResidueSolvableWordPolynomialTest.java ├── ResidueTest.java ├── RingFactoryTokenizerTest.java ├── RunGBTest.java ├── RunSGBTest.java ├── SolvableIdealTest.java ├── SolvableLocalResidueTest.java ├── SolvableLocalTest.java ├── SolvableResidueTest.java ├── WordIdealTest.java └── WordResidueTest.java ├── arith ├── ArithTest.java ├── BigComplexTest.java ├── BigDecimalComplexTest.java ├── BigDecimalTest.java ├── BigIntegerTest.java ├── BigOctonionTest.java ├── BigQuaternionIntegerTest.java ├── BigQuaternionTest.java ├── BigRationalTest.java ├── ModIntTest.java ├── ModIntegerTest.java ├── ModLongTest.java ├── PowerTest.java ├── PrimeTest.java └── ProductTest.java ├── fd ├── FDUtilQuatTest.java ├── FDUtilTest.java ├── GCDFakeTest.java ├── GCDPrimitiveQuatTest.java ├── GCDPrimitiveTest.java ├── GCDSimpleQuatTest.java ├── GCDSimpleTest.java ├── GCDSyzygyTest.java ├── QuotSolvablePolynomialTest.java ├── SGCDFactoryTest.java ├── SGCDParallelProxyTest.java └── SolvableQuotientTest.java ├── gb ├── DGroebnerBaseSeqTest.java ├── EGroebnerBaseSeqTest.java ├── GBProxyTest.java ├── GroebnerBaseDistECTest.java ├── GroebnerBaseDistHybridECTest.java ├── GroebnerBaseParIterTest.java ├── GroebnerBaseParSyzPairTest.java ├── GroebnerBaseParTest.java ├── GroebnerBaseSeqIterTest.java ├── GroebnerBaseSeqPairDistTest.java ├── GroebnerBaseSeqPairParTest.java ├── GroebnerBaseSeqPairSeqTest.java ├── GroebnerBaseSeqTest.java ├── GroebnerBaseSigSeqIterTest.java ├── ModGroebnerBaseTest.java ├── ModSolvableGroebnerBaseTest.java ├── PairListTest.java ├── ReductionTest.java ├── SGBProxyTest.java ├── SolvableGroebnerBaseParTest.java ├── SolvableGroebnerBaseSeqPairParTest.java ├── SolvableGroebnerBaseSeqTest.java ├── SolvableQuatGroebnerBaseSeqTest.java ├── SolvableReductionTest.java ├── WordGroebnerBaseSeqTest.java └── WordReductionTest.java ├── gbufd ├── CharSetTest.java ├── GBFactoryTest.java ├── GroebnerBaseFGLMTest.java ├── GroebnerBasePartTest.java ├── GroebnerBasePseudoParTest.java ├── GroebnerBasePseudoRecParTest.java ├── GroebnerBasePseudoRecSeqTest.java ├── GroebnerBasePseudoSeqTest.java ├── GroebnerBaseQuotientTest.java ├── GroebnerBaseRationalTest.java ├── GroebnerBaseWalkTest.java ├── MultiplicativeSetTest.java ├── PolyGBUtilTest.java ├── RGroebnerBasePseudoSeqTest.java ├── RGroebnerBaseSeqTest.java ├── ReductionTest.java ├── SGBFactoryTest.java ├── SolvableGroebnerBasePseudoRecSeqTest.java ├── SolvableGroebnerBasePseudoSeqTest.java ├── SolvablePseudoReductionTest.java ├── SolvableSyzygyTest.java ├── SyzygyTest.java ├── WordGroebnerBasePseudoRecSeqTest.java ├── WordGroebnerBasePseudoSeqTest.java └── WordPseudoReductionTest.java ├── integrate ├── ElementaryIntegrationAbsoluteTest.java ├── ElementaryIntegrationCzichowskiTest.java ├── ElementaryIntegrationLazardTest.java └── ElementaryIntegrationTest.java ├── kern ├── KernUtilTest.java ├── LocalTimeStatusTest.java └── TimeStatusTest.java ├── poly ├── ANumGenPolynomialTest.java ├── AlgebraicNumberModTest.java ├── AlgebraicNumberTest.java ├── ComplexGenPolynomialTest.java ├── ComplexTest.java ├── DecGenPolynomialTest.java ├── ExpVectorTest.java ├── GFGenPolynomialTest.java ├── GaloisFieldTest.java ├── GenExteriorPolynomialTest.java ├── GenMatrixTest.java ├── GenPolynomialTest.java ├── GenPolynomialTokenizerTest.java ├── GenSolvablePolynomialTest.java ├── GenVectorTest.java ├── GenWordPolynomialTest.java ├── IndexListTest.java ├── IntGenPolynomialTest.java ├── LocalTest.java ├── ModGenPolynomialTest.java ├── ModGenSolvablePolynomialTest.java ├── ModuleListTest.java ├── PolyUtilTest.java ├── PolynomialListTest.java ├── QuatGenPolynomialTest.java ├── QuatGenSolvablePolynomialTest.java ├── QuotientTest.java ├── RatGenPolynomialTest.java ├── RatGenSolvablePolynomialTest.java ├── RatPolyGenPolynomialTest.java ├── RecSolvablePolynomialTest.java ├── RecSolvableWordPolynomialTest.java ├── RelationTableTest.java ├── ResidueTest.java ├── SolvableModuleListTest.java ├── TermOrderByNameCompatTest.java ├── TermOrderByNameTest.java ├── TermOrderOptimizationTest.java ├── TermOrderTest.java └── WordTest.java ├── ps ├── IteratorsTest.java ├── MultiVarPowerSeriesTest.java ├── STDMultiPSTest.java └── UnivPowerSeriesTest.java ├── root ├── ComplexAlgebraicTest.java ├── ComplexRootTest.java ├── RealAlgebraicTest.java ├── RealRootTest.java └── RootUtilTest.java ├── ufd ├── FactorAlgebraicTest.java ├── FactorComplexTest.java ├── FactorFractionTest.java ├── FactorGenericTest.java ├── FactorIntegerTest.java ├── FactorModularTest.java ├── FactorMoreTest.java ├── FactorQuotientTest.java ├── FactorRationalTest.java ├── FactorTest.java ├── GCDFactoryTest.java ├── GCDHenselTest.java ├── GCDModEvalTest.java ├── GCDModLongEvalTest.java ├── GCDModLongTest.java ├── GCDModularTest.java ├── GCDPartFracRatTest.java ├── GCDPrimitiveTest.java ├── GCDProxyTest.java ├── GCDSimpleTest.java ├── GCDSubresRatTest.java ├── GCDSubresTest.java ├── GCDTimingTest.java ├── GenMatrixFFTest.java ├── HenselMultUtilTest.java ├── HenselUtilTest.java ├── PolyUfdUtilTest.java ├── QuotIntPolynomialTest.java ├── QuotientIntTest.java ├── QuotientRatTest.java ├── SquarefreeAlgModTest.java ├── SquarefreeAlgQuotModTest.java ├── SquarefreeIntTest.java ├── SquarefreeModLongTest.java ├── SquarefreeModTest.java ├── SquarefreeQuotModTest.java ├── SquarefreeRatTest.java ├── SquarefreeTest.java └── UnivPowerSeriesTaylorTest.java ├── ufdroot └── FactorRealAlgebraicTest.java ├── util ├── DistHashTableTest.java ├── DistThreadPoolTest.java ├── DistributedListTest.java ├── ExecutableChannelsTest.java ├── ExecutableServerTest.java ├── IteratorsTest.java ├── ListUtilTest.java ├── PowerSetTest.java ├── SocketChannelTest.java ├── TaggedSocketChannelTest.java └── ThreadPoolTest.java └── vector ├── GenMatrixTest.java └── GenVectorTest.java /.gitattributes: -------------------------------------------------------------------------------- 1 | README ident 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /*.class 2 | /*.old 3 | /*.orig 4 | /*.jar 5 | /*.tar 6 | /*.gz 7 | /*.tgz 8 | /*.out 9 | /*.out* 10 | /*.jad 11 | /*.txt 12 | /*.log 13 | /edu 14 | /source 15 | /classes 16 | /DTD 17 | /application 18 | /arith 19 | /kern 20 | /module 21 | /poly 22 | /ring 23 | /structure 24 | /ufd 25 | /util 26 | /vector 27 | /test 28 | /temp 29 | /ps 30 | /NOTES* 31 | *~ 32 | all_jruby.sh 33 | all_jython.sh 34 | jython/classes/ 35 | jython/jsr.out 36 | doc/git_change.log 37 | .jython_cache/ 38 | versuch* 39 | jacoco.exec 40 | report/ 41 | -------------------------------------------------------------------------------- /GBManifest.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Class-Path: lib/log4j-core-2.17.1.jar lib/log4j-api-2.17.1.jar lib/junit-4.13.1.jar lib/hamcrest-core-1.3.jar 3 | Main-Class: edu.jas.application.RunGB 4 | Implementation-Vendor: JAS 5 | Implementation-Title: Java Algebra System 6 | Implementation-Version: 2.7 7 | Implementation-Vendor-Id: java-algebra-system 8 | -------------------------------------------------------------------------------- /commons-math_adapter/.gitignore: -------------------------------------------------------------------------------- 1 | /test 2 | /classes 3 | /*.jar 4 | /*.out 5 | /*.class 6 | -------------------------------------------------------------------------------- /commons-math_adapter/manifest.mf: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: 1.7.0_0 (IceTea) 3 | 4 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | /api 2 | /jython 3 | /jruby 4 | /jas-jython 5 | -------------------------------------------------------------------------------- /doc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM openjdk:11 2 | MAINTAINER Heinz Kredel kredel@rz.uni-mannheim.de 3 | RUN apt-get -y update && apt-get -y upgrade 4 | RUN apt-get -y install junit4 liblog4j2-java jython jruby wget vim-tiny 5 | RUN wget -c http://krum.rz.uni-mannheim.de/jas/@DEBVERSION@.@SVNREV@-all.deb 6 | RUN dpkg -i @DEBVERSION@.@SVNREV@-all.deb 7 | RUN useradd -m mathlibre 8 | ENTRYPOINT su - mathlibre -c /bin/bash 9 | -------------------------------------------------------------------------------- /doc/html.css: -------------------------------------------------------------------------------- 1 | 2 | body { background-color: #FFFFF5; 3 | margin-right: 1em; 4 | margin-left: 0.5em; 5 | } 6 | 7 | body.main { margin-top: 2.5em; 8 | } 9 | 10 | pre { background-color: silver; 11 | margin-left: 1em; 12 | margin-right: 1em; 13 | padding: 1em; 14 | } 15 | 16 | code { font-family: Courier, monospace; 17 | white-space: pre; 18 | /* font-size: larger; */ 19 | /* background: silver; */ 20 | } 21 | 22 | dt { font-weight: bolder; 23 | margin-top: 1em; 24 | } 25 | 26 | nav { line-height: 1.4em; 27 | } 28 | 29 | h1 { text-align: center; 30 | } 31 | 32 | .center { text-align: center; } 33 | 34 | .note { color: maroon; } 35 | -------------------------------------------------------------------------------- /examples/.gitignore: -------------------------------------------------------------------------------- 1 | /*.txt 2 | /*.out 3 | /*.class 4 | /edu 5 | -------------------------------------------------------------------------------- /examples/0dim_primary-decomp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing 9 | from jas import terminate 10 | from jas import startLog 11 | 12 | from jas import QQ 13 | 14 | # polynomial examples: zero dimensional ideals prime and primary decomposition 15 | 16 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 17 | 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | #is automatic: [one,x,y,z] = r.gens(); 22 | 23 | f1 = (x**2 - 5)**2; 24 | f2 = y**2 - 5; 25 | f3 = z**3 - y * x ; 26 | 27 | print "f1 = ", f1; 28 | print "f2 = ", f2; 29 | print "f3 = ", f3; 30 | print; 31 | 32 | F = r.ideal( list=[f1,f2,f3] ); 33 | 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | Q = F.primaryDecomp(); 41 | t = System.currentTimeMillis() - t; 42 | print "Q = ", Q; 43 | print; 44 | print "primary decomp time =", t, "milliseconds"; 45 | print; 46 | 47 | print "F = ", F; 48 | print; 49 | 50 | #startLog(); 51 | terminate(); 52 | -------------------------------------------------------------------------------- /examples/0dim_primary-decomp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: zero dimensional ideals prime and primary decomposition 9 | 10 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 11 | 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #is automatic: one,x,y,z = r.gens(); 16 | 17 | f1 = (x**2 - 5)**2; 18 | f2 = y**2 - 5; 19 | f3 = z**3 - y * x ; 20 | 21 | puts "f1 = " + str(f1); 22 | puts "f2 = " + str(f2); 23 | puts "f3 = " + str(f3); 24 | puts; 25 | 26 | F = r.ideal( "", [f1,f2,f3] ); 27 | 28 | puts "F = ", F; 29 | puts; 30 | 31 | startLog(); 32 | 33 | t = System.currentTimeMillis(); 34 | Q = F.primaryDecomp(); 35 | t = System.currentTimeMillis() - t; 36 | puts "Q = " + str(Q); 37 | puts; 38 | puts "primary decomp time = " + str(t) + " milliseconds"; 39 | puts; 40 | 41 | puts "F = " + str(F); 42 | puts; 43 | 44 | #startLog(); 45 | terminate(); 46 | -------------------------------------------------------------------------------- /examples/0dim_prime-decomp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing 9 | from jas import terminate 10 | from jas import startLog 11 | 12 | from jas import QQ 13 | 14 | # polynomial examples: zero dimensional ideals prime and primary decomposition 15 | 16 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 17 | 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | #is automatic: [one,x,y,z] = r.gens(); 22 | 23 | f1 = (x**2 - 5)**2; 24 | f2 = y**3 - x; 25 | f3 = z**2 - y * x; 26 | 27 | print "f1 = ", f1; 28 | print "f2 = ", f2; 29 | print "f3 = ", f3; 30 | print; 31 | 32 | F = r.ideal( list=[f1,f2,f3] ); 33 | 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | P = F.primeDecomp(); 41 | t1 = System.currentTimeMillis() - t; 42 | print "P = ", P; 43 | print; 44 | print "prime decomp time =", t1, "milliseconds"; 45 | print; 46 | 47 | print "F = ", F; 48 | print; 49 | 50 | #startLog(); 51 | terminate(); 52 | -------------------------------------------------------------------------------- /examples/0dim_prime-decomp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: zero dimensional ideals prime and primary decomposition 9 | 10 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 11 | 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #is automatic: one,x,y,z = r.gens(); 16 | 17 | f1 = (x**2 - 5)**2; 18 | f2 = y**3 - x; 19 | f3 = z**2 - y * x; 20 | 21 | puts "f1 = " + str(f1); 22 | puts "f2 = " + str(f2); 23 | puts "f3 = " + str(f3); 24 | puts; 25 | 26 | F = r.ideal( "", [f1,f2,f3] ); 27 | 28 | puts "F = " + str(F); 29 | puts; 30 | 31 | startLog(); 32 | 33 | t = System.currentTimeMillis(); 34 | P = F.primeDecomp(); 35 | t1 = System.currentTimeMillis() - t; 36 | puts "P = " + str(P); 37 | puts; 38 | puts "prime decomp time = " + str(t1) + " milliseconds"; 39 | puts; 40 | 41 | puts "F = " + str(F); 42 | puts; 43 | 44 | #startLog(); 45 | terminate(); 46 | -------------------------------------------------------------------------------- /examples/0dim_radical.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing 9 | from jas import terminate 10 | from jas import startLog 11 | 12 | from jas import QQ 13 | 14 | # polynomial examples: zero dimensional ideals radical decomposition 15 | 16 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 17 | 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | #is automatic: [one,x,y,z] = r.gens(); 22 | 23 | f1 = (x**2 - 5)**2; 24 | f2 = (y**2 - 3)**3 * (y**2 - 5); 25 | f3 = z**3 - x * y; 26 | 27 | print "f1 = ", f1; 28 | print "f2 = ", f2; 29 | print "f3 = ", f3; 30 | print; 31 | 32 | F = r.ideal( list=[f1,f2,f3] ); 33 | 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | R = F.radicalDecomp(); 41 | t = System.currentTimeMillis() - t; 42 | print "R = ", R; 43 | print; 44 | print "decomp time =", t, "milliseconds"; 45 | print; 46 | 47 | print "F = ", F; 48 | print; 49 | 50 | #startLog(); 51 | terminate(); 52 | -------------------------------------------------------------------------------- /examples/0dim_radical.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: zero dimensional ideals radical decomposition 9 | 10 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 11 | 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #is automatic: one,x,y,z = r.gens(); 16 | 17 | f1 = (x**2 - 5)**2; 18 | f2 = (y**2 - 3)**3 * (y**2 - 5); 19 | f3 = z**3 - x * y; 20 | 21 | puts "f1 = " + str(f1); 22 | puts "f2 = " + str(f2); 23 | puts "f3 = " + str(f3); 24 | puts; 25 | 26 | F = r.ideal( "", [f1,f2,f3] ); 27 | 28 | puts "F = " + str(F); 29 | puts; 30 | 31 | startLog(); 32 | 33 | t = System.currentTimeMillis(); 34 | R = F.radicalDecomp(); 35 | t = System.currentTimeMillis() - t; 36 | puts "R = " + str(R); 37 | puts; 38 | puts "decomp time = " + str(t) + " milliseconds"; 39 | puts; 40 | 41 | puts "F = " + str(F); 42 | puts; 43 | 44 | #startLog(); 45 | terminate(); 46 | -------------------------------------------------------------------------------- /examples/0dim_real_roots.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing 9 | from jas import terminate 10 | from jas import startLog 11 | 12 | from jas import QQ 13 | 14 | # polynomial examples: real roots over Q for zero dimensional ideals 15 | 16 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 17 | 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | #is automatic: [one,x,y,z] = r.gens(); 22 | 23 | f1 = (x**2 - 5)*(x**2 - 3)**2; 24 | f2 = y**2 - 3; 25 | f3 = z**3 - x * y; 26 | 27 | print "f1 = ", f1; 28 | print "f2 = ", f2; 29 | print "f3 = ", f3; 30 | print; 31 | 32 | F = r.ideal( list=[f1,f2,f3] ); 33 | 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | R = F.realRoots(); 41 | t = System.currentTimeMillis() - t; 42 | print "R = ", R; 43 | print; 44 | print "real roots = "; 45 | F.realRootsPrint() 46 | print "real roots time =", t, "milliseconds"; 47 | print; 48 | 49 | print "F = ", F; 50 | print; 51 | 52 | #startLog(); 53 | terminate(); 54 | -------------------------------------------------------------------------------- /examples/0dim_real_roots.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: real roots over Q for zero dimensional ideals 9 | 10 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 11 | 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #is automatic: one,x,y,z = r.gens(); 16 | 17 | f1 = (x**2 - 5)*(x**2 - 3)**2; 18 | f2 = y**2 - 3; 19 | f3 = z**3 - x * y; 20 | 21 | puts "f1 = " + str(f1); 22 | puts "f2 = " + str(f2); 23 | puts "f3 = " + str(f3); 24 | puts; 25 | 26 | F = r.ideal( "", [f1,f2,f3] ); 27 | 28 | puts "F = " + str(F); 29 | puts; 30 | 31 | startLog(); 32 | 33 | t = System.currentTimeMillis(); 34 | R = F.realRoots(); 35 | t = System.currentTimeMillis() - t; 36 | puts "R = " + str(R); 37 | puts; 38 | puts "real roots = "; 39 | F.realRootsPrint() 40 | puts; 41 | puts "real roots time = " + str(t) + " milliseconds"; 42 | puts; 43 | 44 | puts "F = " + str(F); 45 | puts; 46 | 47 | #startLog(); 48 | terminate(); 49 | -------------------------------------------------------------------------------- /examples/alg_surface.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys 7 | 8 | from java.lang import System 9 | from java.lang import Integer 10 | 11 | from jas import Ring 12 | from jas import PolyRing 13 | from jas import Ideal 14 | from jas import QQ, AN, RF, EF 15 | from jas import terminate 16 | from jas import startLog 17 | 18 | # polynomial examples: 19 | 20 | Yr = EF(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build(); 21 | #print "Yr = " + str(Yr); 22 | #print 23 | 24 | [one,x,y,z] = Yr.gens(); 25 | print "one = " + str(one); 26 | print "x = " + str(x); 27 | print "y = " + str(y); 28 | print "z = " + str(z); 29 | print; 30 | 31 | f = (1+z)*(1-z); # / ( x**2 + y**2 ); 32 | print "f = " + str(f); 33 | print; 34 | 35 | g = f / (1 - z); 36 | print "g = " + str(g); 37 | print; 38 | 39 | #startLog(); 40 | terminate(); 41 | -------------------------------------------------------------------------------- /examples/alg_surface.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: 9 | 10 | Yr = EF.new(QQ()).extend("x,y").extend("z","z^2 + x^2 + y^2 - 1").build(); 11 | #puts "Yr = " + str(Yr); 12 | #puts 13 | 14 | one,x,y,z = Yr.gens(); 15 | puts "one = " + str(one); 16 | puts "x = " + str(x); 17 | puts "y = " + str(y); 18 | puts "z = " + str(z); 19 | puts; 20 | 21 | f = (1+z)*(1-z); # / ( x**2 + y**2 ); 22 | puts "f = " + str(f); 23 | puts; 24 | 25 | g = one / (1 - z); 26 | puts "g = " + str(g); 27 | puts; 28 | 29 | g = f / (1 - z); 30 | puts "g = " + str(g); 31 | puts; 32 | 33 | #startLog(); 34 | terminate(); 35 | -------------------------------------------------------------------------------- /examples/armbruster.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | 4 | from jas import Module 5 | from jas import SubModule 6 | 7 | # Armbruster module example 8 | 9 | r = Module( "Rat(u,v,l) L" ); 10 | print "Module: " + str(r); 11 | print; 12 | 13 | 14 | ps = """ 15 | ( 16 | ( ( 1 ), ( 2 ), ( 0 ), ( l^2 ) ), 17 | ( ( 0 ), ( l + 3 v ), ( 0 ), ( u ) ), 18 | ( ( 1 ), ( 0 ), ( 0 ), ( l^2 ) ), 19 | ( ( l + v ), ( 0 ), ( 0 ), ( u ) ), 20 | ( ( l^2 ), ( 0 ), ( 0 ), ( v ) ), 21 | ( ( u ), ( 0 ), ( 0 ), ( v l + v^2 ) ), 22 | ( ( 1 ), ( 0 ), ( l + 3 v ), ( 0 ) ), 23 | ( ( l^2 ), ( 0 ), ( 2 u ), ( v ) ), 24 | ( ( 0 ), ( 1 ), ( l + v ), ( 0 ) ), 25 | ( ( 0 ), ( l^2 ), ( u ), ( 0 ) ), 26 | ( ( 0 ), ( v ), ( u l^2 ), ( 0 ) ), 27 | ( ( 0 ), ( v l + v^2 ), ( u^2 ), ( 0 ) ) 28 | ) 29 | """; 30 | 31 | f = SubModule( r, ps ); 32 | print "SubModule: " + str(f); 33 | print; 34 | 35 | rg = f.GB(); 36 | print "seq Output:", rg; 37 | print; 38 | 39 | print "isGB:", rg.isGB(); 40 | 41 | -------------------------------------------------------------------------------- /examples/atan.rb: -------------------------------------------------------------------------------- 1 | # jruby examples for jas. 2 | # $Id$ 3 | # 4 | 5 | require "examples/jas" 6 | 7 | # elementary integration atan examples 8 | 9 | r = PolyRing.new(QQ(),"x",PolyRing.lex); 10 | puts "r = " + str(r); 11 | rf = RF(r); 12 | puts "rf = " + str(rf.factory()); 13 | one,x = rf.gens(); 14 | puts "one = " + str(one); 15 | puts "x = " + str(x); 16 | puts; 17 | 18 | #f = 1 / ( 1 + x**2 ); 19 | #f = 1 / ( x**2 - 2 ); 20 | #f = 1 / ( x**3 - 2 ); 21 | #f = ( x + 3 ) / ( x**2- 3 * x - 40 ); 22 | 23 | f = ( x**7 - 24 * x**4 - 4 * x**2 + 8 * x - 8 ) / ( x**8 + 6 * x**6 + 12 * x**4 + 8 * x**2 ); 24 | 25 | puts "f = " + str(f); 26 | puts; 27 | 28 | #startLog(); 29 | 30 | t = System.currentTimeMillis(); 31 | e1 = r.integrate(f); 32 | t = System.currentTimeMillis() - t; 33 | puts "e1 = " + str(e1); 34 | puts "integration time = " + str(t) + " milliseconds"; 35 | puts 36 | 37 | t = System.currentTimeMillis(); 38 | e2 = f.integrate(); 39 | t = System.currentTimeMillis() - t; 40 | puts "e2 = " + str(e2); 41 | puts "integration time = " + str(t) + " milliseconds"; 42 | puts 43 | 44 | #startLog(); 45 | terminate(); 46 | -------------------------------------------------------------------------------- /examples/boolean_gb.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Boolean coefficient boolean GB 9 | # see S. Inoue and A. Nagai "On the Implementation of Boolean Groebner Bases" in ASCM 2009 10 | # Z_2 regular ring coefficent example 11 | 12 | 13 | r = PolyRing.new(RR(ZM(2),3),"x,y",PolyRing.lex); 14 | puts "r = " + str(r); 15 | #puts len(r.gens()) 16 | 17 | s1,s2,s3,x,y = r.gens(); 18 | one = r.one(); 19 | puts "one = " + str(one); 20 | puts "s1 = " + str(s1); 21 | puts "s2 = " + str(s2); 22 | puts "s2 = " + str(s3); 23 | puts "x = " + str(x); 24 | puts "y = " + str(y); 25 | 26 | brel = [ x**2 - x, y**2 - y ]; 27 | 28 | puts "brel = " + str(brel[0]) + ", " + str(brel[1]); 29 | 30 | pl = [ ( one + s1 + s2 ) * ( x*y + x + y ), s1 * x + s1, s2 * y + s2, x * y ]; 31 | #pl = [ ( one ) * ( x*y + x + y ), s1 * x + s1, s2 * y + s2, x * y ]; 32 | 33 | pl = pl + brel; 34 | 35 | 36 | startLog(); 37 | 38 | f = ParamIdeal.new(r,"",pl); 39 | puts "Ideal: " + str(f); 40 | 41 | gb = f.regularGB(); 42 | puts "boolean GB: " + str(gb); 43 | 44 | #ss = gb.stringSlice(); 45 | #puts "regular string slice: " + str(ss); 46 | 47 | terminate(); 48 | #sys.exit(); 49 | 50 | -------------------------------------------------------------------------------- /examples/cgb_0.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # simple example for comprehensive GB 9 | # integral/rational function coefficients 10 | 11 | #r = Ring( "IntFunc(u,v) (x,y) L" ); 12 | r = PolyRing.new( PolyRing.new(ZZ(),"(u,v)",PolyRing.lex),"(x,y)", PolyRing.lex ); 13 | puts "Ring: " + str(r); 14 | puts; 15 | 16 | ps = """ 17 | ( 18 | ( { v } x y + x ), 19 | ( { u } y^2 + x^2 ) 20 | ) 21 | """; 22 | 23 | p1 = v * x * y + x; 24 | p2 = u * y**2 + x**2; 25 | 26 | #f = r.paramideal( ps ); 27 | f = r.paramideal( "", [p1,p2] ); 28 | puts "ParamIdeal: " + str(f); 29 | puts; 30 | 31 | #sys.exit(); 32 | 33 | #startLog(); 34 | 35 | gs = f.CGBsystem(); 36 | puts "CGBsystem: " + str(gs); 37 | puts; 38 | 39 | #sys.exit(); 40 | 41 | #bg = gs.isCGBsystem(); 42 | #puts "isCGBsystem: " + str(bg); 43 | #puts; 44 | 45 | #sys.exit(); 46 | 47 | #startLog(); 48 | 49 | gs = f.CGB(); 50 | puts "CGB: " + str(gs); 51 | puts; 52 | 53 | #startLog(); 54 | 55 | #bg = gs.isCGB(); 56 | #puts "isCGB: " + str(bg); 57 | #puts; 58 | 59 | terminate(); 60 | #sys.exit(); 61 | 62 | -------------------------------------------------------------------------------- /examples/cgb_4.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # 2 univariate polynomials of degree 2 example for comprehensive GB 9 | # integral/rational function coefficients 10 | 11 | r = PolyRing.new( PolyRing.new(QQ(),"a",PolyRing.lex),"x,y,z", PolyRing.lex ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #puts "gens: " + str(r.gens()); 16 | 17 | f1 = ( x**2 + a * y**2 - x ); 18 | f2 = ( a * x**2 + y**2 - y ); 19 | f3 = ( x - y ) * z - 1; 20 | 21 | puts "f1 = " + str(f1); 22 | puts "f2 = " + str(f2); 23 | puts "f3 = " + str(f3); 24 | 25 | f = r.paramideal( "", list=[f1,f2,f3] ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | #sys.exit(); # long run time 30 | 31 | startLog(); 32 | 33 | gs = f.CGBsystem(); 34 | puts "CGBsystem: " + str(gs); 35 | puts; 36 | 37 | #sys.exit(); 38 | 39 | bg = gs.isCGBsystem(); 40 | puts "isCGBsystem: " + str(bg); 41 | puts; 42 | 43 | #sys.exit(); 44 | 45 | gs = f.CGB(); 46 | puts "CGB: " + str(gs); 47 | puts; 48 | 49 | #sys.exit(); 50 | 51 | #bg = gs.isCGB(); 52 | #puts "isCGB: " + str(bg); 53 | #puts; 54 | 55 | terminate(); 56 | 57 | -------------------------------------------------------------------------------- /examples/charset.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # characteristic set example Circle of Apollonius, from CLO IVA 9 | 10 | r = PolyRing.new( QQ(),"u1,u2,x1,x2,x3,x4,x5,x6,x7,x8",PolyRing.lex ); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #one,u1,u2,x1,x2,x3,x4,x5,x6,x7,x8 = r.gens(); 15 | #h3 = 2 * x3 - u3; typo 16 | #h4 = 2 * x4 - u4; 17 | 18 | h1 = 2 * x1 - u1; 19 | h2 = 2 * x2 - u2; 20 | h3 = 2 * x3 - u1; 21 | h4 = 2 * x4 - u2; 22 | h5 = u2 * x5 + u1 * x6 - u1 * u2; 23 | h6 = u1 * x5 - u2 * x6; 24 | h7 = x1**2 - x2**2 - 2 * x1 * x7 + 2 * x2 * x8; 25 | h8 = x1**2 - 2 * x1 * x7 - x3**2 + 2 * x3 * x7 - x4**2 + 2 * x4 * x8; 26 | 27 | g = ( ( x5 - x7 )**2 + ( x6 - x8 )**2 - ( x1 - x7 )**2 - x8**2 ); 28 | 29 | L = [h1,h2,h3,h4,h5,h6,h7,h8]; 30 | #print "L = ", str(L); 31 | 32 | f = r.ideal( "", L ); 33 | puts "Ideal: " + str(f); 34 | puts; 35 | 36 | startLog(); 37 | 38 | cc = f.CS(); 39 | puts "seq char set: " + str(cc); 40 | puts "is char set: " + str(cc.isCS()); 41 | puts; 42 | 43 | puts "g: " + str(g); 44 | puts; 45 | 46 | h = cc.csReduction(g); 47 | puts "h: " + str(h); 48 | puts; 49 | 50 | #sys.exit(); 51 | -------------------------------------------------------------------------------- /examples/chebyshev.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, ZZ 9 | from jas import startLog 10 | 11 | # chebyshev polynomial example 12 | # T(0) = 1 13 | # T(1) = x 14 | # T(n) = 2 * x * T(n-1) - T(n-2) 15 | 16 | #r = Ring( "Z(x) L" ); 17 | r = PolyRing(ZZ(), "(x)", PolyRing.lex ); 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | # sage like: with generators for the polynomial ring 22 | #is automatic: [one,x] = r.gens(); 23 | 24 | x2 = 2 * x; 25 | 26 | N = 10; 27 | T = [one,x]; 28 | for n in range(2,N+1): 29 | t = x2 * T[n-1] - T[n-2]; 30 | T.append( t ); 31 | 32 | for n in range(0,N+1): 33 | print "T[%s] = %s" % (n,T[n]); 34 | 35 | print; 36 | 37 | #sys.exit(); 38 | -------------------------------------------------------------------------------- /examples/chebyshev.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # chebyshev polynomial example 9 | # T(0) = 1 10 | # T(1) = x 11 | # T(n) = 2 * x * T(n-1) - T(n-2) 12 | 13 | #r = Ring.new( "Z(x) L" ); 14 | r = PolyRing.new( ZZ(), "(x)", PolyRing.lex ); 15 | puts "Ring: " + str(r); 16 | puts; 17 | 18 | # sage like: with generators for the polynomial ring 19 | #is automatic: one,x = r.gens(); 20 | 21 | x2 = 2 * x; 22 | 23 | N = 10; 24 | T = [one,x]; 25 | for n in 2..N 26 | t = x2 * T[n-1] - T[n-2]; 27 | T[n] = t; 28 | end 29 | 30 | for n in 0..N 31 | puts "T[#{n}] = #{T[n]}"; 32 | end 33 | 34 | puts; 35 | 36 | #sys.exit(); 37 | -------------------------------------------------------------------------------- /examples/contFrac.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # example for rational and real algebraic numbers 9 | # 10 | # 11 | 12 | # continued fractions: 13 | 14 | r = PolyRing.new(QQ(),"alpha",PolyRing.lex); 15 | puts "r = " + str(r); 16 | e,a = r.gens(); 17 | puts "e = " + str(e); 18 | puts "a = " + str(a); 19 | sqrt2 = a**2 - 2; 20 | puts "sqrt2 = " + str(sqrt2); 21 | Qs2r = RealN(sqrt2,[1,3/2],a-1); 22 | #Qs2r = RealN(sqrt2,[-2,-1],a+1); 23 | puts "Qs2r = " + str(Qs2r.factory()) + " :: " + str(Qs2r.elem); 24 | one,alpha = Qs2r.gens(); 25 | puts "one = " + str(one); 26 | puts "alpha = " + str(alpha); 27 | 28 | 29 | cf = Qs2r.contFrac(20); 30 | puts "cf = " + str(cf); 31 | nb = Qs2r.contFracApprox(cf); 32 | puts "nb = " + str(nb) + " ~= " + str(nb.elem.getDecimal()); 33 | 34 | cf = nb.contFrac(0); 35 | puts "cf = " + str(cf); 36 | nb = nb.contFracApprox(cf); 37 | puts "nb = " + str(nb) + " ~= " + str(nb.elem.getDecimal()); 38 | 39 | nb = nb.contFracApprox(nil); 40 | puts "nb = " + str(nb.signum == 0); 41 | 42 | terminate(); 43 | #sys.exit(); 44 | -------------------------------------------------------------------------------- /examples/cyclic5.jas: -------------------------------------------------------------------------------- 1 | #Cyclic equations for N = 5: 2 | Mod 32003 3 | (x0,x1,x2,x3,x4) G 4 | ( 5 | ( x4 + x3 + x2 + x1 + x0 ), 6 | ( x3 * x4 + x0 * x4 + x2 * x3 + x1 * x2 + x0 * x1 ), 7 | ( x2 * x3 * x4 + x0 * x3 * x4 + x0 * x1 * x4 + x1 * x2 * x3 + x0 * x1 * x2 ), 8 | ( x1 * x2 * x3 * x4 + x0 * x2 * x3 * x4 + x0 * x1 * x3 * x4 + x0 * x1 * x2 * x4 + x0 * x1 * x2 * x3 ), 9 | ( x0 * x1 * x2 * x3 * x4 - 1 ) 10 | ) 11 | -------------------------------------------------------------------------------- /examples/cyclic5_complex_roots.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: complex roots over Q for zero dimensional ideal `cyclic5' 9 | 10 | r = PolyRing.new(QQ(),"a,b,c,d,e",PolyRing.lex); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #one,q,w,s,x = r.gens(); 15 | 16 | f1 = a + b + c + d + e; 17 | f2 = a*b + b*c + c*d + d*e + e*a; 18 | f3 = a*b*c + b*c*d + c*d*e + d*e*a + e*a*b; 19 | f4 = a*b*c*d + b*c*d*e + c*d*e*a + d*e*a*b + e*a*b*c; 20 | f5 = a*b*c*d*e - 1; 21 | 22 | puts "f1 = " + str(f1); 23 | puts "f2 = " + str(f2); 24 | puts "f3 = " + str(f3); 25 | puts "f4 = " + str(f4); 26 | puts "f5 = " + str(f5); 27 | puts; 28 | 29 | F = r.ideal( "", list=[f1,f2,f3,f4,f5] ); 30 | puts "F = " + str(F); 31 | puts; 32 | 33 | startLog(); 34 | 35 | t = System.currentTimeMillis(); 36 | R = F.complexRoots(); 37 | #R = F.realRoots(); 38 | t = System.currentTimeMillis() - t; 39 | puts "complex decomposition = " + str(R); 40 | puts; 41 | puts "complex roots = "; 42 | F.complexRootsPrint() 43 | puts "complex roots time = " + str(t) + " milliseconds"; 44 | puts; 45 | 46 | puts "F = " + str(F); 47 | puts; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/cyclic5_real_roots.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: real roots over Q for zero dimensional ideal `cyclic5' 9 | 10 | r = PolyRing.new(QQ(),"a,b,c,d,e",PolyRing.lex); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #one,q,w,s,x = r.gens(); 15 | 16 | f1 = a + b + c + d + e; 17 | f2 = a*b + b*c + c*d + d*e + e*a; 18 | f3 = a*b*c + b*c*d + c*d*e + d*e*a + e*a*b; 19 | f4 = a*b*c*d + b*c*d*e + c*d*e*a + d*e*a*b + e*a*b*c; 20 | f5 = a*b*c*d*e - 1; 21 | 22 | puts "f1 = " + str(f1); 23 | puts "f2 = " + str(f2); 24 | puts "f3 = " + str(f3); 25 | puts "f4 = " + str(f4); 26 | puts "f5 = " + str(f5); 27 | puts; 28 | 29 | F = r.ideal( "", list=[f1,f2,f3,f4,f5] ); 30 | puts "F = " + str(F); 31 | puts; 32 | 33 | startLog(); 34 | 35 | t = System.currentTimeMillis(); 36 | R = F.realRoots(); 37 | t = System.currentTimeMillis() - t; 38 | puts "R = " + str(R); 39 | puts; 40 | puts "real roots = "; 41 | F.realRootsPrint() 42 | puts "real roots time = " + str(t) + " milliseconds"; 43 | puts; 44 | 45 | puts "F = " + str(F); 46 | puts; 47 | 48 | #startLog(); 49 | terminate(); 50 | -------------------------------------------------------------------------------- /examples/cyclic6.jas: -------------------------------------------------------------------------------- 1 | #Cyclic equations for N = 6: 2 | #Mod 32003 (x6,x5,x4,x3,x2,x1) G 3 | Mod 32003 (x1,x2,x3,x4,x5,x6) G 4 | #Z (x1,x2,x3,x4,x5,x6) G 5 | #Q (x1,x2,x3,x4,x5,x6) G 6 | ( 7 | x1 + x2 + x3 + x4 + x5 + x6, 8 | x1*x2 + x1*x6 + x2*x3 + x3*x4 + x4*x5 + x5*x6, 9 | x1*x2*x3 + x1*x2*x6 + x1*x5*x6 + x2*x3*x4 + x3*x4*x5 + x4*x5*x6, 10 | x1*x2*x3*x4 + x1*x2*x3*x6 + x1*x2*x5*x6 + x1*x4*x5*x6 + x2*x3*x4*x5 + x3*x4*x5*x6, 11 | x1*x2*x3*x4*x5 + x1*x2*x3*x4*x6 + x1*x2*x3*x5*x6 + x1*x2*x4*x5*x6 + x1*x3*x4*x5*x6 + x2*x3*x4*x5*x6, 12 | x1*x2*x3*x4*x5*x6 - 1 13 | ) 14 | -------------------------------------------------------------------------------- /examples/cyclic7.jas: -------------------------------------------------------------------------------- 1 | #Cyclic equations for N = 7: 2 | Mod 32003 (x7,x6,x5,x4,x3,x2,x1) G 3 | #Mod 536870909 (x7,x6,x5,x4,x3,x2,x1) G 4 | #Mod 9223372036854775783 (x7,x6,x5,x4,x3,x2,x1) G 5 | 6 | ( 7 | ( x7 + x6 + x5 + x4 + x3 + x2 + x1 ), 8 | ( x6 * x7 + x1 * x7 + x5 * x6 + x4 * x5 + x3 * x4 + x2 * x3 + x1 * x2 ), 9 | ( x5 * x6 * x7 + x1 * x6 * x7 + x1 * x2 * x7 + x4 * x5 * x6 + x3 * x4 * x5 + x2 * x3 * x4 + x1 * x2 * x3 ), 10 | ( x4 * x5 * x6 * x7 + x1 * x5 * x6 * x7 + x1 * x2 * x6 * x7 + x1 * x2 * x3 * x7 + x3 * x4 * x5 * x6 + x2 * x3 * x4 * x5 + x1 * x2 * x3 * x4 ), 11 | ( x3 * x4 * x5 * x6 * x7 + x1 * x4 * x5 * x6 * x7 + x1 * x2 * x5 * x6 * x7 + x1 * x2 * x3 * x6 * x7 + x1 * x2 * x3 * x4 * x7 + x2 * x3 * x4 * x5 * x6 + x1 * x2 * x3 * x4 * x5 ), 12 | ( x2 * x3 * x4 * x5 * x6 * x7 + x1 * x3 * x4 * x5 * x6 * x7 + x1 * x2 * x4 * x5 * x6 * x7 + x1 * x2 * x3 * x5 * x6 * x7 + x1 * x2 * x3 * x4 * x6 * x7 + x1 * x2 * x3 * x4 * x5 * x7 + x1 * x2 * x3 * x4 * x5 * x6 ), 13 | ( x1 * x2 * x3 * x4 * x5 * x6 * x7 - 1 ) 14 | ) 15 | -------------------------------------------------------------------------------- /examples/e-gb.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | #import sys; 7 | 8 | from jas import Ring, PolyRing 9 | from jas import ZZ 10 | from jas import startLog 11 | 12 | # e-gb and d-gb example to compare with hermit normal form 13 | 14 | r = PolyRing( ZZ(), "x4,x3,x2,x1", PolyRing.lex ); 15 | print "Ring: " + str(r); 16 | print; 17 | 18 | #is automatic: [one,x4,x3,x2,x1] = r.gens(); 19 | 20 | f1 = x1 + 2 * x2 + 3 * x3 + 4 * x4 + 3; 21 | f2 = 3 * x2 + 2 * x3 + x4 + 2; 22 | f3 = 3 * x3 + 5 * x4 + 1; 23 | f4 = 5 * x4 + 4; 24 | 25 | L = [f1,f2,f3,f4]; 26 | #print "L = ", str(L); 27 | 28 | f = r.ideal( list=L ); 29 | print "Ideal: " + str(f); 30 | print; 31 | 32 | #startLog(); 33 | 34 | g = f.eGB(); 35 | print "seq e-GB:", g; 36 | print "is e-GB:", g.iseGB(); 37 | print; 38 | 39 | #sys.exit(); 40 | 41 | d = f.dGB(); 42 | print "seq d-GB:", d; 43 | print "is d-GB:", d.isdGB(); 44 | print; 45 | 46 | #startLog(); 47 | 48 | print "d-GB == e-GB:", g.pset.equals(d.pset); 49 | -------------------------------------------------------------------------------- /examples/e-gb.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # e-gb and d-gb example to compare with hermit normal form 9 | 10 | r = PolyRing.new( ZZ(), "x4,x3,x2,x1", PolyRing.lex ); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #is automatic: one,x4,x3,x2,x1 = r.gens(); 15 | 16 | f1 = x1 + 2 * x2 + 3 * x3 + 4 * x4 + 3; 17 | f2 = 3 * x2 + 2 * x3 + x4 + 2; 18 | f3 = 3 * x3 + 5 * x4 + 1; 19 | f4 = 5 * x4 + 4; 20 | 21 | L = [f1,f2,f3,f4]; 22 | #puts "L = " + str(L); 23 | 24 | f = r.ideal( "", L ); 25 | puts "Ideal: " + str(f); 26 | puts; 27 | 28 | #startLog(); 29 | 30 | g = f.eGB(); 31 | puts "seq e-GB: " + str(g); 32 | puts "is e-GB: " + str(g.iseGB()); 33 | puts; 34 | 35 | #sys.exit(); 36 | 37 | d = f.dGB(); 38 | puts "seq d-GB: " + str(d); 39 | puts "is d-GB: " + str(d.isdGB()); 40 | puts; 41 | 42 | #startLog(); 43 | 44 | puts "d-GB == e-GB:" + str(g.pset.equals(d.pset)); 45 | -------------------------------------------------------------------------------- /examples/eliminate.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import QQ, PolyRing 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # ideal elimination example 14 | 15 | #r = Ring( "Rat(x,y,z) G" ); 16 | r = PolyRing( QQ(), "(x,y,z)", PolyRing.grad ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps1 = """ 21 | ( 22 | ( x^2 - 2 ), 23 | ( y^2 - 3 ), 24 | ( z^3 - x * y ) 25 | ) 26 | """; 27 | 28 | ff = [ x**2 - 2, 29 | y**2 - 3, 30 | z**3 - x * y 31 | ] 32 | 33 | #F1 = r.ideal( ps1 ); 34 | F1 = r.ideal( "", ff ); 35 | print "Ideal: " + str(F1); 36 | print; 37 | 38 | #e = Ring( "Rat(z) G" ); 39 | e = PolyRing( QQ(), "(x,z)", PolyRing.grad ); 40 | print "Ring: " + str(e); 41 | print; 42 | 43 | #startLog(); 44 | 45 | rg1 = F1.eliminateRing(e); 46 | print "rg1 = ", rg1; 47 | print; 48 | 49 | rg2 = rg1.intersectRing(e); 50 | print "rg2 = ", rg2; 51 | print; 52 | 53 | terminate(); 54 | #sys.exit(); 55 | -------------------------------------------------------------------------------- /examples/eliminate.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # ideal elimination example 9 | 10 | r = PolyRing.new( QQ(), "(x,y,z)", PolyRing.grad ); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | ps1 = """ 15 | ( 16 | ( x^2 - 2 ), 17 | ( y^2 - 3 ), 18 | ( z^3 - x * y ) 19 | ) 20 | """; 21 | 22 | ff = [ x**2 - 2, 23 | y**2 - 3, 24 | z**3 - x * y 25 | ] 26 | 27 | #F1 = r.ideal( ps1 ); 28 | F1 = r.ideal( "", ff ); 29 | puts "Ideal: " + str(F1); 30 | puts; 31 | 32 | e = PolyRing.new( QQ(), "(x,z)", PolyRing.grad ); 33 | puts "Ring: " + str(e); 34 | puts; 35 | 36 | #startLog(); 37 | 38 | rg1 = F1.eliminateRing(e); 39 | puts "rg1 = " + str(rg1); 40 | puts; 41 | 42 | rg2 = rg1.intersectRing(e); 43 | puts "rg2 = " + str(rg2); 44 | puts; 45 | 46 | terminate(); 47 | #sys.exit(); 48 | -------------------------------------------------------------------------------- /examples/factors_abs_mult.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import QQ, Ring, PolyRing 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: absolute factorization over Q 12 | 13 | #r = Ring( "Q(x,y) L" ); 14 | r = PolyRing( QQ(), "(x,y)", PolyRing.lex ); 15 | print "Ring: " + str(r); 16 | print; 17 | 18 | #is automatic: [one,x,y] = r.gens(); 19 | 20 | f1 = x**2 + y**2; 21 | f2 = x**3 + y**2; 22 | f3 = x**4 + 4; 23 | 24 | f = f1**3 * f2**1 * f3**2; 25 | 26 | print "f = ", f; 27 | print; 28 | 29 | startLog(); 30 | 31 | t = System.currentTimeMillis(); 32 | G = r.factorsAbsolute(f); 33 | t = System.currentTimeMillis() - t; 34 | print "G = ", G.toScript(); 35 | print 36 | print "factor time =", t, "milliseconds"; 37 | print 38 | 39 | #startLog(); 40 | terminate(); 41 | -------------------------------------------------------------------------------- /examples/factors_abs_mult.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: absolute factorization over Q 9 | 10 | #r = Ring.new( "Q(x,y) L" ); 11 | r = PolyRing.new( QQ(), "(x,y)", PolyRing.lex ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #is automatic: one,x,y = r.gens(); 16 | 17 | f1 = x**2 + y**2; 18 | f2 = x**3 + y**2; 19 | f3 = x**4 + 4; 20 | 21 | f = f1**3 * f2**1 * f3**2; 22 | 23 | puts "f = " + str(f); 24 | puts; 25 | 26 | startLog(); 27 | 28 | t = System.currentTimeMillis(); 29 | G = r.factorsAbsolute(f); 30 | t = System.currentTimeMillis() - t; 31 | puts "G = " + G.toScript(); 32 | puts 33 | puts "factor time = " + str(t) + " milliseconds"; 34 | puts 35 | 36 | #startLog(); 37 | terminate(); 38 | -------------------------------------------------------------------------------- /examples/factors_mod_abs.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing, ZM, GF, QQ 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: absolute factorization over Z_p 12 | 13 | #r = PolyRing(GF(19),"x",PolyRing.lex ); 14 | #r = PolyRing(GF(23),"x",PolyRing.lex ); 15 | r = PolyRing(GF(1152921504606846883),"(x)",PolyRing.lex); 16 | #r = PolyRing(GF(32003),"(x)",PolyRing.lex); 17 | #r = PolyRing(GF(65413),"(x)",PolyRing.lex); 18 | #r = PolyRing(GF(536870909),"(x)",PolyRing.lex); 19 | print "Ring: " + str(r); 20 | print; 21 | 22 | #[one,x] = r.gens(); 23 | 24 | 25 | #f = x**4 - 1; 26 | #f = x**3 + 1; 27 | f = x**3 - x - 1; 28 | 29 | 30 | print "f = ", f; 31 | print; 32 | 33 | startLog(); 34 | 35 | t = System.currentTimeMillis(); 36 | #G = r.squarefreeFactors(f); 37 | G = r.factorsAbsolute(f); 38 | t = System.currentTimeMillis() - t; 39 | print "G = ", G.toScript(); 40 | print "factor time =", t, "milliseconds"; 41 | 42 | #startLog(); 43 | terminate(); 44 | -------------------------------------------------------------------------------- /examples/factors_mod_abs.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: absolute factorization over Z_p 9 | 10 | #r = PolyRing.new( GF(19), "x", PolyRing.lex ); 11 | #r = PolyRing.new( GF(23), "x", PolyRing.lex ); 12 | r = PolyRing.new( GF(1152921504606846883), "x", PolyRing.lex ); 13 | #r = PolyRing.new(GF(32003),"(x)",PolyRing.lex); 14 | #r = PolyRing.new(GF(65413),"(x)",PolyRing.lex); 15 | #r = PolyRing.new(GF(536870909),"(x)",PolyRing.lex); 16 | puts "Ring: " + str(r); 17 | puts 18 | 19 | #one,x = r.gens(); 20 | 21 | 22 | #f = x**4 - 1; 23 | #f = x**3 + 1; 24 | f = x**3 - x - 1; 25 | 26 | 27 | puts "f = ", f; 28 | puts; 29 | 30 | startLog(); 31 | 32 | t = System.currentTimeMillis(); 33 | #G = r.squarefreeFactors(f); 34 | #G = r.factors(f); 35 | G = r.factorsAbsolute(f); 36 | t = System.currentTimeMillis() - t; 37 | puts "G = ", G.toScript(); 38 | puts "factor time = " + str(t) + " milliseconds"; 39 | 40 | #startLog(); 41 | terminate(); 42 | -------------------------------------------------------------------------------- /examples/gbisc97.rb: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | # 3 | # jruby examples for jas. 4 | # $Id$ 5 | # 6 | 7 | require "examples/jas" 8 | 9 | # GB examples, ISSAC system challenge 1997 10 | 11 | #r = PolyRing.new( QQ(), "w,z,y,x", PolyRing.grad ); 12 | r = PolyRing.new( ZZ(), "w,z,y,x", PolyRing.grad ); 13 | #r = PolyRing.new( ZZ(), "w,z,y,x", PolyRing.lex ); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | 18 | f1 = 8*w**2 + 5*w*x - 4*w*y + 2*w*z + 3*w + 5*x**2 + 2*x*y - 7*x*z - 7*x + 7*y**2 19 | - 8*y*z - 7*y + 7*z**2 - 8*z + 8; 20 | 21 | f2 = 3*w**2 - 5*w*x - 3*w*y - 6*w*z + 9*w + 4*x**2 + 2*x*y - 2*x*z + 7*x + 9*y**2 22 | + 6*y*z + 5*y + 7*z**2 + 7*z + 5; 23 | 24 | f3 = - 2*w**2 + 9*w*x + 9*w*y - 7*w*z - 4*w + 8*x**2 + 9*x*y - 3*x*z + 8*x 25 | + 6*y**2 - 7*y*z + 4*y - 6*z**2 + 8*z + 2; 26 | 27 | f4 = 7*w**2 + 5*w*x + 3*w*y - 5*w*z - 5*w + 2*x**2 + 9*x*y - 7*x*z + 4*x - 4*y**2 28 | - 5*y*z + 6*y - 4*z**2 - 9*z + 2; 29 | 30 | ff = [f1,f2,f3,f4]; 31 | 32 | f = r.ideal( "", ff ); 33 | puts "Ideal: " + str(f); 34 | puts; 35 | 36 | #startLog(); 37 | 38 | #exit(0) 39 | 40 | rg = f.GB(); 41 | puts "seq GB:", rg; 42 | puts; 43 | 44 | #terminate(); 45 | 46 | -------------------------------------------------------------------------------- /examples/gens_define.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | #load "examples/jas.rb" 7 | require "examples/jas" 8 | 9 | # test auto defined generators 10 | 11 | startLog(); 12 | 13 | r = PolyRing.new( CC(), "(b,s,t,z,p,w)", PolyRing.lex ); 14 | puts "Ring: " + r.to_s; 15 | puts; 16 | 17 | puts "1 = " + str(r.one); 18 | puts "I = " + str(r.I); 19 | puts "b = " + str(r.b); 20 | puts "s = " + str(r.s); 21 | puts "t = " + str(r.t); 22 | puts "z = " + str(r.z); 23 | puts "p = " + str(r.p); 24 | puts "w = " + str(r.w); 25 | puts; 26 | 27 | x = r.b * r.w + ( r.s - r.t + r.one )**2 + r.z**5; 28 | puts "x = " + str(x**2); 29 | puts 30 | -------------------------------------------------------------------------------- /examples/getstart-factor.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import operator 7 | from jas import PolyRing, QQ 8 | from jas import startLog, terminate 9 | 10 | # simple factorization example 11 | 12 | r = PolyRing( QQ(), "x,y,z", PolyRing.lex); # or PolyRing.grad 13 | print "PolyRing: " + str(r); 14 | print; 15 | 16 | p = (x+y+z)**11*(x+1)**5*(y+z)**3; 17 | #print "p: " + str(p); 18 | #print; 19 | 20 | #startLog(); 21 | f = r.factors( p ); 22 | print "factors: " + ", ".join( [ str(k) + "**" + str(v) for k,v in f.items() ] ); 23 | print; 24 | 25 | mp = reduce(operator.mul, [ k**v for k,v in f.items() ] ); 26 | #print str(mp); 27 | print "p == mp: " + str(p == mp); 28 | print; 29 | 30 | startLog(); 31 | terminate(); 32 | -------------------------------------------------------------------------------- /examples/getstart-factor.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # simple factorization example 9 | 10 | r = PolyRing.new( QQ(), "x,y,z", PolyRing.lex); # or PolyRing.grad 11 | puts "PolyRing: " + str(r); 12 | puts; 13 | 14 | p = (x+y+z)**11*(x+1)**5*(y+z)**3; 15 | #puts "p: " + p.to_s; 16 | #puts; 17 | 18 | f = r.factors( p ); 19 | puts "factors: " + f.map{ |k,v| k.to_s + "**" + v.to_s }.join(", "); 20 | puts; 21 | 22 | mp = f.map{ |k,v| k**v }.reduce(:*) 23 | puts "p == mp: " + (p==mp).to_s 24 | puts 25 | 26 | startLog() 27 | terminate() 28 | -------------------------------------------------------------------------------- /examples/getstart-gb.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import PolyRing, QQ 7 | from jas import startLog 8 | 9 | # trinks 7 example 10 | 11 | r = PolyRing( QQ(), "B,S,T,Z,P,W", PolyRing.lex); # or PolyRing.grad 12 | print "PolyRing: " + str(r); 13 | print; 14 | 15 | ff = [ 16 | 45 * P + 35 * S - 165 * B - 36, 17 | 35 * P + 40 * Z + 25 * T - 27 * S, 18 | 15 * W + 25 * S * P + 30 * Z - 18 * T - 165 * B**2, 19 | - 9 * W + 15 * T * P + 20 * S * Z, 20 | P * W + 2 * T * Z - 11 * B**3, 21 | 99 * W - 11 * B * S + 3 * B**2, 22 | B**2 + (33,50) * B + (2673,10000) 23 | ]; 24 | 25 | f = r.ideal( "", ff ); 26 | print "Ideal: " + str(f); 27 | print; 28 | 29 | #startLog(); 30 | g = f.GB(); 31 | print "Groebner base: " + str(g); 32 | print; 33 | -------------------------------------------------------------------------------- /examples/getstart-gb.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # trinks 7 example 9 | 10 | r = PolyRing.new( QQ(), "B,S,T,Z,P,W", PolyRing.lex); # or PolyRing.grad 11 | puts "PolyRing: " + r.to_s; 12 | puts; 13 | 14 | one,B,S,T,Z,P,W = r.gens(); # capital letter variables not automaticaly defined 15 | 16 | ff = [ 17 | 45 * P + 35 * S - 165 * B - 36, 18 | 35 * P + 40 * Z + 25 * T - 27 * S, 19 | 15 * W + 25 * S * P + 30 * Z - 18 * T - 165 * B**2, 20 | - 9 * W + 15 * T * P + 20 * S * Z, 21 | P * W + 2 * T * Z - 11 * B**3, 22 | 99 * W - 11 * B * S + 3 * B**2, 23 | B**2 + 33/50 * B + 2673/10000 24 | ]; 25 | 26 | f = r.ideal( "", ff ); 27 | puts "Ideal: " + f.to_s; 28 | puts; 29 | 30 | #startLog() 31 | g = f.GB(); 32 | puts "Groebner base: " + g.to_s; 33 | puts; 34 | -------------------------------------------------------------------------------- /examples/getstart.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import PolyRing, QQ 7 | from jas import startLog 8 | 9 | # trinks 7 example 10 | 11 | r = PolyRing( QQ(), "B,S,T,Z,P,W", PolyRing.lex); # or PolyRing.grad 12 | print "PolyRing: " + str(r); 13 | print; 14 | 15 | ps = """ 16 | ( 17 | ( 45 P + 35 S - 165 B - 36 ), 18 | ( 35 P + 40 Z + 25 T - 27 S ), 19 | ( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ), 20 | ( - 9 W + 15 T P + 20 S Z ), 21 | ( P W + 2 T Z - 11 B**3 ), 22 | ( 99 W - 11 B S + 3 B**2 ), 23 | ( B**2 + 33/50 B + 2673/10000 ) 24 | ) 25 | """; 26 | 27 | f = r.ideal( ps ); 28 | print "Ideal: " + str(f); 29 | print; 30 | 31 | startLog(); 32 | g = f.GB(); 33 | print "Groebner base:", g; 34 | print; 35 | -------------------------------------------------------------------------------- /examples/getstart.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # trinks 7 example 9 | 10 | r = PolyRing.new( QQ(), "B,S,T,Z,P,W", PolyRing.lex); # or PolyRing.grad 11 | puts "PolyRing: " + str(r); 12 | puts; 13 | 14 | ps = """ 15 | ( 16 | ( 45 P + 35 S - 165 B - 36 ), 17 | ( 35 P + 40 Z + 25 T - 27 S ), 18 | ( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ), 19 | ( - 9 W + 15 T P + 20 S Z ), 20 | ( P W + 2 T Z - 11 B**3 ), 21 | ( 99 W - 11 B S + 3 B**2 ), 22 | ( B**2 + 33/50 B + 2673/10000 ) 23 | ) 24 | """; 25 | 26 | f = r.ideal( ps ); 27 | puts "Ideal: " + str(f); 28 | puts; 29 | 30 | startLog() 31 | g = f.GB(); 32 | puts "Groebner base: " + str(g); 33 | puts; 34 | -------------------------------------------------------------------------------- /examples/hermite.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, ZZ 9 | from jas import startLog, terminate 10 | 11 | # hermite polynomial example 12 | # H(0) = 1 13 | # H(1) = 2 * x 14 | # H(n) = 2 * x * H(n-1) - 2 * (n-1) * H(n-2) 15 | 16 | r = PolyRing( ZZ(), "x", PolyRing.lex ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | # sage like: with generators for the polynomial ring 21 | #auto: [one,x] = r.gens(); 22 | 23 | x2 = 2 * x; 24 | 25 | N = 10; 26 | H = [one,x2]; 27 | for n in range(2,N+1): 28 | h = x2 * H[n-1] - 2 * (n-1) * H[n-2]; 29 | H.append( h ); 30 | 31 | for n in range(0,N+1): 32 | print "H[%s] = %s" % (n,H[n]); 33 | 34 | print; 35 | -------------------------------------------------------------------------------- /examples/hermite.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # hermite polynomial example 9 | # H(0) = 1 10 | # H(1) = 2 * x 11 | # H(n) = 2 * x * H(n-1) - 2 * (n-1) * H(n-2) 12 | 13 | r = PolyRing.new( ZZ(), "x", PolyRing.lex ); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | # sage like: with generators for the polynomial ring 18 | #auto: one,x = r.gens(); 19 | 20 | x2 = 2 * x; 21 | 22 | N = 10; 23 | H = [one,x2]; 24 | for n in 2..N 25 | h = x2 * H[n-1] - 2 * (n-1) * H[n-2]; 26 | H << h; 27 | end 28 | 29 | for n in 0..N 30 | puts "H[#{n}] = #{H[n]}"; 31 | end 32 | puts; 33 | -------------------------------------------------------------------------------- /examples/ideal_one.jas: -------------------------------------------------------------------------------- 1 | # one ideal 2 | 3 | (a,b,c) L 4 | ( 5 | ( 99 ) 6 | ) 7 | -------------------------------------------------------------------------------- /examples/ideal_zero.jas: -------------------------------------------------------------------------------- 1 | # zero ideal 2 | 3 | (a,b,c) L 4 | ( 5 | ( 0 ) 6 | ) 7 | -------------------------------------------------------------------------------- /examples/igcd.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import QQ, ZZ, GF, ZM 9 | from jas import terminate, startLog 10 | 11 | # integer examples: gcd 12 | 13 | r = ZZ(); 14 | #r = QQ(); 15 | # = GF(19); 16 | # = ZM(19*61); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | a = r.random(251); 21 | b = r.random(171); 22 | c = abs(r.random(211)); 23 | #c = 1; 24 | #a = 0; 25 | 26 | 27 | print "a = ", a; 28 | print "b = ", b; 29 | print "c = ", c; 30 | print; 31 | 32 | ac = a * c; 33 | bc = b * c; 34 | 35 | print "ac = ", ac; 36 | print "bc = ", bc; 37 | print; 38 | 39 | t = System.currentTimeMillis(); 40 | d = ac.gcd(bc); 41 | t = System.currentTimeMillis() - t; 42 | 43 | print "d = " + str(d); 44 | 45 | m = d % c; 46 | ## print "m = ", m; 47 | ## print; 48 | 49 | if m.isZERO(): 50 | print "gcd time =", t, "milliseconds,", "isGcd(c,d): true" ; 51 | else: 52 | print "gcd time =", t, "milliseconds,", "isGcd(c,d): ", str(m); 53 | print; 54 | 55 | #startLog(); 56 | terminate(); 57 | -------------------------------------------------------------------------------- /examples/igcd.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # integer examples: gcd 9 | 10 | r = ZZ(); 11 | #r = QQ(); 12 | #r = GF(19); 13 | #r = ZM(19*61); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | #one,x,y,z = r.gens(); 18 | 19 | a = r.random(251); 20 | b = r.random(171); 21 | c = r.random(211).abs(); 22 | #c = 1; 23 | #a = 0; 24 | 25 | puts "a = " + str(a); 26 | puts "b = " + str(b); 27 | puts "c = " + str(c); 28 | puts; 29 | 30 | ac = a * c; 31 | bc = b * c; 32 | 33 | puts "ac = " + str(ac); 34 | puts "bc = " + str(bc); 35 | puts; 36 | 37 | #startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | #d = r.gcd(ac,bc); 41 | d = ac.gcd(bc); 42 | t = System.currentTimeMillis() - t; 43 | 44 | puts "d = " + str(d); 45 | puts; 46 | 47 | puts "gcd time = " + str(t) + " milliseconds" ; 48 | 49 | m = d % c; 50 | #puts "m = " + str(m); 51 | #puts; 52 | if m.isZERO() 53 | puts "isGcd(c,d): true" ; 54 | else 55 | puts "isGcd(c,d): " + str(m); 56 | end 57 | puts; 58 | 59 | #startLog(); 60 | terminate(); 61 | -------------------------------------------------------------------------------- /examples/integrate.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # elementary integration 9 | 10 | r = PolyRing.new( QQ(), "x", PolyRing.lex ); 11 | puts "Ring: " + str(r); 12 | puts 13 | rf = RF(r); 14 | puts "Ring: " + str(rf.factory()); 15 | puts 16 | 17 | one,x = rf.gens(); 18 | 19 | #f = 1 / ( 1 + x**2 ); 20 | #f = x**2 / ( x**2 + 1 ); 21 | 22 | #f = 1 / ( x**2 - 2 ); 23 | #f = 1 / ( x**3 - 2 ); 24 | 25 | #f = ( x + 3 ) / ( x**2- 3 * x - 40 ); 26 | 27 | f = ( x**7 - 24 * x**4 - 4 * x**2 + 8 * x - 8 ) / ( x**8 + 6 * x**6 + 12 * x**4 + 8 * x**2 ); 28 | 29 | 30 | puts "f = " + str(f); 31 | puts; 32 | 33 | startLog(); 34 | 35 | t = System.currentTimeMillis(); 36 | e1 = r.integrate(f); 37 | t = System.currentTimeMillis() - t; 38 | puts "e1 = " + str(e1); 39 | puts "integration time = " + str(t) + " milliseconds"; 40 | puts; 41 | 42 | t = System.currentTimeMillis(); 43 | e2 = f.integrate(); 44 | t = System.currentTimeMillis() - t; 45 | puts "e2 = " + str(e2); 46 | puts "integration time = " + str(t) + " milliseconds"; 47 | puts; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/intersect.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring, PolyRing, QQ 9 | from jas import startLog, terminate 10 | 11 | 12 | # ideal intersection example 13 | 14 | #r = Ring( "Rat(x,y,z) L" ); 15 | r = PolyRing( QQ(), "(x,y,z)", PolyRing.lex ); 16 | print "Ring: " + str(r); 17 | print; 18 | 19 | ps1 = """ 20 | ( 21 | ( x - 1 ), 22 | ( y - 1 ), 23 | ( z - 1 ) 24 | ) 25 | """; 26 | 27 | ps2 = """ 28 | ( 29 | ( x - 2 ), 30 | ( y - 3 ), 31 | ( z - 3 ) 32 | ) 33 | """; 34 | 35 | F1 = r.ideal( ps1 ); 36 | #print "Ideal: " + str(F1); 37 | #print; 38 | 39 | F2 = r.ideal( ps2 ); 40 | #print "Ideal: " + str(F2); 41 | #print; 42 | 43 | #startLog(); 44 | 45 | rg1 = F1.GB(); 46 | print "rg1 = ", rg1; 47 | print; 48 | 49 | rg2 = F2.GB(); 50 | print "rg2 = ", rg2; 51 | print; 52 | 53 | #startLog(); 54 | 55 | ig = F1.intersect(F2); 56 | print "rg1 intersect rg2 = ", ig; 57 | print; 58 | 59 | terminate(); 60 | -------------------------------------------------------------------------------- /examples/intersect.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # ideal intersection example 9 | 10 | #r = Ring.new( "Rat(x,y,z) L" ); 11 | r = PolyRing.new( QQ(), "(x,y,z)", PolyRing.lex ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps1 = """ 16 | ( 17 | ( x - 1 ), 18 | ( y - 1 ), 19 | ( z - 1 ) 20 | ) 21 | """; 22 | 23 | ps2 = """ 24 | ( 25 | ( x - 2 ), 26 | ( y - 3 ), 27 | ( z - 3 ) 28 | ) 29 | """; 30 | 31 | F1 = r.ideal( ps1 ); 32 | #puts "Ideal: " + str(F1); 33 | #puts; 34 | 35 | F2 = r.ideal( ps2 ); 36 | #puts "Ideal: " + str(F2); 37 | #puts; 38 | 39 | #startLog(); 40 | 41 | rg1 = F1.GB(); 42 | puts "rg1 = " + str(rg1); 43 | puts; 44 | 45 | rg2 = F2.GB(); 46 | puts "rg2 = " + str(rg2); 47 | puts; 48 | 49 | #startLog(); 50 | 51 | ig = F1.intersect(F2); 52 | puts "rg1 intersect rg2 = " + str(ig); 53 | puts; 54 | 55 | terminate(); 56 | -------------------------------------------------------------------------------- /examples/intprog.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython for jas example integer programming. 3 | # $Id$ 4 | # 5 | # CLO2, p370 6 | # 4 A + 5 B + C = 37 7 | # 2 A + 3 B + D = 20 8 | # 9 | # max: 11 A + 15 B 10 | # 11 | 12 | import sys; 13 | 14 | from jas import Ring 15 | 16 | r = Ring( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),(1,1,2,2,0,0) )" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | 21 | ps = """ 22 | ( 23 | ( z1^4 z2^2 - w1 ), 24 | ( z1^5 z2^3 - w2 ), 25 | ( z1 - w3 ), 26 | ( z2 - w4 ) 27 | ) 28 | """; 29 | 30 | f = r.ideal( ps ); 31 | print "Ideal: " + str(f); 32 | print; 33 | 34 | rg = f.GB(); 35 | print "seq Output:", rg; 36 | print; 37 | 38 | 39 | pf = """ 40 | ( 41 | ( z1^37 z2^20 ) 42 | ) 43 | """; 44 | 45 | fp = r.ideal( pf ); 46 | print "Ideal: " + str(fp); 47 | print; 48 | 49 | nf = fp.NF(rg); 50 | print "NFs: " + str(nf); 51 | print; 52 | 53 | 54 | -------------------------------------------------------------------------------- /examples/intprog.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | # CLO2, p370 6 | # 4 A + 5 B + C = 37 7 | # 2 A + 3 B + D = 20 8 | # 9 | # max: 11 A + 15 B 10 | # 11 | 12 | require "examples/jas" 13 | 14 | r = Ring.new( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),(1,1,2,2,0,0) )" ); 15 | puts "Ring: " + str(r); 16 | puts; 17 | 18 | 19 | ps = """ 20 | ( 21 | ( z1^4 z2^2 - w1 ), 22 | ( z1^5 z2^3 - w2 ), 23 | ( z1 - w3 ), 24 | ( z2 - w4 ) 25 | ) 26 | """; 27 | 28 | f = r.ideal( ps ); 29 | puts "Ideal: " + str(f); 30 | puts; 31 | 32 | #startLog(); 33 | 34 | rg = f.GB(); 35 | puts "seq Output: " + str(rg); 36 | puts; 37 | 38 | 39 | pf = """ 40 | ( 41 | ( z1^37 z2^20 ) 42 | ) 43 | """; 44 | 45 | fp = r.ideal( pf ); 46 | puts "Ideal: " + str(fp); 47 | puts; 48 | 49 | nf = fp.NF(rg); 50 | puts "NFs: " + str(nf); 51 | puts; 52 | 53 | terminate() 54 | 55 | -------------------------------------------------------------------------------- /examples/intprog2.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython for jas example 2 integer programming. 3 | # $Id$ 4 | # 5 | # CLO2, p372 6 | # 3 A - 2 B + C = -1 7 | # 4 A + B - C - D = 5 8 | # 9 | # max: A + 1000 B + C + 100 D 10 | # 11 | 12 | import sys; 13 | 14 | from jas import Ring 15 | 16 | r = Ring( "Rat(w1,w2,w3,w4,t,z1,z2) W( (0,0,0,0,1,1,1),(1,1,2,2,0,0,0) )" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | 21 | ps = """ 22 | ( 23 | ( z1^3 z2^4 - w1 ), 24 | ( t^2 z2^3 - w2 ), 25 | ( t z1^2 - w3 ), 26 | ( t z1 - w4 ), 27 | ( t z1 z2 - 1 ) 28 | ) 29 | """; 30 | 31 | f = r.ideal( ps ); 32 | print "Ideal: " + str(f); 33 | print; 34 | 35 | rg = f.GB(); 36 | print "seq Output:", rg; 37 | print; 38 | 39 | 40 | pf = """ 41 | ( 42 | ( t z2^6 ) 43 | ) 44 | """; 45 | 46 | fp = r.ideal( pf ); 47 | print "Ideal: " + str(fp); 48 | print; 49 | 50 | nf = fp.NF(rg); 51 | print "NFs: " + str(nf); 52 | print; 53 | -------------------------------------------------------------------------------- /examples/intprog3.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython for jas example 3 integer programming. 3 | # $Id$ 4 | # 5 | # CLO2, p374,a,b 6 | # 3 A + 2 B + C + D = 10 7 | # 4 A + B + C = 5 8 | # 9 | # max: 2 A + 3 B + C + 5 D 10 | # 11 | 12 | import sys; 13 | 14 | from jas import Ring 15 | 16 | #r = Ring( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),(-2,-3,-1,-5,0,0) )" ); 17 | #r = Ring( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),( 7, 3, 2, 1,0,0)*6 )" ); 18 | r = Ring( "Rat(w1,w2,w3,w4,z1,z2) W( (0,0,0,0,1,1),(40,15,11, 1,0,0) )" ); 19 | print "Ring: " + str(r); 20 | print; 21 | 22 | 23 | ps = """ 24 | ( 25 | ( z1^3 z2^4 - w1 ), 26 | ( z1^2 z2 - w2 ), 27 | ( z1 z2 - w3 ), 28 | ( z1 - w4 ) 29 | ) 30 | """; 31 | 32 | f = r.ideal( ps ); 33 | print "Ideal: " + str(f); 34 | print; 35 | 36 | rg = f.GB(); 37 | print "seq Output:", rg; 38 | print; 39 | 40 | 41 | pf = """ 42 | ( 43 | ( z1^10 z2^5 ), 44 | ( z1^20 z2^14 ) 45 | ) 46 | """; 47 | 48 | fp = r.ideal( pf ); 49 | print "Ideal: " + str(fp); 50 | print; 51 | 52 | nf = fp.NF(rg); 53 | print "NFs: " + str(nf); 54 | print; 55 | 56 | -------------------------------------------------------------------------------- /examples/katsura.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import Ring 7 | from jas import Ideal 8 | 9 | from edu.jas.gb import Katsura; 10 | 11 | # katsura examples 12 | 13 | knum = 4 14 | tnum = 2; 15 | 16 | k = Katsura(knum); 17 | r = Ring( k.varList("Rat","G") ); 18 | #r = Ring.new( k.varList("Mod 23","G") ); 19 | print "Ring: " + str(r); 20 | print; 21 | 22 | ps = k.polyList(); 23 | 24 | f = r.ideal( ps ); 25 | print "Ideal: " + str(f); 26 | print; 27 | 28 | rg = f.parGB(tnum); 29 | for th in range(tnum,0,-1): 30 | rg = f.parGB(th); 31 | #print "par Output:", rg; 32 | #print; 33 | 34 | rg = f.GB(); 35 | #print "seq Output:", rg; 36 | print; 37 | 38 | -------------------------------------------------------------------------------- /examples/katsura2.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 2: 2 | (u2,u1,u0) L 3 | ( 4 | u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 - u0, 5 | u2*0 + u1*u2 + u0*u1 + u1*u0 + u2*u1 - u1, 6 | u2 + u1 + u0 + u1 + u2 - 1 7 | ) 8 | 9 | -------------------------------------------------------------------------------- /examples/katsura3.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 3: 2 | (u3,u2,u1,u0) L 3 | ( 4 | u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 - u0, 5 | u3*0 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 - u1, 6 | u3*0 + u2*0 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 - u2, 7 | u3 + u2 + u1 + u0 + u1 + u2 + u3 - 1 8 | ) 9 | 10 | -------------------------------------------------------------------------------- /examples/katsura4.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 4: 2 | (u4,u3,u2,u1,u0) L 3 | ( 4 | u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 - u0, 5 | u4*0 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 - u1, 6 | u4*0 + u3*0 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 - u2, 7 | u4*0 + u3*0 + u2*0 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 - u3, 8 | u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 - 1 9 | ) 10 | 11 | -------------------------------------------------------------------------------- /examples/katsura5.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 5: 2 | (u5,u4,u3,u2,u1,u0) G 3 | ( 4 | u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 - u0, 5 | u5*0 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 - u1, 6 | u5*0 + u4*0 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 - u2, 7 | u5*0 + u4*0 + u3*0 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 - u3, 8 | u5*0 + u4*0 + u3*0 + u2*0 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 - u4, 9 | u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 - 1 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /examples/katsura5s.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 5: 2 | (u0,u1,u2,u3,u4,u5) G|1| 3 | ( 4 | u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 - u0, 5 | u5*0 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 - u1, 6 | u5*0 + u4*0 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 - u2, 7 | u5*0 + u4*0 + u3*0 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 - u3, 8 | u5*0 + u4*0 + u3*0 + u2*0 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 - u4, 9 | u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 - 1 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /examples/katsura5w.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 5: 2 | (u5,u4,u3,u2,u1,u0) W(1,1,1,2,2,1) 3 | ( 4 | u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 - u0, 5 | u5*0 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 - u1, 6 | u5*0 + u4*0 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 - u2, 7 | u5*0 + u4*0 + u3*0 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 - u3, 8 | u5*0 + u4*0 + u3*0 + u2*0 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 - u4, 9 | u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 - 1 10 | ) 11 | 12 | -------------------------------------------------------------------------------- /examples/katsura6.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 6: 2 | (u6,u5,u4,u3,u2,u1,u0) G 3 | ( 4 | u6*u6 + u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 + u6*u6 - u0, 5 | u6*0 + u5*u6 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 + u6*u5 - u1, 6 | u6*0 + u5*0 + u4*u6 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 + u6*u4 - u2, 7 | u6*0 + u5*0 + u4*0 + u3*u6 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 + u6*u3 - u3, 8 | u6*0 + u5*0 + u4*0 + u3*0 + u2*u6 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 + u6*u2 - u4, 9 | u6*0 + u5*0 + u4*0 + u3*0 + u2*0 + u1*u6 + u0*u5 + u1*u4 + u2*u3 + u3*u2 + u4*u1 + u5*u0 + u6*u1 - u5, 10 | u6 + u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 + u6 - 1 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /examples/katsura6w.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 6: 2 | (u6,u5,u4,u3,u2,u1,u0) W(1,1,1,1,1,1,1) 3 | ( 4 | u6*u6 + u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 + u6*u6 - u0, 5 | u6*0 + u5*u6 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 + u6*u5 - u1, 6 | u6*0 + u5*0 + u4*u6 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 + u6*u4 - u2, 7 | u6*0 + u5*0 + u4*0 + u3*u6 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 + u6*u3 - u3, 8 | u6*0 + u5*0 + u4*0 + u3*0 + u2*u6 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 + u6*u2 - u4, 9 | u6*0 + u5*0 + u4*0 + u3*0 + u2*0 + u1*u6 + u0*u5 + u1*u4 + u2*u3 + u3*u2 + u4*u1 + u5*u0 + u6*u1 - u5, 10 | u6 + u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 + u6 - 1 11 | ) 12 | 13 | -------------------------------------------------------------------------------- /examples/katsura7.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 7: 2 | (u7,u6,u5,u4,u3,u2,u1,u0) G 3 | ( 4 | u7*u7 + u6*u6 + u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 + u6*u6 + u7*u7 - u0, 5 | u7*0 + u6*u7 + u5*u6 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 + u6*u5 + u7*u6 - u1, 6 | u7*0 + u6*0 + u5*u7 + u4*u6 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 + u6*u4 + u7*u5 - u2, 7 | u7*0 + u6*0 + u5*0 + u4*u7 + u3*u6 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 + u6*u3 + u7*u4 - u3, 8 | u7*0 + u6*0 + u5*0 + u4*0 + u3*u7 + u2*u6 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 + u6*u2 + u7*u3 - u4, 9 | u7*0 + u6*0 + u5*0 + u4*0 + u3*0 + u2*u7 + u1*u6 + u0*u5 + u1*u4 + u2*u3 + u3*u2 + u4*u1 + u5*u0 + u6*u1 + u7*u2 - u5, 10 | u7*0 + u6*0 + u5*0 + u4*0 + u3*0 + u2*0 + u1*u7 + u0*u6 + u1*u5 + u2*u4 + u3*u3 + u4*u2 + u5*u1 + u6*u0 + u7*u1 - u6, 11 | u7 + u6 + u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 + u6 + u7 - 1 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /examples/katsura7i.jas: -------------------------------------------------------------------------------- 1 | #Katsura equations for N = 7: 2 | Z (u7,u6,u5,u4,u3,u2,u1,u0) G 3 | ( 4 | u7*u7 + u6*u6 + u5*u5 + u4*u4 + u3*u3 + u2*u2 + u1*u1 + u0*u0 + u1*u1 + u2*u2 + u3*u3 + u4*u4 + u5*u5 + u6*u6 + u7*u7 - u0, 5 | u7*0 + u6*u7 + u5*u6 + u4*u5 + u3*u4 + u2*u3 + u1*u2 + u0*u1 + u1*u0 + u2*u1 + u3*u2 + u4*u3 + u5*u4 + u6*u5 + u7*u6 - u1, 6 | u7*0 + u6*0 + u5*u7 + u4*u6 + u3*u5 + u2*u4 + u1*u3 + u0*u2 + u1*u1 + u2*u0 + u3*u1 + u4*u2 + u5*u3 + u6*u4 + u7*u5 - u2, 7 | u7*0 + u6*0 + u5*0 + u4*u7 + u3*u6 + u2*u5 + u1*u4 + u0*u3 + u1*u2 + u2*u1 + u3*u0 + u4*u1 + u5*u2 + u6*u3 + u7*u4 - u3, 8 | u7*0 + u6*0 + u5*0 + u4*0 + u3*u7 + u2*u6 + u1*u5 + u0*u4 + u1*u3 + u2*u2 + u3*u1 + u4*u0 + u5*u1 + u6*u2 + u7*u3 - u4, 9 | u7*0 + u6*0 + u5*0 + u4*0 + u3*0 + u2*u7 + u1*u6 + u0*u5 + u1*u4 + u2*u3 + u3*u2 + u4*u1 + u5*u0 + u6*u1 + u7*u2 - u5, 10 | u7*0 + u6*0 + u5*0 + u4*0 + u3*0 + u2*0 + u1*u7 + u0*u6 + u1*u5 + u2*u4 + u3*u3 + u4*u2 + u5*u1 + u6*u0 + u7*u1 - u6, 11 | u7 + u6 + u5 + u4 + u3 + u2 + u1 + u0 + u1 + u2 + u3 + u4 + u5 + u6 + u7 - 1 12 | ) 13 | 14 | -------------------------------------------------------------------------------- /examples/kw_18.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, example 1.8 from KW: 2 | (x,y,z) L 3 | RelationTable 4 | ( 5 | ( y ), ( x ), ( x y + x ), 6 | ( z ), ( y ), ( y z + z ) 7 | ) 8 | 9 | ( 10 | ( y**3 + x**2 y + x y ), 11 | ( x**2 + z ), 12 | ( z**2 + z ) 13 | ) 14 | -------------------------------------------------------------------------------- /examples/legendre.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring, PolyRing, QQ 9 | from jas import startLog, terminate 10 | 11 | from edu.jas.arith import BigRational 12 | 13 | # Legendre polynomial example 14 | # P(0) = 1 15 | # P(1) = x 16 | # P(n) = 1/n [ (2n-1) * x * P(n-1) - (n-1) * P(n-2) ] 17 | 18 | r = PolyRing( QQ(), "x", PolyRing.lex ); 19 | #r = Ring( "Q(x) L" ); 20 | #r = Ring( "C(x) L" ); 21 | print "Ring: " + str(r); 22 | print; 23 | 24 | # sage like: with generators for the polynomial ring 25 | #auto: [one,x] = r.gens(); 26 | 27 | N = 10; 28 | P = [one,x]; 29 | for n in range(2,N): 30 | p = (2*n-1) * x * P[n-1] - (n-1) * P[n-2]; 31 | r = (1,n); # no rational numbers in python 32 | #r = [(1,n)]; # no complex rational numbers in python 33 | #r = ((1,n),(0,1)); # no complex rational numbers in python 34 | p = r * p; 35 | P.append( p ); 36 | 37 | for n in range(0,N): 38 | print "P[%s] = %s" % (n,P[n]); 39 | 40 | print; 41 | -------------------------------------------------------------------------------- /examples/legendre.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | 5 | require "examples/jas" 6 | 7 | # Legendre polynomial example 8 | # P(0) = 1 9 | # P(1) = x 10 | # P(n) = 1/n [ (2n-1) * x * P(n-1) - (n-1) * P(n-2) ] 11 | 12 | r = PolyRing.new( QQ(), "x", PolyRing.lex ); 13 | #r = Ring.new( "C(x) L" ); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | # sage like: with generators for the polynomial ring 18 | #auto: one,x = r.gens(); 19 | 20 | N = 10; 21 | P = [one,x]; 22 | for n in 2...N do 23 | p = (2*n-1) * x * P[n-1] - (n-1) * P[n-2]; 24 | p = 1/n * p; 25 | P << p; #.monic(); 26 | end 27 | 28 | for n in 0...N do 29 | puts "P[#{n}] = #{P[n]}"; 30 | end 31 | 32 | puts; 33 | -------------------------------------------------------------------------------- /examples/logic.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import Ring, PolyRing, GF 7 | 8 | # logic example from Kreutzer JdM 2008 9 | 10 | #r = Ring( "Mod 2 (a,f,p,u) G" ); 11 | r = PolyRing( GF(2), "(a,f,p,u)", PolyRing.grad ); 12 | print "Ring: " + str(r); 13 | print; 14 | 15 | ks = """ 16 | ( 17 | ( a^2 - a ), 18 | ( f^2 - f ), 19 | ( p^2 - p ), 20 | ( u^2 - u ) 21 | ) 22 | """; 23 | 24 | ps = """ 25 | ( 26 | ( p f + p ), 27 | ( p u + p + u + 1 ), 28 | ( a + u + 1 ), 29 | ( a + p + 1 ) 30 | ) 31 | """; 32 | 33 | 34 | k = r.ideal( ks ); 35 | p = r.ideal( ps ); 36 | 37 | f = k.sum( p ); 38 | 39 | print "Ideal: " + str(f); 40 | print; 41 | 42 | rg = f.GB(); 43 | print "Output:", rg; 44 | print; 45 | 46 | 47 | -------------------------------------------------------------------------------- /examples/logic.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # logic example from Kreutzer JdM 2008 9 | 10 | #r = Ring.new( "Mod 2 (a,f,p,u) G" ); 11 | r = PolyRing.new( GF(2), "(a,f,p,u)", PolyRing.grad ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ks = """ 16 | ( 17 | ( a^2 - a ), 18 | ( f^2 - f ), 19 | ( p^2 - p ), 20 | ( u^2 - u ) 21 | ) 22 | """; 23 | 24 | ps = """ 25 | ( 26 | ( p f + p ), 27 | ( p u + p + u + 1 ), 28 | ( a + u + 1 ), 29 | ( a + p + 1 ) 30 | ) 31 | """; 32 | 33 | 34 | k = r.ideal( ks ); 35 | p = r.ideal( ps ); 36 | 37 | f = k.sum( p ); 38 | 39 | puts "Ideal: " + str(f); 40 | puts; 41 | 42 | rg = f.GB(); 43 | puts "Output:" + str(rg); 44 | puts; 45 | 46 | 47 | -------------------------------------------------------------------------------- /examples/machines.localhost: -------------------------------------------------------------------------------- 1 | # maschines file for jas for junit tests 2 | 3 | localhost:4712 # first host is master on different local port 4 | localhost:4711 # second host with port 5 | #localhost:4711 # third host with port 6 | #localhost:4711 # last host with port 7 | #localhost:4711 # ignored host 8 | 9 | # eof 10 | -------------------------------------------------------------------------------- /examples/machines.test: -------------------------------------------------------------------------------- 1 | # maschines file for jas for junit tests 2 | 3 | localhost:4712 # first host is master on different local port 4 | localhost:4711 # second host with port 5 | localhost:4711 # third host with port 6 | localhost:4711 # last host with port 7 | #localhost:4711 # ignored host 8 | 9 | # eof 10 | -------------------------------------------------------------------------------- /examples/mark.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | #import sys; 7 | 8 | from jas import Ring, PolyRing, ZZ 9 | from jas import startLog 10 | 11 | # mark, d-gb diplom example 12 | 13 | r = PolyRing( ZZ(), "x,y,z", PolyRing.lex ); 14 | print "Ring: " + str(r); 15 | print; 16 | 17 | ps = """ 18 | ( 19 | ( z + x y**2 + 4 x**2 + 1 ), 20 | ( y**2 z + 2 x + 1 ), 21 | ( x**2 z + y**2 + x ) 22 | ) 23 | """; 24 | 25 | f = r.ideal( ps ); 26 | print "Ideal: " + str(f); 27 | print; 28 | 29 | #startLog(); 30 | 31 | eg = f.eGB(); 32 | print "seq e-GB:", eg; 33 | print "is e-GB:", eg.isGB(); 34 | print; 35 | 36 | dg = f.dGB(); 37 | print "seq d-GB:", dg; 38 | print "is d-GB:", dg.isGB(); 39 | print; 40 | 41 | print "d-GB == e-GB:", eg.list.equals(dg.list); 42 | print "d-GB == e-GB:", eg == dg; 43 | -------------------------------------------------------------------------------- /examples/mark.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # mark, d-gb diplom example 9 | 10 | r = PolyRing.new( ZZ(), "x,y,z", PolyRing.lex ); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | ps = """ 15 | ( 16 | ( z + x y**2 + 4 x**2 + 1 ), 17 | ( y**2 z + 2 x + 1 ), 18 | ( x**2 z + y**2 + x ) 19 | ) 20 | """; 21 | 22 | f = r.ideal( ps ); 23 | puts "Ideal: " + str(f); 24 | puts; 25 | 26 | #startLog(); 27 | 28 | eg = f.eGB(); 29 | puts "seq e-GB: " + str(eg); 30 | puts "is e-GB: " + str(eg.isGB()); 31 | puts; 32 | 33 | dg = f.dGB(); 34 | puts "seq d-GB: " + str(dg); 35 | puts "is d-GB: " + str(dg.isGB()); 36 | puts; 37 | 38 | puts "d-GB == e-GB: " + str(eg.list.equals(dg.list)); 39 | puts "d-GB == e-GB: " + str(eg<=>dg); 40 | puts "d-GB == e-GB: " + str(eg===dg); 41 | puts 42 | -------------------------------------------------------------------------------- /examples/mmt.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # example form Moeller, Mora, Traverso 9 | 10 | #r = PolyRing.new(QQ(),"t,z,y,x",PolyRing.grad); 11 | r = PolyRing.new(QQ(),"z,y,x",PolyRing.grad); 12 | #r = PolyRing.new(QQ(),"x,y,z",PolyRing.grad); 13 | print "Ring: " + str(r); 14 | print; 15 | 16 | #auto: one,z,y,x = r.gens(); 17 | 18 | f0 = x**2 * y - z**2; 19 | f1 = x * z**2 - y**2; 20 | f2 = y * z**3 - x**2; 21 | 22 | #f0h = x**2 * y - z**2 * t; 23 | #f1h = x * z**2 - y**2 * t; 24 | #f2h = y * z**3 - x**2 * t**2; 25 | 26 | f = r.ideal("",[f0,f1,f2]); 27 | #f = r.ideal("",[f0h,f1h,f2h]); 28 | 29 | print "Ideal: " + str(f); 30 | print; 31 | 32 | startLog(); 33 | 34 | rg = f.GB(); 35 | print "seq Output: ", rg; 36 | print "\n"; 37 | 38 | #terminate(); 39 | 40 | -------------------------------------------------------------------------------- /examples/module.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | 4 | from jas import PolyRing, QQ, Module 5 | #, SubModule 6 | 7 | # module example 8 | 9 | p = PolyRing(QQ(),"u,v,l", PolyRing.lex); 10 | #r = Module( "Rat(u,v,l) L", cols=4 ); 11 | r = Module( "", p, cols=4 ); 12 | print "Module: " + str(r); 13 | print; 14 | 15 | G = r.gens(); 16 | print "gens() = ", [str(e) for e in G]; 17 | 18 | L = [ e.elem.val for e in G ] 19 | print "gens() = ", [str(e) for e in L]; 20 | 21 | M = r.submodul( list=L ); 22 | print "M = ", M; 23 | 24 | P = M.mset.getPolynomialList(); 25 | print "P = ", P.toScript(); 26 | 27 | print "M.isGB(): ", M.isGB(); 28 | -------------------------------------------------------------------------------- /examples/module.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # module example 9 | 10 | p = PolyRing.new(QQ(),"u,v,l", PolyRing.lex); 11 | #r = CommutativeModule.new( "Rat(u,v,l) L", nil, 4 ); 12 | r = CommutativeModule.new( "", p, 4 ); 13 | puts "Module: " + str(r); 14 | puts; 15 | 16 | G = r.gens(); 17 | puts "gens() = " + str( G.map { |e| str(e) }.join(", ") ); 18 | puts 19 | 20 | L = G.map { |e| e.elem.val } 21 | puts "gens() = " + str( L.map { |e| str(e) }.join(", ") ); 22 | puts 23 | 24 | M = r.submodul("", L ); 25 | puts "M = " + str(M); 26 | puts 27 | 28 | P = M.mset.getPolynomialList(); 29 | puts "P = " + str(P.toScript()); 30 | puts 31 | 32 | puts "M.isGB(): " + str(M.isGB()); 33 | puts 34 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF0.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example Ex-4.8 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b, c) (y,x) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^2 + { b } y^2 ), 23 | ( { c } x^2 + y^2 ), 24 | ( { 2 a } x - { 2 c } y ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | print "CGBsystem: " + str(gs); 36 | print; 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg: 40 | print "isCGBsystem: true"; 41 | else: 42 | print "isCGBsystem: false"; 43 | print; 44 | 45 | #sys.exit(); 46 | 47 | gs = f.CGB(); 48 | print "CGB: " + str(gs); 49 | print; 50 | 51 | bg = gs.isCGB(); 52 | if bg: 53 | print "isCGB: true"; 54 | else: 55 | print "isCGB: false"; 56 | print; 57 | 58 | terminate(); 59 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF0.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example Ex-4.8 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b, c) (y,x) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^2 + { b } y^2 ), 18 | ( { c } x^2 + y^2 ), 19 | ( { 2 a } x - { 2 c } y ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | puts "CGBsystem: " + str(gs); 31 | puts; 32 | 33 | bg = gs.isCGBsystem(); 34 | if bg 35 | puts "isCGBsystem: true"; 36 | else 37 | puts "isCGBsystem: false"; 38 | end 39 | puts; 40 | 41 | #exit(); 42 | 43 | gs = f.CGB(); 44 | puts "CGB: " + str(gs); 45 | puts; 46 | 47 | bg = gs.isCGB(); 48 | if bg 49 | puts "isCGB: true"; 50 | else 51 | puts "isCGB: false"; 52 | end 53 | puts; 54 | 55 | terminate(); 56 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF00.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example Ex-Fig-2 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b, c) (x) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^3 ), 23 | ( { b } x^2 ), 24 | ( { c } x ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | print "CGBsystem: " + str(gs); 36 | print; 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg: 40 | print "isCGBsystem: true"; 41 | else: 42 | print "isCGBsystem: false"; 43 | print; 44 | 45 | #sys.exit(); 46 | 47 | gs = f.CGB(); 48 | print "CGB: " + str(gs); 49 | print; 50 | 51 | bg = gs.isCGB(); 52 | if bg: 53 | print "isCGB: true"; 54 | else: 55 | print "isCGB: false"; 56 | print; 57 | 58 | terminate(); 59 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF00.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example Ex-Fig-2 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b, c) (x) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^3 ), 18 | ( { b } x^2 ), 19 | ( { c } x ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | puts "CGBsystem: " + str(gs); 31 | puts; 32 | 33 | bg = gs.isCGBsystem(); 34 | if bg 35 | puts "isCGBsystem: true"; 36 | else 37 | puts "isCGBsystem: false"; 38 | end 39 | puts; 40 | 41 | #exit(); 42 | 43 | gs = f.CGB(); 44 | puts "CGB: " + str(gs); 45 | puts; 46 | 47 | bg = gs.isCGB(); 48 | if bg 49 | puts "isCGB: true"; 50 | else 51 | puts "isCGB: false"; 52 | end 53 | puts; 54 | 55 | terminate(); 56 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF01.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example Ex-4.3 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b) (y,x) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( x y + x ), 23 | ( { a } x^2 + y + 2 ), 24 | ( { b } x y + y ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | print "CGBsystem: " + str(gs); 36 | print; 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg: 40 | print "isCGBsystem: true"; 41 | else: 42 | print "isCGBsystem: false"; 43 | print; 44 | 45 | #sys.exit(); 46 | 47 | gs = f.CGB(); 48 | print "CGB: " + str(gs); 49 | print; 50 | 51 | bg = gs.isCGB(); 52 | if bg: 53 | print "isCGB: true"; 54 | else: 55 | print "isCGB: false"; 56 | print; 57 | 58 | terminate(); 59 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF01.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example Ex-4.3 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b) (y,x) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( x y + x ), 18 | ( { a } x^2 + y + 2 ), 19 | ( { b } x y + y ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | puts "CGBsystem: " + str(gs); 31 | puts; 32 | 33 | bg = gs.isCGBsystem(); 34 | if bg 35 | puts "isCGBsystem: true"; 36 | else 37 | puts "isCGBsystem: false"; 38 | end 39 | puts; 40 | 41 | #exit(); 42 | 43 | gs = f.CGB(); 44 | puts "CGB: " + str(gs); 45 | puts; 46 | 47 | bg = gs.isCGB(); 48 | if bg 49 | puts "isCGB: true"; 50 | else 51 | puts "isCGB: false"; 52 | end 53 | puts; 54 | 55 | terminate(); 56 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF1.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F1 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b) (y,x) G" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^4 y + x y^2 + { b } x ), 23 | ( x^3 + 2 x y ), 24 | ( { b } x^2 + x^2 y ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | print "CGBsystem: " + str(gs); 39 | print; 40 | 41 | #sys.exit(); 42 | 43 | bg = gs.isCGBsystem(); 44 | if bg: 45 | print "isCGBsystem: true"; 46 | else: 47 | print "isCGBsystem: false"; 48 | print; 49 | 50 | #sys.exit(); 51 | 52 | gs = f.CGB(); 53 | print "CGB: " + str(gs); 54 | print; 55 | 56 | bg = gs.isCGB(); 57 | if bg: 58 | print "isCGB: true"; 59 | else: 60 | print "isCGB: false"; 61 | print; 62 | 63 | terminate(); 64 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF1.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F1 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b) (y,x) G" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^4 y + x y^2 + { b } x ), 18 | ( x^3 + 2 x y ), 19 | ( { b } x^2 + x^2 y ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | puts "CGBsystem: " + str(gs); 34 | puts; 35 | 36 | #sys.exit(); 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg 40 | puts "isCGBsystem: true"; 41 | else 42 | puts "isCGBsystem: false"; 43 | end 44 | puts; 45 | 46 | #exit(); 47 | 48 | gs = f.CGB(); 49 | puts "CGB: " + str(gs); 50 | puts; 51 | 52 | bg = gs.isCGB(); 53 | if bg 54 | puts "isCGB: true"; 55 | else 56 | puts "isCGB: false"; 57 | end 58 | puts; 59 | 60 | terminate(); 61 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF2.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F2 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(b, a) (x,y) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^2 y^3 + { b } y + y ), 23 | ( x^2 y^2 + x y + 2 ), 24 | ( { a } x^2 + { b } y + 2 ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | print "CGBsystem: " + str(gs); 39 | print; 40 | 41 | #sys.exit(); 42 | 43 | bg = gs.isCGBsystem(); 44 | if bg: 45 | print "isCGBsystem: true"; 46 | else: 47 | print "isCGBsystem: false"; 48 | print; 49 | 50 | #sys.exit(); 51 | 52 | gs = f.CGB(); 53 | print "CGB: " + str(gs); 54 | print; 55 | 56 | bg = gs.isCGB(); 57 | if bg: 58 | print "isCGB: true"; 59 | else: 60 | print "isCGB: false"; 61 | print; 62 | 63 | terminate(); 64 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF2.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F2 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(b, a) (x,y) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^2 y^3 + { b } y + y ), 18 | ( x^2 y^2 + x y + 2 ), 19 | ( { a } x^2 + { b } y + 2 ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | puts "CGBsystem: " + str(gs); 34 | puts; 35 | 36 | #sys.exit(); 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg 40 | puts "isCGBsystem: true"; 41 | else 42 | puts "isCGBsystem: false"; 43 | end 44 | puts; 45 | 46 | #exit(); 47 | 48 | gs = f.CGB(); 49 | puts "CGB: " + str(gs); 50 | puts; 51 | 52 | bg = gs.isCGB(); 53 | if bg 54 | puts "isCGB: true"; 55 | else 56 | puts "isCGB: false"; 57 | end 58 | puts; 59 | 60 | terminate(); 61 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF3.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F3 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(c, b, a, d) (x) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^4 + { c } x^2 + { b } ), 23 | ( { b } x^3 + x^2 + 2 ), 24 | ( { c } x^2 + { d } x ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | print "CGBsystem: " + str(gs); 39 | print; 40 | 41 | sys.exit(); 42 | 43 | bg = gs.isCGBsystem(); 44 | if bg: 45 | print "isCGBsystem: true"; 46 | else: 47 | print "isCGBsystem: false"; 48 | print; 49 | 50 | #sys.exit(); 51 | 52 | gs = f.CGB(); 53 | print "CGB: " + str(gs); 54 | print; 55 | 56 | bg = gs.isCGB(); 57 | if bg: 58 | print "isCGB: true"; 59 | else: 60 | print "isCGB: false"; 61 | print; 62 | 63 | terminate(); 64 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF3.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F3 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(c, b, a, d) (x) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^4 + { c } x^2 + { b } ), 18 | ( { b } x^3 + x^2 + 2 ), 19 | ( { c } x^2 + { d } x ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | puts "CGBsystem: " + str(gs); 34 | puts; 35 | 36 | terminate(); 37 | exit(); 38 | 39 | bg = gs.isCGBsystem(); 40 | if bg 41 | puts "isCGBsystem: true"; 42 | else 43 | puts "isCGBsystem: false"; 44 | end 45 | puts; 46 | 47 | #exit(); 48 | 49 | gs = f.CGB(); 50 | puts "CGB: " + str(gs); 51 | puts; 52 | 53 | bg = gs.isCGB(); 54 | if bg 55 | puts "isCGB: true"; 56 | else 57 | puts "isCGB: false"; 58 | end 59 | puts; 60 | 61 | terminate(); 62 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF4.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F4 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b, c, d) (y, x) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^3 y + { c } x y^2 ), 23 | ( x^4 y + { 3 d } y ), 24 | ( { c } x^2 + { b } x y ), 25 | ( x^2 y^2 + { a } x^2 ), 26 | ( x^5 + y^5 ) 27 | ) 28 | """; 29 | 30 | #startLog(); 31 | 32 | f = r.paramideal( ps ); 33 | print "ParamIdeal: " + str(f); 34 | print; 35 | 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | gs = f.CGBsystem(); 39 | gs = f.CGBsystem(); 40 | print "CGBsystem: " + str(gs); 41 | print; 42 | 43 | sys.exit(); 44 | 45 | bg = gs.isCGBsystem(); 46 | if bg: 47 | print "isCGBsystem: true"; 48 | else: 49 | print "isCGBsystem: false"; 50 | print; 51 | 52 | #sys.exit(); 53 | 54 | gs = f.CGB(); 55 | print "CGB: " + str(gs); 56 | print; 57 | 58 | bg = gs.isCGB(); 59 | if bg: 60 | print "isCGB: true"; 61 | else: 62 | print "isCGB: false"; 63 | print; 64 | 65 | terminate(); 66 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF4.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F4 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b, c, d) (y, x) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^3 y + { c } x y^2 ), 18 | ( x^4 y + { 3 d } y ), 19 | ( { c } x^2 + { b } x y ), 20 | ( x^2 y^2 + { a } x^2 ), 21 | ( x^5 + y^5 ) 22 | ) 23 | """; 24 | 25 | #startLog(); 26 | 27 | f = r.paramideal( ps ); 28 | puts "ParamIdeal: " + str(f); 29 | puts; 30 | 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | gs = f.CGBsystem(); 34 | gs = f.CGBsystem(); 35 | puts "CGBsystem: " + str(gs); 36 | puts; 37 | 38 | terminate(); 39 | exit(); 40 | 41 | bg = gs.isCGBsystem(); 42 | if bg 43 | puts "isCGBsystem: true"; 44 | else 45 | puts "isCGBsystem: false"; 46 | end 47 | puts; 48 | 49 | #exit(); 50 | 51 | gs = f.CGB(); 52 | puts "CGB: " + str(gs); 53 | puts; 54 | 55 | bg = gs.isCGB(); 56 | if bg 57 | puts "isCGB: true"; 58 | else 59 | puts "isCGB: false"; 60 | end 61 | puts; 62 | 63 | terminate(); 64 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF5.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F5 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(b, a, c) (x,y) L" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( { a } x^2 y + { b } x + y^2 ), 23 | ( { a } x^2 y + { b } x y ), 24 | ( y^2 + { b } x^2 y + { c } x y ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | print "CGBsystem: " + str(gs); 39 | print; 40 | 41 | #sys.exit(); 42 | 43 | bg = gs.isCGBsystem(); 44 | if bg: 45 | print "isCGBsystem: true"; 46 | else: 47 | print "isCGBsystem: false"; 48 | print; 49 | 50 | #sys.exit(); 51 | 52 | gs = f.CGB(); 53 | print "CGB: " + str(gs); 54 | print; 55 | 56 | bg = gs.isCGB(); 57 | if bg: 58 | print "isCGB: true"; 59 | else: 60 | print "isCGB: false"; 61 | print; 62 | 63 | terminate(); 64 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF5.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F5 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(b, a, c) (x,y) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( { a } x^2 y + { b } x + y^2 ), 18 | ( { a } x^2 y + { b } x y ), 19 | ( y^2 + { b } x^2 y + { c } x y ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | puts "CGBsystem: " + str(gs); 34 | puts; 35 | 36 | #exit(); 37 | 38 | bg = gs.isCGBsystem(); 39 | if bg 40 | puts "isCGBsystem: true"; 41 | else 42 | puts "isCGBsystem: false"; 43 | end 44 | puts; 45 | 46 | #exit(); 47 | 48 | gs = f.CGB(); 49 | puts "CGB: " + str(gs); 50 | puts; 51 | 52 | bg = gs.isCGB(); 53 | if bg 54 | puts "isCGB: true"; 55 | else 56 | puts "isCGB: false"; 57 | end 58 | puts; 59 | 60 | terminate(); 61 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF6.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F6 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b,c, d) (x) G" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( x^4 + { a } x^3 + { b } x^2 + { c } x + { d } ), 23 | ( 4 x^3 + { 3 a } x^2 + { 2 b } x + { c } ) 24 | ) 25 | """; 26 | 27 | #startLog(); 28 | 29 | f = r.paramideal( ps ); 30 | print "ParamIdeal: " + str(f); 31 | print; 32 | 33 | gs = f.CGBsystem(); 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | print "CGBsystem: " + str(gs); 38 | print; 39 | 40 | bg = gs.isCGBsystem(); 41 | if bg: 42 | print "isCGBsystem: true"; 43 | else: 44 | print "isCGBsystem: false"; 45 | print; 46 | 47 | #sys.exit(); 48 | 49 | gs = f.CGB(); 50 | print "CGB: " + str(gs); 51 | print; 52 | 53 | bg = gs.isCGB(); 54 | if bg: 55 | print "isCGB: true"; 56 | else: 57 | print "isCGB: false"; 58 | print; 59 | 60 | terminate(); 61 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF6.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F6 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b,c, d) (x) G" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( x^4 + { a } x^3 + { b } x^2 + { c } x + { d } ), 18 | ( 4 x^3 + { 3 a } x^2 + { 2 b } x + { c } ) 19 | ) 20 | """; 21 | 22 | #startLog(); 23 | 24 | f = r.paramideal( ps ); 25 | puts "ParamIdeal: " + str(f); 26 | puts; 27 | 28 | gs = f.CGBsystem(); 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | puts "CGBsystem: " + str(gs); 33 | puts; 34 | 35 | bg = gs.isCGBsystem(); 36 | if bg 37 | puts "isCGBsystem: true"; 38 | else 39 | puts "isCGBsystem: false"; 40 | end 41 | puts; 42 | 43 | #exit(); 44 | 45 | gs = f.CGB(); 46 | puts "CGB: " + str(gs); 47 | puts; 48 | 49 | bg = gs.isCGB(); 50 | if bg 51 | puts "isCGB: true"; 52 | else 53 | puts "isCGB: false"; 54 | end 55 | puts; 56 | 57 | terminate(); 58 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF7.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog 10 | from jas import terminate 11 | 12 | 13 | # Nabashima, ISSAC 2007, example F7 14 | # integral function coefficients 15 | 16 | r = Ring( "IntFunc(a, b) (z,y,x) G" ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | ps = """ 21 | ( 22 | ( x^3 - { a } ), 23 | ( y^4 - { b } ), 24 | ( x + y - { a } z ) 25 | ) 26 | """; 27 | 28 | #startLog(); 29 | 30 | f = r.paramideal( ps ); 31 | print "ParamIdeal: " + str(f); 32 | print; 33 | 34 | gs = f.CGBsystem(); 35 | gs = f.CGBsystem(); 36 | gs = f.CGBsystem(); 37 | gs = f.CGBsystem(); 38 | print "CGBsystem: " + str(gs); 39 | print; 40 | 41 | bg = gs.isCGBsystem(); 42 | if bg: 43 | print "isCGBsystem: true"; 44 | else: 45 | print "isCGBsystem: false"; 46 | print; 47 | 48 | #sys.exit(); 49 | 50 | gs = f.CGB(); 51 | print "CGB: " + str(gs); 52 | print; 53 | 54 | bg = gs.isCGB(); 55 | if bg: 56 | print "isCGB: true"; 57 | else: 58 | print "isCGB: false"; 59 | print; 60 | 61 | terminate(); 62 | -------------------------------------------------------------------------------- /examples/nabeshima_cgbF7.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Nabashima, ISSAC 2007, example F7 9 | # integral function coefficients 10 | 11 | r = Ring.new( "IntFunc(a, b) (z,y,x) G" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( x^3 - { a } ), 18 | ( y^4 - { b } ), 19 | ( x + y - { a } z ) 20 | ) 21 | """; 22 | 23 | #startLog(); 24 | 25 | f = r.paramideal( ps ); 26 | puts "ParamIdeal: " + str(f); 27 | puts; 28 | 29 | gs = f.CGBsystem(); 30 | gs = f.CGBsystem(); 31 | gs = f.CGBsystem(); 32 | gs = f.CGBsystem(); 33 | puts "CGBsystem: " + str(gs); 34 | puts; 35 | 36 | bg = gs.isCGBsystem(); 37 | if bg 38 | puts "isCGBsystem: true"; 39 | else 40 | puts "isCGBsystem: false"; 41 | end 42 | puts; 43 | 44 | #exit(); 45 | 46 | gs = f.CGB(); 47 | puts "CGB: " + str(gs); 48 | puts; 49 | 50 | bg = gs.isCGB(); 51 | if bg 52 | puts "isCGB: true"; 53 | else 54 | puts "isCGB: false"; 55 | end 56 | puts; 57 | 58 | terminate(); 59 | -------------------------------------------------------------------------------- /examples/ncmat.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | require "matrix" 8 | 9 | # matrix and polynomial examples: 10 | # conditions for (non) commuting matrices 11 | 12 | r = PolyRing.new(ZZ(), "a,b,c,d,e,f,g,h") 13 | puts "r = " + r.to_s 14 | puts 15 | 16 | x = Matrix[[a,b],[c,d]] 17 | y = Matrix[[e,f],[g,h]] 18 | puts "x = " + x.to_s + ", y = " + y.to_s 19 | puts 20 | 21 | com = x*y - y*x 22 | puts "commutator = " + com.to_s 23 | puts 24 | 25 | ff = r.ideal("", [ com[0,0], com[0,1], com[1,0], com[1,1] ] ) 26 | puts "ff = " + ff.to_s 27 | puts 28 | 29 | gg = ff.GB(); 30 | puts "gg = " + gg.to_s 31 | puts 32 | 33 | #startLog(); 34 | #terminate(); 35 | -------------------------------------------------------------------------------- /examples/ncmatj.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, Ideal, QQ, ZZ, EF, Mat 9 | 10 | # matrix and polynomial examples: 11 | # conditions for (non) commuting matrices 12 | 13 | r = EF(QQ()).polynomial("a,b,c,d,e,f,g,h").build(); 14 | print "r = " + str(r); 15 | 16 | #one, a, b, c, d, e, f, g, h = r.gens(); 17 | print "h = " + str(h); 18 | print 19 | 20 | x = Mat(r,2,2,[[a,b],[c,d]]) 21 | y = Mat(r,2,2,[[e,f],[g,h]]) 22 | print "x = " + str(x) + ", y = " + str(y) #+ ", x y = " + str(x*y) 23 | print 24 | 25 | com = x*y - y*x 26 | print "commutator = " + str(com) 27 | print 28 | 29 | ff = r.ideal("", [ com[0][0], com[0][1], com[1][0], com[1][1] ] ) 30 | print "ff = " + str(ff) 31 | print 32 | 33 | gg = ff.GB(); 34 | print "gg = " + str(gg) 35 | print 36 | 37 | #startLog(); 38 | #terminate(); 39 | -------------------------------------------------------------------------------- /examples/ncmatj.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # matrix and polynomial examples: 9 | # conditions for (non) commuting matrices 10 | 11 | r = EF.new(QQ()).polynomial("a,b,c,d,e,f,g,h").build() 12 | puts "r = " + str(r) 13 | 14 | #one, a, b, c, d, e, f, g, h = r.gens(); 15 | puts "h = " + str(h) 16 | puts 17 | 18 | x = Mat(r,2,2,[[a,b],[c,d]]) 19 | y = Mat(r,2,2,[[e,f],[g,h]]) 20 | z = Mat(r,2,2,[[one,0],[0,one]]) 21 | puts "x = " + str(x) + ", y = " + str(y) + ", z = " + str(z) 22 | puts 23 | 24 | com = x*y - y*x #+ z 25 | puts "commutator = " + com.to_s 26 | puts 27 | 28 | ff = r.ideal("", [ com[0,0], com[0,1], com[1,0], com[1,1] ] ) 29 | puts "ff = " + str(ff) 30 | puts 31 | 32 | gg = ff.GB(); 33 | puts "gg = " + str(gg) 34 | puts 35 | 36 | #startLog(); 37 | #terminate(); 38 | -------------------------------------------------------------------------------- /examples/ore_t.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Ore extension Q[x,y][z;d][t,e]: 2 | Rat(x,y,z,t) L 3 | RelationTable 4 | ( 5 | ( z ), ( y ), ( y z + x ), 6 | ( t ), ( y ), ( y t + y ), 7 | ( t ), ( z ), ( z t - z ) 8 | ) 9 | 10 | ( 11 | ( x^2 + y^2 + z^2 + t^2 + 1 ) 12 | ) 13 | -------------------------------------------------------------------------------- /examples/pppj2006.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, ZZ 9 | from jas import startLog 10 | 11 | # pppj 2006 paper examples 12 | 13 | #r = Ring( "Z(x1,x2,x3) L" ); 14 | r = PolyRing( ZZ(), "x1,x2,x3", PolyRing.lex ); 15 | print "Ring: " + str(r); 16 | print; 17 | 18 | #unused: 19 | ps = """ 20 | ( 21 | ( 3 x1^2 x3^4 + 7 x2^5 - 61 ) 22 | ) 23 | """; 24 | 25 | f = 3 * x1**2 * x3**4 + 7 * x2**5 - 61; 26 | print "f = " + str(f); 27 | print; 28 | 29 | #id = r.ideal( ps ); 30 | id = r.ideal( "", [f] ); 31 | print "Ideal: " + str(id); 32 | print; 33 | 34 | #startLog(); 35 | 36 | pps = """ 37 | 3 x1^2 x3^4 + 7 x2^5 - 61 38 | """; 39 | 40 | ri = r.ring; 41 | print "ri = " + str(ri); 42 | print 43 | 44 | pol = id.pset; 45 | print "pol = " + str(pol); 46 | print 47 | 48 | pol = ri.parse( pps ); 49 | print "pol = " + str(pol); 50 | print 51 | -------------------------------------------------------------------------------- /examples/pppj2006.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # pppj 2006 paper examples 9 | 10 | r = PolyRing.new( ZZ(), "x1,x2,x3", PolyRing.lex ); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | 15 | f = 3 * x1**2 * x3**4 + 7 * x2**5 - 61; 16 | 17 | puts "f = " + str(f); 18 | puts; 19 | 20 | id = r.ideal( "", [f] ); 21 | puts "Ideal: " + str(id); 22 | puts; 23 | 24 | ri = r.ring; 25 | puts "ri = " + str(ri); 26 | 27 | pol = id.pset; 28 | puts "pol = " + str(pol); 29 | puts 30 | 31 | pol = ri.parse( str(f) ); 32 | puts "pol = " + str(pol); 33 | puts; 34 | 35 | #startLog(); 36 | -------------------------------------------------------------------------------- /examples/primary-decomp-charp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, DD, RF, GF 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: ideal primary decomposition 12 | 13 | cr = PolyRing(GF(5),"c",PolyRing.lex); 14 | print "coefficient Ring: " + str(cr); 15 | rf = RF(cr); 16 | print "coefficient quotient Ring: " + str(rf.ring); 17 | 18 | r = PolyRing(rf,"x,y,z",PolyRing.lex); 19 | print "Ring: " + str(r); 20 | print; 21 | 22 | #automatic: [one,c,x,y,z] = r.gens(); 23 | 24 | f1 = (x**2 - 2); #**2 25 | f2 = (y**2 - c)**5; 26 | f3 = (z**2 - 2 * c); #**5 27 | 28 | print "f1 = ", f1; 29 | print "f2 = ", f2; 30 | print "f3 = ", f3; 31 | print; 32 | 33 | F = r.ideal( list=[f1,f2,f3] ); 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | Q = F.primaryDecomp(); 41 | t = System.currentTimeMillis() - t; 42 | print "Q = ", Q; 43 | print; 44 | print "primary decomp time =", t, "milliseconds"; 45 | print; 46 | 47 | print "F = ", F; 48 | print; 49 | 50 | #startLog(); 51 | terminate(); 52 | -------------------------------------------------------------------------------- /examples/primary-decomp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, DD 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: ideal primary decomposition 12 | 13 | #r = Ring( "Rat(x) L" ); 14 | #r = Ring( "Q(x) L" ); 15 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 16 | 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | #automatic: [one,x,y,z] = r.gens(); 21 | 22 | f1 = (x**2 - 5)**2; 23 | f2 = (y**2 - x)**2; 24 | f3 = z**2 - x ; 25 | 26 | #print "f1 = ", f1; 27 | print "f2 = ", f2; 28 | print "f3 = ", f3; 29 | print; 30 | 31 | F = r.ideal( list=[f2,f3] ); 32 | 33 | print "F = ", F; 34 | print; 35 | 36 | startLog(); 37 | 38 | t = System.currentTimeMillis(); 39 | Q = F.primaryDecomp(); 40 | t = System.currentTimeMillis() - t; 41 | print "Q = ", Q; 42 | print; 43 | print "primary decomp time =", t, "milliseconds"; 44 | print; 45 | 46 | print "F = ", F; 47 | print; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/primary-decomp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: ideal primary decomposition in char 0 9 | 10 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #automatic: one,x,y,z = r.gens(); 15 | puts one,x,y,z; 16 | 17 | #exit(); 18 | 19 | f1 = (x**2 - 2)**2; 20 | f2 = (y**2 - x)**2; 21 | f3 = (z**2 - x); 22 | 23 | puts "f1 = " + str(f1); 24 | puts "f2 = " + str(f2); 25 | puts "f3 = " + str(f3); 26 | #puts "f4 = " + str(f4); 27 | puts; 28 | 29 | F = r.ideal( "", list=[f1,f2,f3] ); 30 | #F = r.ideal( "", list=[f1,f3] ); 31 | #F = r.ideal( "", list=[f2,f3] ); 32 | 33 | puts "F = " + str(F); 34 | puts; 35 | 36 | startLog(); 37 | 38 | t = System.currentTimeMillis(); 39 | P = F.primaryDecomp(); 40 | t = System.currentTimeMillis() - t; 41 | puts "P = " + str(P); 42 | puts; 43 | puts "decomp time = " + str(t) + " milliseconds"; 44 | puts; 45 | 46 | puts "F = " + str(F); 47 | puts; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/prime-decomp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, DD 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: ideal prime decomposition 12 | 13 | #r = Ring( "Rat(x) L" ); 14 | #r = Ring( "Q(x) L" ); 15 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 16 | 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | #automatic: [one,x,y,z] = r.gens(); 21 | 22 | f1 = (x**2 - 5)**2; 23 | f2 = y**3 - x; 24 | f3 = z**2 - y * x; 25 | 26 | #print "f1 = ", f1; 27 | print "f2 = ", f2; 28 | print "f3 = ", f3; 29 | print; 30 | 31 | F = r.ideal( list=[f2,f3] ); 32 | 33 | print "F = ", F; 34 | print; 35 | 36 | startLog(); 37 | 38 | t = System.currentTimeMillis(); 39 | P = F.primeDecomp(); 40 | t1 = System.currentTimeMillis() - t; 41 | print "P = ", P; 42 | print; 43 | print "prime decomp time =", t1, "milliseconds"; 44 | print; 45 | 46 | print "F = ", F; 47 | print; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/prime-decomp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | #startLog(); 9 | 10 | # polynomial examples: ideal prime decomposition 11 | 12 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 13 | 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | #automatic: one,x,y,z = r.gens(); 18 | 19 | f1 = (x**2 - 5)**2; 20 | f2 = y**3 - x; 21 | f3 = z**2 - y * x; 22 | 23 | puts "f1 = " + str(f1); 24 | puts "f2 = " + str(f2); 25 | puts "f3 = " + str(f3); 26 | puts; 27 | 28 | #F = r.ideal( "", [f1,f2,f3] ); 29 | F = r.ideal( "", [f2,f3] ); 30 | 31 | puts "F = ", F; 32 | puts; 33 | 34 | startLog(); 35 | 36 | t = System.currentTimeMillis(); 37 | P = F.primeDecomp(); 38 | t1 = System.currentTimeMillis() - t; 39 | puts "P = " + str(P); 40 | puts; 41 | puts "prime decomp time = " + str(t1) + " milliseconds"; 42 | puts; 43 | 44 | puts "F = " + str(F); 45 | puts; 46 | 47 | #startLog(); 48 | terminate(); 49 | -------------------------------------------------------------------------------- /examples/primes.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | #import sys; 7 | #from jas import startLog, terminate 8 | 9 | from edu.jas.arith import PrimeList 10 | 11 | # example for prime numbers 12 | # 13 | 14 | pl = PrimeList(PrimeList.Range.small); 15 | print "pl: " + str(pl); 16 | print; 17 | pp = ""; 18 | for i in range(0,pl.size()+10): 19 | pp = pp + " " + str(pl.get(i)) 20 | print "pp: " + pp; 21 | print; 22 | 23 | pl = PrimeList(PrimeList.Range.low); 24 | print "pl: " + str(pl); 25 | print; 26 | pp = ""; 27 | for i in range(0,pl.size()+10): 28 | pp = pp + " " + str(pl.get(i)) 29 | print "pp: " + pp; 30 | print; 31 | 32 | pl = PrimeList(PrimeList.Range.medium); 33 | print "pl: " + str(pl); 34 | print; 35 | pp = ""; 36 | for i in range(0,pl.size()+10): 37 | pp = pp + " " + str(pl.get(i)) 38 | print "pp: " + pp; 39 | print; 40 | 41 | pl = PrimeList(PrimeList.Range.large); 42 | print "pl: " + str(pl); 43 | print; 44 | pp = ""; 45 | for i in range(0,pl.size()+10): 46 | pp = pp + " " + str(pl.get(i)) 47 | print "pp: " + pp; 48 | print; 49 | 50 | #pl = PrimeList(PrimeList.Range.mersenne); 51 | #print "pl: " + str(pl); 52 | #print; 53 | -------------------------------------------------------------------------------- /examples/primes.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # example for prime numbers 9 | # 10 | 11 | pl = PrimeList.new(PrimeList::Range.small); 12 | puts "pl: " + str(pl); 13 | puts; 14 | pp = ""; 15 | for i in 0..pl.size()+10 do 16 | pp = pp + " " + str(pl.get(i)) 17 | end 18 | puts "pp: " + pp; 19 | puts; 20 | 21 | pl = PrimeList.new(PrimeList::Range.low); 22 | puts "pl: " + str(pl); 23 | puts; 24 | pp = ""; 25 | for i in 0..pl.size()+10 do 26 | pp = pp + " " + str(pl.get(i)) 27 | end 28 | puts "pp: " + pp; 29 | puts; 30 | 31 | pl = PrimeList.new(PrimeList::Range.medium); 32 | puts "pl: " + str(pl); 33 | puts; 34 | pp = ""; 35 | for i in 0..pl.size()+10 do 36 | pp = pp + " " + str(pl.get(i)) 37 | end 38 | puts "pp: " + pp; 39 | puts; 40 | 41 | pl = PrimeList.new(PrimeList::Range.large); 42 | puts "pl: " + str(pl); 43 | puts; 44 | pp = ""; 45 | for i in 0..pl.size()+10 do 46 | pp = pp + " " + str(pl.get(i)) 47 | end 48 | puts "pp: " + pp; 49 | puts; 50 | 51 | #pl = PrimeList.new(PrimeList::Range.mersenne); 52 | #puts "pl: " + str(pl); 53 | #puts; 54 | -------------------------------------------------------------------------------- /examples/radical-decomp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, DD 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: ideal radical decomposition 12 | 13 | #r = Ring( "Rat(x) L" ); 14 | #r = Ring( "Q(x) L" ); 15 | r = PolyRing(QQ(),"x,y,z",PolyRing.lex); 16 | print "Ring: " + str(r); 17 | print; 18 | 19 | #automatic: [one,x,y,z] = r.gens(); 20 | 21 | f1 = (x**2 - 5)**2; 22 | f2 = (y**2 - 3)**3 * (y**2 - 5); 23 | f3 = z**3 - x * y; 24 | 25 | #print "f1 = ", f1; 26 | print "f2 = ", f2; 27 | print "f3 = ", f3; 28 | print; 29 | 30 | F = r.ideal( list=[f2,f3] ); 31 | print "F = ", F; 32 | print; 33 | 34 | startLog(); 35 | 36 | t = System.currentTimeMillis(); 37 | R = F.radicalDecomp(); 38 | t = System.currentTimeMillis() - t; 39 | print "R = ", R; 40 | print; 41 | print "decomp time =", t, "milliseconds"; 42 | print; 43 | 44 | print "F = ", F; 45 | print; 46 | 47 | #startLog(); 48 | terminate(); 49 | -------------------------------------------------------------------------------- /examples/radical-decomp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: ideal radical decomposition 9 | 10 | #r = Ring.new( "Rat(x) L" ); 11 | #r = Ring.new( "Q(x) L" ); 12 | r = PolyRing.new(QQ(),"x,y,z",PolyRing.lex); 13 | puts "Ring: " + str(r); 14 | puts; 15 | 16 | #automatic: one,x,y,z = r.gens(); 17 | 18 | f1 = (x**2 - 5)**2; 19 | f2 = (y**2 - 3)**3 * (y**2 - 5); 20 | f3 = z**3 - x * y; 21 | 22 | #puts "f1 = " + str(f1); 23 | puts "f2 = " + str(f2); 24 | puts "f3 = " + str(f3); 25 | puts; 26 | 27 | F = r.ideal( "", list=[f2,f3] ); 28 | puts "F = " + str(F); 29 | puts; 30 | 31 | startLog(); 32 | 33 | t = System.currentTimeMillis(); 34 | R = F.radicalDecomp(); 35 | t = System.currentTimeMillis() - t; 36 | puts "R = " + str(R); 37 | puts; 38 | puts "decomp time = " + str(t) + " milliseconds"; 39 | puts; 40 | 41 | puts "F = " + str(F); 42 | puts; 43 | 44 | #startLog(); 45 | terminate(); 46 | -------------------------------------------------------------------------------- /examples/radical-decomp_charp.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, ZM, GF 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: ideal radical decomposition, dim > 0, char p separable 12 | 13 | r = PolyRing(GF(5),"x,y,z",PolyRing.lex); 14 | print "Ring: " + str(r); 15 | print; 16 | 17 | #automatic: [one,x,y,z] = r.gens(); 18 | 19 | #f1 = (x**2 - 5)**2; 20 | #f1 = (y**10 - x**5)**3; 21 | f2 = y**6 + 2 * x * y**4 + 3 * x**2 * y**2 + 4 * x**3; 22 | f2 = f2**5; 23 | f3 = z**10 - x**5; 24 | 25 | f4 = (y**2 - x)**3; 26 | 27 | #print "f1 = ", f1; 28 | print "f2 = ", f2; 29 | print "f3 = ", f3; 30 | #print "f4 = ", f4; 31 | print; 32 | 33 | F = r.ideal( list=[f2,f3] ); 34 | print "F = ", F; 35 | print; 36 | 37 | startLog(); 38 | 39 | t = System.currentTimeMillis(); 40 | R = F.radicalDecomp(); 41 | t = System.currentTimeMillis() - t; 42 | print "R = ", R; 43 | print; 44 | print "decomp time =", t, "milliseconds"; 45 | print; 46 | 47 | print "F = ", F; 48 | print; 49 | 50 | #startLog(); 51 | terminate(); 52 | -------------------------------------------------------------------------------- /examples/radical-decomp_charp.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: ideal radical decomposition, dim > 0, char p separable 9 | 10 | r = PolyRing.new(GF(5),"x,y,z",PolyRing.lex); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #automatic: one,x,y,z = r.gens(); 15 | 16 | #f1 = (x**2 - 5)**2; 17 | #f1 = (y**10 - x**5)**3; 18 | f2 = y**6 + 2 * x * y**4 + 3 * x**2 * y**2 + 4 * x**3; 19 | f2 = f2**5; 20 | f3 = z**10 - x**5; 21 | 22 | f4 = (y**2 - x)**3; 23 | 24 | #puts "f1 = " + str(f1); 25 | puts "f2 = " + str(f2); 26 | puts "f3 = " + str(f3); 27 | #puts "f4 = " + str(f4); 28 | puts; 29 | 30 | F = r.ideal( "", list=[f2,f3] ); 31 | puts "F = " + str(F); 32 | puts; 33 | 34 | startLog(); 35 | 36 | t = System.currentTimeMillis(); 37 | R = F.radicalDecomp(); 38 | t = System.currentTimeMillis() - t; 39 | puts "R = " + str(R); 40 | puts; 41 | puts "decomp time = " + str(t) + " milliseconds"; 42 | puts; 43 | 44 | puts "F = " + str(F); 45 | puts; 46 | 47 | #startLog(); 48 | terminate(); 49 | -------------------------------------------------------------------------------- /examples/raksanyi.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring, PolyRing, RF, ZZ 9 | from jas import terminate 10 | 11 | 12 | # Raksanyi & Walter example 13 | # rational function coefficients 14 | 15 | #r = Ring( "RatFunc(a1, a2, a3, a4) (x1, x2, x3, x4) G" ); 16 | r = PolyRing( RF(PolyRing(ZZ(),"a1, a2, a3, a4",PolyRing.lex)), 17 | "x1, x2, x3, x4", PolyRing.grad ); 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | ps = """ 22 | ( 23 | ( x4 - { a4 - a2 } ), 24 | ( x1 + x2 + x3 + x4 - { a1 + a3 + a4 } ), 25 | ( x1 x3 + x1 x4 + x2 x3 + x3 x4 - { a1 a4 + a1 a3 + a3 a4 } ), 26 | ( x1 x3 x4 - { a1 a3 a4 } ) 27 | ) 28 | """; 29 | 30 | f = r.ideal( ps ); 31 | print "Ideal: " + str(f); 32 | print; 33 | 34 | rg = f.GB(); 35 | rg = f.GB(); 36 | rg = f.GB(); 37 | print "GB:", rg; 38 | print; 39 | 40 | terminate(); 41 | 42 | -------------------------------------------------------------------------------- /examples/raksanyi.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Raksanyi & Walter example 9 | # rational function coefficients 10 | 11 | #r = Ring.new( "RatFunc(a1, a2, a3, a4) (x1, x2, x3, x4) G" ); 12 | r = PolyRing.new( RF(PolyRing.new(ZZ(),"a1, a2, a3, a4",PolyRing.lex)), 13 | "x1, x2, x3, x4", PolyRing.grad ); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | ps = """ 18 | ( 19 | ( x4 - { a4 - a2 } ), 20 | ( x1 + x2 + x3 + x4 - { a1 + a3 + a4 } ), 21 | ( x1 x3 + x1 x4 + x2 x3 + x3 x4 - { a1 a4 + a1 a3 + a3 a4 } ), 22 | ( x1 x3 x4 - { a1 a3 a4 } ) 23 | ) 24 | """; 25 | 26 | f = r.ideal( ps ); 27 | puts "Ideal: " + str(f); 28 | puts; 29 | 30 | rg = f.GB(); 31 | rg = f.GB(); 32 | rg = f.GB(); 33 | puts "GB:" + str(rg); 34 | puts; 35 | 36 | terminate(); 37 | -------------------------------------------------------------------------------- /examples/raksanyi_int.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring 9 | from jas import startLog, terminate 10 | 11 | 12 | # Raksanyi & Walter example 13 | # rational function coefficients 14 | 15 | r = Ring( "IntFunc(a1, a2, a3, a4) (x1, x2, x3, x4) L" ); 16 | print "Ring: " + str(r); 17 | print; 18 | 19 | ps = """ 20 | ( 21 | ( x4 - { a4 - a2 } ), 22 | ( x1 + x2 + x3 + x4 - { a1 + a3 + a4 } ), 23 | ( x1 x3 + x1 x4 + x2 x3 + x3 x4 - { a1 a4 + a1 a3 + a3 a4 } ), 24 | ( x1 x3 x4 - { a1 a3 a4 } ) 25 | ) 26 | """; 27 | 28 | f = r.paramideal( ps ); 29 | print "Ideal: " + str(f); 30 | print; 31 | 32 | #startLog(); 33 | 34 | rg = f.GB(); 35 | rg = f.GB(); 36 | rg = f.GB(); 37 | print "Ideal: " + str(rg); 38 | print; 39 | 40 | bg = rg.isGB(); 41 | if bg: 42 | print "isGB: true"; 43 | else: 44 | print "isGB: false"; 45 | print; 46 | 47 | terminate(); 48 | -------------------------------------------------------------------------------- /examples/raksanyi_int.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # Raksanyi & Walter example 9 | # rational function coefficients 10 | 11 | r = Ring.new( "IntFunc(a1, a2, a3, a4) (x1, x2, x3, x4) L" ); 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | ps = """ 16 | ( 17 | ( x4 - { a4 - a2 } ), 18 | ( x1 + x2 + x3 + x4 - { a1 + a3 + a4 } ), 19 | ( x1 x3 + x1 x4 + x2 x3 + x3 x4 - { a1 a4 + a1 a3 + a3 a4 } ), 20 | ( x1 x3 x4 - { a1 a3 a4 } ) 21 | ) 22 | """; 23 | 24 | f = r.paramideal( ps ); 25 | puts "Ideal: " + str(f); 26 | puts; 27 | 28 | #startLog(); 29 | 30 | rg = f.GB(); 31 | rg = f.GB(); 32 | rg = f.GB(); 33 | puts "Ideal: " + str(rg); 34 | puts; 35 | 36 | bg = rg.isGB(); 37 | if bg 38 | puts "isGB: true"; 39 | else 40 | puts "isGB: false"; 41 | end 42 | puts; 43 | 44 | terminate(); 45 | -------------------------------------------------------------------------------- /examples/real_roots_ideal.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: real roots over Q for zero dimensional ideals 9 | 10 | r = PolyRing.new(QQ(),"q,w,s,x",PolyRing.lex); 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #automatic: one,q,w,s,x = r.gens(); 15 | 16 | # EF.new(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2", "[1,2]").polynomial("x").build(); 17 | 18 | f1 = q**3 - 3; 19 | f2 = w**2 - q; 20 | #f3 = s**5 - 2; 21 | f3 = s**3 - 2; 22 | f4 = x**2 - w * s; 23 | 24 | puts "f1 = " + str(f1); 25 | puts "f2 = " + str(f2); 26 | puts "f3 = " + str(f3); 27 | puts "f4 = " + str(f4); 28 | puts; 29 | 30 | F = r.ideal( "", list=[f1,f2,f3,f4] ); 31 | puts "F = " + str(F); 32 | puts; 33 | 34 | startLog(); 35 | 36 | t = System.currentTimeMillis(); 37 | R = F.realRoots(); 38 | t = System.currentTimeMillis() - t; 39 | puts "R = " + str(R); 40 | puts; 41 | puts "real roots = "; 42 | F.realRootsPrint() 43 | puts "real roots time = " + str(t) + " milliseconds"; 44 | puts; 45 | 46 | puts "F = " + str(F); 47 | puts; 48 | 49 | #startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/roots_real_tower.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: real roots tower over Q 9 | 10 | r = EF.new(QQ()).realExtend("q","q^3 - 3", "[1,2]").realExtend("w", "w^2 - q", "[1,2]").realExtend("s", "s^5 - 2", "[1,2]").polynomial("x").build(); 11 | 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #automatic: one,q,w,s,x = r.gens(); 16 | 17 | 18 | f = x**2 - w * s; 19 | 20 | puts "f = " + f.to_s; 21 | puts; 22 | 23 | 24 | startLog(); 25 | 26 | t = System.currentTimeMillis(); 27 | rr = r.realRoots(f); 28 | t = System.currentTimeMillis() - t; 29 | #puts "rr = " + str(rr); 30 | puts "rr = " + str(rr.map{ |a| str(a.elem.ring.getRoot())+"," }); 31 | puts "real roots time = " + str(t) + " milliseconds"; 32 | 33 | eps = QQ(1,10) ** (BigDecimal::DEFAULT_PRECISION); 34 | puts "eps = " + str(eps); 35 | 36 | t = System.currentTimeMillis(); 37 | rr = r.realRoots(f,eps); 38 | t = System.currentTimeMillis() - t; 39 | #puts "rr = ", [ str(r) for r in rr ]; 40 | puts "rr = " + str(rr.map{ |a| str(a.elem.decimalMagnitude())+"," }); 41 | puts "real roots time = " + str(t) + " milliseconds"; 42 | 43 | #startLog(); 44 | terminate(); 45 | -------------------------------------------------------------------------------- /examples/rose.jas: -------------------------------------------------------------------------------- 1 | # of rose 2 | 3 | (U3,U4,A46) L 4 | 5 | ( 6 | U4^4 - 20/7 A46^2, 7 | A46^2 U3^4 + 7/10 A46 U3^4 + 7/48 U3^4 - 50/27 A46^2 - 35/27 A46 - 49/216, 8 | A46^5 U4^3 + 7/5 A46^4 U4^3 + 609/1000 A46^3 9 | U4^3 + 49/1250 A46^2 U4^3 - 27391/800000 A46 U4^3 10 | - 1029/160000 U4^3 + 3/7 A46^5 U3 U4^2 + 3/5 A46^6 11 | U3 U4^2 + 63/200 A46^3 U3 U4^2 + 147/2000 A46^2 12 | U3 U4^2 + 4137/800000 A46 U3 U4^2 - 7/20 A46^4 13 | U3^2 U4 - 77/125 A46^3 U3^2 U4 - 23863/60000 A46^2 14 | U3^2 U4 - 1078/9375 A46 U3^2 U4 - 24353/1920000 15 | U3^2 U4 - 3/20 A46^4 U3^3 - 21/100 A46^3 U3^3 16 | - 91/800 A46^2 U3^3 - 5887/200000 A46 U3^3 17 | - 343/128000 U3^3 18 | ) 19 | 20 | -------------------------------------------------------------------------------- /examples/sd.ini: -------------------------------------------------------------------------------- 1 | # 2 | # $Id$ 3 | # 4 | [DEFAULT] 5 | sdhost = symbolicdata.uni-leipzig.de 6 | 7 | [sparql] 8 | #local = http://localhost:8890/sparql 9 | local = http://localhost:8890 10 | #symbolicdata.org = http://symbolicdata.uni-leipzig.de:8890/sparql 11 | symbolicdata.org = %(sdhost)s:8890 12 | path = /sparql 13 | 14 | [symbolicdata] 15 | sd = http://symbolicdata.org/Data/Model# 16 | ideal = http://symbolicdata.org/Data/Ideal/ 17 | 18 | [queries] 19 | list_ideals = SELECT ?ideal WHERE { ?ideal a sd:Ideal . } 20 | -------------------------------------------------------------------------------- /examples/sdexam.py: -------------------------------------------------------------------------------- 1 | # 2 | # $Id$ 3 | # 4 | 5 | import sdjas; 6 | from jas import terminate, startLog, auto_inject 7 | #startLog() 8 | 9 | auto_inject = False 10 | sd = sdjas.SymbolicData() 11 | print 12 | #sd.list_ideals() 13 | #print 14 | #exit(); 15 | 16 | bb87 = sd.get_ideal('Buchberger-87') 17 | #bb87 = sd.get_ideal('Buchberger-87.Homog') 18 | print 19 | print "bb87 = " + str(bb87) 20 | print 21 | G = bb87.GB() 22 | print "G = " + str(G) 23 | print 24 | 25 | startLog() 26 | #terminate() 27 | #exit(); 28 | 29 | 30 | cz86c = sd.get_ideal('Czapor-86c') 31 | #cz86c = sd.get_ideal('Czapor-86c.Flat') 32 | #cz86c = sd.get_ideal('Czapor-86c.Flat.Homog') 33 | print 34 | print "cz86c = " + str(cz86c) 35 | print 36 | G = cz86c.GB() 37 | print "G = " + str(G) 38 | print 39 | 40 | #startLog() 41 | terminate() 42 | exit(); 43 | 44 | ids = sd.get_ideals() 45 | 46 | for id in ids: 47 | print "id = " + str(id) 48 | if 'Curves' in id: #.find('Curves') >= 0: 49 | print "'Curves' = " + str(id) 50 | continue 51 | F = sd.get_ideal(id) 52 | print "F = " + str(F) 53 | G = F.GB(); 54 | print "G = " + str(G) 55 | -------------------------------------------------------------------------------- /examples/sdexam.rb: -------------------------------------------------------------------------------- 1 | # 2 | # $Id$ 3 | # 4 | 5 | require "examples/jas" 6 | require "examples/sdjas" 7 | 8 | startLog() 9 | 10 | sd = SymbolicData.new() 11 | puts 12 | #sd.list_ideals() 13 | #puts 14 | #exit(); 15 | 16 | bb87 = sd.get_ideal('Buchberger-87') 17 | #bb87 = sd.get_ideal('Buchberger-87.Homog') 18 | puts 19 | puts "bb87 = " + str(bb87) 20 | puts 21 | gg = bb87.GB() 22 | puts "gg = " + str(gg) 23 | puts 24 | 25 | #startLog() 26 | #terminate() 27 | #exit(); 28 | 29 | 30 | cz86c = sd.get_ideal('Czapor-86c') 31 | #cz86c = sd.get_ideal('Czapor-86c.Flat') 32 | #cz86c = sd.get_ideal('Czapor-86c.Flat.Homog') 33 | puts 34 | puts "cz86c = " + str(cz86c) 35 | puts 36 | gg = cz86c.GB() 37 | puts "gg = " + str(gg) 38 | puts 39 | 40 | #startLog() 41 | terminate() 42 | 43 | -------------------------------------------------------------------------------- /examples/series_poly.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | #load "examples/jas.rb" 7 | require "examples/jas" 8 | 9 | # example polynomial with multivariate powerseries coefficients 10 | 11 | startLog(); 12 | 13 | #s = MPS(QQ(),"x,y"); 14 | s = MultiSeriesRing.new("",8,nil,QQ(),"x,y"); 15 | puts "s: " + s.to_s; 16 | 17 | ##one,x,y = s.gens(); 18 | ##puts "1: " + one.to_s; 19 | ##puts "x: " + x.to_s; 20 | ##puts "y: " + y.to_s; 21 | 22 | r = PolyRing.new(s.ring,"z"); 23 | puts "r: " + r.to_s; 24 | puts; 25 | puts "z: " + z.to_s; 26 | 27 | #one,x,y,z = r.gens(); 28 | puts "x: " + x.to_s; 29 | puts "y: " + y.to_s; 30 | 31 | p = y + z + (x+1) * z**2; 32 | #p = z + z**2; 33 | puts "p: " + p.to_s; 34 | 35 | q = p.monic(); 36 | puts "q: " + q.to_s; 37 | 38 | o = p / q; 39 | puts "o: " + o.to_s; 40 | 41 | o2 = o*q; 42 | puts "o*q: " + o2.to_s; 43 | puts "p == o*q: " + (p == o2).to_s; 44 | puts; 45 | 46 | o = p*q; 47 | puts "p*q: " + o.to_s; 48 | puts; 49 | 50 | #terminate(); 51 | -------------------------------------------------------------------------------- /examples/sgb.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials: 2 | (a,x,y) L 3 | RelationTable 4 | ( 5 | ( y ), ( x ), ( x y + a ) 6 | ) 7 | 8 | ( 9 | ( y**3 + x**2 y + x y ), 10 | ( x**2 + x ) 11 | ) 12 | -------------------------------------------------------------------------------- /examples/sicora.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, ZZ, Order, Ideal 9 | from jas import startLog, terminate 10 | 11 | # sicora, e-gb example 12 | 13 | r = PolyRing( ZZ(), "t", Order.INVLEX ); 14 | print "Ring: " + str(r); 15 | print; 16 | 17 | f1 = 2 * t + 1; 18 | f2 = t**2 + 1; 19 | 20 | F = r.ideal( "", [f1,f2] ); 21 | print "Ideal: " + str(F); 22 | print; 23 | 24 | E = F.eGB(); 25 | print "seq e-GB:", E; 26 | print "is e-GB:", E.iseGB(); 27 | print; 28 | 29 | f = t**3; 30 | n = E.eReduction(f); 31 | print "e-Reduction = " + str(n); 32 | -------------------------------------------------------------------------------- /examples/sicora.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # sicora, e-gb example 9 | 10 | r = PolyRing.new(ZZ(),"t",Order::INVLEX) 11 | puts "Ring: " + str(r); 12 | puts; 13 | #automatic: one,t = r.gens(); 14 | 15 | f1 = 2 * t + 1; 16 | f2 = t**2 + 1; 17 | 18 | ff = r.ideal( "", [f1,f2] ); 19 | puts "ideal: " + str(ff); 20 | puts; 21 | 22 | gg = ff.eGB(); 23 | puts "seq e-GB: " + str(gg); 24 | puts "is e-GB: " + str(gg.iseGB()); 25 | puts; 26 | 27 | f = t**3; 28 | n = gg.eReduction(f); 29 | puts "e-Reduction = " + str(n); 30 | 31 | -------------------------------------------------------------------------------- /examples/solv_cgb_0.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # simple example for solvable comprehensive GB 9 | # integral/rational function coefficients 10 | 11 | rc = PolyRing.new( PolyRing.new(QQ(),"u,v",PolyRing.lex),"x,y", PolyRing.lex ); 12 | puts "commutativ Ring: " + str(rc); 13 | puts; 14 | 15 | rel = [y, x, x * y + 1]; 16 | puts "relations = [ " + rel.join(", ") { |r| r.to_s } + "]"; 17 | puts; 18 | 19 | r = SolvPolyRing.new( PolyRing.new(QQ(),"u,v",PolyRing.lex),"x,y", PolyRing.lex, rel); 20 | puts "Ring: " + str(r); 21 | puts; 22 | 23 | p1 = v * x * y + x; 24 | p2 = u * y**2 + x**2; 25 | 26 | f = r.paramideal( "", [p1,p2] ); 27 | puts "ParamIdeal: " + str(f); 28 | puts; 29 | 30 | #sys.exit(); 31 | #startLog(); 32 | 33 | gs = f.CGBsystem(); 34 | puts "CGBsystem: " + str(gs); 35 | puts; 36 | 37 | #sys.exit(); 38 | 39 | bg = gs.isCGBsystem(); 40 | puts "isCGBsystem: " + str(bg); 41 | puts; 42 | 43 | #exit(); 44 | #startLog(); 45 | 46 | gs = f.CGB(); 47 | puts; 48 | puts "CGB: " + str(gs); 49 | puts; 50 | 51 | #startLog(); 52 | 53 | bg = gs.isCGB(); 54 | puts "isCGB: " + str(bg); 55 | puts; 56 | 57 | terminate(); 58 | #sys.exit(); 59 | 60 | -------------------------------------------------------------------------------- /examples/solvable.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import SolvableRing 7 | 8 | 9 | # WA_32 solvable polynomial example 10 | 11 | rs = """ 12 | # solvable polynomials, Weyl algebra A_3,2: 13 | Rat(a,b,e1,e2,e3) G|3| 14 | RelationTable 15 | ( 16 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 17 | ( e3 ), ( e2 ), ( e2 e3 - e2 ) 18 | ) 19 | """; 20 | 21 | r = SolvableRing( rs ); 22 | print "SolvableRing: " + str(r); 23 | print; 24 | 25 | 26 | ps = """ 27 | ( 28 | ( e1 e3^3 + e2^10 - a ), 29 | ( e1^3 e2^2 + e3 ), 30 | ( e3^3 + e3^2 - b ) 31 | ) 32 | """; 33 | 34 | f = r.ideal( ps ); 35 | print "SolvableIdeal: " + str(f); 36 | print; 37 | 38 | 39 | rg = f.leftGB(); 40 | print "seq left GB:", rg; 41 | print; 42 | 43 | 44 | rg = f.twosidedGB(); 45 | print "seq twosided GB:", rg; 46 | print; 47 | 48 | 49 | rg = f.rightGB(); 50 | print "seq right GB:", rg; 51 | print; 52 | -------------------------------------------------------------------------------- /examples/solvable.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # WA_32 solvable polynomial example 9 | 10 | rs = """ 11 | # solvable polynomials, Weyl algebra A_3,2: 12 | Rat(a,b,e1,e2,e3) G|3| 13 | RelationTable 14 | ( 15 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 16 | ( e3 ), ( e2 ), ( e2 e3 - e2 ) 17 | ) 18 | """; 19 | 20 | r = SolvableRing.new( rs ); 21 | puts "SolvableRing: " + str(r); 22 | puts; 23 | 24 | 25 | ps = """ 26 | ( 27 | ( e1 e3^3 + e2^10 - a ), 28 | ( e1^3 e2^2 + e3 ), 29 | ( e3^3 + e3^2 - b ) 30 | ) 31 | """; 32 | 33 | f = r.ideal( ps ); 34 | puts "SolvableIdeal: " + str(f); 35 | puts; 36 | 37 | 38 | rg = f.leftGB(); 39 | puts "seq left GB: " + str(rg); 40 | puts; 41 | 42 | 43 | rg = f.twosidedGB(); 44 | puts "seq twosided GB: " + str(rg); 45 | puts; 46 | 47 | 48 | rg = f.rightGB(); 49 | puts "seq right GB: " + str(rg); 50 | puts; 51 | 52 | startLog(); 53 | terminate(); 54 | -------------------------------------------------------------------------------- /examples/solvablemodule.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import SolvableModule 7 | from jas import SolvableSubModule 8 | 9 | # Quantum plane example 10 | 11 | rsan = """ 12 | AN[ (i) (i^2 + 1) ] (Y,X,x,y) G 13 | RelationTable 14 | ( 15 | ( y ), ( x ), ( {i} x y ) 16 | ( X ), ( Y ), ( {i} Y X ) 17 | ) 18 | """; 19 | 20 | rsc = """ 21 | C(Y,X,x,y) G |2| 22 | RelationTable 23 | ( 24 | ( y ), ( x ), ( 0i1 x y ) 25 | ( X ), ( Y ), ( 0i1 Y X ) 26 | ) 27 | """; 28 | 29 | r = SolvableModule( rsc ); 30 | #r = SolvableModule( rsan ); 31 | print "SolvableModule: " + str(r); 32 | print; 33 | 34 | 35 | ps = """ 36 | ( 37 | ( ( x + 1 ), ( y ) ), 38 | ( ( x y ), ( 0 ) ), 39 | ( ( x - X ), ( x - X ) ), 40 | ( ( y - Y ), ( y - Y ) ) 41 | ) 42 | """; 43 | 44 | f = SolvableSubModule( r, ps ); 45 | print "SolvableSubModule: " + str(f); 46 | print; 47 | 48 | 49 | flg = f.leftGB(); 50 | print "seq left GB:", flg; 51 | print; 52 | 53 | 54 | ftg = f.twosidedGB(); 55 | print "seq twosided GB:", ftg; 56 | print; 57 | 58 | # split term order not supported for rightGB 59 | -------------------------------------------------------------------------------- /examples/squarefree.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing, QQ, ZM 9 | from jas import terminate, startLog 10 | 11 | import operator 12 | 13 | # polynomial examples: squarefree: characteristic 0 14 | 15 | r = PolyRing(QQ(),"x, y, z",PolyRing.lex) 16 | print "Ring: " + str(r); 17 | print; 18 | 19 | #automatic: [one,x,y,z] = r.gens(); 20 | 21 | a = r.random(k=2,l=3); 22 | b = r.random(k=2,l=3); 23 | c = r.random(k=1,l=3); 24 | 25 | if a.isZERO(): 26 | a = x; 27 | if b.isZERO(): 28 | b = y; 29 | if c.isZERO(): 30 | c = z; 31 | 32 | f = a**2 * b**3 * c; 33 | 34 | print "a = ", a; 35 | print "b = ", b; 36 | print "c = ", c; 37 | print "f = ", f; 38 | print; 39 | 40 | t = System.currentTimeMillis(); 41 | #F = r.squarefreeFactors(f); 42 | F = f.squarefreeFactors(); 43 | t = System.currentTimeMillis() - t; 44 | print "factors:"; 45 | print ", ".join([ str(k)+"**"+str(v) for k,v in F.items() ] ); 46 | print 47 | print "f == prod(F): " + str(f == reduce(operator.mul, [ k**v for k,v in F.items()])) 48 | print 49 | print "factor time =", t, "milliseconds"; 50 | 51 | startLog(); 52 | terminate(); 53 | -------------------------------------------------------------------------------- /examples/squarefree.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: squarefree: characteristic 0 9 | 10 | r = PolyRing.new(QQ(),"x, y, z",PolyRing.lex) 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #automatic: one,x,y,z = r.gens(); 15 | 16 | a = r.random(k=2,l=3); 17 | b = r.random(k=2,l=3); 18 | c = r.random(k=1,l=3); 19 | 20 | if a.isZERO() 21 | a = x; 22 | end 23 | if b.isZERO() 24 | b = y; 25 | end 26 | if c.isZERO() 27 | c = z; 28 | end 29 | 30 | f = a**2 * b**3 * c; 31 | 32 | puts "a = " + str(a); 33 | puts "b = " + str(b); 34 | puts "c = " + str(c); 35 | puts "f = " + str(f); 36 | puts; 37 | 38 | t = System.currentTimeMillis(); 39 | #F = r.squarefreeFactors(f); 40 | F = f.squarefreeFactors(); 41 | t = System.currentTimeMillis() - t; 42 | puts "factors:"; 43 | puts F.map { |k,v| k.to_s + ( v == 1 ? "" : "**" + v.to_s ) }.join(", ") 44 | puts 45 | puts "f == prod(F): " + (f == F.map { |k,v| k**v }.reduce(:*)).to_s 46 | puts 47 | puts "factor time = " + str(t) + " milliseconds"; 48 | 49 | startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/squarefree_finite.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing, QQ, ZM, GF 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: squarefree: characteristic p, finite 12 | 13 | #r = PolyRing(QQ(),"x, y, z",PolyRing.lex) 14 | r = PolyRing(GF(5),"x, y, z",PolyRing.lex) 15 | print "Ring: " + str(r); 16 | print; 17 | 18 | #automatic: [one,x,y,z] = r.gens(); 19 | 20 | a = r.random(k=2,l=3); 21 | b = r.random(k=2,l=3); 22 | c = r.random(k=1,l=3); 23 | 24 | if a.isZERO(): 25 | a = x; 26 | if b.isZERO(): 27 | b = y; 28 | if c.isZERO(): 29 | c = z; 30 | 31 | f = a**10 * b**5 * c; 32 | 33 | print "a = ", a; 34 | print "b = ", b; 35 | print "c = ", c; 36 | print "f = ", f; 37 | print; 38 | 39 | t = System.currentTimeMillis(); 40 | F = r.squarefreeFactors(f); 41 | t = System.currentTimeMillis() - t; 42 | print "factors:"; 43 | for g in F.keys(): 44 | i = F[g]; 45 | print "g = %s**%s" % (g,i); 46 | print 47 | print "factor time =", t, "milliseconds"; 48 | 49 | startLog(); 50 | terminate(); 51 | -------------------------------------------------------------------------------- /examples/squarefree_finite.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: squarefree: characteristic p, finite 9 | 10 | #r = PolyRing.new(QQ(),"x, y, z",PolyRing.lex) 11 | r = PolyRing.new(GF(5),"x, y, z",PolyRing.lex) 12 | puts "Ring: " + str(r); 13 | puts; 14 | 15 | #automatic: one,x,y,z = r.gens(); 16 | 17 | a = r.random(k=2,l=3); 18 | b = r.random(k=2,l=3); 19 | c = r.random(k=1,l=3); 20 | 21 | if a.isZERO() 22 | a = x; 23 | end 24 | if b.isZERO() 25 | b = y; 26 | end 27 | if c.isZERO() 28 | c = z; 29 | end 30 | 31 | f = a**10 * b**5 * c; 32 | #f = 1; 33 | 34 | puts "a = " + str(a); 35 | puts "b = " + str(b); 36 | puts "c = " + str(c); 37 | puts "f = " + str(f); 38 | puts; 39 | 40 | t = System.currentTimeMillis(); 41 | F = r.squarefreeFactors(f); 42 | t = System.currentTimeMillis() - t; 43 | puts "factors:"; 44 | for g in F.keys() 45 | i = F[g]; 46 | puts "g = #{g}**#{i}"; 47 | end 48 | puts 49 | puts "factor time = " + str(t) + " milliseconds"; 50 | 51 | startLog(); 52 | terminate(); 53 | -------------------------------------------------------------------------------- /examples/squarefree_finite_alg.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import PolyRing, QQ, ZM, AN, GF 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: squarefree: characteristic p, finite algebraic 12 | 13 | ar = PolyRing(GF(7),"i",PolyRing.lex) 14 | #automatic: [one,i] = ar.gens(); 15 | 16 | # irred for 7, 11, 19 17 | r = PolyRing(AN(i**2+1,field=True),"x, y, z",PolyRing.lex) 18 | print "Ring: " + str(r); 19 | print; 20 | 21 | #automatic: [one,i,x,y,z] = r.gens(); 22 | 23 | a = r.random(k=2,l=3); 24 | b = r.random(k=2,l=3); 25 | c = r.random(k=1,l=3); 26 | 27 | if a.isZERO(): 28 | a = x; 29 | if b.isZERO(): 30 | b = y; 31 | if c.isZERO(): 32 | c = z; 33 | 34 | f = a**2 * b**7 * c; 35 | 36 | print "a = ", a; 37 | print "b = ", b; 38 | print "c = ", c; 39 | print "f = ", f; 40 | print; 41 | 42 | t = System.currentTimeMillis(); 43 | F = r.squarefreeFactors(f); 44 | t = System.currentTimeMillis() - t; 45 | print "factors:"; 46 | for g in F.keys(): 47 | i = F[g]; 48 | print "g = %s**%s" % (g,i); 49 | print 50 | print "factor time =", t, "milliseconds"; 51 | 52 | startLog(); 53 | terminate(); 54 | -------------------------------------------------------------------------------- /examples/squarefree_finite_alg.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: squarefree: characteristic p, finite algebraic 9 | 10 | ar = PolyRing.new(GF(7),"i",PolyRing.lex) 11 | #automatic: one,i = ar.gens(); 12 | 13 | # irred for 7, 11, 19 14 | r = PolyRing.new(AN(i**2+1,field=true),"x, y, z",PolyRing.lex) 15 | puts "Ring: " + str(r); 16 | puts; 17 | 18 | #automatic: one,i,x,y,z = r.gens(); 19 | 20 | a = r.random(k=2,l=3); 21 | b = r.random(k=2,l=3); 22 | c = r.random(k=1,l=3); 23 | 24 | if a.isZERO() 25 | a = x; 26 | end 27 | if b.isZERO() 28 | b = y; 29 | end 30 | if c.isZERO() 31 | c = z; 32 | end 33 | 34 | f = a**2 * b**7 * c; 35 | 36 | puts "a = " + str(a); 37 | puts "b = " + str(b); 38 | puts "c = " + str(c); 39 | puts "f = " + str(f); 40 | puts; 41 | 42 | t = System.currentTimeMillis(); 43 | F = r.squarefreeFactors(f); 44 | t = System.currentTimeMillis() - t; 45 | puts "factors:"; 46 | 47 | for g in F.keys() 48 | i = F[g]; 49 | puts "g = #{g}**#{i}"; 50 | end 51 | puts 52 | puts "factor time = " + str(t) + " milliseconds"; 53 | 54 | startLog(); 55 | terminate(); 56 | -------------------------------------------------------------------------------- /examples/std.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import Ring, PolyRing, Ideal, PSIdeal, QQ, ZM 9 | from jas import startLog, terminate 10 | 11 | # example from CLO(UAG), 4.4 12 | 13 | #R = PolyRing( GF(32003), "x,y,z" ); 14 | R = PolyRing( QQ(), "x,y,z" ); 15 | print "Ring: " + str(R); 16 | print; 17 | 18 | #automatic: [one,x,y,z] = R.gens(); 19 | 20 | f1 = x**5 - x * y**6 - z**7; 21 | f2 = x * y + y**3 + z**3; 22 | f3 = x**2 + y**2 - z**2; 23 | 24 | L = [f1,f2,f3]; 25 | #print "L = ", str(L); 26 | 27 | F = R.ideal( list=L ); 28 | print "Ideal: " + str(F); 29 | print; 30 | 31 | PR = R.powerseriesRing(); 32 | print "Power series ring: " + str(PR); 33 | print; 34 | 35 | Fp = PSIdeal(PR,L); 36 | print "Power series ideal: " + str(Fp); 37 | print; 38 | 39 | startLog(); 40 | 41 | #9+5 # truncate at total degree 9 42 | S = Fp.STD(); 43 | #print "std: " + str(S); 44 | print; 45 | for p in S.list: 46 | #print "p = ", str(p.asPolynomial()); 47 | print "p = ", str(p); 48 | print; 49 | 50 | #sys.exit(); 51 | 52 | #terminate(); 53 | 54 | -------------------------------------------------------------------------------- /examples/std.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # example from CLO(UAG), 4.4 9 | 10 | #R = PolyRing( GF(32003), "x,y,z" ); 11 | R = PolyRing.new( QQ(), "x,y,z" ); 12 | puts "Ring: " + str(R); 13 | puts; 14 | 15 | #automatic: one,x,y,z = R.gens(); 16 | 17 | f1 = x**5 - x * y**6 - z**7; 18 | f2 = x * y + y**3 + z**3; 19 | f3 = x**2 + y**2 - z**2; 20 | 21 | L = [f1,f2,f3]; 22 | #puts "L = ", str(L); 23 | 24 | F = R.ideal( "", L ); 25 | puts "Ideal: " + str(F); 26 | puts; 27 | 28 | PR = R.powerseriesRing(); 29 | puts "Power series ring: " + str(PR); 30 | puts; 31 | 32 | Fp = PSIdeal.new(PR,L); 33 | puts "Power series ideal: " + str(Fp); 34 | puts; 35 | 36 | startLog(); 37 | 38 | #9+5 # truncate at total degree 9 39 | S = Fp.STD(); 40 | #puts "std: " + str(S); 41 | puts; 42 | for p in S.list do 43 | #puts "p = ", str(p.asPolynomial()); 44 | puts "p = " + str(p); 45 | end 46 | puts; 47 | 48 | #sys.exit(); 49 | 50 | #terminate(); 51 | 52 | -------------------------------------------------------------------------------- /examples/subring.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from java.lang import System 7 | 8 | from jas import Ring, PolyRing, QQ, ZZ, GF, CC, ZM 9 | from jas import terminate, startLog 10 | 11 | # polynomial examples: subring 12 | 13 | #r = PolyRing( ZM(1152921504606846883), "(x,y,z)", PolyRing.lex ); 14 | #r = PolyRing( CC(), "(x,y,z)", PolyRing.lex ); 15 | #r = PolyRing( ZZ(), "(x,y,z)", PolyRing.lex ); 16 | r = PolyRing( QQ(), "x,y,z", PolyRing.lex ); 17 | print "Ring: " + str(r); 18 | print; 19 | 20 | #[one,x,y,z] = r.gens(); 21 | 22 | a = r.random(3,4); 23 | b = r.random(2,3); 24 | c = abs( r.random(3,3) ); 25 | 26 | print "a = ", a; 27 | print "b = ", b; 28 | print "c = ", c; 29 | print; 30 | 31 | 32 | 33 | t = System.currentTimeMillis(); 34 | dd = r.subring("", [a,b,c]); 35 | t = System.currentTimeMillis() - t; 36 | 37 | print "sub ring = " + str([ str(x) for x in dd]); 38 | print; 39 | 40 | print "subring time = " + str(t) + " milliseconds" ; 41 | print; 42 | 43 | cc = a + b * c; 44 | tt = r.subringmember(dd, cc); 45 | print "sub ring member = " + str(tt); 46 | print; 47 | 48 | #startLog(); 49 | terminate(); 50 | -------------------------------------------------------------------------------- /examples/subring.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # polynomial examples: subring 9 | 10 | #r = PolyRing.new( ZM(1152921504606846883), "(x,y,z)", PolyRing.lex ); 11 | #r = PolyRing.new( CC(), "(x,y,z)", PolyRing.lex ); 12 | #r = PolyRing.new( ZZ(), "(x,y,z)", PolyRing.lex ); 13 | r = PolyRing.new( QQ(), "x,y,z", PolyRing.lex ); 14 | puts "Ring: " + str(r); 15 | puts; 16 | 17 | #one,x,y,z = r.gens(); 18 | 19 | a = r.random(3,4); 20 | b = r.random(2,3); 21 | c = r.random(3,3).abs(); 22 | 23 | puts "a = " + str(a); 24 | puts "b = " + str(b); 25 | puts "c = " + str(c); 26 | puts; 27 | 28 | t = System.currentTimeMillis(); 29 | dd = r.subring("", [a,b,c]); 30 | t = System.currentTimeMillis() - t; 31 | 32 | puts "sub ring = " + str(dd.map{ |a| a.elem.to_s }); 33 | puts; 34 | 35 | puts "subring time = " + str(t) + " milliseconds" ; 36 | puts; 37 | 38 | cc = a + b * c; 39 | tt = r.subringmember(dd, cc); 40 | puts "sub ring member = " + str(tt); 41 | puts; 42 | 43 | #startLog(); 44 | terminate(); 45 | -------------------------------------------------------------------------------- /examples/sys-bio.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # system biology examples: GB in Z_2 9 | # see: Informatik Spektrum, 2009, February, 10 | # Laubenbacher, Sturmfels: Computer Algebra in der Systembiologie 11 | 12 | r = PolyRing.new(GF(2),"M, B, A, L, P",PolyRing.lex); 13 | puts "PolyRing: " + str(r); 14 | puts; 15 | 16 | #automatic not possible, since capital letters 17 | one,M,B,A,L,P = r.gens(); 18 | 19 | f1 = M - A; 20 | f2 = B - M; 21 | f3 = A - A - L * B - A * L * B; 22 | f4 = P - M; 23 | f5 = L - P - L - L * B - L * P - L * B * P; 24 | ## t1 = M - 1; 25 | ## t2 = B - 1; 26 | ## t3 = A - 1; 27 | ## t4 = L - 1; 28 | ## t5 = P - 1; 29 | # 30 | ## t1 = M; 31 | ## t2 = B; 32 | ## t3 = A; 33 | ## t4 = L; 34 | ## t5 = P; 35 | # 36 | ## t1 = M; 37 | ## t2 = B; 38 | ## t3 = A; 39 | ## t4 = L - 1; 40 | ## t5 = P; 41 | # 42 | t1 = M; 43 | t2 = B; 44 | t3 = A - 1; 45 | t4 = L - 1; 46 | t5 = P; 47 | 48 | 49 | F = [f1,f2,f3,f4,f5]; 50 | #F = [f1,f2,f3,f4,f5,t1,t2,t3,t4,t5]; 51 | 52 | I = r.ideal( "", list=F ); 53 | puts "Ideal: " + str(I); 54 | puts; 55 | 56 | G = I.GB(); 57 | puts "GB: " + str(G); 58 | puts; 59 | 60 | 61 | #startLog(); 62 | terminate(); 63 | -------------------------------------------------------------------------------- /examples/syzsolv.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import SolvableRing 7 | 8 | # ? example 9 | 10 | rs = """ 11 | Rat(a,b,e1,e2,e3) L 12 | RelationTable 13 | ( 14 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 15 | ( e3 ), ( e2 ), ( e2 e3 - e2 ) 16 | ) 17 | """; 18 | 19 | r = SolvableRing( rs ); 20 | print "SolvableRing: " + str(r); 21 | print; 22 | 23 | ps = """ 24 | ( 25 | ( e1 e3^3 + e2^10 - a ), 26 | ( e1^3 e2^2 + e3 ), 27 | ( e3^3 + e3^2 - b ) 28 | ) 29 | """; 30 | 31 | f = r.ideal( ps ); 32 | print "SolvIdeal: " + str(f); 33 | print; 34 | 35 | from edu.jas.gbufd import SolvableSyzygySeq; 36 | 37 | R = SolvableSyzygySeq(r.ring.coFac).resolution( f.pset ); 38 | 39 | for i in range(0,R.size()): 40 | print "\n %s. resolution" % (i+1); 41 | print "\n", R[i]; 42 | 43 | -------------------------------------------------------------------------------- /examples/syzsolv.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # ? example 9 | 10 | rs = """ 11 | Rat(a,b,e1,e2,e3) L 12 | RelationTable 13 | ( 14 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 15 | ( e3 ), ( e2 ), ( e2 e3 - e2 ) 16 | ) 17 | """; 18 | 19 | r = SolvableRing.new( rs ); 20 | puts "SolvableRing: " + str(r); 21 | puts; 22 | 23 | ps = """ 24 | ( 25 | ( e1 e3^3 + e2^10 - a ), 26 | ( e1^3 e2^2 + e3 ), 27 | ( e3^3 + e3^2 - b ) 28 | ) 29 | """; 30 | 31 | f = r.ideal( ps ); 32 | puts "SolvIdeal: " + str(f); 33 | puts; 34 | 35 | java_import "edu.jas.gbufd.SolvableSyzygySeq"; 36 | 37 | #startLog(); 38 | 39 | R = SolvableSyzygySeq.new(r.ring.coFac).resolution( f.pset ); 40 | 41 | for i in 0..R.size() 42 | puts "\n #{i+1}. resolution"; 43 | puts "\n" + str(R[i]); 44 | end 45 | 46 | #terminate(); 47 | -------------------------------------------------------------------------------- /examples/syzy3.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import Ring 7 | 8 | # ? example 9 | 10 | r = Ring( "Rat(x,y,z) L" ); 11 | print "Ring: " + str(r); 12 | print; 13 | 14 | ps = """ 15 | ( 16 | ( z^3 - y ), 17 | ( y z - x ), 18 | ( y^3 - x^2 z ), 19 | ( x z^2 - y^2 ) 20 | ) 21 | """; 22 | 23 | f = r.ideal( ps ); 24 | print "Ideal: " + str(f); 25 | print; 26 | 27 | from edu.jas.gbufd import SyzygySeq; 28 | 29 | R = SyzygySeq(r.ring.coFac).resolution( f.pset ); 30 | 31 | for i in range(0,R.size()): 32 | print "\n %s. resolution" % (i+1); 33 | print "\n ", R[i]; 34 | 35 | -------------------------------------------------------------------------------- /examples/syzy3.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # ? example 9 | 10 | r = Ring.new( "Rat(x,y,z) L" ); 11 | print "Ring: " + str(r); 12 | print; 13 | 14 | ps = """ 15 | ( 16 | ( z^3 - y ), 17 | ( y z - x ), 18 | ( y^3 - x^2 z ), 19 | ( x z^2 - y^2 ) 20 | ) 21 | """; 22 | 23 | f = r.ideal( ps ); 24 | print "Ideal: " + str(f); 25 | print; 26 | 27 | 28 | java_import "edu.jas.gbufd.SyzygySeq"; 29 | 30 | #startLog(); 31 | 32 | R = SyzygySeq.new(r.ring.coFac).resolution( f.pset ); 33 | 34 | for i in 0..R.size() 35 | puts "\n #{i+1}. resolution"; 36 | puts "\n" + str(R[i]); 37 | end 38 | 39 | #terminate(); 40 | -------------------------------------------------------------------------------- /examples/testunit.py: -------------------------------------------------------------------------------- 1 | # 2 | # test functionality of the jython interface to jas. 3 | # $Id$ 4 | # 5 | 6 | # test ideal Groebner bases 7 | execfile("examples/trinksTest.py") 8 | 9 | # test module Groebner bases 10 | execfile("examples/armbruster.py") 11 | 12 | # test solvable Groebner bases 13 | execfile("examples/wa_32.py") 14 | 15 | # test solvable module Groebner bases 16 | execfile("examples/solvablemodule.py") 17 | 18 | 19 | import sys; 20 | sys.exit(); 21 | -------------------------------------------------------------------------------- /examples/trinks.groovy: -------------------------------------------------------------------------------- 1 | /* 2 | * groovy trinks example. 3 | * $Id: $ 4 | */ 5 | 6 | import edu.jas.groovy.Ring 7 | import edu.jas.groovy.Ideal 8 | 9 | def r = new Ring( "Rat(B,S,T,Z,P,W) L" ); 10 | println "Ring: " + r.toString(); 11 | println ""; 12 | 13 | 14 | def ps = """ 15 | ( 16 | ( 45 P + 35 S - 165 B - 36 ), 17 | ( 35 P + 40 Z + 25 T - 27 S ), 18 | ( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ), 19 | ( - 9 W + 15 T P + 20 S Z ), 20 | ( P W + 2 T Z - 11 B**3 ), 21 | ( 99 W - 11 B S + 3 B**2 ) 22 | , ( B**2 + 33/50 B + 2673/10000 ) 23 | ) 24 | """; 25 | 26 | // ( B**2 + 33/50 B + 2673/10000 ) 27 | 28 | def f = r.ideal( ps ); 29 | println "Ideal: " + f 30 | println "" 31 | 32 | def rg = f.GB(); 33 | println "seq Output: " + rg 34 | println "" 35 | 36 | 37 | //terminate() 38 | 39 | a = new edu.jas.arith.BigRational(2,3) 40 | println "a = " + a 41 | 42 | b = a.fromInteger(5) 43 | println "b = " + b 44 | 45 | c = a.sum(b) 46 | println "c = " + c 47 | 48 | pp = new edu.jas.structure.Power(a) 49 | 50 | d = pp.positivePower(c,10) 51 | println "d = " + d 52 | 53 | d = pp.power(c,10) 54 | println "d = " + d 55 | 56 | //println "plus = " + (a+b) 57 | -------------------------------------------------------------------------------- /examples/trinks6.jas: -------------------------------------------------------------------------------- 1 | # trinks6 2 | 3 | (B,S,T,Z,P,W) L 4 | ( 5 | ( 45 P + 35 S - 165 B - 36 ), 6 | ( 35 P + 40 Z + 25 T - 27 S ), 7 | ( 15 W + 25 S P + 30 Z - 18 T - 165 B^2 ), 8 | ( - 9 W + 15 T P + 20 S Z ), 9 | ( P W + 2 T Z - 11 B^3 ), 10 | ( 99 W - 11 B S + 3 B^2 ) 11 | ) 12 | -------------------------------------------------------------------------------- /examples/trinks7.jas: -------------------------------------------------------------------------------- 1 | # trinks 7 2 | 3 | (B,S,T,Z,P,W) L 4 | ( 5 | ( 45 P + 35 S - 165 B - 36 ), 6 | ( 35 P + 40 Z + 25 T - 27 S ), 7 | ( 15 W + 25 S P + 30 Z - 18 T - 165 B**2 ), 8 | ( - 9 W + 15 T P + 20 S Z ), 9 | ( P W + 2 T Z - 11 B**3 ), 10 | ( 99 W - 11 B S + 3 B**2 ), 11 | ( B**2 + 33/50 B + 2673/10000 ) 12 | ) 13 | -------------------------------------------------------------------------------- /examples/tuzun.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | import sys; 7 | 8 | from jas import PolyRing, Ideal, ZZ 9 | from jas import startLog, terminate 10 | 11 | # tuzun, e-gb example 12 | 13 | r = PolyRing(ZZ(), "(t)" ); 14 | print "Ring: " + str(r); 15 | 16 | #automatic: [one,t] = r.gens(); 17 | print "one: " + str(one); 18 | print "t: " + str(t); 19 | print; 20 | 21 | f1 = 2 * t + 1; 22 | f2 = t**2 + 1; 23 | 24 | F = [f1,f2]; 25 | I = r.ideal( list=F ); 26 | print "Ideal: " + str(I); 27 | print; 28 | 29 | #startLog(); 30 | 31 | G = I.eGB(); 32 | print "seq e-GB:", G; 33 | print "is e-GB:", G.iseGB(); 34 | print; 35 | 36 | p = f1 + 2*f2 - f1*f2 + f1**4; 37 | print "p:", p; 38 | n = G.eReduction(p); 39 | print "n:", n; 40 | -------------------------------------------------------------------------------- /examples/tuzun.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # tuzun, e-gb example 9 | 10 | r = PolyRing.new(ZZ(),"t",PolyRing.lex) 11 | puts "Ring: " + str(r); 12 | puts; 13 | 14 | #automatic: one,t = r.gens(); 15 | 16 | f1 = 2 * t + 1; 17 | f2 = t**2 + 1; 18 | 19 | ff = r.ideal( "", [f1,f2] ); 20 | puts "ideal: " + str(ff); 21 | puts; 22 | 23 | #t = System.currentTimeMillis(); 24 | gg = ff.eGB(); 25 | #t = System.currentTimeMillis() - t; 26 | 27 | puts "seq e-GB: " + str(gg); 28 | puts; 29 | puts "is e-GB: " + str(gg.iseGB()); 30 | #puts "e-GB time = " + str(t) + " milliseconds"; 31 | puts; 32 | 33 | p = f1 + 2*f2 - f1*f2 + f1**4; 34 | puts "p: " + str(p); 35 | n = gg.eReduction(p); 36 | puts "n: " + str(n); 37 | 38 | #startLog(); 39 | terminate(); 40 | -------------------------------------------------------------------------------- /examples/u_sl_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import SolvableRing 7 | 8 | 9 | # U(sl_2) example 10 | 11 | rs = """ 12 | # solvable polynomials, U(sl_2): 13 | Rat(e,f,h) G 14 | RelationTable 15 | ( 16 | ( f ), ( e ), ( e f - h ), 17 | ( h ), ( e ), ( e h + 2 e ), 18 | ( h ), ( f ), ( f h - 2 f ) 19 | ) 20 | """; 21 | 22 | r = SolvableRing( rs ); 23 | print "SolvableRing: " + str(r); 24 | print; 25 | 26 | 27 | ps = """ 28 | ( 29 | ( e^2 + f^3 ) 30 | ) 31 | """; 32 | 33 | f = r.ideal( ps ); 34 | print "SolvableIdeal: " + str(f); 35 | print; 36 | 37 | 38 | rg = f.leftGB(); 39 | print "seq left GB:", rg; 40 | print; 41 | 42 | 43 | rg = f.twosidedGB(); 44 | print "seq twosided GB:", rg; 45 | print; 46 | 47 | 48 | #rg = f.rightGB(); 49 | #print "seq right GB:", rg; 50 | #print; 51 | 52 | -------------------------------------------------------------------------------- /examples/u_sl_2.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # U(sl_2) example 9 | 10 | rs = """ 11 | # solvable polynomials, U(sl_2): 12 | Rat(e,f,h) G 13 | RelationTable 14 | ( 15 | ( f ), ( e ), ( e f - h ), 16 | ( h ), ( e ), ( e h + 2 e ), 17 | ( h ), ( f ), ( f h - 2 f ) 18 | ) 19 | """; 20 | 21 | r = SolvableRing.new( rs ); 22 | puts "SolvableRing: " + str(r); 23 | puts; 24 | 25 | 26 | ps = """ 27 | ( 28 | ( e^2 + f^3 ) 29 | ) 30 | """; 31 | 32 | f = r.ideal( ps ); 33 | puts "SolvableIdeal: " + str(f); 34 | puts; 35 | 36 | #startLog(); 37 | 38 | rg = f.leftGB(); 39 | puts "seq left GB: " + str(rg); 40 | puts; 41 | 42 | 43 | rg = f.twosidedGB(); 44 | puts "seq twosided GB: " + str(rg); 45 | puts; 46 | 47 | 48 | rg = f.rightGB(); 49 | puts "seq right GB: " + str(rg); 50 | puts; 51 | 52 | -------------------------------------------------------------------------------- /examples/u_sl_2_e.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | 4 | from jas import SolvableRing 5 | 6 | 7 | # U(sl_2_e) example 8 | 9 | rs = """ 10 | # solvable polynomials, U(sl_2_e): 11 | Rat(e,h) G 12 | RelationTable 13 | ( 14 | ( h ), ( e ), ( e h + 2 e ) 15 | ) 16 | """; 17 | 18 | r = SolvableRing( rs ); 19 | print "SolvableRing: " + str(r); 20 | print; 21 | 22 | 23 | ps = """ 24 | ( 25 | ( e^2 + h^3 ) 26 | ) 27 | """; 28 | 29 | f = r.ideal( ps ); 30 | print "SolvableIdeal: " + str(f); 31 | print; 32 | 33 | 34 | rg = f.leftGB(); 35 | print "seq left Output:", rg; 36 | print; 37 | 38 | 39 | rg = f.twosidedGB(); 40 | print "seq twosided Output:", rg; 41 | print; 42 | 43 | -------------------------------------------------------------------------------- /examples/u_sl_2_e.rb: -------------------------------------------------------------------------------- 1 | # 2 | # jruby examples for jas. 3 | # $Id$ 4 | # 5 | 6 | require "examples/jas" 7 | 8 | # U(sl_2_e) example 9 | 10 | rs = """ 11 | # solvable polynomials, U(sl_2_e): 12 | Rat(e,h) G 13 | RelationTable 14 | ( 15 | ( h ), ( e ), ( e h + 2 e ) 16 | ) 17 | """; 18 | 19 | r = SolvableRing.new( rs ); 20 | puts "SolvableRing: " + str(r); 21 | puts; 22 | 23 | 24 | ps = """ 25 | ( 26 | ( e^2 + h^3 ) 27 | ) 28 | """; 29 | 30 | f = r.ideal( ps ); 31 | puts "SolvableIdeal: " + str(f); 32 | puts; 33 | 34 | 35 | rg = f.leftGB(); 36 | puts "seq left Output: " + str(rg); 37 | puts; 38 | 39 | 40 | rg = f.twosidedGB(); 41 | puts "seq twosided Output: " + str(rg); 42 | puts 43 | 44 | 45 | rg = f.rightGB(); 46 | puts "seq right GB: " + str(rg); 47 | puts; 48 | 49 | -------------------------------------------------------------------------------- /examples/u_sl_2_f.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | 4 | from jas import SolvableRing 5 | 6 | 7 | # U(sl_2_f) example 8 | 9 | rs = """ 10 | # solvable polynomials, U(sl_2_f): 11 | Rat(f,h) G 12 | RelationTable 13 | ( 14 | ( h ), ( f ), ( f h - 2 f ) 15 | ) 16 | """; 17 | 18 | r = SolvableRing( rs ); 19 | print "SolvableRing: " + str(r); 20 | print; 21 | 22 | 23 | ps = """ 24 | ( 25 | ( h^2 + f^3 ) 26 | ) 27 | """; 28 | 29 | f = r.ideal( ps ); 30 | print "SolvableIdeal: " + str(f); 31 | print; 32 | 33 | 34 | rg = f.leftGB(); 35 | print "seq left Output:", rg; 36 | print; 37 | 38 | 39 | rg = f.twosidedGB(); 40 | print "seq twosided Output:", rg; 41 | print; 42 | 43 | -------------------------------------------------------------------------------- /examples/u_sl_3.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials in U(sl_3): 2 | #(a,x,y) L 3 | #RelationTable 4 | #( 5 | # ( y ), ( x ), ( x y + a ) 6 | #) 7 | 8 | #( 9 | # ( y**3 + x**2 y + x y ), 10 | # ( x**2 + x ) 11 | #) 12 | -------------------------------------------------------------------------------- /examples/vw.jas: -------------------------------------------------------------------------------- 1 | #Weispfenning-94, from SymbolicData: 2 | (x, y, z) L 3 | ( 4 | y^4+x*y^2*z+x^2-2*x*y+y^2+z^2, 5 | x*y^4+y*z^4-2*x^2*y-3, 6 | -x^3*y^2+x*y*z^3+y^4+x*y^2*z-2*x*y 7 | ) 8 | -------------------------------------------------------------------------------- /examples/wa_1.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_1: 2 | (a,b,x,y) L 3 | RelationTable 4 | ( 5 | ( y ), ( x ), ( x y - 1 ), 6 | ) 7 | 8 | ( 9 | ( x y^2 - a ), 10 | ( y^3 - b ) 11 | ) 12 | -------------------------------------------------------------------------------- /examples/wa_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # jython examples for jas. 3 | # $Id$ 4 | # 5 | 6 | from jas import SolvableRing 7 | 8 | 9 | # WA_1 example 10 | 11 | rs = """ 12 | # solvable polynomials, Weyl algebra A_1: 13 | Rat(p,t,x,d) G 14 | RelationTable 15 | ( 16 | ( d ), ( x ), ( x d + 1 ) 17 | ) 18 | """; 19 | 20 | r = SolvableRing( rs ); 21 | print "SolvableRing: " + str(r); 22 | print; 23 | 24 | 25 | ps = """ 26 | ( 27 | ( x^7 ), 28 | ( x d + 7 ) 29 | ) 30 | """; 31 | 32 | i7 = r.ideal( ps ); 33 | print "SolvableIdeal: " + str(i7); 34 | print; 35 | 36 | i7rg = i7.leftGB(); 37 | print "seq left i7 Output:", i7rg; 38 | print; 39 | 40 | 41 | ps = """ 42 | ( 43 | ( d^7 ), 44 | ( x d - 7 + 1 ) 45 | ) 46 | """; 47 | 48 | j7 = r.ideal( ps ); 49 | print "SolvableIdeal: " + str(j7); 50 | print; 51 | 52 | j7rg = j7.leftGB(); 53 | print "seq left i7 Output:", j7rg; 54 | print; 55 | 56 | -------------------------------------------------------------------------------- /examples/wa_1r.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_1, right GB: 2 | Rat (a,b,x,y) L 3 | RelationTable 4 | ( 5 | #( y^3 ), ( x ), ( x * y^3 - 3 y^2 ), 6 | #( y^2 ), ( x^2 ), ( x^2 * y^2 - 4 x * y + 2 ), 7 | #( y^2 ), ( x ), ( x * y^2 - 2 y ), 8 | #( y ), ( x^4 ), ( x^4 * y - 4 x^3 ), 9 | #( y ), ( x^3 ), ( x^3 * y - 3 x^2 ), 10 | #( y ), ( x^2 ), ( x^2 * y - 2 x ), 11 | ( y ), ( x ), ( x * y - 1 ) 12 | ) 13 | 14 | ( 15 | ( y - 1/48 a^3 * x^2 + 1/12 a^2 * x - 1/2 a ), 16 | ( b - 1/24 a^3 ), 17 | ( a^4 ) 18 | ) 19 | -------------------------------------------------------------------------------- /examples/wa_32.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_3,2: 2 | (a,b,e1,e2,e3) L 3 | RelationTable 4 | ( 5 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 6 | ( e3 ), ( e2 ), ( e2 e3 - e2 ) 7 | ) 8 | 9 | ( 10 | ( e1 e3^3 + e2^10 - a ), 11 | ( e1^3 e2^2 + e3 ), 12 | ( e3^3 + e3^2 - b ) 13 | ) 14 | -------------------------------------------------------------------------------- /examples/wa_34.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_3,4: 2 | (a,b,e1,e2,e3) L 3 | RelationTable 4 | ( 5 | ( e3 ), ( e1 ), ( e1 e3 - e1 ), 6 | ( e3 ), ( e2 ), ( e2 e3 + e2 ) 7 | ) 8 | 9 | ( 10 | ( e1 e3^3 + e2^10 - a ), 11 | ( e1^3 e2^2 + e3 ), 12 | ( e3^3 + e3^2 - b ) 13 | ) 14 | -------------------------------------------------------------------------------- /examples/wa_39.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_3,9: 2 | (a,b,e1,e2,e3) G 3 | RelationTable 4 | ( 5 | ( e3 ), ( e1 ), ( e1 e3 - e3 ), 6 | ( e3 ), ( e2 ), ( e2 e3 - e1 ), 7 | ( e3 ), ( e1 ), ( e1 e3 + e2 ) 8 | ) 9 | 10 | ( 11 | ( e1 e3^3 + e2^2 - a ), 12 | ( e1^3 e2^2 + e3 ), 13 | ( e3^3 + e3^2 - b ) 14 | ) 15 | -------------------------------------------------------------------------------- /examples/wa_41.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_4,1: 2 | (a,b,e1,e2,e3,e4) G 3 | RelationTable 4 | ( 5 | ( e4 ), ( e2 ), ( e2 e4 - e1 ), 6 | ( e4 ), ( e3 ), ( e3 e4 - e2 ) 7 | ) 8 | 9 | ( 10 | ( e1 e3^3 + e2^2 - a ), 11 | ( e1^3 e2^2 + e3 ), 12 | ( e3^3 + e3^2 - b ) 13 | ) 14 | -------------------------------------------------------------------------------- /examples/wa_61.jas: -------------------------------------------------------------------------------- 1 | # solvable polynomials, Weyl algebra A_6,1: 2 | (a,b,e1,e2,e3,e4,e5,e6) G 3 | RelationTable 4 | ( 5 | ( e2 ), ( e1 ), ( e1 e2 - e3 ), 6 | ( e3 ), ( e1 ), ( e1 e3 - e4 ), 7 | ( e5 ), ( e1 ), ( e1 e5 - e6 ) 8 | ) 9 | 10 | ( 11 | ( e1 e3^3 + e2^2 - a ), 12 | ( e1^3 e2^2 + e3 ), 13 | ( e3^3 + e3^2 - b ) 14 | ) 15 | -------------------------------------------------------------------------------- /html.css: -------------------------------------------------------------------------------- 1 | 2 | body { background-color: #FFFFF5; 3 | margin-right: 1em; 4 | margin-left: 0.5em; 5 | } 6 | 7 | body.main { margin-top: 2.5em; 8 | } 9 | 10 | pre { background-color: silver; 11 | margin-left: 1em; 12 | margin-right: 1em; 13 | padding: 1em; 14 | } 15 | 16 | code { font-family: Courier, monospace; 17 | white-space: pre; 18 | font-size: larger; 19 | /* background: silver; */ 20 | } 21 | 22 | dt { font-weight: bolder; 23 | margin-top: 1em; 24 | } 25 | 26 | nav { line-height: 1.4em; 27 | } 28 | 29 | h1 { text-align: center; 30 | } 31 | 32 | .center { text-align: center; } 33 | 34 | .note { color: maroon; } 35 | -------------------------------------------------------------------------------- /images/PackageOverview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/PackageOverview.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-examples-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-examples-thumb.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-examples.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-examples.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out-big-part-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out-big-part-thumb.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out-big-part.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out-big-part.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out-big-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out-big-thumb.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out-big.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out-big.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out-thumb.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-out.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks-thumb.png -------------------------------------------------------------------------------- /images/device-2012-11-18-jas-trinks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/device-2012-11-18-jas-trinks.png -------------------------------------------------------------------------------- /images/eclipse-legendre.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/eclipse-legendre.png -------------------------------------------------------------------------------- /images/jas-pack-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/jas-pack-over.png -------------------------------------------------------------------------------- /images/jas-poly-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/jas-poly-over.png -------------------------------------------------------------------------------- /images/jas-py.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Encoding=UTF-8 4 | Name=JAS.py 5 | GenericName=Java Algebra System 6 | Comment=jpython shell for JAS 7 | Icon=jas.xpm 8 | #Exec=jas -py 9 | Exec=gnome-terminal --show-menubar -x jas -py 10 | #Exec=gnome-terminal --show-menubar -x jas -d -v -py 11 | #Terminal=true 12 | Categories=Education;Science;Java;Math; 13 | # 14 | #$Id$ 15 | -------------------------------------------------------------------------------- /images/jas-rb.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | Encoding=UTF-8 4 | Name=JAS.rb 5 | GenericName=Java Algebra System 6 | Comment=jruby shell for JAS 7 | Icon=jas.xpm 8 | #Exec=jas -rb 9 | Exec=gnome-terminal --show-menubar -x jas -rb 10 | #Exec=gnome-terminal --show-menubar -x jas -d -v -rb 11 | #Terminal=true 12 | Categories=Education;Science;Java;Math; 13 | # 14 | #$Id$ 15 | -------------------------------------------------------------------------------- /images/jas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/jas.png -------------------------------------------------------------------------------- /images/mathlibre-jas-py-rb_deb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/mathlibre-jas-py-rb_deb.png -------------------------------------------------------------------------------- /images/overview-methods.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/overview-methods.png -------------------------------------------------------------------------------- /images/overview-recursive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/overview-recursive.png -------------------------------------------------------------------------------- /images/poly-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/poly-over.png -------------------------------------------------------------------------------- /images/poly-ring-over.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kredel/java-algebra-system/255fe6b2d26cef4e89ea64d931dd738bea8f8624/images/poly-ring-over.png -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 |
6 | 7 |
13 | This package contains classes for arithmetic in the basic coefficient rings,
14 | e.g. BigRational
, BigInteger
, ModLong
or
15 | ModInteger
.
16 | All such classes implement the RingElem
respectively the GcdRingElem
interface.
17 | The class PrimeList
provides a list of useful prime numbers.
18 | The Product
class implements a finite product of other ring elements.
19 |
25 | 26 | 27 | Last modified: Thu Dec 15 22:56:05 CET 2011 28 | 29 |
30 |$Id$ 31 |
32 | 33 | 34 | -------------------------------------------------------------------------------- /src/edu/jas/gb/EReduction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.gb; 6 | 7 | 8 | import edu.jas.structure.RingElem; 9 | 10 | 11 | /** 12 | * Polynomial E-Reduction interface. Empty marker interface since all required 13 | * methods are already defined in the DReduction interface. 14 | * @param
13 | This package contains classes for polynomial pseudo reduction and
14 | Groebner bases using pseudo reduction
15 | GroebnerBasePseudoSeq
and
16 | GroebnerBasePseudoRecSeq
.
17 | Groebner bases for polynomial rings over regular rings (direct
18 | products of fields or integral domains) are implemented in
19 | RGroebnerBaseSeq
and
20 | RGroebnerBasePseudoSeq
.
21 |
27 | 28 | 29 | Last modified: Fri Dec 24 15:00:40 CET 2010 30 | 31 |
32 |$Id$ 33 |
34 | 35 | 36 | -------------------------------------------------------------------------------- /src/edu/jas/integrate/package.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 |13 | This package contains classes for elementary integration of 14 | (univariate) polynomials and rational functions. 15 |
16 |17 | The implementation follows 18 | Bronstein Symbolic Integration I - Transcendental Functions. 19 |
20 | 21 |24 | 25 | 26 | Last modified: Fri Nov 27 22:23:52 CET 2009 27 | 28 |
29 |$Id$ 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /src/edu/jas/kern/JASConfig.java: -------------------------------------------------------------------------------- 1 | package edu.jas.kern; 2 | 3 | 4 | import edu.jas.ufd.FactorAbstract; 5 | 6 | 7 | /** 8 | * Configuration options to truncate long running Kronecker factorization. 9 | * @author Axel Kramer 10 | */ 11 | 12 | public class JASConfig { 13 | 14 | 15 | /** 16 | * {@linkFactorAbstract#factorsSquarefreeKronecker(edu.jas.poly.GenPolynomial)} 17 | * will throw an {@link ArithmeticException}, if this parameter is 18 | * greater than0
and the Kronecker substitution
19 | * degree is greater than this value.
20 | */
21 | public static int MAX_DEGREE_KRONECKER_FACTORIZATION = -1;
22 |
23 |
24 | /**
25 | * {@link FactorAbstract#factorsSquarefreeKronecker(edu.jas.poly.GenPolynomial)}
26 | * will throw an {@link ArithmeticException}, if this parameter is greater
27 | * than 0
and the Kronecker iteration counter is greater than
28 | * this value.
29 | */
30 | public static int MAX_ITERATIONS_KRONECKER_FACTORIZATION = -1;
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/src/edu/jas/kern/PreemptStatus.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id$
3 | */
4 |
5 | package edu.jas.kern;
6 |
7 |
8 | /**
9 | * PreemptStatus, defines global status for preemptive interruption handling.
10 | * @author Heinz Kredel
11 | */
12 |
13 | public class PreemptStatus {
14 |
15 |
16 | /**
17 | * Global status flag.
18 | */
19 | private static volatile boolean allowPreempt = true;
20 |
21 |
22 | /**
23 | * No public constructor.
24 | */
25 | protected PreemptStatus() {
26 | }
27 |
28 |
29 | /**
30 | * isAllowed.
31 | * @return true, preemtive interruption is allowed, else false.
32 | */
33 | public static boolean isAllowed() {
34 | //System.out.println("allowPreempt: " + allowPreempt);
35 | return allowPreempt;
36 | }
37 |
38 |
39 | /**
40 | * setAllow, set preemtive interruption to allowed status.
41 | */
42 | public static void setAllow() {
43 | allowPreempt = true;
44 | }
45 |
46 |
47 | /**
48 | * setNotAllow, set preemtive interruption to not allowed status.
49 | */
50 | public static void setNotAllow() {
51 | allowPreempt = false;
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/edu/jas/kern/PreemptingException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id$
3 | */
4 |
5 | package edu.jas.kern;
6 |
7 |
8 | /**
9 | * Preempting Exception class. Runtime Exception to be thrown when a thread is
10 | * interrupted.
11 | * @author Heinz Kredel
12 | */
13 |
14 | public class PreemptingException extends RuntimeException {
15 |
16 |
17 | public PreemptingException() {
18 | super("PreemptingException");
19 | }
20 |
21 |
22 | public PreemptingException(String c) {
23 | super(c);
24 | }
25 |
26 |
27 | public PreemptingException(String c, Throwable t) {
28 | super(c, t);
29 | }
30 |
31 |
32 | public PreemptingException(Throwable t) {
33 | super("PreemptingException", t);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/edu/jas/kern/PrettyPrint.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id$
3 | */
4 |
5 | package edu.jas.kern;
6 |
7 |
8 | /**
9 | * PrettyPrint, defines global pretty print status.
10 | * @author Heinz Kredel
11 | */
12 |
13 | public class PrettyPrint {
14 |
15 |
16 | private static volatile boolean doPretty = true;
17 |
18 |
19 | protected PrettyPrint() {
20 | }
21 |
22 |
23 | /**
24 | * isTrue.
25 | * @return true, if to use pretty printing, else false.
26 | */
27 | public static boolean isTrue() {
28 | return doPretty;
29 | }
30 |
31 |
32 | /**
33 | * setPretty. Set use pretty printing to true.
34 | */
35 | public static void setPretty() {
36 | doPretty = true;
37 | }
38 |
39 |
40 | /**
41 | * setInternal. Set use pretty printing to false.
42 | */
43 | public static void setInternal() {
44 | doPretty = false;
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/edu/jas/kern/TimeExceededException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * $Id$
3 | */
4 |
5 | package edu.jas.kern;
6 |
7 |
8 | /**
9 | * Time exceeded exception class. Runtime Exception to be thrown when the
10 | * run-time has exceeded a certain limit.
11 | * @author Heinz Kredel
12 | */
13 |
14 | public class TimeExceededException extends RuntimeException {
15 |
16 |
17 | public TimeExceededException() {
18 | super("TimeExceededException");
19 | }
20 |
21 |
22 | public TimeExceededException(String c) {
23 | super(c);
24 | }
25 |
26 |
27 | public TimeExceededException(String c, Throwable t) {
28 | super(c, t);
29 | }
30 |
31 |
32 | public TimeExceededException(Throwable t) {
33 | super("TimeExceededException", t);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/src/edu/jas/kern/package.html:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
13 | This package contains classes used in global execution of all JAS packages.
14 | E.g. PrettyPrint
is used to control the print (i.e. the toString())
15 | of many classes.
16 | PreemptingException
and PreemptStatus
17 | are used to preemptively cancel long running computations.
18 |
24 | 25 | 26 | Last modified: Wed Jul 11 19:06:14 CEST 2007 27 | 28 |
29 |$Id$ 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /src/edu/jas/poly/InvalidExpressionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.poly; 6 | 7 | 8 | 9 | /** 10 | * Invalid expression exception class. 11 | * Runtime Exception to be thrown for invalid algebraic / polynomial expressions. 12 | * @author Heinz Kredel 13 | */ 14 | public class InvalidExpressionException extends RuntimeException { 15 | 16 | 17 | public InvalidExpressionException() { 18 | super("InvalidExpressionException"); 19 | } 20 | 21 | 22 | public InvalidExpressionException(String c) { 23 | super(c); 24 | } 25 | 26 | 27 | public InvalidExpressionException(String c, Throwable t) { 28 | super(c, t); 29 | } 30 | 31 | 32 | public InvalidExpressionException(Throwable t) { 33 | super("InvalidExpressionException", t); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/edu/jas/poly/RelationGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.poly; 6 | 7 | 8 | import edu.jas.structure.RingElem; 9 | 10 | 11 | /** 12 | * Generate Relation Tables for solvable polynomial rings. Adds the respective 13 | * relations to the relation table of the given solvable ring factory. Relations 14 | * are of the form xj * xi = xi xj + 15 | * pij for 1 ≤ i < j ≤ n = number of variables. 16 | * @author Heinz Kredel 17 | */ 18 | public interface RelationGenerator
13 | This package
14 | contains interfaces for the most general algebraic structures used in JAS,
15 | e.g. RingElem
and RingFactory
.
16 | The Power
class implements exponentiation of monoid and ring elements.
17 |
20 |
22 |
23 | RingElem, Ring and polynomial overview
24 |
29 | 30 | 31 | Last modified: Sun Sep 21 18:29:11 CEST 2014 32 | 33 |
34 |$Id$ 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /src/edu/jas/ufd/NoLiftingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.ufd; 6 | 7 | 8 | /** 9 | * Non existing Hensel lifting. Exception to be thrown when a valid 10 | * Hensel lifting cannot be constructed. 11 | * @author Heinz Kredel 12 | */ 13 | 14 | public class NoLiftingException extends Exception { 15 | 16 | 17 | public NoLiftingException() { 18 | super("NoLiftingException"); 19 | } 20 | 21 | 22 | public NoLiftingException(String c) { 23 | super(c); 24 | } 25 | 26 | 27 | public NoLiftingException(String c, Throwable t) { 28 | super(c, t); 29 | } 30 | 31 | 32 | public NoLiftingException(Throwable t) { 33 | super("NoLiftingException", t); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/edu/jas/ufdroot/package.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 |
13 | This package contains classes for factorization in structures
14 | used in roots computation, for example FactorRealAlgebraic
.
15 |
21 | 22 | 23 | Last modified: Sat Feb 4 12:45:33 CET 2012 24 | 25 |
26 |$Id$ 27 |
28 | 29 | 30 | -------------------------------------------------------------------------------- /src/edu/jas/util/RemoteExecutable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.util; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * Interface RemoteExecutable. 11 | * Used to mark a Serializable and Runnable class. 12 | * @author Heinz Kredel 13 | */ 14 | 15 | 16 | public interface RemoteExecutable extends Serializable, Runnable { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/edu/jas/util/StrategyEnumeration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id$ 3 | */ 4 | 5 | package edu.jas.util; 6 | 7 | 8 | /** 9 | * StrategyEnumeration. This class names possible / implemented strategies for 10 | * thread pools. 11 | * @author Heinz Kredel 12 | */ 13 | 14 | public final class StrategyEnumeration { 15 | 16 | 17 | public static final StrategyEnumeration FIFO = new StrategyEnumeration(); 18 | 19 | 20 | public static final StrategyEnumeration LIFO = new StrategyEnumeration(); 21 | 22 | 23 | private StrategyEnumeration() { 24 | } 25 | 26 | 27 | /** 28 | * toString. 29 | */ 30 | @Override 31 | public String toString() { 32 | if (this == FIFO) { 33 | return "FIFO strategy"; 34 | } 35 | return "LIFO strategy"; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/edu/jas/util/machines: -------------------------------------------------------------------------------- 1 | # maschines file for jas 2 | 3 | 10.1.1.254:7114 # first host is master 4 | 10.1.1.254:8114 # first client host, master-port+1000 5 | 10.1.1.254:8114 # second host with port 6 | #localhost:7411 # next host with port 7 | #localhost:7411 # last host 8 | 9 | # eof 10 | -------------------------------------------------------------------------------- /src/edu/jas/util/machines.localhost: -------------------------------------------------------------------------------- 1 | # maschines file for jas 2 | 3 | localhost:7114 # first host is master 4 | localhost:8114 # first client host, master-port+1000 5 | #localhost:9114 # second host with port 6 | #localhost:8411 # next host with port 7 | #localhost:8411 # last host 8 | 9 | # eof 10 | -------------------------------------------------------------------------------- /src/edu/jas/util/package.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 |
13 | This package
14 | contains further utilities for parallel and distributed computations
15 | like ThreadPool
, DistThreadPool
16 | or DistHashTable
.
17 |
23 | 24 | 25 | Last modified: Mon Jul 9 22:45:40 CEST 2007 26 | 27 |
28 |$Id$ 29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /src/edu/jas/vector/package.html: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 |
13 | This package contains classes for generic vectors and matices over
14 | RingElem
s, namely GenVector
and
15 | GenMatrix
. Algorithms for vector and matrix
16 | computation are contained in BasicLinAlg
and matrix
17 | decompositions in LinAlg
.
18 |
24 | 25 | 26 | Last modified: Thu Jul 8 17:24:45 CEST 2021 27 | 28 |
29 |$Id$ 30 |
31 | 32 | 33 | --------------------------------------------------------------------------------