Skip to content

Commit

Permalink
e-antic 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Winfried Bruns committed Jun 21, 2021
1 parent 7f0c7f3 commit 85f1d74
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
14 changes: 6 additions & 8 deletions NormalizModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ static bool prepare_nf_input(vector< vector< NumberFieldElem > >& out,
current_elem = NumberFieldElem(*nf, current_vector);
}
if (string_check(current_element)) {
current_elem = NumberFieldElem(*nf);
current_elem = PyUnicodeToString(current_element);
current_elem = NumberFieldElem(*nf,PyUnicodeToString(current_element));
// current_elem = PyUnicodeToString(current_element);
}
if (PyFloat_Check(current_element)){
throw PyNormalizInputException("Nonintegral numbers must be given as strings");
Expand Down Expand Up @@ -1045,15 +1045,13 @@ static PyObject* _NmzConeIntern_renf(PyObject* kwargs)
return NULL;
}


renf_class* renf;
// number_field_data contains 3 entries: poly, var, emb
// All are strings
string poly = PyUnicodeToString(PySequence_GetItem(number_field_data, 0));
string var = PyUnicodeToString(PySequence_GetItem(number_field_data, 1));
string emb = PyUnicodeToString(PySequence_GetItem(number_field_data, 2));
// std::shared_ptr<const renf_class>* renf = new std::shared_ptr<const renf_class>;
std::shared_ptr<const renf_class> renf = renf_class::make(poly, var, emb);
// boost::intrusive_ptr<const renf_class>* renf = new boost::intrusive_ptr<const renf_class>;
boost::intrusive_ptr<const renf_class> renf = renf_class::make(poly, var, emb);
const renf_class* my_renf = renf.get();

map< InputType, vector< vector< renf_elem_class > > > input;
Expand All @@ -1076,7 +1074,7 @@ static PyObject* _NmzConeIntern_renf(PyObject* kwargs)
continue;
vector< vector< renf_elem_class > > Mat;
try {
prepare_nf_input(Mat, current_value, renf);
prepare_nf_input(Mat, current_value, my_renf);
}
catch (PyNormalizInputException& e) {
PyErr_SetString(PyNormaliz_cppError,
Expand Down Expand Up @@ -2505,7 +2503,7 @@ static PyObject* NmzGetRenfInfo(PyObject* self, PyObject* args)
}
const renf_class* renf = get_cone_renf_renf(cone_py);
std::string minpoly_str;
minpoly_str = fmpq_poly_get_str_pretty(renf->get_renf()->nf->pol, renf->gen_name.c_str());
minpoly_str = fmpq_poly_get_str_pretty(renf->get_renf()->nf->pol, renf->gen_name().c_str());
std::string res1 = arb_get_str(renf->get_renf()->emb, 64, 0);
// long prec = renf->get_renf()->prec;
return PyTuple_Pack(2, StringToPyUnicode(minpoly_str), StringToPyUnicode(res1));
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
py_modules = [ "PyNormaliz" ],
ext_modules = [ Extension( "PyNormaliz_cpp",
[ "NormalizModule.cpp" ],
extra_compile_args=['-std=c++11'],
extra_compile_args=['-std=c++14'],
libraries=[ 'normaliz' ],
**extra_kwds) ],

Expand Down

0 comments on commit 85f1d74

Please sign in to comment.