1
0
Fork 0
mirror of https://gitlab.rlp.net/mobitar/ReCo.jl.git synced 2024-09-19 19:01:17 +00:00

Fixed AbstractVector of SVector

This commit is contained in:
Mo8it 2022-01-30 15:15:25 +01:00
parent f63b69ea17
commit 78a9e96e9d
2 changed files with 13 additions and 7 deletions

View file

@ -294,9 +294,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[deps.Distributions]] [[deps.Distributions]]
deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"] deps = ["ChainRulesCore", "DensityInterface", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SparseArrays", "SpecialFunctions", "Statistics", "StatsBase", "StatsFuns", "Test"]
git-tree-sha1 = "0c8693f37a265b6c0e552861cad8bf4b13d65686" git-tree-sha1 = "38bcc22b6e358e88a7715ad0db446dfd3a4fea47"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
version = "0.25.42" version = "0.25.43"
[[deps.DocStringExtensions]] [[deps.DocStringExtensions]]
deps = ["LibGit2"] deps = ["LibGit2"]

View file

@ -47,7 +47,7 @@ function center_of_mass_from_proj_sums(
return SVector(COM_x, COM_y) return SVector(COM_x, COM_y)
end end
function center_of_mass(centers::AbstractVector{SVector{2,<:Real}}, half_box_len::Real) function center_of_mass(centers::AbstractVector{<:SVector{2,<:Real}}, half_box_len::Real)
x_proj_sum = SVector(0.0, 0.0) x_proj_sum = SVector(0.0, 0.0)
y_proj_sum = SVector(0.0, 0.0) y_proj_sum = SVector(0.0, 0.0)
@ -90,7 +90,7 @@ function gyration_tensor(
end end
function gyration_tensor( function gyration_tensor(
centers::AbstractVector{SVector{2,<:Real}}, half_box_len::Real, COM::SVector{2,<:Real} centers::AbstractVector{<:SVector{2,<:Real}}, half_box_len::Real, COM::SVector{2,<:Real}
) )
S11 = 0.0 S11 = 0.0
S12 = 0.0 S12 = 0.0
@ -108,7 +108,9 @@ function gyration_tensor(
end end
function gyration_tensor( function gyration_tensor(
particles_or_centers::Union{AbstractVector{Particle},AbstractVector{SVector{2,<:Real}}}, particles_or_centers::Union{
AbstractVector{Particle},AbstractVector{<:SVector{2,<:Real}}
},
half_box_len::Real, half_box_len::Real,
) )
COM = center_of_mass(particles_or_centers, half_box_len) COM = center_of_mass(particles_or_centers, half_box_len)
@ -122,7 +124,9 @@ function eigvals_ratio(matrix)
end end
function gyration_tensor_eigvals_ratio( function gyration_tensor_eigvals_ratio(
particles_or_centers::Union{AbstractVector{Particle},AbstractVector{SVector{2,<:Real}}}, particles_or_centers::Union{
AbstractVector{Particle},AbstractVector{<:SVector{2,<:Real}}
},
half_box_len::Real, half_box_len::Real,
) )
g_tensor = gyration_tensor(particles_or_centers, half_box_len) g_tensor = gyration_tensor(particles_or_centers, half_box_len)
@ -130,7 +134,9 @@ function gyration_tensor_eigvals_ratio(
end end
function gyration_tensor_eigvals_ratio( function gyration_tensor_eigvals_ratio(
particles_or_centers::Union{AbstractVector{Particle},AbstractVector{SVector{2,<:Real}}}, particles_or_centers::Union{
AbstractVector{Particle},AbstractVector{<:SVector{2,<:Real}}
},
half_box_len::Real, half_box_len::Real,
COM::SVector{2,<:Real}, COM::SVector{2,<:Real},
) )