Skip to content

Commit

Permalink
Change Int64 to Int8 in nums_neighbors
Browse files Browse the repository at this point in the history
  • Loading branch information
Vilin97 committed Aug 20, 2022
1 parent 276837b commit 2f12e8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spatial/topology.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ struct CartesianGridRej{N, T}
dims::NTuple{N, Int}

"number of neighbor for each site"
nums_neighbors::Vector{Int}
nums_neighbors::Vector{Int8}
CI::CartesianIndices{N, T}
LI::LinearIndices{N, T}

Expand All @@ -127,7 +127,7 @@ function CartesianGridRej(dims::Tuple)
CI = CartesianIndices(dims)
LI = LinearIndices(dims)
offsets = potential_offsets(dim)
nums_neighbors = [count(x -> x + CI[site] in CI, offsets) for site in 1:prod(dims)]
nums_neighbors = Int8[count(x -> x + CI[site] in CI, offsets) for site in 1:prod(dims)]
CartesianGridRej(dims, nums_neighbors, CI, LI, offsets)
end
CartesianGridRej(dims) = CartesianGridRej(Tuple(dims))
Expand All @@ -147,7 +147,7 @@ end
# neighbor sampling is iterator-based
struct CartesianGridIter{N, T}
dims::NTuple{N, Int}
nums_neighbors::Vector{Int}
nums_neighbors::Vector{Int8}
CI::CartesianIndices{N, T}
LI::LinearIndices{N, T}
offsets::Vector{CartesianIndex{N}}
Expand All @@ -157,7 +157,7 @@ function CartesianGridIter(dims::Tuple)
CI = CartesianIndices(dims)
LI = LinearIndices(dims)
offsets = potential_offsets(dim)
nums_neighbors = [count(x -> x + CI[site] in CI, offsets) for site in 1:prod(dims)]
nums_neighbors = Int8[count(x -> x + CI[site] in CI, offsets) for site in 1:prod(dims)]
CartesianGridIter(dims, nums_neighbors, CI, LI, offsets)
end
CartesianGridIter(dims) = CartesianGridIter(Tuple(dims))
Expand Down

0 comments on commit 2f12e8b

Please sign in to comment.