Skip to content

Commit 296fce1

Browse files
authored
Merge pull request #178 from ShikharJ/Singleton
Implemented Singleton Pattern
2 parents 169ba50 + c8ecb7e commit 296fce1

File tree

8 files changed

+328
-83
lines changed

8 files changed

+328
-83
lines changed

symengine/__init__.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from .lib.symengine_wrapper import (Symbol, sympify as S, sympify,
1+
from .lib.symengine_wrapper import (Symbol, S, sympify,
22
SympifyError, Add, Mul, Pow, function_symbol, I, E, pi, oo,
33
zoo, nan, have_mpfr, have_mpc, have_flint, have_piranha,
44
have_llvm, Integer, Rational, Float, Number, RealNumber,
@@ -9,8 +9,9 @@
99
UndefFunction, Function, FunctionSymbol as AppliedUndef,
1010
have_numpy, true, false, Equality, Unequality, GreaterThan,
1111
LessThan, StrictGreaterThan, StrictLessThan, Eq, Ne, Ge, Le,
12-
Gt, Lt, GoldenRatio, Catalan, EulerGamma, Dummy, perfect_power,
13-
integer_nthroot, isprime, sqrt_mod)
12+
Gt, Lt, golden_ratio as GoldenRatio, catalan as Catalan,
13+
eulergamma as EulerGamma, Dummy, perfect_power, integer_nthroot,
14+
isprime, sqrt_mod)
1415
from .utilities import var, symbols
1516
from .functions import *
1617

symengine/lib/symengine.pxd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,6 +332,8 @@ cdef extern from "<symengine/number.h>" namespace "SymEngine":
332332
bool is_positive() nogil
333333
bool is_negative() nogil
334334
bool is_zero() nogil
335+
bool is_one() nogil
336+
bool is_minus_one() nogil
335337
bool is_complex() nogil
336338
pass
337339
cdef cppclass NumberWrapper(Basic):
@@ -370,6 +372,7 @@ cdef extern from "<symengine/rational.h>" namespace "SymEngine":
370372
cdef RCP[const Number] from_mpq "SymEngine::Rational::from_mpq"(rational_class r) nogil
371373
cdef void get_num_den(const Rational &rat, const Ptr[RCP[Integer]] &num,
372374
const Ptr[RCP[Integer]] &den) nogil
375+
cdef RCP[const Number] rational(long n, long d) nogil
373376

374377
cdef extern from "<symengine/complex.h>" namespace "SymEngine":
375378
cdef cppclass Complex(Number):

0 commit comments

Comments
 (0)