1 | #ifndef WRAPPERS_H |
---|
2 | #define WRAPPERS_H |
---|
3 | |
---|
4 | #ifdef HAVE_WRAPPERS |
---|
5 | |
---|
6 | #include "ring.h" |
---|
7 | #include "polys.h" |
---|
8 | #include "PrettyPrinter.h" |
---|
9 | |
---|
10 | /*! \mainpage C++ wrappers for SINGULAR and related systems |
---|
11 | * |
---|
12 | * \section design Design Overview |
---|
13 | * The following picture shows a UML-like design of the classes implemented so far, |
---|
14 | * and their relationship. |
---|
15 | * \image html "file:///C:/Work/C++Code/inside SINGULAR/C++Wrappers/Overview1.jpg" |
---|
16 | * |
---|
17 | * \section howto How to run this code inside SINGULAR |
---|
18 | * The following steps need to be done to run the C++ wrapper code inside SINGULAR:<br><br> |
---|
19 | * Re-build and run SINGULAR:<br> |
---|
20 | * - checkout the latest code and compile SINGULAR,<br> |
---|
21 | * - go to <c>/SINGULAR</c> and perform <c>make clean</c>,<br> |
---|
22 | * - go to <c>/kernel</c> and perform <c>make clean</c>,<br> |
---|
23 | * - open <c>/SINGULAR/mod2.h</c> and include the line <c>#define HAVE_WRAPPERS 1</c>,<br> |
---|
24 | * - open <c>/kernel/mod2.h</c> and include the line <c>#define HAVE_WRAPPERS 1</c>,<br> |
---|
25 | * - go to <c>/SINGULAR</c> and perform <c>make</c>,<br> |
---|
26 | * - go to <c>/kernel</c> and perform <c>make</c> (Now you have a runnable SINGULAR version |
---|
27 | * including the C++ wrapper code.),<br> |
---|
28 | * - go to <c>/SINGULAR</c> and perform <c>./Singular</c> to run the newly built local |
---|
29 | * executable<br> |
---|
30 | * |
---|
31 | * Call the new code:<br> |
---|
32 | * - you may first declare a ring, e.g. by typing <c>ring r;</c>,<br> |
---|
33 | * - type <c>system("c++wrappers", 0);</c> to perform <c>testWrappers</c> (see file Wrappers.h) without |
---|
34 | * detailed printout to the console,<br> |
---|
35 | * - type <c>system("c++wrappers", 1);</c> to perform <c>testWrappers</c> (see file Wrappers.h) with |
---|
36 | * detailed printout to the console,<br> |
---|
37 | * - declare a ring and two polynomials f and g; then type <c>system("c++wrappers", f, g);</c> |
---|
38 | * to perform <c>wrapSINGULARPolys</c> (see file Wrappers.h). |
---|
39 | */ |
---|
40 | |
---|
41 | /*! type definition for the type of the instance counter inside the class ReferenceCounter */ |
---|
42 | typedef unsigned long ReferenceCounterType; |
---|
43 | |
---|
44 | /*! type definition for SINGULAR-internal polynomials */ |
---|
45 | typedef poly SingularPoly; |
---|
46 | |
---|
47 | /*! type definition for SINGULAR-internal rings */ |
---|
48 | typedef ring SingularRing; |
---|
49 | |
---|
50 | /*! |
---|
51 | * A method for performing a series of tests with the wrapper code.<br> |
---|
52 | * More concretely, the following tests will be performed:<br> |
---|
53 | * - Test0: Creation of RingWrapper from current SINGULAR ring, if any,<br> |
---|
54 | * - Test1: Creation and destruction of instances of RingWrapper,<br> |
---|
55 | * - Test2: Creation, copying, assignment, and destruction of instances of PolyWrapper,<br> |
---|
56 | * - Test3: Addition of compatible instances of PolyWrapper,<br> |
---|
57 | * - Test4: Addition of incompatible instances of PolyWrapper.<br> |
---|
58 | * |
---|
59 | * After compiling SINGULAR and including the line<br> |
---|
60 | * <c>#define HAVE_WRAPPERS 1</c><br> |
---|
61 | * in <c>/SINGULAR/mod2.h</c> and in <c>/kernel/mod2.h</c>, the user may call this |
---|
62 | * method by typing <c>system("c++wrappers", 0)</c> (without detailed console printout), |
---|
63 | * or <c>system("c++wrappers", 1)</c> (with detailed console printout). |
---|
64 | * @param detailedOutput if true this enforces a very detailed console output including internal method calls etc. |
---|
65 | */ |
---|
66 | void testWrappers (bool detailedOutput); |
---|
67 | |
---|
68 | /*! |
---|
69 | * A method for wrapping SINGULAR-internal polynomials as instances of PolyWrapper |
---|
70 | * and afterwards computing their sum as an instance of PolyWrapper.<br> |
---|
71 | * After compiling SINGULAR and including the line<br> |
---|
72 | * <c>#define HAVE_WRAPPERS 1</c><br> |
---|
73 | * in <c>/SINGULAR/mod2.h</c> and in <c>/kernel/mod2.h</c>, the user may call this |
---|
74 | * method by first declaring two polys f and g, and typing |
---|
75 | * <c>system("c++wrappers", f, g)</c>. |
---|
76 | * @param sp1 a SINGULAR-internal poly |
---|
77 | * @param sp2 a SINGULAR-internal poly |
---|
78 | */ |
---|
79 | void wrapSINGULARPolys (const SingularPoly& sp1, const SingularPoly& sp2); |
---|
80 | |
---|
81 | /*! PrettyPrinter used throughout all wrapper code |
---|
82 | for pretty-printing detailed output to the console |
---|
83 | if requested */ |
---|
84 | extern PrettyPrinter prpr; |
---|
85 | |
---|
86 | #endif |
---|
87 | /* HAVE_WRAPPERS */ |
---|
88 | |
---|
89 | #endif |
---|
90 | /* WRAPPERS_H */ |
---|