Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
terasakisatoshi committed May 16, 2024
1 parent 030957a commit 98f7a39
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/affine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ jobs:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- name: Instantiate
run: julia --project -e 'using Pkg; Pkg.instantiate()'
- name: Install CxxWrap
run: julia -e 'using Pkg; Pkg.add("CxxWrap")'
- name: Install Eigen
run: sudo apt-get install libeigen3-dev
- name: Build shared libraries
Expand Down
7 changes: 6 additions & 1 deletion affine/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

julia_version = "1.10.3"
manifest_format = "2.0"
project_hash = "ccf1a3757eeb779bee7bfa161a032801f22b27b7"
project_hash = "1bf575ae6f6226ebe875439048e07b3eae0f0506"

[[deps.Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
Expand Down Expand Up @@ -53,6 +53,11 @@ uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
deps = ["SHA"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

[[deps.Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"

[[deps.SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
version = "0.7.0"
Expand Down
3 changes: 2 additions & 1 deletion affine/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ version = "0.1.0"
[deps]
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
test = ["Test"]
13 changes: 12 additions & 1 deletion affine/src/MyCxxWrap5.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
module MyCxxWrap5

using Reexport


module MyAffine

using ..MyCxxWrap5

using CxxWrap
using Libdl

Expand All @@ -9,4 +16,8 @@ function __init__()
@initcxx
end

end # module MyAffine
end # MyAffine

@reexport using .MyAffine: Affine, getW, getb, EigenMatrix

end # module MyCxxWrap5
10 changes: 5 additions & 5 deletions affine/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ using Test
using MyCxxWrap5

@testset "Affine W, b" begin
W = MyCxxWrap5.EigenMatrix{Float64,2,2}()
b = MyCxxWrap5.EigenMatrix{Float64,2,1}()
W = EigenMatrix{Float64,2,2}()
b = EigenMatrix{Float64,2,1}()

jlW = rand(2, 2)
for ci in CartesianIndices(jlW)
Expand All @@ -16,9 +16,9 @@ using MyCxxWrap5
b[i, 1] = jlb[i]
end

aff = MyCxxWrap5.Affine(W, b)
affW = MyCxxWrap5.getW(aff)
affb = MyCxxWrap5.getb(aff)
aff = Affine(W, b)
affW = getW(aff)
affb = getb(aff)
for ci in CartesianIndices(jlW)
@test affW[ci.I...] == jlW[ci]
end
Expand Down

0 comments on commit 98f7a39

Please sign in to comment.