Skip to content

Commit

Permalink
Merge pull request #59 from JuliaReach/schillic/unused
Browse files Browse the repository at this point in the history
Remove unused variables
  • Loading branch information
schillic authored Mar 2, 2024
2 parents fe8102e + 58c280f commit 17e14bf
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/Arrays/SingleEntryVector.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function inner(e1::SingleEntryVector{N}, A::AbstractMatrix{N},
end

# norm
function LinearAlgebra.norm(e::SingleEntryVector, p::Real=Inf)
function LinearAlgebra.norm(e::SingleEntryVector, ::Real=Inf)
return abs(e.v)
end

Expand Down
4 changes: 2 additions & 2 deletions src/Arrays/matrix_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function issquare(M::AbstractMatrix)
return m == n
end

function issquare(M::Diagonal)
function issquare(::Diagonal)
return true
end

Expand Down Expand Up @@ -273,7 +273,7 @@ end

# fallback: represent the projection matrix as a sparse array
function projection_matrix(block::AbstractVector{Int}, n::Int,
VN::Type{<:AbstractVector{N}}) where {N}
::Type{<:AbstractVector{N}}) where {N}
return projection_matrix(block, n, N)
end

Expand Down
4 changes: 2 additions & 2 deletions src/Arrays/matrix_vector_operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ matrix_type(MT::Type{<:AbstractMatrix{T}}) where {T} = MT
matrix_type(::Type{<:AbstractSparseVector{T}}) where {T} = SparseMatrixCSC{T,Int}

# matrix constructors
_matrix(m, n, MT::Type{<:AbstractMatrix{T}}) where {T} = Matrix{T}(undef, m, n)
_matrix(m, n, MT::Type{<:SparseMatrixCSC{T}}) where {T} = spzeros(T, m, n)
_matrix(m, n, ::Type{<:AbstractMatrix{T}}) where {T} = Matrix{T}(undef, m, n)
_matrix(m, n, ::Type{<:SparseMatrixCSC{T}}) where {T} = spzeros(T, m, n)

"""
to_matrix(vectors::AbstractVector{VN},
Expand Down
24 changes: 12 additions & 12 deletions src/Comparison/tolerance.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,24 @@ end
# global Float64 tolerances
const _TOL_F64 = default_tolerance(Float64)

_rtol(N::Type{Float64}) = _TOL_F64.rtol
_ztol(N::Type{Float64}) = _TOL_F64.ztol
_atol(N::Type{Float64}) = _TOL_F64.atol
_rtol(::Type{Float64}) = _TOL_F64.rtol
_ztol(::Type{Float64}) = _TOL_F64.ztol
_atol(::Type{Float64}) = _TOL_F64.atol

set_rtol(N::Type{Float64}, ε::Float64) = _TOL_F64.rtol = ε
set_ztol(N::Type{Float64}, ε::Float64) = _TOL_F64.ztol = ε
set_atol(N::Type{Float64}, ε::Float64) = _TOL_F64.atol = ε
set_rtol(::Type{Float64}, ε::Float64) = _TOL_F64.rtol = ε
set_ztol(::Type{Float64}, ε::Float64) = _TOL_F64.ztol = ε
set_atol(::Type{Float64}, ε::Float64) = _TOL_F64.atol = ε

# global rational tolerances
const _TOL_RAT = default_tolerance(Rational)

_rtol(N::Type{<:Rational}) = _TOL_RAT.rtol
_ztol(N::Type{<:Rational}) = _TOL_RAT.ztol
_atol(N::Type{<:Rational}) = _TOL_RAT.atol
_rtol(::Type{<:Rational}) = _TOL_RAT.rtol
_ztol(::Type{<:Rational}) = _TOL_RAT.ztol
_atol(::Type{<:Rational}) = _TOL_RAT.atol

set_rtol(N::Type{<:Rational}, ε::Rational) = _TOL_RAT.rtol = ε
set_ztol(N::Type{<:Rational}, ε::Rational) = _TOL_RAT.ztol = ε
set_atol(N::Type{<:Rational}, ε::Rational) = _TOL_RAT.atol = ε
set_rtol(::Type{<:Rational}, ε::Rational) = _TOL_RAT.rtol = ε
set_ztol(::Type{<:Rational}, ε::Rational) = _TOL_RAT.ztol = ε
set_atol(::Type{<:Rational}, ε::Rational) = _TOL_RAT.atol = ε

# global default tolerances for other numeric types
TOL_N = Dict{Type{<:Number},Tolerance}()
Expand Down
4 changes: 2 additions & 2 deletions src/Distribution/DefaultUniform.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ function rand(rng::AbstractRNG, U::DefaultUniform)
end

function rand(rng::AbstractRNG, U::DefaultUniform, n::Int)
return [rand(rng, U) for i in 1:n]
return [rand(rng, U) for _ in 1:n]
end

function rand(rng::AbstractRNG, U::AbstractVector{<:DefaultUniform})
return rand.(Ref(rng), U)
end

function rand!(x, rng::AbstractRNG, U::DefaultUniform)
@inbounds for i in eachindex(x)
@inbounds for _ in eachindex(x)
x[i] = rand(rng, U)
end
return x
Expand Down
2 changes: 1 addition & 1 deletion src/Distribution/reseed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ function reseed!(rng::AbstractRNG, seed::Int)
return seed!(rng, seed)
end

function reseed!(rng::AbstractRNG, seed::Nothing)
function reseed!(rng::AbstractRNG, ::Nothing)
return rng
end
2 changes: 1 addition & 1 deletion src/Iteration/NondecreasingIndices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,6 @@ function Base.iterate(ndi::NondecreasingIndices, state::AbstractVector{Int})
end

# termination
function Base.iterate(ndi::NondecreasingIndices, state::Nothing)
function Base.iterate(::NondecreasingIndices, ::Nothing)
return nothing
end
2 changes: 1 addition & 1 deletion src/Iteration/StrictlyIncreasingIndices.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ function Base.iterate(sii::StrictlyIncreasingIndices, state::AbstractVector{Int}
end

# termination
function Base.iterate(sii::StrictlyIncreasingIndices, state::Nothing)
function Base.iterate(::StrictlyIncreasingIndices, ::Nothing)
return nothing
end

0 comments on commit 17e14bf

Please sign in to comment.