custom addition -> elementwise addition : Base

This commit is contained in:
Maxime Vorwerk
2023-09-25 06:48:26 +02:00
parent 4179f2bb45
commit ec5069a9fb
3 changed files with 6 additions and 10 deletions

View File

@@ -19,12 +19,12 @@ function getPossibleNeighbors(S::Polycube)
possibleSpots = Set{Tuple{Int64, Int64, Int64}}()
for p S.recentCubes
push!(possibleSpots,
p + (1, 0, 0),
p + (0, 1, 0),
p + (0, 0, 1),
p - (1, 0, 0),
p - (0, 1, 0),
p - (0, 0, 1)
p .+ (1, 0, 0),
p .+ (0, 1, 0),
p .+ (0, 0, 1),
p .- (1, 0, 0),
p .- (0, 1, 0),
p .- (0, 0, 1)
)
end
spots = setdiff(possibleSpots, S.cubes)

View File

@@ -1,6 +1,5 @@
include("Polycube.jl")
include("ImmutableOrientedPolycube.jl")
include("TupleMisc.jl")
include("plot.jl")
using XXhash
using Serialization

View File

@@ -1,3 +0,0 @@
Base.:+(X::Tuple{Integer, Integer, Integer}, Y::Tuple{Integer, Integer, Integer}) = (X[1]+Y[1], X[2]+Y[2], X[3]+Y[3])
Base.:-(X::Tuple{Integer, Integer, Integer}, Y::Tuple{Integer, Integer, Integer}) = (X[1]-Y[1], X[2]-Y[2], X[3]-Y[3])