mirror of
https://gitlab.rlp.net/mobitar/ReCo.jl.git
synced 2024-12-21 00:51:21 +00:00
Fixed AbstractVector of SVector
This commit is contained in:
parent
f63b69ea17
commit
78a9e96e9d
2 changed files with 13 additions and 7 deletions
|
@ -294,9 +294,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
|
|||
|
||||
[[deps.Distributions]]
|
||||
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"
|
||||
version = "0.25.42"
|
||||
version = "0.25.43"
|
||||
|
||||
[[deps.DocStringExtensions]]
|
||||
deps = ["LibGit2"]
|
||||
|
|
16
src/Shape.jl
16
src/Shape.jl
|
@ -47,7 +47,7 @@ function center_of_mass_from_proj_sums(
|
|||
return SVector(COM_x, COM_y)
|
||||
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)
|
||||
y_proj_sum = SVector(0.0, 0.0)
|
||||
|
||||
|
@ -90,7 +90,7 @@ function gyration_tensor(
|
|||
end
|
||||
|
||||
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
|
||||
S12 = 0.0
|
||||
|
@ -108,7 +108,9 @@ function gyration_tensor(
|
|||
end
|
||||
|
||||
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,
|
||||
)
|
||||
COM = center_of_mass(particles_or_centers, half_box_len)
|
||||
|
@ -122,7 +124,9 @@ function eigvals_ratio(matrix)
|
|||
end
|
||||
|
||||
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,
|
||||
)
|
||||
g_tensor = gyration_tensor(particles_or_centers, half_box_len)
|
||||
|
@ -130,7 +134,9 @@ function gyration_tensor_eigvals_ratio(
|
|||
end
|
||||
|
||||
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,
|
||||
COM::SVector{2,<:Real},
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue