From: Akshay S. <ak...@us...> - 2012-03-25 03:39:31
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "matlisp". The branch, matlisp-cffi has been updated via d54f0adc84bb64c23dbbc4bbb1c7885e8cd610e6 (commit) via 4010f091a89e7b2b0a606cdc3251124b609699c3 (commit) from db5331565aae1b08109f11abba655999d3774c6e (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit d54f0adc84bb64c23dbbc4bbb1c7885e8cd610e6 Merge: db53315 4010f09 Author: Akshay Srinivasan <aks...@gm...> Date: Sun Mar 25 09:06:04 2012 +0530 Merge branch 'local-cffi' into matlisp-cffi commit 4010f091a89e7b2b0a606cdc3251124b609699c3 Author: Akshay Srinivasan <aks...@gm...> Date: Sun Mar 25 09:02:55 2012 +0530 Move matrix modification routines into trans.lisp and sub-mat.lisp diff --git a/src/real-matrix.lisp b/src/real-matrix.lisp index b6b90a2..c02b9cf 100644 --- a/src/real-matrix.lisp +++ b/src/real-matrix.lisp @@ -56,73 +56,8 @@ don't know how to coerce COMPLEX to REAL")) ;; -(defmethod transpose ((matrix real-matrix)) - (mlet* (((hd nr nc rs cs st) (slot-values matrix '(head number-of-rows number-of-cols row-stride col-stride store)) - :type (fixnum fixnum fixnum fixnum fixnum (real-matrix-store-type *)))) - (make-instance 'sub-real-matrix - :nrows nc :ncols nr - :store st - :head hd - :row-stride cs :col-stride rs - :parent matrix))) ;; -(defmethod sub-matrix ((matrix real-matrix) (origin list) (dim list)) - (destructuring-bind (o-i o-j) origin - (destructuring-bind (nr-s nc-s) dim - (mlet* (((hd nr nc rs cs st) (slot-values matrix '(head number-of-rows number-of-cols row-stride col-stride store)) - :type (fixnum fixnum fixnum fixnum fixnum (real-matrix-store-type *)))) - (unless (and (< -1 o-i (+ o-j nr-s) nr) (< -1 o-j (+ o-j nc-s) nc)) - (error "Bad index and/or size. -Cannot create a sub-matrix of size (~a ~a) starting at (~a ~a)" nr-s nc-s o-i o-j)) - (make-instance 'sub-real-matrix - :nrows nr-s :ncols nc-s - :store st - :head (store-indexing o-i o-j hd rs cs) - :row-stride rs :col-stride cs))))) - -;; -(defmethod row ((matrix real-matrix) (i fixnum)) - (mlet* (((hd nr nc rs cs st) (slot-values matrix '(head number-of-rows number-of-cols row-stride col-stride store)) - :type (fixnum fixnum fixnum fixnum fixnum (real-matrix-store-type *)))) - (unless (< -1 i nr) - (error "Index ~a is outside the valid range for the given matrix." i)) - (make-instance 'sub-real-matrix - :nrows 1 :ncols nc - :store st - :head (store-indexing i 0 hd rs cs) - :row-stride rs :col-stride cs))) - -;; -(defmethod col ((matrix real-matrix) (j fixnum)) - (mlet* (((hd nr nc rs cs st) (slot-values matrix '(head number-of-rows number-of-cols row-stride col-stride store)) - :type (fixnum fixnum fixnum fixnum fixnum (real-matrix-store-type *)))) - (unless (< -1 j nc) - (error "Index ~a is outside the valid range for the given matrix." j)) - (make-instance 'sub-real-matrix - :nrows nr :ncols 1 - :store st - :head (store-indexing 0 j hd rs cs) - :row-stride rs :col-stride cs))) - -;; -(defmethod diag ((matrix real-matrix) &optional (d 0)) - (declare (type fixnum d)) - (mlet* (((hd nr nc rs cs st) (slot-values matrix '(head number-of-rows number-of-cols row-stride col-stride store)) - :type (fixnum fixnum fixnum fixnum fixnum (real-matrix-store-type *))) - ((f-i f-j) (if (< d 0) - (values (- d) 0) - (values 0 d)) - :type (fixnum fixnum))) - (unless (and (< -1 f-i nr) (< -1 f-j nc)) - (error "Index ~a is outside the valid range for the given matrix." d)) - (let ((d-s (min (- nr f-i) (- nc f-j)))) - (declare (type fixnum d-s)) - (make-instance 'sub-real-matrix - :nrows 1 :ncols d-s - :store st - :head (store-indexing f-i f-j hd rs cs) - :row-stride 1 :col-stride (+ rs cs))))) ;; (defun make-real-matrix-dim (n m &key (fill 0.0d0) (order :row-major)) ----------------------------------------------------------------------- Summary of changes: src/real-matrix.lisp | 65 -------------------------------------------------- 1 files changed, 0 insertions(+), 65 deletions(-) hooks/post-receive -- matlisp |