Skip to content

Commit 8fa974c

Browse files
authored
convert objects of type DEF_CMD to nothing (#905)
* convert objects of type DEF_CMD to nothing * format
1 parent 9977713 commit 8fa974c

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

deps/src/caller.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ static jl_value_t * get_type_mapper()
3838
{RESOLUTION_CMD, "RESOLUTION_CMD"},
3939
{MODUL_CMD, "MODUL_CMD"},
4040
{VECTOR_CMD, "VECTOR_CMD"},
41-
{INTVEC_CMD, "INTVEC_CMD"}};
41+
{INTVEC_CMD, "INTVEC_CMD"},
42+
{DEF_CMD,"DEF_CMD"}};
4243

4344
jl_array_t * return_array =
4445
jl_alloc_array_1d(jl_array_any_type, sizeof(types) / sizeof(types[0]));
@@ -458,6 +459,9 @@ void singular_define_caller(jlcxx::Module & Singular)
458459
Singular.method("RESOLUTION_CMD_CASTER", [](void * obj) {
459460
return reinterpret_cast<syStrategy>(obj);
460461
});
462+
Singular.method("DEF_CMD_CASTER", [](void * obj) {
463+
return jl_box_int64(reinterpret_cast<long>(obj));
464+
});
461465
Singular.method("LIST_CMD_TRAVERSAL", &convert_nested_list);
462466
Singular.method("get_ring_content", &get_ring_content);
463467
Singular.method("get_ring_ref", &get_ring_ref);

src/caller.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,11 @@ function create_casting_functions()
132132
cast = libSingular.RESOLUTION_CMD_CASTER(vptr)
133133
return R(cast, Val(:resolution)) # eh
134134
end
135+
,
136+
mapping_types_reversed[:DEF_CMD] =>
137+
function (vptr, R)
138+
return nothing
139+
end
135140
)
136141
end
137142

test/libsingular-test.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
include("libsingular/nemo-test.jl")
2+
include("libsingular/Puiseuxexpansions-test.jl")
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
@testset "Singular.LibPuiseuxexpansions" begin
2+
R, (x, y) = polynomial_ring(QQ, ["x", "y"])
3+
4+
f = y^3 + x^2 + x^8
5+
6+
L = Singular.LibPuiseuxexpansions.puiseux(f,8,1)
7+
8+
@test L[1][1] == 1//9*x^38 - 1//3*x^20 - x^2
9+
@test L[1][2] == 3
10+
@test L[1][3] == nothing
11+
end

0 commit comments

Comments
 (0)