Scipy - the embarrassing way to code
vetta.org
vetta.org
Python is going to replace Matlab, but the pattern in the same.
People aren't really used to thinking about matrices and vectors as primitive types and operations.
By the way, this is an excellent resource for learning Matlab. http://www.andrew.cmu.edu/course/16-720/handouts.html
Look at the "working with images" section. If you manually touch every pixel in an image, you're doing something wrong. You code will be 5X as long, and 100X as slow.
Good observation, succinctly stated. Most of my days are spent trying to figure out what I need to do, not how to do it.
"...and I question the usefulness of learning MATLAB unless you actually need it."
The problem is, most people don't realize they need it and just plod along writing hundreds of lines of python, perl, ruby, java, etc. implementing a decade old numerical computation.
I would agree that many problems people spend time on can be found as single commands in matlab.
It'd be nice if there was a nice type system to aid in getting comfortable with matlab's semantics, in my opinion
Matlab is for engineers, Mathematica is for scientists. Matlab is designed for speedy matrixy stuff. Mathematica uses a lisp-like structure 'replacement' pattern matching evaluation scheme, and intrinsically supports symbolic mathematics and is the the only language i would really call multiparadigmatic
have you looked at R? it's an open source matlab. though i don't know what kind of database options it might have
What language is it currently written in
Common Lisp (at least, the calculation part). It's a great language for developing the product, but we don't want to greenspun our own vector-based calculation engine if we don't have to.
NumPy gives you a good matrix syntax while building on an excellent general purpose language. Personally I felt NumPy is a lot cleaner and Python a lot more fun than Matlab though Matlab has many many "toolboxes"/libraries not in NumPy.
I wish there were an open alternative to matlab that was fast. Matlab is kinda fast if you do exactly the right thing, but its interpretedness gets in the way. Most of the people I know doing computational stuff write everything in c using some outside libraries to speed things up. Often they just code up all their own algorithms from scratch. Its lame, but they usually halve the computation time. I could imagine that SciPy and NumPy is much much faster than Matlab.
Matlab is crazy easy to code for though. Its really handy for prototyping.
SciPy and NumPy tend to be just about as fast as Matlab, when used in their default manner. When you drop into inline Blitz/C for your inner loops using Scipy though, you can achieve orders of magnitude improvements.
Check it out: http://www.scipy.org/PerformancePython
A good example in Computer Science is the various reductions (efficient or not )between different problems, where you relate the difficulty of the problem to any other computational problem which you find you're able to encode within the structure of the orginal problem.
As for myself I often find that I have to fully explore the problem on my own terms before I can maturely optimize my source.
Often the best way to understand a problem is to try to implement a solution.
http://www.jsoftware.com/stable.htm
and here's a post about it:
Haven't done anything with it yet, but it's on my radar.
J is not open source. Might be a factor to consider.
From the J site,
"Jsoftware licenses source for all the Jsoftware binaries. There are several factors in determining the cost of source licenses. Primary is the source itself: J Engine (portable C); Windows GUI support (C++); and Unix GUI support (Java). Secondary is the scope of use: internal; distributed products; and competitive (to Jsoftware) products. And finally the platforms: Windows; Unix; PocketPC; etc. The price range is from $10,000 to $400,000. Regular updates to our current source levels are available for separate update fees."
It's sort of a set union of every good free math program.
The more you work, the less you appear to have.
The efficiency paradox.