diff --git a/tests/TestRealAlgebraicNumbersComparison.mpl b/tests/TestRealAlgebraicNumbersComparison.mpl deleted file mode 100644 index 0de2c3b..0000000 --- a/tests/TestRealAlgebraicNumbersComparison.mpl +++ /dev/null @@ -1,122 +0,0 @@ -# Class: TestRealAlgebraicNumbersComparison.mpl -# -# Description: -# Tests for comparisons of objects implemented by the class RealAlgebraicNumber.mpl -# Author: -# Kacper Pluta - kacper.pluta@esiee.fr -# Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France -# -# Date: -# 14/04/2016 -# -# License: -# Simplified BSD License -# -# Copyright (c) 2016, Kacper Pluta -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL Kacper Pluta BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - - -# Procedure: TestRealAlgebraicNumbersComparisonLower -# Some test of implementation of real algebraic numbers. -# -# Parameters: -# loops::integer - a number of random polynomials to consider, -# default value is 10 -# deg::integer - a maximal possible degree of random polynomial -# -TestRealAlgebraicNumbersComparison := proc( loops::integer := 10, deg::integer := 80 ) - local numA := Object( RealAlgebraicNumber, 3 * x - 1, 91625968981/274877906944, 45812984491/137438953472 ); - local numB := Object( RealAlgebraicNumber, x^2 - 3, -238051250353/137438953472, -14878203147/8589934592 ); - local numC := Object( RealAlgebraicNumber, x - 1/2, -1, 1 ); - local numD := Object( RealAlgebraicNumber, 3*x - 1/2, 0, 1 ); - local numE := Object( RealAlgebraicNumber, x, 0, 1 ); - local numF := Object( RealAlgebraicNumber, x, -1, 0 ); - local f::polynom, g::polynom, rootsF := [], rootsG := [], numbers := []; - local i, rf, rg; - print( "numA : ", numA ); - print( "numB : ", numB ); - kernelopts( assertlevel = 1 ); - (* Test for A rational and B non-rational, or equal. *) - ASSERT( evalb( numB < numA ) = true, " ( numA < numB ) gives false should true" ); - ASSERT( evalb( numA < numB ) = false, " ( numA < numB ) gives true should false" ); - ASSERT( evalb( numA < numA ) = false, " ( numA < numA ) gives true should false" ); - ASSERT( evalb( numB > numA ) = false, " ( numA > numB ) gives false should true" ); - ASSERT( evalb( numA > numB ) = true, " ( numA > numB ) gives false should true" ); - ASSERT( evalb( numA > numA ) = false, " ( numA > numA ) gives true should false" ); - ASSERT( evalb( numB <= numA ) = true, " ( numA <= numB ) gives false should true" ); - ASSERT( evalb( numA <= numB ) = false, " ( numA <= numB ) gives true should false" ); - ASSERT( evalb( numA <= numA ) = true, " ( numA <= numA ) gives false should true" ); - ASSERT( evalb( numB >= numA ) = false, " ( numA >= numB ) gives true should false" ); - ASSERT( evalb( numA >= numB ) = true, " ( numA >= numB ) gives false should true" ); - ASSERT( evalb( numA >= numA ) = true, " ( numA >= numA ) gives false should true" ); - ASSERT( evalb( numA = numA ) = true, " ( numA = numA ) gives false should true" ); - ASSERT( evalb( numB = numB ) = true, " ( numB = numB ) gives false should true" ); - ASSERT( evalb( numA = numB ) = false, " ( numrA = numB ) gives true should false" ); - ASSERT( evalb( numB = numA ) = false, " ( numrB = numA ) gives true should false" ); - (*Test for numbers with ill ranges*) - ASSERT( evalb( numC = numD ) = false, " ( numrC = numD ) gives true should false" ); - ASSERT( evalb( numE = numF ) = true, " ( numrE = numF ) gives false should true" ); - ASSERT( evalb( numC > numE ) = true, " ( numrC > numE ) gives false should true" ); - ASSERT( evalb( numC > numD ) = true, " ( numrC > numD ) gives false should true" ); - ASSERT( evalb( numC < numD ) = false, " ( numrC < numD ) gives true should false" ); - ASSERT( evalb( numC = numF ) = false, " ( numrC = numF ) gives true should false" ); - kernelopts( assertlevel = 0 ); - for i from 1 to loops do - f := randpoly( x, degree=MapleTA[Builtin][rint]( 1, deg ) ); - f := sqrfree( factor( f ) )[2,..,1][1]; - g := randpoly( x, degree=MapleTA[Builtin][rint]( 1, deg ) ); - g := sqrfree( factor( g ) )[2,..,1][1]; - rootsF := RootFinding:-Isolate ( f, x, output='interval' ); - rootsG := RootFinding:-Isolate ( g, x, output='interval' ); - for rf in rootsF do - numbers := [ op( numbers ), Object( RealAlgebraicNumber, f, op( rf )[2][1], op( rf )[2][2] ) ]; - end do; - for rg in rootsG do - numbers := [ op( numbers ), Object( RealAlgebraicNumber, g, op( rg )[2][1], op( rg )[2][2] ) ]; - end do; - end do; - for numA in numbers do - for numB in numbers do - i := Compare( numA, numB ); - if i = -1 then - print( numA, " < ", numB ); - elif i = 0 then - print( numA, " = ", numB ); - elif i = 1 then - print( numA, " > ", numB ); - else - error "Two numbers was not compared correctly."; - end if; - end do; - end do; - print( "Use sort() to sort the list of algebraic numbers." ); - numbers := sort( numbers, proc(l,r) - if Compare( l, r ) = -1 then - return true; - else - return false; - end if; - end proc ); - print( numbers ); -end proc: - diff --git a/tests/TestRigidMotionsParameterSpaceDecomposition.mpl b/tests/TestRigidMotionsParameterSpaceDecomposition.mpl deleted file mode 100644 index 231fed7..0000000 --- a/tests/TestRigidMotionsParameterSpaceDecomposition.mpl +++ /dev/null @@ -1,220 +0,0 @@ -# File: TestRigidMotionsParameterSpaceDecomposition.mpl -# -# Description: -# This file contains tests for the module RigidMotionsParameterSpaceDecomposition. -# -# Author: -# Kacper Pluta - kacper.pluta@esiee.fr -# Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France -# -# Date: -# 05/05/2016 -# -# License: -# Simplified BSD License -# -# Copyright (c) 2016, Kacper Pluta -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL Kacper Pluta BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - - -TestRigidMotionsParameterSpaceDecomposition := module() - option package; - local init, Test, CheckInit; - export InitModule, TestCayleyTransform, TestGetNeighborhood, TestGetQuadric, - TestEliminationResultant, TestIsMonotonic, TestComputeSetOfQuadrics, TestIsAsymptotic, TestAll: - - - InitModule := proc(path::string) - local mplFile; - mplFile := - FileTools:-JoinPath([sprintf("%s/RigidMotionsParameterSpaceDecomposition.mpl",path)],base=homedir): - read mplFile: - mplFile := - FileTools:-JoinPath([sprintf("%s/RigidMotionsParameterSpaceCommon.mpl",path)],base=homedir): - read mplFile: - Test := CodeTools:-Test; - init := true: - end proc: - - CheckInit := proc() - if init <> true then - error "You have to first call InitModule!"; - fi: - end proc; - - - TestCayleyTransform :=proc() - local CayleyTransform; - CheckInit(); - CayleyTransform := RigidMotionsParameterSpaceDecomposition:-CayleyTransform; - Test( indets( CayleyTransform( {a} ) ), {a}, label="CayleyTransform: Test Pass 1"); - Test( whattype( CayleyTransform( {a} ) ), Matrix, label="CayleyTransform: Test Pass 2"); - Test( {upperbound( CayleyTransform( {a} ) )}, {2, 2}, label="CayleyTransform: Test Pass 3"); - Test( indets( CayleyTransform( {a, b} ) ), {a, b}, label="CayleyTransform: Test Pass 4"); - Test( whattype( CayleyTransform( {a, b} ) ), Matrix, label="CayleyTransform: Test Pass 5"); - Test( {upperbound( CayleyTransform( {a, b} ) )}, {2, 2}, label="CayleyTransform: Test Pass 6"); - Test( indets( CayleyTransform( {a, b, c} ) ), {a, b, c}, label="CayleyTransform: Test Pass 7"); - Test( whattype( CayleyTransform( {a, b, c} ) ), Matrix, label="CayleyTransform: Test Pass 8"); - Test( {upperbound( CayleyTransform( {a, b, c} ) )}, {3, 3}, label="CayleyTransform: Test Pass 9"); - Test( CayleyTransform( {a, b, c, d} ), "Unsupported dimension", testerror, - label="CayleyTransform: Test Pass 10"); - end proc; - - - TestGetNeighborhood := proc() - local GetNeighborhood; - CheckInit(); - GetNeighborhood := RigidMotionsParameterSpaceDecomposition:-GetNeighborhood; - Test( whattype( GetNeighborhood("N1") ), list, label="GetNeighborhood: Test Pass 1"); - Test( nops( ListTools:-MakeUnique( GetNeighborhood("N1") ) ), 7, label="GetNeighborhood: Test Pass 2"); - Test( whattype( GetNeighborhood("N2") ), list, label="GetNeighborhood: Test Pass 3"); - Test( nops( ListTools:-MakeUnique( GetNeighborhood("N2") ) ), 19, label="GetNeighborhood: Test Pass 4"); - Test( whattype( GetNeighborhood("N3") ), list, label="GetNeighborhood: Test Pass 5"); - Test( nops( ListTools:-MakeUnique( GetNeighborhood("N3") ) ), 27, label="GetNeighborhood: Test Pass 6"); - Test( nops( ListTools:-MakeUnique( GetNeighborhood("TEST") ) ), "Not supported type", testerror, - label="GetNeighborhood: Test Pass 7"); - end proc; - - - TestGetQuadric := proc() - local GetQuadric, R, N1, N2, N3; - CheckInit(); - GetQuadric := RigidMotionsParameterSpaceDecomposition:-GetQuadric; - R := RigidMotionsParameterSpaceDecomposition:-CayleyTransform( {a, b, c} ); - N1 := RigidMotionsParameterSpaceDecomposition:-GetNeighborhood( "N1" ); - N2 := RigidMotionsParameterSpaceDecomposition:-GetNeighborhood( "N2" ); - N3 := RigidMotionsParameterSpaceDecomposition:-GetNeighborhood( "N3" ); - - Test( type( GetQuadric( R, Vector( N1[1] ), - Vector([1/2, 1/2, 1/2]), 1 ), polynom ), - true, label="GetQuadric: Test Pass 1" ); - Test( type( GetQuadric( R, Vector( N2[8] ), - Vector([1/2, 1/2, 1/2]), 1 ), polynom ), - true, label="GetQuadric: Test Pass 2" ); - Test( type( GetQuadric( R, Vector( N3[27] ), - Vector([1/2, 1/2, 1/2]), 1 ), polynom ), - true, label="GetQuadric: Test Pass 3" ); - Test( type( GetQuadric( R, Vector( N1[7] ), - Vector([1/2, 1/2, 1/2]), 1 ), polynom ), - true, label="GetQuadric: Test Pass 4" ); - Test( GetQuadric( R, Vector( N1[7] ), - Vector([1/2, 1/2, 1/2]), 4 ), - "Wrong dimension", testerror, - label="GetQuadric: Test Pass 5" ); - Test( GetQuadric( R, Vector( N1[7] ), - Vector([1/2, 1/2, 1/2]), -1 ), - "Wrong dimension", testerror, - label="GetQuadric: Test Pass 6" ); - end proc; - - - TestEliminationResultant := proc() - local p1, p2, p3; - CheckInit(); - p1 := -15*a^4*b-59*a*b*c^3+30*a^2*c^2-27*a*b^3+16*c^2-28*b; - p2 := -48*a^3*b^2+53*a^2*b*c^2-91*a^2*c-88*b*c^2+92*c^2+43*c; - p3 := 9*a^3*c^2-60*a*b*c^3-83*b*c^4+83*a^2*c^2+16*b^2*c+71*b^2; - - Test( EliminationResultant( {p1, p2, p3}, [a, b, c] ), 0, label="EliminationResultant: Test Pass 1" ); - Test( EliminationResultant( {p1, p2}, [a, b, c] ), 0, label="EliminationResultant: Test Pass 2" ); - Test( EliminationResultant( {"test", p2, p3}, [a, b, c] ), "Wrong type of", testerror, - label="EliminationResultant: Test Pass 3" ); - Test( EliminationResultant( {p1, "test", p3}, [a, b, c] ), "Wrong type of", testerror, - label="EliminationResultant: Test Pass 4" ); - Test( EliminationResultant( {p1, p2, "test"}, [a, b, c] ), "Wrong type of", testerror, - label="EliminationResultant: Test Pass 5" ); - Test( EliminationResultant( {x, x^2, 2*x^4}, [x] ), "Wrong number of", testerror, - label="EliminationResultant: Test Pass 6" ); - Test( EliminationResultant( {x, x^2, 2*y^4}, [x, y] ), x, label="EliminationResultant: Test Pass 7" ); - Test( EliminationResultant( {x*z*d, x^2, 2*y^4}, [x, y, d, z] ), x, label="EliminationResultant: Test Pass 8" ); - Test( type(EliminationResultant( {2*b, -6*c, a^2+b^2-3*c^2-3}, [a, b, c] ), polynom ), true, - label="EliminationResultant: Test Pass 9" ); - end proc; - - TestIsMonotonic := proc() - local p1, p2, IsMonotonic; - CheckInit(); - IsMonotonic := RigidMotionsParameterSpaceDecomposition:-IsMonotonic; - p1 := a^2+b^2-3*c^2-3; - p2 := x^2 + 1; - Test( IsMonotonic( p1 ), false, label="IsMonotonic: Test Pass 1" ); - Test( IsMonotonic( p2 ), true, label="IsMonotonic: Test Pass 2" ); - Test( IsMonotonic( -p2 ), true, label="IsMonotonic: Test Pass 3" ); - Test( IsMonotonic( p2 - 1 ), true, label="IsMonotonic: Test Pass 4" ); - Test( IsMonotonic( p2 - y ), false, label="IsMonotonic: Test Pass 5" ); - end proc; - - - TestComputeSetOfQuadrics := proc() - local ComputeSetOfQuadrics, R, RR, RRR, kRange := [-1, 0, 1], kRange2 := [-2, -1, 0, 1, 2], - kRange3 := [-3, -2, -1, 0, 1, 2, 3]; - CheckInit(); - ComputeSetOfQuadrics := RigidMotionsParameterSpaceDecomposition:-ComputeSetOfQuadrics; - R := RigidMotionsParameterSpaceDecomposition:-CayleyTransform( {a, b, c} ); - RR := Matrix(3, 3, [[-35,80,-82],[21,19,-70],[90,88,41]]); - RRR := Matrix(4, 4, [[-44,-1,-26,12],[-38,63,30,45],[-38,-23,10,-14],[91,-63,22,60]]); - - Test(upperbound(ComputeSetOfQuadrics(RR,"N1", 1, kRange)), "Used matrix", testerror, - label="ComputeSetOfQuadrics: Test Pass 1"); - Test(upperbound(ComputeSetOfQuadrics(RRR,"N1", 1, kRange)), "Used matrix", testerror, - label="ComputeSetOfQuadrics: Test Pass 2"); - Test(upperbound(ComputeSetOfQuadrics(R,"TEST", 1, kRange)), "Not supported type", testerror, - label="ComputeSetOfQuadrics: Test Pass 3"); - Test(upperbound(ComputeSetOfQuadrics(R,"N1", 0, kRange)), "Axis is not", testerror, - label="ComputeSetOfQuadrics: Test Pass 4"); - Test(upperbound(ComputeSetOfQuadrics(R,"N1", 4, kRange)), "Axis is not", testerror, - label="ComputeSetOfQuadrics: Test Pass 5"); - Test(upperbound(ComputeSetOfQuadrics(R,"N1", 1, kRange)), 27, label="ComputeSetOfQuadrics: Test Pass 6"); - Test(upperbound(ComputeSetOfQuadrics(R,"N1", 2, kRange)), 27, label="ComputeSetOfQuadrics: Test Pass 7"); - Test(upperbound(ComputeSetOfQuadrics(R,"N1", 3, kRange)), 27, label="ComputeSetOfQuadrics: Test Pass 8"); - Test(upperbound(ComputeSetOfQuadrics(R,"N2", 1, kRange2)), 171, label="ComputeSetOfQuadrics: Test Pass 9"); - Test(upperbound(ComputeSetOfQuadrics(R,"N2", 2, kRange2)), 171, label="ComputeSetOfQuadrics: Test Pass 10"); - Test(upperbound(ComputeSetOfQuadrics(R,"N2", 3, kRange2)), 171, label="ComputeSetOfQuadrics: Test Pass 11"); - Test(upperbound(ComputeSetOfQuadrics(R,"N3", 1, kRange3)), 247, label="ComputeSetOfQuadrics: Test Pass 12"); - Test(upperbound(ComputeSetOfQuadrics(R,"N3", 2, kRange3)), 247, label="ComputeSetOfQuadrics: Test Pass 13"); - Test(upperbound(ComputeSetOfQuadrics(R,"N3", 3, kRange3)), 247, label="ComputeSetOfQuadrics: Test Pass 14"); - end proc; - - - TestIsAsymptotic := proc() - local IsAsymptotic; - CheckInit(); - IsAsymptotic := RigidMotionsParameterSpaceDecomposition:-IsAsymptotic; - - Test(IsAsymptotic(c^2 + 2 * b * c + b^2 + c * a - c + b), {a = 2}, label="IsAsymptotic: Test Pass 1"); - Test(IsAsymptotic(b * c + b^2 + c * a + 1), {}, label="IsAsymptotic: Test Pass 2"); - end proc; - - - TestAll := proc() - CheckInit(); - TestCayleyTransform(); - TestGetNeighborhood(); - TestGetQuadric(); - TestEliminationResultant(); - TestIsMonotonic(); - TestComputeSetOfQuadrics(); - TestIsAsymptotic(); - end proc; - -end module; diff --git a/tests/TestRigidMotionsParameterSpaceDecompositionRecursive.mpl b/tests/TestRigidMotionsParameterSpaceDecompositionRecursive.mpl deleted file mode 100644 index f9d6d43..0000000 --- a/tests/TestRigidMotionsParameterSpaceDecompositionRecursive.mpl +++ /dev/null @@ -1,95 +0,0 @@ -# File: TestRigidMotionsParameterSpaceDecompositionRecursive.mpl -# -# Description: -# This file contains tests for the module RigidMotionsParameterSpaceDecompositionRecursive. -# -# Author: -# Kacper Pluta - kacper.pluta@esiee.fr -# Laboratoire d'Informatique Gaspard-Monge - LIGM, A3SI, France -# -# Date: -# 05/05/2016 -# -# License: -# Simplified BSD License -# -# Copyright (c) 2016, Kacper Pluta -# All rights reserved. - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# * Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# * Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL Kacper Pluta BE LIABLE FOR ANY -# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -# - - -TestRigidMotionsParameterSpaceDecompositionRecursive := module() - option package; - local init, Test, CheckInit; - export InitModule, TestSpecialCases, TestAll: - - - InitModule := proc() - local real::RealAlgebraicNumber, writer::SamplePointsWriter; - Test := CodeTools:-Test; - init := true: - end proc: - - CheckInit := proc() - if init <> true then - error "You have to first call InitModule!"; - fi: - end proc; - - TestSpecialCases :=proc() - local quadrics := Array([]); - local i::integer; - CheckInit(); - quadrics(1) := [x*y-1]; - quadrics(2) := [x+y-1/4]; - quadrics(3) := [x+y-1/9]; - quadrics(4) := [x^2+y^2-1]; - quadrics(5) := [y-(x-1/9)^2+1/100]; - quadrics(6) := [x*y-3*x-3*y+8, x-3-y/10^50]; - quadrics(7) := [x*y-3*x-3*y+8, y-3-x/10^50]; - quadrics(8) := [x*y-1, x, x-1]; # error expected - quadrics(9) := [x-1, y-1]; - quadrics(10) := [x^2-2*x-2, y^2-2*y-2]; - quadrics(11) := [x*y-3*x-3*y+8, x-3, y-5/2]; - quadrics(12) := [x[1]^2+x[2]^2-1]; - - # Fix the seed for reproducible random generation - RandomTools:-MersenneTwister:-SetState(state=123456789); - quadrics(13) := [randpoly $ 60]([x,y], dense, degree=2, coeffs=rand(0..1)); - quadrics(13) := eval(quadrics(13), [x = -x, y = -y]); - - for i from 1 to upperbound(quadrics) do - try - LaunchOnGridComputeSamplePoints2D(quadrics[i], 0, 20, true, i, [op(indets(quadrics(i)))], - "/tmp", "sam_" ); - catch: - print("Error", lastexception); - end try; - od; - end proc; - - TestAll := proc() - CheckInit(); - TestSpecialCases(); - end proc; - -end module;