MRocklin
  • Member for 10 years, 1 month
  • Last seen more than 1 year ago
Is it common not to use libraries for standard numerical algorithms, and why?
34 votes

There is substantial programmer overhead involved in linking to a library function, especially if that library is new to the programmer. It is often simpler to just rewrite simple algorithms rather ...

View answer
Symbolic software packages for Matrix expressions?
Accepted answer
30 votes

Edit: This is now in SymPy $ isympy In [1]: A = MatrixSymbol('A', n, n) In [2]: B = MatrixSymbol('B', n, n) In [3]: context = Q.symmetric(A) & Q.positive_definite(A) & Q.orthogonal(B) In [4]: ...

View answer
Define custom probability density function in Python
17 votes

You should check out sympy.stats. It provides an interface to deal with random variables. The following example provides a random variable X defined on the unit interval with density 2x In [1]: from ...

View answer
Is there software that can autogenerate numerically-accurate floating point C routines from symbolic formulae?
11 votes

Code generation and precompilation of mathematical expressions is becoming more popular. While symbolic packages like SymPy, Mathematica, and Maple may include code generation I'm not confident that ...

View answer
creating a flat surface in python
Accepted answer
6 votes

In the line Z = X You're just renaming X to Z, not making a copy. Your code then proceeds to zero out all elements of X. You might want to try replacing this with the following: Z = X.copy() ...

View answer
How do I make sure that the results of my simulations and the results in my paper are always in sync?
4 votes

If running all your code is cheap then you could do something low-tech like the following: You could template your documents with formatted strings so that they look like this "we observed a %(...

View answer
Uses of power series maps
4 votes

You could look into asymptotic behavior of discrete Dynamical Systems. There is both a rich theoretical literature on this topic in mathematics and more applied literature in physics and computer ...

View answer
How can I plot piece-wise defined function in some easily-accessed open-source tool?
3 votes

SymPy is able to plot your piecewise function: from sympy import * x = Symbol('x') n = 2 # you have to choose some explicit number for n f = Piecewise((0, n<=x), (x-n, x<=n+1), (2-x+n, x<=n+...

View answer
When do orthogonal transformations outperform Gaussian elimination?
3 votes

The article you cite defends Gaussian Elimination by saying that even though it is numerically unstable it tends to do well on random matrices and since most matrices one can think of are like random ...

View answer
Which package should I use to wrap Modern Fortran Code with Python?
2 votes

fwrap specifically targets Fortran90/95 and uses some of the same software stack as f2py.

View answer
What programming paradigms should I be investing in if I want my code to run on petascale machines in the future?
2 votes

I suspect that even the most well-thought out answers to this question will be obsolete in five to ten years. Given the uncertainty of future programming paradigms it may not be worthwhile to spend a ...

View answer
R/C/C++ library for N-dimensional arrays
1 votes

The DyND library might interest you. It comes out of the Scientific Python ecosystem as a numpy replacement but I believe that it is straight C++ and so should be easily wrappable in R. Actually, ...

View answer
Multiply Multiple Sparse Matrices
1 votes

It is likely that some algorithms for matrix multiply could benefit by considering a single 3-multiply rather than two 2-multiplies. For example one might be able to better optimize memory access if ...

View answer