Skip to content

Commit a17e5dc

Browse files
committed
define some return types in utilitiesPairID.jl
1 parent 739d225 commit a17e5dc

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/contactDetection/ContactDetectionMPR/utilitiesPairID.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
const i16max = Int64(typemax(Int16))
66
const i32max = Int64(typemax(Int32))
77

8-
pack16(i1::Integer, i2::Integer) = Int64(i1) + i16max*Int64(i2)
8+
pack16(i1::Integer, i2::Integer)::Integer = Int64(i1) + i16max*Int64(i2)
99

10-
function pack(i1::Integer, i2::Integer,i3::Integer,i4::Integer)
11-
@assert(i1 >= 0 && i1 <= typemax(Int16))
12-
@assert(i2 >= 0 && i2 <= typemax(Int16))
13-
@assert(i3 >= 0 && i3 <= typemax(Int16))
14-
@assert(i4 >= 0 && i4 <= typemax(Int16))
15-
return pack16(i1,i2) + i32max*pack16(i3,i4)
10+
function pack(i1::Integer, i2::Integer,i3::Integer,i4::Integer)::Integer
11+
@assert(i1 >= 0 && i1 <= typemax(Int16))
12+
@assert(i2 >= 0 && i2 <= typemax(Int16))
13+
@assert(i3 >= 0 && i3 <= typemax(Int16))
14+
@assert(i4 >= 0 && i4 <= typemax(Int16))
15+
return pack16(i1,i2) + i32max*pack16(i3,i4)
1616
end
1717

1818

@@ -41,7 +41,7 @@ end
4141

4242
### -------------------computation of pairID -----------------------------------
4343
### it returns a unique ID
44-
function orderPositions(is,i,js,j)
44+
function orderPositions(is,i,js,j)::Integer
4545
if is < js
4646
return pack(is,i,js,j)
4747
elseif is > js
@@ -53,7 +53,7 @@ end; end
5353
#getPositionsOfObj(scene::Composition.Scene, obj::Composition.Object3D,
5454
# movablePos::Nothing) = (false, 0, 0)
5555
function getPositionsOfObj(scene::Composition.Scene,
56-
obj::Composition.Object3D, movablePos::Int64)
56+
obj::Composition.Object3D, movablePos::Int64)::Tuple{Bool, Int64, Int64}
5757
if movablePos == 0
5858
return (false, 0, 0)
5959
else
@@ -63,7 +63,7 @@ end
6363

6464
function computePairID(scene::Composition.Scene,
6565
actObj::Composition.Object3D, nextObj::Composition.Object3D,
66-
is, i, js, j)
66+
is, i, js, j)::Integer
6767
# is: actual super - object
6868
# js: subsequent super - object
6969
# i: Object3D of is_th super - object

0 commit comments

Comments
 (0)