Archives
-
Mathematica Gripes
Don’t get me wrong, I think Mathematica’s a wonderful piece of software, but sometimes it takes way too much effort to do simple things. The linear algebra interface is completely wacko: ‘convenience’ supplants consistency in a very inconvenient manner. One would think that since matrices are lists of lists, vectors should be lists of singleton [...]
-
A basic subgradient solver for a
sparsification program on SO(n)In connection with the last question I posted about (simultaneous sparsification of matrices via conjugation with a unitary matrix) and my research, consider the following optimization problem: My goal is to achieve sparsification without changing the left singular vectors— I could also let the singular values change, in which case you’re more likely to be [...]
May 21st, 2010 | Filed under Mathematics, Programming -
A Shout-out to leo
I like well-designed programming tools as much as I like programming itself; there’s something invigorating about a tool that fits in naturally with your workflow, yet multiplies your productivity. So, imagine how excited I was when I first came across leo, which was originally being billed as a literate programming tool if I recall correctly. [...]
Apr 8th, 2010 | Filed under General, Programming -
CVXOPT + Pythonika = convex optimization from Mathematica
One of the reasons why I use Matlab more than Mathematica is Matlab supports convenient convex optimization via the open source CVX package, while Mathematica doesn’t seem to have any support even via (open source) third party packages for convex optimization. Now it seems I’ve found a relatively easy way to rectify this, by interfacing [...]
Feb 27th, 2010 | Filed under Mathematics, Programming -
CVX implementation of Alon and Naor’s SDP for approximating the cut norm (infinity to 1 operator norm)
Surprisingly, I couldn’t find this in an Internet search, so I implemented the algorithm using CVX. %% [X,Y,VAL] = INF1NORM(A) provides a probabilistic lower bound on the % infinity->1 operator norm of A, to within a guaranteed factor, in % expectation. % % (since the quality of the approximation is only guaranteed in % expectation, [...]
Jan 27th, 2010 | Filed under Mathematics, Programming -
A failed attempt to use an SDP to find a nonorthogonal factorization
I’m looking at a nonorthogonal factorization problem: given a symmetric matrix , write it as where the columns of all have norm less than one, is diagonal, and are chosen to achieve , where the minimization is taken over all such . Why do I care about this problem? My advisor suggested it when I [...]
Jan 17th, 2010 | Filed under Mathematics, Programming -
A resolution: become a better vim user
I read Bram Moolenaar’s essay on effective text editing earlier today, and in the spirit of the beginning of a new year, made the resolution to learn how to use vim more effectively. In particular, I need to get a grip on the way buffers and files are handled in vim, learn how to cut [...]
Jan 2nd, 2010 | Filed under General, Programming -
Poisson Image Editing
I spent the last several days implementing a very crappy version of Perez, Gangnet, and Blake’s famous “Poisson Image Editing” paper. The idea was to implement a simple but meaningful and useful project to refresh my C++ knowledge, and to work a bit with CImg. The idea is that, to seamlessly merge information from a [...]
Dec 29th, 2009 | Filed under Mathematics, Programming -
A really crappy EIAS .img format loader for Mathematica
About three hours ago, I decided I’d read about OpenGL and experimented enough with it to attempt loading a heightfield and visualizing it as a collection of flat shaded triangles. Obviously, the first step is to find heightfields to work with; since this is going to be a crappy visualization, I decided to look for [...]
Dec 24th, 2009 | Filed under Programming