My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
Singular
dyn_modules
python
wrapper.h
Go to the documentation of this file.
1
#ifndef PYTHON_SINGULAR_WRAPPER_HEADER
2
#define PYTHON_SINGULAR_WRAPPER_HEADER
3
#include <Python.h>
4
#include <boost/python.hpp>
5
#include <sstream>
6
#include "
kernel/mod2.h
"
7
8
9
#include "
kernel/structs.h
"
10
#include "
coeffs/numbers.h
"
11
12
#include "
Singular/ipid.h
"
13
#include "
Singular/ipshell.h
"
14
#include "
Number.h
"
15
#include "
Poly.h
"
16
#include "
PowerSeries.h
"
17
#include "
Ideal.h
"
18
#include "
ideal_wrap.h
"
19
#include "
factory/factory.h
"
20
#include "
poly_wrap.h
"
21
#include "
vector_wrap.h
"
22
#include "
CF_wrap.h
"
23
#include "
number_wrap.h
"
24
#include "
interpreter_support.h
"
25
#include "
ring_wrap.h
"
26
#include "
intvec_wrap.h
"
27
//using boost::python::numeric::array;
28
using
boost::python::extract;
29
30
using namespace
boost::python;
31
32
Vector
unitVector0
(
int
i
)
33
{
34
return
unitVector
(
i
,
currRing
);
35
}
36
37
void
different_ring_translator
(
DifferentDomainException
const
&
x
)
38
{
39
PrintS
(
"hoho"
);
40
PyErr_SetString(PyExc_UserWarning,
"Objects didn't have the same ring"
);
41
}
42
BOOST_PYTHON_MODULE
(Singular)
43
{
44
//Print("ref count after add: %d", currRing->ref);
45
register_exception_translator<
46
DifferentDomainException
>(
different_ring_translator
);
47
export_poly
();
48
export_number
();
49
export_vector
();
50
//export_playground();
51
export_ideal
();
52
export_module
();
53
//export_interpreter();
54
export_ring
();
55
export_intvec
();
56
boost::python::class_<PowerSeries>(
"power_series"
)
57
.def(boost::python::init <const PowerSeries::numerator_type &,const PowerSeries::denominator_type&>())
58
.def(
"__iter__"
, boost::python::iterator<PowerSeries>());
59
boost::python::class_<VectorPowerSeries>(
"vector_power_series"
)
60
.def(boost::python::init <const VectorPowerSeries::numerator_type&,const VectorPowerSeries::denominator_type &>())
61
.def(
"__iter__"
, boost::python::iterator<VectorPowerSeries>());
62
def(
"gen"
,
unitVector0
);
63
// .def(self+=self)
64
// .def(self+self)
65
//.def(self*=Number())
66
//.def(Number() * self);
67
}
68
BOOST_PYTHON_MODULE
(factory)
69
{
70
boost::python::class_<Variable>(
"variable"
)
71
.def(boost::python::init <const int, char>())
72
.def(boost::python::init <char>())
73
.def(boost::python::init <const int>());
74
export_CF
();
75
}
76
BOOST_PYTHON_MODULE
(_Singular)
77
{
78
export_interpreter
();
79
}
80
#endif
export_CF
void export_CF()
Definition
CF_wrap.cc:17
CF_wrap.h
Ideal.h
Number.h
Poly.h
unitVector
Vector unitVector(int i, ring r=currRing)
Definition
Poly.h:630
PowerSeries.h
i
int i
Definition
cfEzgcd.cc:132
x
Variable x
Definition
cfModGcd.cc:4090
DifferentDomainException
Definition
Poly.h:20
Vector
Definition
Poly.h:509
factory.h
factory.h' is the user interface to Factory.
export_module
void export_module()
Definition
ideal_wrap.cc:68
export_ideal
void export_ideal()
Definition
ideal_wrap.cc:55
ideal_wrap.h
export_interpreter
void export_interpreter()
Definition
interpreter_support.cc:529
interpreter_support.h
export_intvec
void export_intvec()
Definition
intvec_wrap.cc:30
intvec_wrap.h
ipid.h
ipshell.h
mod2.h
export_number
void export_number()
Definition
number_wrap.cc:19
number_wrap.h
numbers.h
export_poly
void export_poly()
Definition
poly_wrap.cc:29
poly_wrap.h
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition
polys.cc:13
PrintS
void PrintS(const char *s)
Definition
reporter.cc:288
export_ring
void export_ring()
Definition
ring_wrap.cc:32
ring_wrap.h
structs.h
vector_wrap.h
export_vector
void export_vector()
BOOST_PYTHON_MODULE
BOOST_PYTHON_MODULE(Singular)
Definition
wrapper.h:42
unitVector0
Vector unitVector0(int i)
Definition
wrapper.h:32
different_ring_translator
void different_ring_translator(DifferentDomainException const &x)
Definition
wrapper.h:37
Generated on
for My Project by
doxygen 1.17.0
for
Singular