MCPcopy Create free account
hub / github.com/Singular/Singular / Number

Class Number

Singular/dyn_modules/python/Number.h:33–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31//class TrivialErrorHandler;
32class Vector;
33class Number
34{
35 public:
36 friend Number operator+(const Number& n1, const Number& n2);
37 friend Number operator-(const Number& n1, const Number& n2);
38 friend Number operator/(const Number& n1, const Number& n2);
39 friend Number operator*(const Number& n1, const Number& n2);
40 friend bool operator==(const Number& n1, const Number& n2);
41 friend Number operator+(const Number& n1, int n2);
42 friend Number operator-(const Number& n1, int n2);
43 friend Number operator/(const Number& n1, int n2);
44 friend Number operator*(const Number& n1, int n2);
45 friend bool operator==(const Number& n1, int n2);
46 friend Number operator+(int n1, const Number& n2);
47 friend Number operator-(int n1, const Number& n2);
48 friend Number operator/(int n1, const Number& n2);
49 friend Number operator*(int n1, const Number& n2);
50 friend bool operator==(int n1, const Number& n2);
51 friend class Poly;
52 friend class Vector;
53 //friend class PolyBase<POLY_VARIANT_RING,Poly,TrivialErrorHandler>;
54// friend class PolyBase <poly_variant variant,
55// class create_type_input,
56// class error_handle_traits>;
57 template <poly_variant,class,class> friend class PolyBase;
58 friend class PolyImpl;
59 number as_number() const
60 {
61 return n_Copy(n,r.get()->cf);
62 }
63 Number& operator=(const Number& n2)
64 {
65 //durch Reihenfolge Selbstzuweisungen ber�cksichtigt
66 number nc=n_Copy(n2.n,n2.r.get()->cf);
67 n_Delete(&n,r.get()->cf);
68 r=n2.r;
69 n=nc;
70 return *this;
71 }
72 Number operator-()
73 {
74 Number t(*this);
75 //t.n=n_Copy(n,r);
76 t.n=n_InpNeg(t.n,r.get()->cf);
77 return t;
78 }
79 Number& operator+=(const Number & n2)
80 {
81 if (r!=n2.r)
82 {
83 WerrorS("not the same ring");
84 return *this;
85 }
86 number nv=n_Add(n,n2.n,r.get()->cf);
87 n_Delete(&n,r.get()->cf);
88 n=nv;
89 return *this;
90 }

Callers 15

export_vectorFunction · 0.70
operator+Function · 0.70
operator*Function · 0.70
operator-Function · 0.70
operator/Function · 0.70
operator==Function · 0.70
symm.pyFile · 0.70
export_polyFunction · 0.70
buildPyObjectFromLeftvFunction · 0.70
buildPyObjectFromIdhdlFunction · 0.70
leadCoefMethod · 0.70
operator-Method · 0.70

Calls 9

n_CopyFunction · 0.85
n_DeleteFunction · 0.85
WerrorSFunction · 0.85
n_AddFunction · 0.85
n_MultFunction · 0.85
n_SubFunction · 0.85
n_DivFunction · 0.85
n_InitFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected