diff --git a/.github/workflows/test-oscar.yml b/.github/workflows/test-oscar.yml index a3211ca..cf3a766 100644 --- a/.github/workflows/test-oscar.yml +++ b/.github/workflows/test-oscar.yml @@ -23,11 +23,11 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} JULIA_PKG_SERVER_REGISTRY_PREFERENCE: "eager" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Set up Julia" - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: - version: '~1.6.0-0' + version: 'lts' - name: OscarDevTools - CI if: github.repository == 'oscar-system/OscarDevTools.jl' run: | @@ -64,9 +64,9 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: "Set up Julia" - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} - name: re-using OscarDevTools checkout diff --git a/.github/workflows/test-polymake.yml b/.github/workflows/test-polymake.yml index 5e0740b..7095c45 100644 --- a/.github/workflows/test-polymake.yml +++ b/.github/workflows/test-polymake.yml @@ -27,12 +27,12 @@ jobs: strategy: matrix: os: [ubuntu-latest, macOS-latest] - julia-version: ['1.6', '~1.10.0-0', '~1.11.0-0', '1.12-nightly'] + julia-version: ['~1.10.0-0', '~1.11.0-0', '1.12-nightly'] fail-fast: false steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cache artifacts uses: actions/cache@v3 env: @@ -47,16 +47,13 @@ jobs: ${{ runner.os }}-test- ${{ runner.os }}- - name: "Set up Julia" - uses: julia-actions/setup-julia@v1 + uses: julia-actions/setup-julia@v2 with: version: ${{ matrix.julia-version }} - arch: ${{ matrix.julia-version == '1.6' && 'x64' || runner.arch }} + arch: ${{ runner.arch }} - name: "Build and set override" run: | julia --project=test/project test-prepare.jl --override --build --ignore-compat - - name: "Work around glibcxx issue" - if: matrix.os == 'ubuntu-20.04' - run: echo "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6" >> $GITHUB_ENV - name: "Test polymake" env: TERM: linux diff --git a/OscarCI.toml b/OscarCI.toml index be5b7d1..f1deb93 100644 --- a/OscarCI.toml +++ b/OscarCI.toml @@ -25,11 +25,6 @@ branches = [ "release", "" ] julia-version = "1.10" os = "ubuntu-latest" - [include.lts] - Polymake = "" - julia-version = "1.6" - os = "ubuntu-latest" - [include.oscar] Oscar = "" Polymake = "" diff --git a/include/jlpolymake/containers.h b/include/jlpolymake/containers.h index ffc7e6f..f9d9a32 100644 --- a/include/jlpolymake/containers.h +++ b/include/jlpolymake/containers.h @@ -170,7 +170,7 @@ struct WrapVectorBase return elemType(V[n - 1]); }); wrapped.method("_setindex!", - [](WrappedT& V, elemType val, int64_t n) { + [](WrappedT& V, const elemType& val, int64_t n) { V[n - 1] = val; }); wrapped.method("length", &WrappedT::dim); @@ -255,7 +255,7 @@ struct WrapArrayImpl return elemType(V[static_cast(n) - 1]); }); wrapped.method("_setindex!", - [](WrappedT& V, elemType val, int64_t n) { + [](WrappedT& V, const elemType& val, int64_t n) { V[static_cast(n) - 1] = val; }); wrapped.method("length", &WrappedT::size); @@ -293,7 +293,7 @@ struct WrapArrayImpl> return elemType(V[static_cast(n) - 1]); }); wrapped.method("_setindex!", - [](WrappedT& V, elemType val, int64_t n) { + [](WrappedT& V, const elemType& val, int64_t n) { V[static_cast(n) - 1] = val; }); wrapped.method("length", &WrappedT::size); diff --git a/include/jlpolymake/jlpolymake.h b/include/jlpolymake/jlpolymake.h index 91cddc4..f80e59a 100644 --- a/include/jlpolymake/jlpolymake.h +++ b/include/jlpolymake/jlpolymake.h @@ -32,6 +32,7 @@ #include #include #include +#include #include @@ -43,8 +44,8 @@ #endif #define JLPOLYMAKE_VERSION_MAJOR 0 -#define JLPOLYMAKE_VERSION_MINOR 13 -#define JLPOLYMAKE_VERSION_PATCH 1 +#define JLPOLYMAKE_VERSION_MINOR 14 +#define JLPOLYMAKE_VERSION_PATCH 0 #define __JLPOLYMAKE_STR_HELPER(x) #x #define __JLPOLYMAKE_STR(x) __JLPOLYMAKE_STR_HELPER(x) diff --git a/src/jlpolymake.cpp b/src/jlpolymake.cpp index df9c869..cb0a2e1 100644 --- a/src/jlpolymake.cpp +++ b/src/jlpolymake.cpp @@ -68,6 +68,7 @@ JLCXX_MODULE define_module_polymake(jlcxx::Module& jlpolymake) // extra types add_homologygroup(jlpolymake); wrap_array>(jlpolymake); + wrap_array>(jlpolymake); add_switchtable(jlpolymake); diff --git a/src/polymake/type_setup.pl b/src/polymake/type_setup.pl index 5abba68..b857f03 100644 --- a/src/polymake/type_setup.pl +++ b/src/polymake/type_setup.pl @@ -76,6 +76,7 @@ sub template { sub BigObject { return ["BigObject", "pm::perl::BigObject", "BigObject", "bigobject"]; } sub BigObjectType { return ["BigObjectType", "pm::perl::BigObjectType", "BigObjectType", "bigobjecttype"]; } sub BasicDecoration { return [ "BasicDecoration", "polymake::graph::lattice::BasicDecoration", "BasicDecoration", "basicdecoration"]; } +sub CovectorDecoration { return [ "CovectorDecoration", "polymake::tropical::CovectorDecoration", "CovectorDecoration", "covectordecoration"]; } sub QuadraticExtension { return template("QuadraticExtension", @_); @@ -318,6 +319,18 @@ sub EdgeMap { "Array{HomologyGroup{Integer}}", "array_homologygroup_integer", ], + [ + "CycleGroup_Integer", + "polymake::topaz::CycleGroup", + "CycleGroup{Integer}", + "cyclegroup_integer", + ], + [ + "Array_CycleGroup_Integer", + "pm::Array>", + "Array{CycleGroup{Integer}}", + "array_cyclegroup_integer", + ], [ "SwitchTable", "polymake::group::SwitchTable", @@ -334,6 +347,9 @@ sub EdgeMap { BasicDecoration, NodeMap(BasicDecoration), Array(BasicDecoration), + CovectorDecoration, + NodeMap(CovectorDecoration), + Array(CovectorDecoration), ); $extra_calls = $wrap_calls; diff --git a/src/type_decoration.cpp b/src/type_decoration.cpp index 9459bf9..be0768f 100644 --- a/src/type_decoration.cpp +++ b/src/type_decoration.cpp @@ -20,6 +20,16 @@ void add_decoration(jlcxx::Module& jlpolymake) return show_small_object(S); }); + using CovDecT = polymake::tropical::CovectorDecoration; + auto covtype = jlpolymake.add_type("CovectorDecoration") + .constructor&, Int, const IncidenceMatrix<>&>() + .method("decoration_face", [](const CovDecT& a) { return a.face; }) + .method("decoration_rank", [](const CovDecT& a) { return a.rank; }) + .method("decoration_covector", [](const CovDecT& a) { return a.covector; }) + + .method("show_small_obj", [](const CovDecT& S) { + return show_small_object(S); + }); } } diff --git a/src/type_homologygroup.cpp b/src/type_homologygroup.cpp index 21bcbe6..3b62899 100644 --- a/src/type_homologygroup.cpp +++ b/src/type_homologygroup.cpp @@ -13,9 +13,9 @@ void add_homologygroup(jlcxx::Module& jlpolymake) auto type = jlpolymake .add_type>>( - "HomologyGroup"); + "HomologyGroup") - type.apply>([&jlpolymake](auto wrapped) { + .apply>([&jlpolymake](auto wrapped) { typedef typename decltype(wrapped)::type WrappedT; @@ -27,6 +27,22 @@ void add_homologygroup(jlcxx::Module& jlpolymake) }); }); + auto cgtype = jlpolymake + .add_type>>( + "CycleGroup") + + .apply>([&jlpolymake](auto wrapped) { + + typedef typename decltype(wrapped)::type WrappedT; + + wrapped.method("coeffs", [](const WrappedT& a) { return a.coeffs; }); + wrapped.method("faces", [](const WrappedT& a) { return a.faces; }); + + wrapped.method("show_small_obj", [](const WrappedT& S) { + return show_small_object(S); + }); + }); + } } diff --git a/test-prepare.jl b/test-prepare.jl index 6e37b3f..bb5537c 100644 --- a/test-prepare.jl +++ b/test-prepare.jl @@ -1,8 +1,8 @@ using Pkg -Pkg.add(name="libcxxwrap_julia_jll", version="0.13.3") +Pkg.add(name="libcxxwrap_julia_jll", version="0.14.3") Pkg.pin("libcxxwrap_julia_jll") -Pkg.add(name="polymake_jll", version="400.1300.2") +Pkg.add(name="polymake_jll", version="400.1400.0") using polymake_jll using libcxxwrap_julia_jll