Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defmacro with-matrix-elements (matrix &body body)
- `(let ((rows (number-of-rows ,matrix))
- (cols (number-of-cols ,matrix)))
- (declare
- (type fixnum rows cols)
- (optimize (debug 0) (safety 0) (speed 3)))
- (loop for i fixnum from 0 below rows
- do
- (loop for j from 0 below cols
- do
- ,@body))))
- (defmethod self-print ((matrix r-matrix-sfp))
- (print-object matrix t)
- (format t "~%Matrix elements:~%")
- (with-matrix-elements matrix
- (format t "~TA(~a,~a)=~,4e~%" i j (mref matrix i j))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement