Skip to content

Commit

Permalink
fixup! First version of caller - WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Jul 24, 2019
1 parent 0b5a8c5 commit 4f321a2
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
3 changes: 1 addition & 2 deletions deps/parselibs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ open(output_filename, "w") do outputfile
error("from libparse: $(libs.stderr)")
end
libs_splitted = split(libs.stdout,"\n")[4:end-1]
libs_splitted = [ split(i," ") for i in libs_splitted ]
libs_splitted = [ [ j for j in i if j != ""] for i in libs_splitted ]
libs_splitted = [ split(i," ", keepempty = false) for i in libs_splitted ]
println(outputfile, ":$(i[1:end - 4]) => [")
for j in libs_splitted
println(outputfile, """[ "$(j[1])", "$(j[3])" ],""")
Expand Down
2 changes: 0 additions & 2 deletions deps/src/caller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#include <Singular/lists.h>
#include <misc/intvec.h>

// #include <julia/julia.h>

static jl_value_t * jl_int64_vector_type;
static jl_value_t * jl_int64_matrix_type;
static jl_value_t * jl_singular_number_type;
Expand Down
4 changes: 1 addition & 3 deletions deps/src/coeffs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,12 @@ void singular_define_coeffs(jlcxx::Module & Singular)
});

Singular.method("n_Delete", [](snumber * n, coeffs cf) {
number * t = &n;
if (n != NULL) {
n_Delete(t, cf);
n_Delete(&n, cf);
}
});

Singular.method("n_Delete_Q", [](snumber * n, coeffs cf) {
;
if (n != NULL) {
n_Delete(&n, cf);
}
Expand Down
1 change: 0 additions & 1 deletion src/LibSingular.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module libSingular

import Libdl

using CxxWrap
@wrapmodule(realpath(joinpath(@__DIR__, "..", "local", "lib", "libsingularwrap." * Libdl.dlext)))

Expand Down
2 changes: 1 addition & 1 deletion src/caller.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ end

function convert_return_value(single_value, rng = nothing)
if single_value[1]
error("recieved list instead of single value")
error("received list instead of single value")
end
cast = casting_functions[single_value[3]][1](single_value[2])
if cast isa Array{Any}
Expand Down
4 changes: 2 additions & 2 deletions src/resolution/resolution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ elem_type(::ResolutionSet{T}) where T <: AbstractAlgebra.RingElem = sresolution{
parent_type(::Type{sresolution{T}}) where T <: AbstractAlgebra.RingElem = ResolutionSet{T}

function checkbounds(r::sresolution, i::Int)
(i < 1 || i > libSingular.get_sySize(r.ptr)) && throw(BoundsError(r, i))
(i < 1 || i > length(r)) && throw(BoundsError(r, i))
end

function getindex(r::sresolution, i::Int)
Expand Down Expand Up @@ -105,7 +105,7 @@ end

function show(io::IO, r::sresolution)
println(io, "Singular Resolution:")
len = libSingular.get_sySize(r.ptr)
len = length(r)
if len > 0
ptr = libSingular.getindex_internal(r.ptr,0,r.minimal)
if ptr.cpp_object != C_NULL
Expand Down

0 comments on commit 4f321a2

Please sign in to comment.