-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a C++ PySymbol if Symbol is subclassed.
- Loading branch information
Showing
5 changed files
with
33 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,5 @@ | ||
import symengine | ||
from types import ModuleType | ||
import sys | ||
|
||
functions = ModuleType(__name__ + ".functions") | ||
sys.modules[functions.__name__] = functions | ||
|
||
functions.sqrt = sqrt | ||
functions.exp = exp | ||
|
||
for name in ("""sin cos tan cot csc sec | ||
asin acos atan acot acsc asec | ||
sinh cosh tanh coth sech csch | ||
asinh acosh atanh acoth asech acsch | ||
gamma log atan2""").split(): | ||
setattr(functions, name, getattr(symengine, name)) | ||
|
||
from .lib.symengine_wrapper import (sin, cos, tan, cot, csc, sec, | ||
asin, acos, atan, acot, acsc, asec, | ||
sinh, cosh, tanh, coth, sech, csch, | ||
asinh, acosh, atanh, acoth, asech, acsch, | ||
gamma, log, atan2, sqrt, exp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,2 @@ | ||
from .lib import symengine_wrapper as symengine | ||
from .utilities import var, symbols | ||
from .compatibility import with_metaclass | ||
from .lib.symengine_wrapper import (sympify, sympify as S, | ||
SympifyError, sqrt, I, E, pi, MutableDenseMatrix, | ||
ImmutableDenseMatrix, DenseMatrix, Matrix, Derivative, exp, | ||
nextprime, mod_inverse, primitive_root, Lambdify as lambdify, | ||
symarray, diff, eye, diag, ones, zeros, expand, Subs, | ||
FunctionSymbol as AppliedUndef, Max, Min, Integer, Rational, | ||
Float, Number, Add, Mul, Pow, sin, cos, tan, cot, csc, sec, | ||
asin, acos, atan, acot, acsc, asec, sinh, cosh, tanh, coth, sech, csch, | ||
asinh, acosh, atanh, acoth, asech, acsch, gamma, log, atan2) | ||
from types import ModuleType | ||
import sys | ||
|
||
|
||
class BasicMeta(type): | ||
def __instancecheck__(self, instance): | ||
return isinstance(instance, self._classes) | ||
|
||
|
||
class Basic(with_metaclass(BasicMeta, object)): | ||
_classes = (symengine.Basic,) | ||
pass | ||
|
||
|
||
class Symbol(symengine.PySymbol, Basic): | ||
_classes = (symengine.Symbol,) | ||
pass | ||
|
||
|
||
functions = ModuleType(__name__ + ".functions") | ||
sys.modules[functions.__name__] = functions | ||
|
||
functions.sqrt = sqrt | ||
functions.exp = exp | ||
|
||
for name in ("""sin cos tan cot csc sec | ||
asin acos atan acot acsc asec | ||
sinh cosh tanh coth sech csch | ||
asinh acosh atanh acoth asech acsch | ||
gamma log atan2""").split(): | ||
setattr(functions, name, getattr(symengine, name)) | ||
from symengine import * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters