The Wu-Tang Clan's IT Team Lead ([info]fiberpunk) wrote,
@ 2005-06-10 10:57:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Boring stuff
I'm playing around with writing a library to do matrix arithmetic in my dinky Scheme implementation. I decided to compute determinants by expanding cofactors, so I wrote this function to get the minor of row n and column m of a matrix (that is, the matrix left when row n and column m are deleted). Since I am treating a matrix as simply a list of row lists:

(define (minor matrix n m)
(transpose (except-nth (transpose (except-nth matrix n)) m)))

If I'd written this in C, it would have been a nightmare of for statements. I like Scheme.



(3 comments) - (Post a new comment)


[info]cleotyne
2005-06-11 09:13 pm UTC (link)
Me too!

(Reply to this)


[info]nverzeanu
2005-06-12 12:55 am UTC (link)
I'd do it your way too! Except my game would run at, like, 0.003 Hz.

(Reply to this)

deEvGaNgGhGk
(Anonymous)
2007-06-21 08:37 pm UTC (link)
a6a7d2745ee994377352f07b209ce0d6

(Reply to this)


(3 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…