Skip to content

Commit

Permalink
only set_option(string,bool,ring)
Browse files Browse the repository at this point in the history
  • Loading branch information
hannes14 committed Jun 14, 2024
1 parent 721c1a8 commit 7f18e68
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 166 deletions.
13 changes: 6 additions & 7 deletions deps/src/caller.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "caller.h"
#include "ideals.h"

#include <Singular/tok.h>
#include <Singular/grammar.h>
Expand Down Expand Up @@ -253,7 +252,7 @@ jl_value_t * get_julia_type_from_sleftv(leftv ret)
jl_value_t * get_ring_content(ring r)
{
ring save = currRing;
rChangeCurrRing_wo_options(r);
rChangeCurrRing(r);

// count elements
idhdl h = r->idroot;
Expand Down Expand Up @@ -284,7 +283,7 @@ jl_value_t * get_ring_content(ring r)
nr++;
}
JL_GC_POP();
rChangeCurrRing_wo_options(save);
rChangeCurrRing(save);
return reinterpret_cast<jl_value_t *>(result);
}

Expand Down Expand Up @@ -410,9 +409,9 @@ jl_value_t * convert_nested_list(void * l_void)
void * create_syStrategy_data(syStrategy res, ring o)
{
const ring origin = currRing;
rChangeCurrRing_wo_options(o);
rChangeCurrRing(o);
syStrategy temp = syCopy(res);
rChangeCurrRing_wo_options(origin);
rChangeCurrRing(origin);
return reinterpret_cast<void *>(temp);
}

Expand Down Expand Up @@ -490,9 +489,9 @@ void singular_define_caller(jlcxx::Module & Singular)
Singular.method("jl_array_to_void",
[](jl_value_t * args_val, jl_value_t * types_val, ring R) {
auto origin = currRing;
rChangeCurrRing_wo_options(R);
rChangeCurrRing(R);
lists l = jl_array_to_list_helper(args_val, types_val);
rChangeCurrRing_wo_options(origin);
rChangeCurrRing(origin);
return (void *)l;
});

Expand Down
5 changes: 2 additions & 3 deletions deps/src/coeffs.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#include "coeffs.h"
#include "ideals.h"

auto transExt_helper(coeffs cf, jlcxx::ArrayRef<uint8_t *> param)
{
Expand Down Expand Up @@ -27,9 +26,9 @@ poly transExt_to_poly(number a, coeffs cf, ring r)
ring ext = cf->extRing;
nMapFunc nMap = n_SetMap(ext->cf, r->cf);
const ring origin = currRing;
rChangeCurrRing_wo_options(r);
rChangeCurrRing(r);
poly p = p_PermPoly(NUM((fraction)a), NULL, ext, r, nMap, NULL);
rChangeCurrRing_wo_options(origin);
rChangeCurrRing(origin);
return p;
}

Expand Down
Loading

0 comments on commit 7f18e68

Please sign in to comment.