Hi
First let me say I am a python and sage novice, but I seem to have a
problem in using
maxima within sage. My sage installation is on a CentOS linux
distribution and I just
unpacked the Redhat distribution and run it. So no clever installation
things done.
Now I have a medium'ish program (1500 lines) which at one point needs
access to
normal variates. I see maxima has this so I define a function....
maxima("load(distrib)");
def MultiVarNormal(n,r):
s=maxima("random_normal(0,%s,%s)"%(r,n));
return s;
and run my program. Firstly the above function creates a significant
slow down (compared to the dummy code I give later) and eventually I
get a crash with the following error message....
/home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
structure/parent.so in sage.structure.parent.Parent.__call__ (sage/
structure/parent.c:6820)()
/home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
structure/coerce_maps.so in
sage.structure.coerce_maps.NamedConvertMap._call_ (sage/structure/
coerce_maps.c:4221)()
/home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
interfaces/maxima.pyc in _real_double_(self, R)
1896 2.41421356237
1897 """
-> 1898 return R(self._sage_())
1899
1900 def real(self):
/home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
interfaces/maxima.pyc in _sage_(self)
1822 import sage.calculus.calculus as calculus
1823 return
calculus.symbolic_expression_from_maxima_string(self.name(),
-> 1824 maxima=self.parent())
1825
1826 def _symbolic_(self, R):
/home/crypto/linux.x86_64/sage/local/lib/python2.6/site-packages/sage/
calculus/calculus.pyc in symbolic_expression_from_maxima_string(x,
equals_sub, maxima)
1652 return symbolic_expression_from_string(s, syms,
accept_sequence=True)
1653 except SyntaxError:
-> 1654 raise TypeError, "unable to make sense of Maxima
expression '%s' in Sage"%s
1655 finally:
1656 is_simplified = False
TypeError: unable to make sense of Maxima expression
'"__SAGE_SYNCHRO_MARKER_135903684"' in Sage
Now as a test that it is the above maxima function causing the
problems I replace the
above code with....
def MultiVarNormal_V2(n,r):
s=[1..n];
for i in range(0,n):
s[i]=randint(-r,r);
return s;
OK Its no longer a normal distribution, but this is just a testing
idea. The code now runs very fast and does not produce the crash. So
this leads me to think it is the above function causing the problems.
One initially suspects it could be some form of memory leak/corruption
as when I move to a bigger machine the original version takes longer
to crash (it still crashes). However, running top whilst the program
runs does not seem to reveal a huge increase in memory. So
I have been unable to produce a small code snippett which produces the
crash since running MultiVarNormal a gazillion times does not seem to
crash.
I am therefore stuck as to how to proceed. Any ideas would be most
welcome. And please remember I really am a python/sage idiot at this
stage.
Yours
Nigel
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org