@@ -3,6 +3,7 @@ using MultivariatePolynomials
33import MultivariateBases as MB
44using SemialgebraicSets
55using MultivariateMoments
6+ import GenericLinearAlgebra # Needed for `svd` to work on `Matrix{BigFloat}`
67
78struct DummySolver <: SemialgebraicSets.AbstractAlgebraicSolver end
89SemialgebraicSets. promote_for (:: Type{T} , :: Type{DummySolver} ) where {T} = T
@@ -34,18 +35,18 @@ function _atoms(atoms, rank_check, solver)
3435 atoms = atomic_measure (ν, rank_check, solver)
3536 @test atoms != = nothing
3637 if ! isnothing (atoms)
37- @test atoms ≈ η
38+ @test atoms ≈ η rtol = 1e-8
3839 end
3940end
4041
41- function atoms_1 (rank_check, solver)
42- atoms = [[1 , 2 ]]
42+ function atoms_1 (T, rank_check, solver)
43+ atoms = [T [1 , 2 ]]
4344 _atoms (atoms, rank_check, solver)
4445 return
4546end
4647
47- function atoms_2 (rank_check, solver)
48- atoms = [[1 , 1 ], [1 , - 1 ]]
48+ function atoms_2 (T, rank_check, solver)
49+ atoms = [T [1 , 1 ], T [1 , - 1 ]]
4950 _atoms (atoms, rank_check, solver)
5051 return
5152end
@@ -351,10 +352,10 @@ function jcg14_6_1(rank_check, ok::Bool = true)
351352 end
352353end
353354
354- function large_norm (rank_check)
355+ function large_norm (T, rank_check)
355356 # If the norm of `M` is given to `rref!` instead of `√||M||`, `atomic_measure` will error.
356357 Mod. @polyvar x[1 : 2 ]
357- Q = [
358+ Q = T [
358359 586.8034549325414 - 800.152792847183
359360 - 800.152792847183 2749.376669556701
360361 ]
@@ -390,19 +391,21 @@ _short(x) = _short(string(x))
390391
391392function test_extract ()
392393 default_solver = SemialgebraicSets. default_algebraic_solver ([1.0 x - 1.0 x])
393- @testset " $(_short (solver)) " for solver in [
394- FlatExtension (),
395- FlatExtension (NewtonTypeDiagonalization ()),
396- Echelon (),
397- ImageSpaceSolver (ShiftCholeskyLDLT (1e-15 ), Echelon ()),
398- ShiftNullspace (),
399- ImageSpaceSolver (ShiftCholeskyLDLT (1e-15 ), ShiftNullspace ()),
400- ]
394+ @testset " $T $(_short (solver)) " for T in [Float64, BigFloat],
395+ solver in [
396+ FlatExtension (),
397+ FlatExtension (NewtonTypeDiagonalization ()),
398+ Echelon (),
399+ ImageSpaceSolver (ShiftCholeskyLDLT (1e-15 ), Echelon ()),
400+ ShiftNullspace (),
401+ ImageSpaceSolver (ShiftCholeskyLDLT (1e-15 ), ShiftNullspace ()),
402+ ]
403+
401404 @testset " Atom 1" begin
402- atoms_1 (1e-10 , solver)
405+ atoms_1 (T, 1e-10 , solver)
403406 end
404407 @testset " Atom 2" begin
405- atoms_2 (1e-10 , solver)
408+ atoms_2 (T, 1e-10 , solver)
406409 end
407410 end
408411 @testset " hl05_2_3 $(_short (lrc)) " for lrc in
@@ -465,11 +468,13 @@ function test_extract()
465468 lpj20_3_9 (FixedRank (7 ), 0 )
466469 jcg14_6_1 (6e-3 )
467470 jcg14_6_1 (8e-4 , false )
468- large_norm (1e-2 )
471+ @testset " $T " for T in [Float64, BigFloat]
472+ large_norm (T, 1e-2 )
473+ end
469474 @testset " No comm fix $(_short (solver)) $T " for solver in
470475 [ShiftNullspace ()],
471- T in [Float64]
472- # , BigFloat]
476+ T in [Float64, BigFloat ]
477+
473478 no_com (solver, T)
474479 end
475480 return
0 commit comments