Skip to content

Commit

Permalink
fixing depreciation warnings, part2
Browse files Browse the repository at this point in the history
  • Loading branch information
pogudingleb committed Jan 21, 2024
1 parent 0f79ab9 commit 9bd79ec
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions src/RationalFunctionFields/IdealMQS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ end
function ParamPunPam.reduce_mod_p!(
mqs::IdealMQS,
ff::Field,
) where {Field <: Union{Nemo.GaloisField, Nemo.FpField}}
) where {Field <: Union{Nemo.fpField, Nemo.FpField}}
@debug "Reducing MQS ideal modulo $(ff)"
# If there is a reduction modulo this field already,
if haskey(mqs.cached_nums_gf, ff)
Expand All @@ -251,7 +251,7 @@ function ParamPunPam.specialize_mod_p(
mqs::IdealMQS,
point::Vector{T};
saturated = true,
) where {T <: Union{fpFieldElem, gfp_fmpz_elem}}
) where {T <: Union{fpFieldElem, FpFieldElem}}
K_1 = parent(first(point))
@debug "Evaluating MQS ideal over $K_1 at $point"
@assert haskey(mqs.cached_nums_gf, K_1)
Expand Down
2 changes: 1 addition & 1 deletion src/discrete.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ function _assess_local_identifiability_discrete_aux(

@debug "Building the matrices"
Jac = zero(
Nemo.MatrixSpace(
Nemo.matrix_space(
bring,
length(dds.x_vars) + length(dds.parameters),
1 + prec * length(dds.y_vars) + length(known_ic),
Expand Down
6 changes: 3 additions & 3 deletions src/elimination.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function Bezout_matrix(f::P, g::P, var_elim::P) where {P <: MPolyRingElem}
n = max(deg_f, deg_g)
coeffs_f = [coeff(f, [var_elim], [i]) for i in 0:n]
coeffs_g = [coeff(g, [var_elim], [i]) for i in 0:n]
GL = AbstractAlgebra.MatrixSpace(parent_ring, n, n)
GL = AbstractAlgebra.matrix_space(parent_ring, n, n)
M = zero(GL)
for i in 1:n
for j in 1:n
Expand Down Expand Up @@ -96,7 +96,7 @@ function Sylvester_matrix(f::P, g::P, var_elim::P) where {P <: MPolyRingElem}
deg_f = Nemo.degree(f, var_elim)
deg_g = Nemo.degree(g, var_elim)
n = deg_f + deg_g
GL = AbstractAlgebra.MatrixSpace(parent_ring, n, n)
GL = AbstractAlgebra.matrix_space(parent_ring, n, n)
M = zero(GL)
for i in 1:deg_f
for j in 0:deg_g
Expand Down Expand Up @@ -384,7 +384,7 @@ Output:
flush(_si_logger[].stream)
M_simp, matrix_factors = simplify_matrix(M)
@debug "Removed factors $(map(length, matrix_factors))"
M_size = zero(Nemo.MatrixSpace(Nemo.ZZ, ncols(M_simp), ncols(M_simp)))
M_size = zero(Nemo.matrix_space(Nemo.ZZ, ncols(M_simp), ncols(M_simp)))
for i in 1:ncols(M_simp)
for j in 1:ncols(M_simp)
M_size[i, j] = length(M_simp[i, j])
Expand Down
14 changes: 7 additions & 7 deletions src/local_identifiability.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ function differentiate_solution(
@debug "Building the variational system at the solution"
# Y' = AY + B
vars = vcat(ode.x_vars, ode.parameters)
SA = AbstractAlgebra.MatrixSpace(ps_ring, length(ode.x_vars), length(ode.x_vars))
SA = AbstractAlgebra.matrix_space(ps_ring, length(ode.x_vars), length(ode.x_vars))
A = SA([
eval_at_dict(derivative(ode.x_equations[vars[i]], vars[j]), ps_sol) for
i in 1:length(ode.x_vars), j in 1:length(ode.x_vars)
])
SB = AbstractAlgebra.MatrixSpace(ps_ring, length(ode.x_vars), length(vars))
SB = AbstractAlgebra.matrix_space(ps_ring, length(ode.x_vars), length(vars))
B = zero(SB)
for i in 1:length(ode.x_vars)
for j in (length(ode.x_vars) + 1):length(vars)
Expand All @@ -55,7 +55,7 @@ function differentiate_solution(
end
# TODO: make use of one() function (problems modulo prime)
initial_condition =
zero(Nemo.MatrixSpace(base_ring(ode.poly_ring), length(ode.x_vars), length(vars)))
zero(Nemo.matrix_space(base_ring(ode.poly_ring), length(ode.x_vars), length(vars)))
for i in 1:length(ode.x_vars)
initial_condition[i, i] = 1
end
Expand Down Expand Up @@ -247,7 +247,7 @@ function _assess_local_identifiability(
num_exp = 0
# rows are the "parameters": parameters and initial conditions
# columns are "observations": derivatives of the outputs
Jac = zero(Nemo.MatrixSpace(F, length(ode.parameters), 1))
Jac = zero(Nemo.matrix_space(F, length(ode.parameters), 1))
output_derivatives = undef
# the while loop is primarily for ME-deintifiability, it is adding replicas until the rank stabilizes
# in the SE case, it will exit right away
Expand All @@ -261,10 +261,10 @@ function _assess_local_identifiability(
output_derivatives = differentiate_output(ode_red, params_vals, ic, inputs, prec)

@debug "Building the matrices"
newJac = vcat(Jac, zero(Nemo.MatrixSpace(F, length(ode.x_vars), ncols(Jac))))
newJac = vcat(Jac, zero(Nemo.matrix_space(F, length(ode.x_vars), ncols(Jac))))
newJac = hcat(
newJac,
zero(Nemo.MatrixSpace(F, nrows(newJac), prec * length(ode.y_vars))),
zero(Nemo.matrix_space(F, nrows(newJac), prec * length(ode.y_vars))),
)
xs_params = vcat(ode_red.x_vars, ode_red.parameters)
for (i, y) in enumerate(ode.y_vars)
Expand Down Expand Up @@ -300,7 +300,7 @@ function _assess_local_identifiability(

if !isnothing(trbasis)
@debug "Transcendence basis computation requested"
reverted_Jac = zero(Nemo.MatrixSpace(F, size(Jac)[2], size(Jac)[1]))
reverted_Jac = zero(Nemo.matrix_space(F, size(Jac)[2], size(Jac)[1]))
for i in 1:size(Jac)[1]
for j in 1:size(Jac)[2]
reverted_Jac[j, i] = Jac[size(Jac)[1] - i + 1, j]
Expand Down
10 changes: 5 additions & 5 deletions src/power_series_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ function ps_matrix_linear_de(
) where {T <: Generic.FieldElem}
prec = (prec == -1) ? precision(A[1, 1]) : prec
n = nrows(A)
identity = one(AbstractAlgebra.MatrixSpace(base_ring(parent(Y0)), n, n))
identity = one(AbstractAlgebra.matrix_space(base_ring(parent(Y0)), n, n))
Yh, Zh = ps_matrix_homlinear_de(A, identity, prec)
matrix_set_precision!(Zh, prec)
return _variation_of_constants(A, B, Yh, Zh, Y0, prec)
Expand Down Expand Up @@ -234,9 +234,9 @@ function ps_ode_solution(
) where {T <: Generic.FieldElem, P <: MPolyRingElem{T}}
n = length(equations)
ring = parent(equations[1])
S = AbstractAlgebra.MatrixSpace(ring, n, n)
Sv = AbstractAlgebra.MatrixSpace(ring, n, 1)
Svconst = AbstractAlgebra.MatrixSpace(base_ring(ring), n, 1)
S = AbstractAlgebra.matrix_space(ring, n, n)
Sv = AbstractAlgebra.matrix_space(ring, n, 1)
Svconst = AbstractAlgebra.matrix_space(base_ring(ring), n, 1)
eqs = Sv(equations)

x_vars = filter(v -> ("$(v)_dot" in map(string, gens(ring))), gens(ring))
Expand All @@ -246,7 +246,7 @@ function ps_ode_solution(
Jac_dots = S([derivative(p, xd) for p in equations, xd in x_dot_vars])
Jac_xs = S([derivative(p, x) for p in equations, x in x_vars])

ps_ring, t = PowerSeriesRing(base_ring(ring), prec, "t"; model = :capped_absolute)
ps_ring, t = power_series_ring(base_ring(ring), prec, "t"; model = :capped_absolute)
solution = Dict()
for (u, coeffs) in inputs
solution[u] = sum(coeffs[i] * t^(i - 1) for i in 1:length(coeffs))
Expand Down
4 changes: 2 additions & 2 deletions src/primality_check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function check_primality_zerodim(J::Array{QQMPolyRingElem, 1})
J = Groebner.groebner(J, loglevel = _groebner_loglevel[])
basis = Groebner.kbase(J, loglevel = _groebner_loglevel[])
dim = length(basis)
S = Nemo.MatrixSpace(Nemo.QQ, dim, dim)
S = Nemo.matrix_space(Nemo.QQ, dim, dim)
matrices = []
@debug "$J $basis"
@debug "Dim is $dim"
Expand All @@ -25,7 +25,7 @@ function check_primality_zerodim(J::Array{QQMPolyRingElem, 1})
R, t = Nemo.polynomial_ring(Nemo.QQ, "t")
@debug "$(Nemo.charpoly(R, generic_multiplication))"

return Nemo.isirreducible(Nemo.charpoly(R, generic_multiplication))
return Nemo.is_irreducible(Nemo.charpoly(R, generic_multiplication))
end

#------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function uncertain_factorization(f::MPolyRingElem{QQFieldElem})
f = divexact(f, factor_out)
f_uni = divexact(f_uni, gcd(f_uni, derivative(f_uni)))
end
is_irr = Nemo.isirreducible(f_uni)
is_irr = Nemo.is_irreducible(f_uni)
break
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/wronskian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ Computes the Wronskians of io_equations
for (i, tlist) in enumerate(termlists)
n = length(tlist)
evaled = massive_eval(tlist, ps_ext)
S = Nemo.MatrixSpace(F, n, n)
S = Nemo.matrix_space(F, n, n)
W = zero(S)
for (i, ps) in enumerate(evaled)
for j in 1:n
Expand Down
2 changes: 1 addition & 1 deletion test/det_minor_expansion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ if GROUP == "All" || GROUP == "Core"
@testset "Determinant by minor expansion" begin
for d in 1:5
for testcase in 1:10
mat_space = Nemo.MatrixSpace(Nemo.QQ, d, d)
mat_space = Nemo.matrix_space(Nemo.QQ, d, d)
rnd_matrix = mat_space([mod(rand(Int), 1000) for i in 1:d, j in 1:d])
@test det(rnd_matrix) == det_minor_expansion(rnd_matrix)
end
Expand Down
2 changes: 1 addition & 1 deletion test/ps_diff.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if GROUP == "All" || GROUP == "Core"
@testset "Power Series Differentiation" begin
T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute)
T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute)

@test ps_diff(zero(T)) == zero(T)

Expand Down
2 changes: 1 addition & 1 deletion test/ps_integrate.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if GROUP == "All" || GROUP == "Core"
@testset "Power series integration" begin
T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute)
T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute)

@test ps_integrate(zero(T)) == zero(T)

Expand Down
4 changes: 2 additions & 2 deletions test/ps_inverse.jl
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
if GROUP == "All" || GROUP == "Core"
@testset "Power series matrix inverse" begin
T, t = Nemo.PowerSeriesRing(
T, t = Nemo.power_series_ring(
Nemo.Native.GF(2^31 - 1),
50,
"t";
model = :capped_absolute,
)

for d in 1:5
S = Nemo.MatrixSpace(T, d, d)
S = Nemo.matrix_space(T, d, d)
for case in 1:20
M = S([random_ps(T) for i in 1:d, j in 1:d])
while isequal(
Expand Down
6 changes: 3 additions & 3 deletions test/ps_matrix_homlinear.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if GROUP == "All" || GROUP == "Core"
@testset "Homogeneous linear differential equations" begin
T, t = Nemo.PowerSeriesRing(
T, t = Nemo.power_series_ring(
Nemo.Native.GF(2^31 - 1),
300,
"t";
Expand All @@ -9,9 +9,9 @@ if GROUP == "All" || GROUP == "Core"

for d in 1:5
for c in 1:5
S = Nemo.MatrixSpace(T, d, d)
S = Nemo.matrix_space(T, d, d)
A = random_ps_matrix(T, S)
Sconst = Nemo.MatrixSpace(Nemo.Native.GF(2^31 - 1), d, d)
Sconst = Nemo.matrix_space(Nemo.Native.GF(2^31 - 1), d, d)
Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d])
while StructuralIdentifiability.LinearAlgebra.det(Y0) == 0
Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d])
Expand Down
6 changes: 3 additions & 3 deletions test/ps_matrix_linear.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
if GROUP == "All" || GROUP == "Core"
@testset "Linear differential equations" begin
T, t = Nemo.PowerSeriesRing(
T, t = Nemo.power_series_ring(
Nemo.Native.GF(2^31 - 1),
300,
"t";
Expand All @@ -9,10 +9,10 @@ if GROUP == "All" || GROUP == "Core"

for d in 1:5
for c in 1:5
S = Nemo.MatrixSpace(T, d, d)
S = Nemo.matrix_space(T, d, d)
A = random_ps_matrix(T, S)
B = random_ps_matrix(T, S)
Sconst = Nemo.MatrixSpace(Nemo.Native.GF(2^31 - 1), d, d)
Sconst = Nemo.matrix_space(Nemo.Native.GF(2^31 - 1), d, d)
Y0 = Sconst([rand(Int) % 100 for i in 1:d, j in 1:d])
@time sol = ps_matrix_linear_de(A, B, Y0)
to_be_zero = map(ps_diff, sol) - A * sol - B
Expand Down
8 changes: 4 additions & 4 deletions test/ps_matrix_log.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
if GROUP == "All" || GROUP == "Core"
@testset "Logarith of power series matrices" begin
T, t = Nemo.PowerSeriesRing(Nemo.QQ, 300, "t"; model = :capped_absolute)
T, t = Nemo.power_series_ring(Nemo.QQ, 300, "t"; model = :capped_absolute)

for d in 1:5
diag_elements = [1 + t * random_ps(T) for i in 1:d]
S = Nemo.MatrixSpace(T, d, d)
S = Nemo.matrix_space(T, d, d)
M = S([(i == j ? diag_elements[i] : T(0)) for i in 1:d, j in 1:d])
result = ps_matrix_log(M)
correct = S([(i == j ? log(diag_elements[i]) : T(0)) for i in 1:d, j in 1:d])
Expand All @@ -13,7 +13,7 @@ if GROUP == "All" || GROUP == "Core"

for c in 1:5
f = random_ps(T) * t
S = Nemo.MatrixSpace(T, 2, 2)
S = Nemo.matrix_space(T, 2, 2)
m = S([
T(1) f
T(0) T(1)
Expand All @@ -27,7 +27,7 @@ if GROUP == "All" || GROUP == "Core"

for c in 1:5
f, g = random_ps(T) * t, random_ps(T) * t
S = Nemo.MatrixSpace(T, 3, 3)
S = Nemo.matrix_space(T, 3, 3)
m = S([
T(1) f g
T(0) T(1) f
Expand Down

0 comments on commit 9bd79ec

Please sign in to comment.