Beispiel #1
0
 def jacobian(t, y, p):
     jac = self.jac
     # note that the evaluated code sets jac as a side effect
     if Solver._use_inline:
         weave_inline(jac_eqs, ['jac', 't', 'y', 'p']);
     else:
         _exec(jac_eqs_py, locals())
     return jac
Beispiel #2
0
 def rhs(t, y, p):
     ydot = self.ydot
     # note that the evaluated code sets ydot as a side effect
     if Solver._use_inline:
         weave_inline(code_eqs, ['ydot', 't', 'y', 'p']);
     else:
         _exec(code_eqs_py, locals())
     return ydot
Beispiel #3
0
 def jacobian(t, y, p):
     jac = self.jac
     # note that the evaluated code sets jac as a side effect
     if Solver._use_inline:
         weave_inline(jac_eqs, ['jac', 't', 'y', 'p'])
     else:
         _exec(jac_eqs_py, locals())
     return jac
Beispiel #4
0
 def rhs(t, y, p):
     ydot = self.ydot
     # note that the evaluated code sets ydot as a side effect
     if Solver._use_inline:
         weave_inline(code_eqs, ['ydot', 't', 'y', 'p'])
     else:
         _exec(code_eqs_py, locals())
     return ydot
Beispiel #5
0
 def _test_inline():
     """Detect whether scipy.weave.inline is functional."""
     if not hasattr(Solver, '_use_inline'):
         Solver._use_inline = False
         try:
             if weave_inline is not None:
                 weave_inline('int i=0; i=i;', force=1)
                 Solver._use_inline = True
         except (scipy.weave.build_tools.CompileError,
                 distutils.errors.CompileError, ImportError):
             pass
Beispiel #6
0
 def _test_inline():
     """Detect whether scipy.weave.inline is functional."""
     if not hasattr(Solver, '_use_inline'):
         Solver._use_inline = False
         try:
             if weave_inline is not None:
                 weave_inline('int i=0; i=i;', force=1)
                 Solver._use_inline = True
         except (scipy.weave.build_tools.CompileError,
                 distutils.errors.CompileError, ImportError):
             pass