| Home | Trees | Indices | Help |
|---|
|
|
object --+
|
uniq --+
|
object --+ |
| |
structure.sage_object.SageObject --+ |
| |
structure.parent.Parent --+ |
| |
structure.parent_base.ParentWithBase --+ |
| |
structure.parent_gens.ParentWithGens --+ |
| |
rings.ring.Ring --+ |
| |
rings.ring.CommutativeRing --+
|
SymbolicExpressionRing_class
The ring of all formal symbolic expressions.
EXAMPLES:
sage: SR
Symbolic Ring
sage: type(SR)
<class 'sage.calculus.calculus.SymbolicExpressionRing_class'>
TESTS:
Test serializing:
sage: loads(dumps(SR)) == SR
True
|
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
Create a symbolic expression ring.
EXAMPLES:
sage: from sage.calculus.calculus import SymbolicExpressionRing_class
sage: SymbolicExpressionRing_class()
Symbolic Ring
|
Compare two symbolic expression rings. They are equal if and
only if they have the same type. Otherwise their types are
compared.
EXAMPLES:
sage: cmp(SR, RR) #random
1
sage: cmp(RR, SymbolicExpressionRing()) #random
-1
sage: cmp(SR, SymbolicExpressionRing()) #random
0
|
True if there is an element of the symbolic ring that is equal
to x under ==.
EXAMPLES:
The symbolic variable x is in the symbolic ring.
sage: x.parent()
Symbolic Ring
sage: x in SR
True
2 is also in the symbolic ring since it is equal to something
in SR, even though 2's parent is not SR.
sage: 2 in SR
True
sage: parent(2)
Integer Ring
sage: 1/3 in SR
True
The finite field element 1 (in GF(3)) is not equal to
anything in SR.
sage: GF(3)(1) in SR
False
|
Coerce $x$ into the symbolic expression ring SR.
EXAMPLES:
sage: a = SR(-3/4); a
-3/4
sage: type(a)
<class 'sage.calculus.calculus.SymbolicConstant'>
sage: a.parent()
Symbolic Ring
sage: type(SR(I))
<class 'sage.calculus.calculus.SymbolicConstant'>
sage: is_SymbolicExpression(SR(I))
True
If $a$ is already in the symblic expression ring, coercing returns
$a$ itself (not a copy):
sage: SR(a) is a
True
A Python complex number:
sage: SR(complex(2,-3))
2.00000000000000 - 3.00000000000000*I
|
Used for implicit coercion.
EXAMPLES:
sage: x=var('x'); y0,y1=PolynomialRing(ZZ,2,'y').gens()
sage: x+y0/y1
y0/y1 + x
sage: x.subs(x=y0/y1)
y0/y1
|
Return string representation of this symbolic ring.
EXAMPLES:
sage: SR._repr_()
'Symbolic Ring'
|
Return latex representation of the symbolic ring.
EXAMPLES:
sage: latex(SR)
ext{SR}
sage: M = MatrixSpace(SR, 2); latex(M)
\mbox{
m Mat}_{2 imes 2}( ext{SR})
|
Return the symbolic variable defined by x as an element of the
symbolic ring.
EXAMPLES:
sage: zz = SR.var('zz'); zz
zz
sage: type(zz)
<class 'sage.calculus.calculus.SymbolicVariable'>
sage: t = SR.var('theta2'); t
theta2
|
Return the characteristic of the symbolic ring, which is 0.
OUTPUT:
a Sage integer
EXAMPLES:
sage: c = SR.characteristic(); c
0
sage: type(c)
<type 'sage.rings.integer.Integer'>
|
Return an element of the symbolic ring, which is used
by the coercion model.
EXAMPLES:
Currently this function always returns 0. That may change.
sage: SR._an_element_impl()
0
|
Returns True, since the symbolic expression ring is (for the
most part) a field.
EXAMPLES:
sage: SR.is_field()
True
|
Return False, because there are approximate elements in
the symbolic ring.
EXAMPLES:
sage: SR.is_exact()
False
Here is an inexact element.
sage: SR(1.9393)
1.93930000000000
|
| Home | Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Thu Jul 17 04:23:31 2008 | http://epydoc.sourceforge.net |