---------------------------------------------------------------------- -- CoCoA demo -- IMA 2006 -- ---------------------------------------------------------------------- -- ideal of points -- very efficient (modular algorithm) Use R ::= Q[x,y,z]; Pts := [ [1/N, (1/N)^2, (1/N)^3] | N In 2..7 ]; Pts; IdealOfPoints(Pts); F := Interpolate(Pts, [10, 1, 4, 5, 1/7, 1/4]); F; StarPrint(F); Foreach P In Pts Do Print Eval(F, P), " "; EndForeach; I := IdealOfProjectivePoints(GenericPoints(20)); I; -- Hilbert functions HilbertSeries(R/I); HilbertFn(R/I); ---------------------------------------------------------------------- -- Factorizing polynomials Facs := Factor(x^301-1); Facs; Product([ F[1]^F[2] | F In Facs ]); ---------------------------------------------------------------------- -- Real Roots RR := RealRoots(x^2-2, 10^(-30)); Len(RR); RR[1]; -- incomprehensible DecimalStr(RR[1].Inf, 30); -- comprehensible FloatStr(RR[1].Inf, 30); -- comprehensible ---------------------------------------------------------------------- -- and more... N := 15; M := Mat([[ Rand(-100,100) | I In 1..N ] | J In 1..N ]); M; Det(M); Latex(M); ---------------------------------------------------------------------- -- CoCoA-4 & CoCoAServer: a step into the future CoCoA5 ---------------------------------------------------------------------- Use Q[x[0..4]]; RandomPolys := [ Randomized(DensePoly(3)) | N In 1..4 ]; RandomPolys; -- LT(Ideal(RandomPolys)); -- 30 min (60 min using battery) -- LT5(Ideal(RandomPolys)); -- 1 min (2 min Using battery) LT5x(Ideal(RandomPolys), Record[FloatPrecision = 128]); -- what happens if the precision is not enough? LT5x(Ideal(RandomPolys), Record[FloatPrecision = 32]);