Skip to content

Commit

Permalink
Merge pull request #13 from chkwon/ctype
Browse files Browse the repository at this point in the history
Cint -> Int32, Cdouble -> Float64
  • Loading branch information
chkwon authored May 9, 2022
2 parents 784d657 + 3aa800f commit 968aecd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,16 @@ result3 = solve_tsp(dist_mtx, ap; x_coordinates=x, y_coordinates=y)
The paramters for the HGS algorithm with default values are:
```julia
Base.@kwdef mutable struct AlgorithmParameters
nbGranular :: Cint = 20
mu :: Cint = 25
lambda :: Cint = 40
nbElite :: Cint = 4
nbClose :: Cint = 5
targetFeasible :: Cdouble = 0.2
seed :: Cint = 0
nbIter :: Cint = 20000
timeLimit :: Cdouble = 0.0
useSwapStar :: Cint = 1
nbGranular :: Int32 = 20
mu :: Int32 = 25
lambda :: Int32 = 40
nbElite :: Int32 = 4
nbClose :: Int32 = 5
targetFeasible :: Float64 = 0.2
seed :: Int32 = 0
nbIter :: Int32 = 20000
timeLimit :: Float64 = 0.0
useSwapStar :: Int32 = 1 # 1 = true, 0 = false
end
```
where `const C_DBL_MAX = floatmax(Cdouble)`.
Expand Down
24 changes: 14 additions & 10 deletions src/c_api.jl
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
# # System Independent Types
# @assert Cint == Int32
# @assert Cdouble == Float64

# Must match with AlgorithmParameters.h in HGS-CVRP: https://github.com/vidalt/HGS-CVRP
Base.@kwdef mutable struct AlgorithmParameters
nbGranular :: Cint = 20
mu :: Cint = 25
lambda :: Cint = 40
nbElite :: Cint = 4
nbClose :: Cint = 5
targetFeasible :: Cdouble = 0.2
seed :: Cint = 0
nbIter :: Cint = 20000
timeLimit :: Cdouble = 0.0
useSwapStar :: Cint = 1
nbGranular :: Int32 = 20
mu :: Int32 = 25
lambda :: Int32 = 40
nbElite :: Int32 = 4
nbClose :: Int32 = 5
targetFeasible :: Float64 = 0.2
seed :: Int32 = 0
nbIter :: Int32 = 20000
timeLimit :: Float64 = 0.0
useSwapStar :: Int32 = 1 # 1 = true, 0 = false
end

mutable struct C_SolutionRoute
Expand Down

0 comments on commit 968aecd

Please sign in to comment.