Request for help: Numerical linear algebra

I have a bit of an odd background. I have a fair bit of mathematics (four year MA equivalent course in mathematics at Cambridge) and at least a reasonable background in software engineering and programming (about three years working as a software engineer now, plus a lot of random stuff on my spare time during that period and a little bit before hand), but I don’t have a lot of knowldge of the overlap between the two. This is increasingly causing me trouble, and I’d like to fix it. It seems like the sort of subject my blog audience should know about, so I’m asking for help here. :-)

The immediate subject I want to learn more about is numerical linear algebra. It’s come up a couple times recently and I’ve had to go “Bwrgh. Um. Halp!”. I usually muddle through, but it’s really not something I should be struggling on and I’ve probably done stupid things as a result of lack of knowledge.

So, my goal here is to become reasonably well versed in at least the basics of the subject. At the moment nothing terribly specific – I want to get a good grasp of the theory and practice of working with matrices, vectors, etc. computationally. Linear optimisation and eigenvector problems especially. I’m looking for recommendations for books, libraries, software packages and anything else you think would be useful. I’m willing to spend a reasonable amount of money (more so on the books than the software packages, as long term I’ll really be looking for stuff I can freely bundle with my personal projects) in doing so, ‘though obviously free is a plus. Libraries I can use from a variety of languages are definitely a good thing, though I’m willing to look at language specific things like NumPy, etc. too if they come highly recommended (at least as a starting point).

Relevant background:

Mathematics: Quite a lot of real and complex analysis, though mostly pure. Enough linear algebra that I at least know where to start with it, though I’m going to be rusty.

Programming/computer science: Some amount of general algorithms and datastructures work. Generally comfortable with Java, Haskell and Scala. Comfortable enough with C that I can write it if I have to. A little bit of Python and Lua (plus a few others which are probably not relevant). Fairly willing to pick up a new language if it would help (though if you tell me to write fortran I’ll cry).

So, suggestions?

Edit: I’ll keep a list of recommendations updated here. If you have any comments for or against these, please pipe up.

I found a copy of Epperson going very cheaply and for no particular reason it looked interesting, so I’ve ordered a copy. I’ll almost certainly order a copy of Golub and Loan. I’m also going to be playing around with Octave. Thanks guys!

This entry was posted in programming and tagged on by .

Not really an announcement: GUI frontend to Scala Interpreter

So, I’ve finally got sick of the unusable command line interface to the Scala interpreter.

Don’t get me wrong, I like command line interfaces. But I’ve always found command line interfaces written in Java to be pretty horribly unusable, and the variety of different quirks shown by the scala one between windows and linux is pretty gruesome.

Anyway, the upshot is that I’m building a simple GUI frontend to it. It turns out that the interpreter API is actually really easy to work with – it only took me about half an hour to hack together a basic working frontend (after some… minor issues with Java’s IO API)

So far this isn’t really in a state that other people can use it – no proper buildscript, the GUI frontend is hacked together in the interface designer and doesn’t handle resizing properly at all (so is probably broken on any resolution but mine). This is more of a “If you want to look at the code and see how to do it” than anything else. It’s available in my misc hg repository.

A particular reason you might want to look at the code is that it uses QT Jambi rather than Swing, so if you want a Swing version you’ll have to write it yourself and might find this a useful starting point. Why? Well, two reasons. Firstly, I like the results and API of QT better than Swing’s. Secondly, Swing doesn’t work on my home PC so it would be pretty pointless for me to use it.

This entry was posted in programming and tagged , , , , , on by .

A reminder of how WordPress handles RSS feeds

Those of you who read my blog for the programming content might have been rather surprised to learn how to make parmesan and tomato polenta yesterday. Similarly those of you who have come here from “Playing with your food” are probably thinking “What on earth is a Scala and how do I cook it?”

Well, fear not. Those of you who lie in the set programmers ^ cooks need not view the content you don’t care about. They’re set up in different categories, and wordpress allows you to view just a single category or to subscribe to a feed for a specific category. The category specific pages are linked on the left, and if you add “feed” to the URL for a category you will get an RSS feed that covers only that particular one. For example, the feed for programming is http://www.drmaciver.com/category/programming/feed

If you do subscribe to a particular category, I’d appreciate it if you also subscribe to the “Admin” category. I’ll use it to make announcements that are important to readers in general, including the addition of new categories which you might be interested in.

This entry was posted in Admin and tagged on by .

Baked parmesan and tomato polenta

This is the first food post on the new blog location. Hopefully the first of many, though my track record with foodblogging isn’t amazing. :-)

I cook very much on a whim. This is reflected both in how I cook and in what I cook. It’s also reflected in what I buy. For example, I bought some polenta a few weeks ago. Why did I buy polenta? Three very good reasons.

Firstly, it was an appealing colour.

Secondly, there’s an amusing polenta scene in Heat.

Thirdly, I’d never tried polenta before.

As you can see, a well reasoned purchase decision.

I’ve made it a few times since, usually frying it in butter, and it’s ok. I cook it with a fair bit of salt, and it has a texture and taste that goes well with that. But for today’s lunch I tried doing it a different way. Here’s how it turned out.

For this I used polenta, salt, brown sugar, crushed chilli, butter, parmesan, pine nuts, ripeish tomatoes and balsamic vinegar. I won’t even pretend I measured proportions. :-)

It’s basically very easy. To make the polenta, boil twice its volume of salted water, add the polenta and stir until what you have is very thick and gloopy. Stir in a knob of butter and the chilli (I’d have used powdered paprika but didn’t have any) and leave to sit for about 10 minutes.

Then spread very thinly (somewhere under 1cm thick I guess) over the base of a greased baking sheet (I used a cookie tray), coarse grate parmesan on top of it and put it in the oven for 15 minutes at 150C.

What I did next was finely dice the tomatoes, mix them with pine nuts, balsamic vinegar and sugar, then pour them on top of the baking polenta, turn up the temperature slightly and then bake for another 15 minutes.

I’d probably do this differently in the future. It resulted in the polenta getting a bit too soggy. I would probably recommend instead roasting them separately at a higher temperature for 15 minutes, baking the polenta for more like 25 minutes on its own, then adding the roast tomato mix to the top of the polenta and baking for 5. That’s just a guess though.

Regardless, despite the slight sogginess of the polenta, this was really good and rather easy to make. I’d definitely make it again.

This entry was posted in Food on by .

Removing myself from Artima Scala Buzz

This is a minor announcement – I’m going to be taking this blog off Artima Scala Buzz fairly imminently.

There are various reasons for this. The primary one is that Scala is a horrible, terrible language and its community is full of awful people with whom I don’t want to be associated.

Um, no. That’s not right.

I fully intend to be blogging about Scala just as much as I have in the past. Similarly participating on the mailing lists occasionally and on the IRC channel frequently. I like you lot really. :-)

Basically this blog is going to be covering an increasingly diverse set of topics as I integrate my cooking blog with it and start expanding out onto other subjects. Scala buzz is specifically for blogs which are primarily about Scala. I was originally planning to set up a Scala specific feed and channel it there, but then I realised that I deeply dislike the Buzz’s behaviour anyway. It produces tiny little (and usually mangled) precis of the posts and then when you click on them it takes you fucking Artima’s forums, not the original post. This is really rude.

So, I’ll be taking myself off it in a few days once I’m sure the people who care have seen this post. If you want to keep reading my stuff, please subscribe to the feed directly.

This entry was posted in programming on by .