|
From: Raymond T. <toy...@gm...> - 2012-03-13 03:47:23
|
On 3/12/12 10:18 AM, Akshay Srinivasan wrote: > Hi, > Now that I have a reasonable amount of support for matrix slices (and > more). I can now do neat stuff like > > ? (defvar a (make-complex-matrix 2 2)) > ;; Get the second column > ? (defvar e (make-sub-matrix a 0 1 2 1)) > ;; Set the imaginary part of the second column to pi > ? (copy! pi (imagpart! e)) This is pretty cool stuff! > > without without ever having to copy the store. I guess this is okay > for user interaction; but I guess there are costs involved with > creating new CLOS objects though. Should this sort of stuff be avoided > inside core functions then ? I think it really depends on the clos implementation. I would say for now to just ignore it unless you're creating lots of clos objects in a tight loop. That's probably not a good idea, plus that generates a lot of garbage. Ray > > Akshay > > P.S: I will merge my changes and push things to matlisp-cffi, after > sending this mail. > |