Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test-oscar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down Expand Up @@ -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
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test-polymake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions OscarCI.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ branches = [ "release", "<matching>" ]
julia-version = "1.10"
os = "ubuntu-latest"

[include.lts]
Polymake = "<matching>"
julia-version = "1.6"
os = "ubuntu-latest"

[include.oscar]
Oscar = "<matching>"
Polymake = "<matching>"
Expand Down
6 changes: 3 additions & 3 deletions include/jlpolymake/containers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -255,7 +255,7 @@ struct WrapArrayImpl
return elemType(V[static_cast<pm::Int>(n) - 1]);
});
wrapped.method("_setindex!",
[](WrappedT& V, elemType val, int64_t n) {
[](WrappedT& V, const elemType& val, int64_t n) {
V[static_cast<pm::Int>(n) - 1] = val;
});
wrapped.method("length", &WrappedT::size);
Expand Down Expand Up @@ -293,7 +293,7 @@ struct WrapArrayImpl<pm::perl::BigObject::Array_element<readonly>>
return elemType(V[static_cast<pm::Int>(n) - 1]);
});
wrapped.method("_setindex!",
[](WrappedT& V, elemType val, int64_t n) {
[](WrappedT& V, const elemType& val, int64_t n) {
V[static_cast<pm::Int>(n) - 1] = val;
});
wrapped.method("length", &WrappedT::size);
Expand Down
5 changes: 3 additions & 2 deletions include/jlpolymake/jlpolymake.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include <polymake/group/switch_table.h>
#include <polymake/graph/Decoration.h>
#include <polymake/RandomGenerators.h>
#include <polymake/tropical/covectors.h>

#include <polymake/perl/calls.h>

Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/jlpolymake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ JLCXX_MODULE define_module_polymake(jlcxx::Module& jlpolymake)
// extra types
add_homologygroup(jlpolymake);
wrap_array<polymake::topaz::HomologyGroup<pm::Integer>>(jlpolymake);
wrap_array<polymake::topaz::CycleGroup<pm::Integer>>(jlpolymake);

add_switchtable(jlpolymake);

Expand Down
16 changes: 16 additions & 0 deletions src/polymake/type_setup.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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", @_);
Expand Down Expand Up @@ -318,6 +319,18 @@ sub EdgeMap {
"Array{HomologyGroup{Integer}}",
"array_homologygroup_integer",
],
[
"CycleGroup_Integer",
"polymake::topaz::CycleGroup<pm::Integer>",
"CycleGroup{Integer}",
"cyclegroup_integer",
],
[
"Array_CycleGroup_Integer",
"pm::Array<polymake::topaz::CycleGroup<pm::Integer>>",
"Array{CycleGroup{Integer}}",
"array_cyclegroup_integer",
],
[
"SwitchTable",
"polymake::group::SwitchTable",
Expand All @@ -334,6 +347,9 @@ sub EdgeMap {
BasicDecoration,
NodeMap(BasicDecoration),
Array(BasicDecoration),
CovectorDecoration,
NodeMap(CovectorDecoration),
Array(CovectorDecoration),
);

$extra_calls = $wrap_calls;
Expand Down
10 changes: 10 additions & 0 deletions src/type_decoration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ void add_decoration(jlcxx::Module& jlpolymake)
return show_small_object<DecT>(S);
});

using CovDecT = polymake::tropical::CovectorDecoration;
auto covtype = jlpolymake.add_type<CovDecT>("CovectorDecoration")
.constructor<const pm::Set<Int>&, 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<CovDecT>(S);
});
}

}
20 changes: 18 additions & 2 deletions src/type_homologygroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ void add_homologygroup(jlcxx::Module& jlpolymake)

auto type = jlpolymake
.add_type<jlcxx::Parametric<jlcxx::TypeVar<1>>>(
"HomologyGroup");
"HomologyGroup")

type.apply<polymake::topaz::HomologyGroup<pm::Integer>>([&jlpolymake](auto wrapped) {
.apply<polymake::topaz::HomologyGroup<pm::Integer>>([&jlpolymake](auto wrapped) {

typedef typename decltype(wrapped)::type WrappedT;

Expand All @@ -27,6 +27,22 @@ void add_homologygroup(jlcxx::Module& jlpolymake)
});
});

auto cgtype = jlpolymake
.add_type<jlcxx::Parametric<jlcxx::TypeVar<1>>>(
"CycleGroup")

.apply<polymake::topaz::CycleGroup<pm::Integer>>([&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<WrappedT>(S);
});
});

}

}
4 changes: 2 additions & 2 deletions test-prepare.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading