The lisp-matrix Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The lisp-matrix Reference Manual

This is the lisp-matrix Reference Manual, version 0.3, generated automatically by Declt version 2.3 "Robert April" on Tue Feb 20 09:01:29 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction


LICENSE: BSD sans advertising (Mark H)

* QuickStart

  Use QuickLisp to load

#+BEGIN_SRC lisp
(ql:quickload :lisp-matrix)
#+END_SRC

  and create some data

#+BEGIN_SRC lisp
  
  (in-package :lisp-matrix-user)
  
  (M* (ones 2 2 :implementation :foreign-array)
      (ones 2 2 :implementation :foreign-array))
  
  (M* (ones 2 2 :implementation :lisp-array)
      (ones 2 2 :implementation :lisp-array))
  
  (M* (ones 2 2 :implementation :lisp-array)
      (ones 2 2 :implementation :foriegn-array))
  
#+END_SRC

* Introduction

  Lisp-Matrix intends to be a reasonably modern, flexible system for
  numeric algebra in Lisp.

  Rif, Tamas Papp, and Mark H contributed various critical pieces
  (code, design, code, testing, code, benchmarks, code, and more
  code).

  Some of them continued on other projects and left this behind, a gem
  in the rough, so I took this one on.

  I'm just a dwarf standing on the shoulders of giants.

** Design

   Basic approach:

   Storage can be done at the lisp or external level.  Selection is
   user-specific, since you might have various people doing one or
   either, depending oupon the nature of the computations that are
   required.  For example, large LAPACK-ish computations are required
   to be done externally whereas stuff which is more lisp-centric
   culd be done internally.

   We avoid deep copying whenever possible.  current scablability of
   storage is not nearly as great as the storgeage required to do
   interesting things with biomedical data or economic data.  Whoops.
   This means that we spend time on structures when copying is
   optional, done when needed to break the connection from the initial
   data storage.

   We, of course, means "them".

* Requirements:

** Common Lisp Systems

   Currently being developed under SBCL

*** DONE [#A] compiles and runs with SBCL
    - State "DONE"       from "CURR"       [2010-10-09 Sat 14:48] \\
      verified a while back.
    - State "CURR"       from "TODO"       [2010-10-09 Sat 14:48]
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]

*** CURR [#B] compiles and runs with CLISP
    - State "CURR"       from "TODO"       [2010-10-09 Sat 14:48]
      in progress, Tony checking it from time to time.
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]
     
*** TODO [#C] compiles and runs with CMUCL
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]
      Definitely of interest, of slightly less interest only because
      SBCL is supported and CMUCL is closely related (unlike CCL).

*** TODO [#B] compiles and runs with ClozureCL
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]
      Definitely of interest

*** TODO [#B] compiles and runs with Franz Lisp
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]
      Definitely of interest

*** TODO [#B] compiles and runs with Allegro CL
    - State "TODO"       from ""           [2010-10-09 Sat 14:46]
      Definitely of interest

** Packages:
*** From Rif:

**** org.middleangle.cl-blapack

     This covers the overall BLAS and LAPACK integration.

**** org.middleangle.foreign-numeric-vector

     This provides a data store for C/FORTRAN code that can be
     accessed by common-lisp.

*** From Tomas:

**** ffa
     
     This provides lisp stored matrices

**** array-operations

     general actions for these matrices.

*** From Mark:

**** lisp-matrix integration (also found in ffa and cl-blapack).

     Mark initially put it all together.

*** From Others

    These are dependencies that arise from the original authors.

**** cffi  (depends on babel, alexandria )

     
**** cl-utilities
**** iterate
**** metabang-bind
**** asdf-system-connections
**** lift
     
     (depends on trivial-timeout)

     Am not sure that this is still the case (trivial-timeout dependency)

*** Others (AJR?)

**** lift (unit testing)

     lift has become the canonical unit-testing framework for this
     system.  There could also be an argument for lisp-unit, which is
     more popular.

**** xarray (generic array-like accessors)

     This is not so much a dependency as an enhancer.  It provides a
     single common API for access of elements in array-like objects.

* Documentation

** API

*** matrix-foreign-array

(defgeneric make-fa-matrix (nrows ncols fnv-type

*** matrix

(defgeneric nrows (matrix)
(defgeneric ncols (matrix)
(defgeneric data (matrix)
(defgeneric nelts (matrix)
(defgeneric matrix-dimension (matrix axis-number)
(defgeneric matrix-dimensions (matrix)
(defgeneric orientation (matrix)
(defgeneric flatten-matrix-indices (matrix i j)
(defgeneric mref (matrix i j)
(defgeneric (setf mref) (value matrix i j)
(defgeneric matview-p (matrix)
(defgeneric parent (matrix)
(defgeneric ancestor (matrix)
(defgeneric real-nrows (matrix)
(defgeneric real-ncols (matrix)
(defgeneric transposed-p (matrix)
(defgeneric zero-offset-p (matrix)
(defgeneric offset (matrix)
(defgeneric unit-strides-p (matrix)
(defgeneric make-matrix* (nrows
(defgeneric implementation (matrix)
(defgeneric element-type (matrix)
(defgeneric element-type-size (matrix)
(defgeneric transpose-class (matrix)
(defgeneric window-class (matrix)
(defgeneric stride-class (matrix)
(defgeneric transpose-matrix (matrix)
(defgeneric window (matrix &key nrows ncols row-offset col-offset)
(defgeneric strides (matrix &key nrows ncols row-offset col-offset row-stride
(defgeneric copy! (a b)
(defgeneric copy* (matrix implementation)
(defgeneric fill-matrix (matrix fill-element)
(defgeneric m= (a b)

*** matrix-operations

(defgeneric m* (a b)
(defgeneric m+ (a b)
(defgeneric m- (a b)
(defgeneric sum (matrix)
(defgeneric bind2 (m1 m2 &key by)
(defgeneric cross-product (mata matb))
(defgeneric outer-product (mata matb &optional op)
(defgeneric m.+ (mata matb)
(defgeneric m.- (mata matb)
(defgeneric m.* (mata matb)
(defgeneric m./ (mata matb)

;; (defgeneric map-matrix (withfn mat &key iterator result-type)

*** numerical-linear-algebra

(defgeneric factorized-matrix (a)
(defgeneric factorize (a &key by)
(defgeneric invert (a &optional by)
(defgeneric least-squares (y x &key w)
(defgeneric eigensystems (x)
(defgeneric optimize (f data params &key method maximize-p)
(defgeneric root-find (f data params &key method)

*** vector

(defgeneric vector-dimension (vector)
(defgeneric vector-orientation (vector)
(defgeneric col-vector-p (matrix)
(defgeneric row-vector-p (matrix)
(defgeneric check-invariant (vector)
(defgeneric vref (vector i)
(defgeneric (setf vref) (value vector i)
(defgeneric vecview-p (vector)
(defgeneric real-nelts (matrix)
(defgeneric diagonal! (mat &key type)
(defgeneric real-stride (vector)
(defgeneric slice-class (matrix)
(defgeneric slice (matrix &key offset stride nelts type)
(defgeneric row (matrix i)
(defgeneric col (matrix j)
(defgeneric v= (x y)
(defgeneric v=2 (&rest args)
(defgeneric v+ (x y &optional return-type)
(defgeneric v- (x y &optional return-type)
(defgeneric v* (x y &optional return-type)
(defgeneric v/ (x y &optional return-type)
  (defgeneric v`op (x y &optional return-type)

* Usage

#+begin_src lisp
(ql:quickload :lisp-matrix)
#+end_src

** COMMENT Demo (working things)
   Demos for Lisp Matrix (encoded within progn's)

   1. instantiating matrices and vectors
   2. inversion using BLAS/LAPACK

   <2012-10-25 Thu> except that transpose and the last example (geqrf)
   are broken.

   In Common lisp, it is useful, sometimes overkill, to properly
   define the precision and form of the numbers (i.e. single, double, rational,
   or complex).  

   Here is the approach for creating matrices which satisfy the
   default (preset) storage and framework, as well as how one might
   retrieve the documentation string.

#+name: CreatingDefaultMatrices
#+begin_src lisp
  (in-package :lisp-matrix-user)
  (defparameter *m01*
    (make-matrix
     6 5
     :initial-contents '((11d0 12d0 13d0 14d0 15d0)
                         (21d0 22d0 23d0 24d0 25d0)
                         (31d0 32d0 33d0 34d0 35d0)
                         (41d0 42d0 43d0 44d0 45d0)
                         (51d0 52d0 53d0 54d0 55d0)
                         (61d0 62d0 63d0 64d0 65d0)))
    "6x5 matrix with entries representing row+1,col+1 values, for
       test purposes.")
  (documentation  '*m01* 'variable)
#+end_src

   We can also create matrices which follow a specified framework, for
   example using lisp-based storage, in CL arrays (TODO: verify!  but
   I think this claim is true):

#+name: CreatingLispArrayMatrices
#+begin_src lisp
  (in-package :lisp-matrix-user)

  (defparameter *m1-ex*
    (make-matrix
     2 5
     :implementation :lisp-array  ;; :foreign-array
     :element-type 'double-float)
    "quick variable initialized to zeros")

  (defparameter *m2-la*
    (make-matrix
     2 5
     :implementation :lisp-array 
     :element-type 'double-float
     :initial-contents #2A(( 1d0 2d0 3d0 4d0 5d0)
                           ( 6d0 7d0 8d0 9d0 10d0)))
    "placeholder 2")
      
  (defparameter *m2-la-int*
    (make-matrix
     2 5
     :implementation :lisp-array  ;; :foreign-array
     :element-type 'integer ; 'double-float
     ;; :initial-contents (list 1 2 3 4 5 6 7 8 9 10)
     :initial-contents #2A((1 2 3 4 5)
                           (6 7 8 9 10)))
    "placeholder 2")

    (defparameter *m3-la*
      (make-matrix
       2 2
       :implementation :lisp-array 
       :element-type 'double-float
       :initial-contents #2A(( 1d0 2d0 )
                             ( 6d0 7d0 )))
      "placeholder 2")
#+end_src

   At times, it can be optimal to store data in foreign (C/Fortran)
   native structures.  Then, we create matrices which use foreign
   array storage:

   Currently we can make a foriegn matrix of doubles, but not a
   foreign matrix of integers.  This is a implementation gap, not a
   fundamental error, and we just need to fix it.

#+name: CreatingForeignArrayMatrices
#+begin_src lisp
  (defparameter *m2-fa*
    (make-matrix
     2 5
     :implementation :foreign-array 
     :element-type 'double-float
     :initial-contents #2A(( 1d0 2d0 3d0 4d0 5d0)
                           ( 6d0 7d0 8d0 9d0 10d0)))
    "placeholder 2")
  
  (defparameter *m3-fa*
    (make-matrix
     2 2
     :implementation :foreign-array 
     :element-type 'double-float
     :initial-contents #2A(( 1d0 2d0 )
                           ( 6d0 7d0 )))
    "placeholder 2")
#+end_src

We can subset matrices without copying, though it is always possible
to copy if one would like to:

#+begin_src lisp
  (defparameter *m01b*
    (strides *m01* :nrows 2 :ncols 3
             :row-stride 2
             :row-offset 1 :col-offset 1))
  
  (defparameter *m01c* 
    (window *m01*
            :nrows 2 :ncols 3
            :row-offset 2 :col-offset 1))
#+end_src

And we are allowed to, with vectors, specify orientation.  This is a
controversial point -- should vectors always be orientation-free, with
1xN and Mx1 matrices represent row and column "vectors", i.e. 1-d
matrices? 

The following sets up data for linear least squares estimation:

#+name LinearLeastSquaresEx  
#+begin_src lisp
    (defparameter *xv*
      (make-vector
       8
       :type :row ;; default, not usually needed!
       :initial-contents '((1d0 3d0 2d0 4d0 3d0 5d0 4d0 6d0))))
  
    ;; col vector
    (defparameter *xv2*
      (make-vector
       8
       :type :column
       :initial-contents '((1d0)
                           (3d0)
                           (2d0)
                           (4d0)
                           (3d0)
                           (5d0)
                           (4d0)
                           (6d0))))
  
    (v= *xv* *xv2*) ; => T
    (m= *xv* *xv2*) ; => nil
  
    (defparameter *xv+1*
      (make-matrix
       8 2
       :initial-contents '((1d0 1d0)
                           (1d0 3d0)
                           (1d0 2d0)
                           (1d0 4d0)
                           (1d0 3d0)
                           (1d0 5d0)
                           (1d0 4d0)
                           (1d0 6d0))))
  
    (defparameter *xv+1a*
      (make-matrix
       8 2
       :initial-contents #2A((1d0 1d0)
                             (1d0 3d0)
                             (1d0 2d0)
                             (1d0 4d0)
                             (1d0 3d0)
                             (1d0 5d0)
                             (1d0 4d0)
                             (1d0 6d0))))
  
    (defparameter *xv+1b*
      (bind2
       (ones 8 1)
       (make-matrix
        8 1
        :initial-contents '((1d0)
                            (3d0)
                            (2d0)
                            (4d0)
                            (3d0)
                            (5d0)
                            (4d0)
                            (6d0)))
       :by :column))
  
    (m= *xv+1a* *xv+1b*) ; => T
  
    (defparameter *xm*
      (make-matrix
       2 8
       :initial-contents '((1d0 3d0 2d0 4d0 3d0 5d0 4d0 6d0)
                           (1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
  
    (defparameter *y*
      (make-vector
       8
       :type :row
       :initial-contents '((1d0 2d0 3d0 4d0 5d0 6d0 7d0 8d0))))
  
    (defparameter *y2*
      (make-vector
       8
       :type :column
       :initial-contents '((1d0)
                           (2d0)
                           (3d0)
                           (4d0)
                           (5d0)
                           (6d0)
                           (7d0)
                           (8d0))))
    (transpose *y2*) ;; ERROR: not in lisp-matrix-user?
  
  
  
  
    (format nil "Data set up"))
  
  ,#+nil
  (progn 
    ;; Tests for square matrices...
    (trap2mat (rand 3 3))
  
    (trap2mat (make-matrix 3 3
                           :initial-contents #2A((1d0 2d0 3d0)
                                                 (4d0 5d0 6d0)
                                                 (7d0 8d0 9d0))))
    (trap2mat (make-matrix 3 3
                           :initial-contents #2A((1d0 2d0 3d0)
                                                 (4d0 5d0 6d0)
                                                 (7d0 8d0 9d0)))
              :type :lower)
    (trap2mat (make-matrix 3 3
                           :initial-contents #2A((1d0 2d0 3d0)
                                                 (4d0 5d0 6d0)
                                                 (7d0 8d0 9d0)))
              :type :upper)
  
    ;; need to write unit tests for square and rect matrices.
    )
  
  
  ,#+nil
  (progn
    ;; factorization and inversion via LAPACK
  
    ;; LU
    (let ((test-eye (eye 7 7)))
      (m* test-eye (minv-lu test-eye)))
  
    ;; Cholesky
    (let ((myrand (rand 4 4)))
      (princ myrand)
      (princ (matrix-like-symmetric-p (m* (transpose myrand) myrand)))
      (princ (m*  (m* (transpose myrand) myrand)
                  (minv-cholesky  (m* (transpose myrand) myrand))))))
  
  
  (progn  
    ;; Using xGEQRF routines for supporting linear regression.
  
    ;; Question: Need to incorporate the xGEQRF routines, to support
    ;; linear regression work?
  
    ;; LAPACK suggests to use the xGELSY driver (GE general matrix, LS
    ;; least squares, need to lookup Y intent (used to be an X alg, see
    ;; release notes).
  
    (let ((a (rand 10 5)))
      (geqrf a))) ;; error, something not being properly passed.
  
#+end_src

lm-demo.lisp : things that might work but should
** Demo (getting started)
#+begin_src common-lisp
  (in-package :cl-user)
  (asdf:oos 'asdf:load-op :lisp-matrix)
#+end_src

** Demo (more working things)
#+begin_src common-lisp
;;; This file illustrates some common actions in the course of working
;;; with matrices using lisp-matrix.  It is important to note that
;;; there are better ways to do this, that this are to help introduce
;;; usage, not describe best practices for using this system.

;;; = Precursor systems
;;  (asdf:oos 'asdf:compile-op 'ffa :force t)
;;  (asdf:oos 'asdf:compile-op 'org.middleangle.foreign-numeric-vector :force t)
;;  (asdf:oos 'asdf:compile-op 'org.middleangle.cl-blapack :force t)

;;; = The maing thing...
;; (asdf:oos 'asdf:compile-op 'lisp-matrix :force t)
;; (asdf:oos 'asdf:compile-op 'lisp-matrix)

;;; And the only thing that ought to be required;
(asdf:oos 'asdf:load-op 'lisp-matrix)

;;; Check status of the installation...

(in-package :lisp-matrix-unittests)
(run-lisp-matrix-tests)

;; if the above describes errors, here is how we figure out what bug
;; report to write...

(describe  (run-lisp-matrix-tests))

;;; Now we can use it, either by importing the symbols into the
;;; current package by:

;; (use-package :lisp-matrix)

;;; or by trying it out in the -user package, before implementing for
;;; production usage.

(in-package :lisp-matrix-user)

;; (lisp-matrix-unittests:run-lisp-matrix-tests)
;; (describe (lisp-matrix-unittests:run-lisp-matrix-tests))

;;; We wrap these up into a progn for simple overall evaluation, but
;;; stepping through them is fine as well.

(progn 
  
  ;; make some matrices
  (defparameter *m1* (make-matrix 2 5
			:implementation :lisp-array  ;; :foreign-array
			:element-type 'double-float)
    "placeholder 1")
  
  ;; works, as it should.  Indexing is zero-based, so we get the first
  ;; element by...
  (mref *m1* 0 0)
  (mref *m1* 1 3)
  (setf (mref *m1* 1 3) 1.2d0)
  *m1*


  ;; increase complexity

  (defparameter *m2* (make-matrix 2 5
			:implementation :lisp-array  ;; :foreign-array
			:element-type 'integer ; 'double-float
			;; :initial-contents (list 1 2 3 4 5 6 7 8 9 10)
			:initial-contents #2A(( 1 2 3 4 5)
					      ( 6 7 8 9 10)))
    "placeholder 2")

  (defparameter *m2a*
    (make-matrix 2 5
		 :implementation :lisp-array  ;; :foreign-array
		 :element-type 'integer ; 'double-float
		 :initial-contents '((1 2 3 4 5)
				     (6 7 8 9 10)))
    "placeholder...")

  ;; Currently we can make a foriegn matrix of doubles, but not a
  ;; foreign matrix of integers.  If we are working with smaller
  ;; matrices and are not doing a great deal of matrix algebra, then
  ;; we probably prefer :lisp-array rather than :foreign-array.
  (defvar *m2b*
    (make-matrix 2 5
		 :implementation :foreign-array 
		 :element-type 'double-float
		 :initial-contents #2A(( 1d0 2d0 3d0 4d0 5d0)
				       ( 6d0 7d0 8d0 9d0 10d0)))
    "placeholder 2")
  *m2b*

  (mref *m2b* 0 2) ;; => 3
  *m2b*
  (transpose *m2b*)

  ;; simple subsetting is simple
  (m= (row *m2b* 0)
      (col (transpose *m2b*) 0)) ; => nil, orientation
  (v= (row *m2b* 0)
      (col (transpose *m2b*) 0)) ; => T, no orientation worries

  (m= (col *m2b* 0)
      (row (transpose *m2b*) 0))
  (v= (col *m2b* 0)
      (row (transpose *m2b*) 0))


  (defvar *m3*
    (make-matrix 6 5 :initial-contents '((1d0 2d0 3d0 4d0 5d0)
					 (6d0  7d0  8d0  9d0  10d0)
					 (11d0 12d0 13d0 14d0 15d0)
					 (16d0 17d0 18d0 19d0 20d0)
					 (21d0 22d0 23d0 24d0 25d0)
					 (26d0 27d0 28d0 29d0 30d0)))
    "placeholder 3")

  (row *m3* 2)
  (col *m3* 1)


  (= (mref *m3* 0 1)
     (mref (transpose *m3*) 1 0))

  (=  (mref *m3* 2 2)
      (mref (transpose *m3*) 2 2))

  *m3*
  (transpose *m3*)

  ;;; Now we play with striding and slicing subsets.  These work well
  ;;; for simple subsetting which can be done by counting/enumeration
  ;;; on some form of regular scale.

  ;;; In addition, equality is somewhat important for numerical
  ;;; issues.  Right.  Anyway, for matrices it is mostly clear what to
  ;;; do, but for vectors, which are inheriting from matrices, we have
  ;;; 2 issues.  The first is the obvious, the numerical values, and
  ;;; the second is not quite obvious, which is the metadata
  ;;; surrounding the difference between an MxN and NxM matrix.  For
  ;;; the first, think about v= and for the second, m= is the right
  ;;; function.

  (defvar *m4* (strides *m3* :nrows 2 :row-stride 2)
    "yet another placeholder.")
  *m4*
  (m= (row *m4* 0)
      (make-matrix 1 5 :initial-contents '((1d0 2d0 3d0 4d0 5d0))))
  (m= (row *m4* 1)
      (make-matrix 1 5 :initial-contents '((11d0 12d0 13d0 14d0 15d0))))
  ;; note the redoing for the columns -- different!
  (m= (col *m4* 0)
      (make-matrix 2 1 :initial-contents '((1d0) (11d0))))
  (m= (col *m4* 1)
      (make-matrix 2 1 :initial-contents '((2d0) (12d0))))

  (v= (row *m4* 0) (col (transpose *m4*) 0))
  (v= (col *m4* 0) (row (transpose *m4*) 0))

  *m4*
  (row *m4* 0)
  (col *m4* 4)


  (let* ((*default-element-type* '(complex double-float))
	 (m1 (axpy #C(1.0d0 0.0d0)
		   (ones 2 2)
		   (scal #C(1.5d0 0.0d0)
			 (ones 2 2))))
	 (m2 (scal #C(2.5d0 0.0d0) (ones 2 2)))
	 (m3 (axpy #C(-1.0d0 0.0d0)
		   (ones 2 2)
		   (scal #C(1.5d0 0.0d0) (ones 2 2))))
	 (m4 (scal #C(0.5d0 0.0d0) (ones 2 2))))
    (format t "~A ~A ~%"
	    (m= m1 m2)
	    (m= m3 m4)))

  (m+ (row m3 1) (row m3 2))
  (m- (row m3 1) (row m3 2))

  )



;;; EXAMPLES TO DEMONSTRATE


;;; consider the following matrix:
;;; n1= 11 12 13
;;;     21 22 23
(defparameter *n1*
  (make-matrix 2 3
	       :implementation :lisp-array
	       :element-type 'double-float
	       :initial-contents #2A ((11d0 12d0 13d0)
				      (21d0 22d0 23d0))))
*n1*
;;; then storage in row-major orientation would be a sequence
;;;     11 12 13 21 22 23
;;; while in column-major orientation it would be
;;;     11 21 12 22 13 23 
;;; At this point, consider the following.  Suppose we have a matview
;;; with dims 1x3, row/col offset 1,0:
;;; n2= 21 22 23
(defparameter *n2*
  (window *n1*
	  :nrows 1 :ncols 3
	  :row-offset 1 :col-offset 0))
*n2*
;;; or alternatively dims 2x2, row/col offset 0,1:
;;; n3= 12 13
;;;     22 23
(defparameter *n3*
  (window *n1*
	  :nrows 2 :ncols 2
	  :row-offset 0 :col-offset 1))
*n3*
;;;
;;; for the first, we see that, by orientation, we have the following:
;;;     .. .. .. 21 22 23   (row-major)
;;;     .. 21 .. 22 .. 23   (column-major)
;;; 
;;; so we see that for
;;; row-major:    index=3 (ncols), stride=1
;;; column-major: index=1 (ncols), stride=2 (nrows)
;;; 
;;; for the second, by orientation, we have:
;;;     .. 12 13 .. 22 23  (row-major)
;;;     .. 12 22 .. 13 23  (column-major)
;;; 
;;; so we see that for
;;; row-major:    index=1 (ncols), stride=2 (ncols)
;;; column-major: index=1,(nrows), stride=3 (nrows)
;;; 
;;; Consider a more complex matrix:
;;; 
;;; o1= 11 12 13 14 15
;;;     21 22 23 24 25
;;;     31 32 33 34 35
;;;     41 42 43 44 45
(defparameter *o1*
  (make-matrix 4 5
	       :implementation :lisp-array
	       :element-type 'double-float
	       :initial-contents #2A ((11d0 12d0 13d0 14d0 15d0)
				      (21d0 22d0 23d0 24d0 25d0)
				      (31d0 32d0 33d0 34d0 35d0)
				      (41d0 42d0 43d0 44d0 45d0))))
*o1*
;;; row-major:
;;;    o1= 11 12 13 14 15 21 22 23 24 25 31 32 33 34 35 41 42 43 44 45
;;; col-major: 
;;;    o1= 11 21 31 41 12 22 32 42 13 23 33 43 14 24 34 44 15 25 35 45
;;;
;;;
;;; Then a matview, dims 3, offset 2,1 :
;;;
;;; o2= 32 33 34
;;;     42 43 44
(defparameter *o2*
  (window *o1*
	  :nrows 2 :ncols 3
	  :row-offset 2 :col-offset 1))
*o2*
;;;
;;; and a strided matview, indexed, could be (offset 2,3; row-stride 2)
;;;
;;; o3= 23 24 25
;;;     43 44 45
(defparameter *o3*
  (strides *o1*
	   :nrows 2 :ncols 3
	   :row-offset 1 :col-offset 2
	   :row-stride 2 :col-stride 1))
*o3*
;;; and for where this sits in the original matrix...
;;;
;;; and now to pull out the rows and columns via slicing on a strided
;;; matrix, we have the following approaches, for the zero-th column:
;;;     23
;;;     43
(slice *o3* :offset 0 :stride 1 :nelts (nrows *o3*) :type :column)
(parent *o3*)
;;; and for the 2nd column (3rd, since we are zero counting).
;;;     25
;;;     45
(slice *o3* :offset 4 :stride 1 :nelts (nrows *o3*) :type :column)
;;; and for the 1st row (2nd, again zero-counting):
;;;     43 44 45
(slice *o3* :offset 1 :stride 2 :nelts (ncols *o3*) :type :row)
;;; 
(orientation *o3*)

;; convert between foriegn-array and lisp-array.

;; operate ()

;; do some blas/lapack

;; output

;; Windowing -- simple, works!
(m= (col *c* 0)
    (make-matrix 3 1 :initial-contents '((16d0) (21d0) (26d0))))
(m= (col *c* 1) 
    (make-matrix 3 1 :initial-contents '((17d0) (22d0) (27d0))))
(m= (col *c* 2)
    (make-matrix 3 1 :initial-contents '((18d0) (23d0) (28d0))))
(m= (col *c* 3)
    (make-matrix 3 1 :initial-contents '((19d0) (24d0) (29d0))))
(m= (col *c* 4)
    (make-matrix 3 1 :initial-contents '((20d0) (25d0) (30d0))))

(m= (col *d* 0)
    (make-matrix 3 1 :initial-contents '((18d0) (23d0) (28d0))))
(m= (col *d* 1) 
    (make-matrix 3 1 :initial-contents '((19d0) (24d0) (29d0))))

;; do we want this as part of the API? Currently fails.
;; (m= (col *c* 4)
;;     (col *c* 4)
;;     (make-matrix 3 1 :initial-contents '((20d0) (25d0) (30d0))))


;;;;;;;;


;; strided matrix col access
m01b
(orientation m01b)
(unit-strides-p m01b) ;; false, it's explicitly strided
(parent m01b)
(orientation  (parent m01b))
(unit-strides-p (parent m01b)) ;; true, it's the original...

;; Windowed matrix
(orientation m01c)
(row m01c 0) ; Y
(row m01c 1) ; Y
(col m01c 0) ; Y
(col m01c 1) ; Y
(col m01c 2) ; Y

;; slice matrix access to rows
(row m01b 0) ; Y
(row m01b 1) ; Y
(orientation m01b) (offset m01b)
(row-offset m01b) (col-offset m01b)
(col m01b 0) ; N
(col m01b 1) ; N...
(col m01b 2)
(col m01b 3)

(slice m01b :offset 0 :stride 2 :nelts (ncols m01b) :type :row)
(slice (parent m01b) ; equiv on parent
       :offset 1
       :stride 2
       :nelts (ncols m01b)
       :type :row)
;; 
(slice m01b :offset 1 :stride 2 :nelts (ncols m01b) :type :row)
(slice (parent m01b) ; equiv on parent
       :offset 1
       :stride 2
       :nelts (ncols m01b)
       :type :row)

;; slice matrix access to columns
(slice m01b :offset 0 :stride 1 :nelts (nrows m01b) :type :column)
(col m01b 0)
(slice m01b :offset 2 :stride 1 :nelts (nrows m01b) :type :column)
(col m01b 1)
(slice m01b :offset 4 :stride 1 :nelts (nrows m01b) :type :column)
(col m01b 2)
(slice m01b :offset 6 :stride 1 :nelts (nrows m01b) :type :column)
(col m01b 3)
(offset m01b)
(row-stride m01b) ; => 2
(col-stride m01b) ; => 1

  (m= (col m01b 0)
      (make-matrix 2 1 :initial-contents '((11d0) (31d0))))
  (m= (col m01b 1)
      (make-matrix 2 1 :initial-contents '((12d0) (32d0))))
  (m= (col m01b 2)
      (make-matrix 2 1 :initial-contents '((13d0) (33d0))))
  (m= (col m01b 3)
      (make-matrix 2 1 :initial-contents '((14d0) (34d0))))
  (m= (col m01b 4)
      (make-matrix 2 1 :initial-contents '((15d0) (35d0))))
  (row m01b 0)
  (row m01b 1)
  (col m01b 0)
  (col m01b 1)

  
  ;; FIXME: there are bugs in slicing/striding with transposed
  ;; matrices. 

  ;; the following are correct, but..
  (row m01 0)
  (row m01 1)
  (row m01 2)
  (row m01 3)

  (col m01 0)
  (col m01 1)
  (col m01 2)
  (col m01 3)

  m01
  (transpose m01)
  (row (transpose m01) 0)
  (row (transpose m01) 1) ; wrong: grab bad column, AND by 1 (pushed up)
  (row (transpose m01) 2) ; ditto, wrong by 2
  (row (transpose m01) 3) ; etc...wrong by 3

  (row (transpose m01) 0)
  (transpose (row (transpose m01) 0))

  m01
  (transpose m01)
  (col (transpose m01) 0)
  (col (transpose m01) 1) ; last rather than first
  (col (transpose m01) 2) ;
  (col (transpose m01) 3) ; ditto above


  (v= (row m01 0)
      (col (transpose m01) 0)) ;; works
  
  (m= (row m01 0)
      (col (transpose m01) 0)) ;; fails, since dims unequal
  
  m01
  (transpose m01)
  ;; given the above...
  ;; FIXME: Big Barf!
  (v= (row m01 1)
      (col (transpose m01) 1) ) ;; fails badly.  Real badly.
  
  (v= (col m01 1)
      (row (transpose m01) 1) ) ;; fails, but closer...
  
  (col m01 1)
  (col (transpose m01) 1) ;; this is the problem, indexing issue...
  
  
  ;; and the same problem.
  m3 
  (transpose m3)
  (v= (col m3 1) (row (transpose m3) 1))
  (v= (row m3 1) (col (transpose m3) 1))
	  
  ;; Striding and Slicing issues:
  ;; Strides provide matrix sections; slicing provides vector'd sections.

  ;; STRIDING
  m01
  (strides m01 :nrows 2 :row-stride 2)  ;; view just rows 1 and 3 from m01
  (strides m01 :nrows 3) ;; first 3 rows
  (strides m01 :ncols 3 :col-stride 2) ;; cols 1, 3 ,5
  (strides m01 :ncols 2) ;; first 2 cols
  m01

  ;; SLICING
  m01
  (slice m01 :offset 5 :stride  2 :nelts 3 :type :row)
  ;; col 2 
  (slice m01 :offset 5 :stride  2 :nelts 3 :type :row)


  (slice (transpose m01) :offset 5 :stride  2 :nelts 3 :type :row)
  (slice m01
	 :offset 5
	 :stride  2
	 :nelts 3
	 :type :row)
  (slice (transpose m01) :offset 5 :stride  2 :nelts 3 :type :row)

  ;; slicing isn't affected by transposition -- doesn't affect the
  ;; counting.  Would have suggested that column-major or row-major.
  ;; Should this be the case?  (need to migrate to unit-tests).

  (v=  (slice m01 :offset 5 :stride  2 :nelts 3 :type :row)
       (slice (transpose m01) :offset 5 :stride  2 :nelts 3 :type :row))
  (v=  (slice m01 :offset 5 :stride  2 :nelts 3 :type :row)
       (slice (transpose m01) :offset 5 :stride  2 :nelts 3 :type :column))
  ;; and note the above -- vector equality doesn't depend on orientation...

  (slice m01 :offset 1 :stride  2 :nelts 3 :type :column)
  (slice m01 :offset 1 :stride  0 :nelts 3 :type :column)
  ;; :type   : provides the form to provide output for
  ;; :offset : number of observations (in "col/row major"
  ;;           matrix-dependent order) to skip over before starting
  ;;           extraction
  ;; :stride : 0 = repeat same value; 1, as ordered, 2 every other, 
  ;;           etc... 


  ;; Alternative approach for slicing, via Tamas's AFFI package:
  (defparameter *my-idx* (affi:make-affi '(5 6))) ; -> generator
  (affi:calculate-index *my-idx* #(1 1)) ; -> 7 



  ;; FIXME: need to get the foriegn-friendly arrays package involved
  ;; to create integer matrices.  Or do we just throw an error that
  ;; says to use lisp-arrays?
  (make-matrix 2 5
	       :implementation :foreign-array 
	       :element-type 'integer 
	       :initial-contents #2A(( 1 2 3 4 5)
				     ( 6 7 8 9 10)))


  ;; FIXME -- indexing with mref not checked against dims, doesn't
  ;; barf correctly.  (now is checked, but badly/poorly -- this FIXME
  ;; is about better optimization, NOT about it failing to work, which
  ;; was the original problem).
  m01
  (assert-valid-matrix-index m01 1 8)
  (assert-valid-matrix-index m01 8 1)
  (mref m01 1 8) ; good -- we throw an error... but
  (mref m01 8 1) ; BAD! barfs, not protecting against first index...
  (setf (mref m01 7 7) 1.2d0)
  m01
  
  
  ;; FIXME: the following has no applicable method -- only for
  ;; doubles, not integers.  
  (m* m2 (transpose m2))
  ;; but we can multiple doubles, but...
  (m* m01 (transpose m01))






(progn 
  (defparameter *a*
    (make-matrix 6 5 :initial-contents '((1d0 2d0 3d0 4d0 5d0)
					 (6d0  7d0  8d0  9d0  10d0)
					 (11d0 12d0 13d0 14d0 15d0)
					 (16d0 17d0 18d0 19d0 20d0)
					 (21d0 22d0 23d0 24d0 25d0)
					 (26d0 27d0 28d0 29d0 30d0))))
  (defparameter *b* (strides *a* :nrows 3 :row-stride 2))
  (defparameter *b1* (strides *a* :nrows 2 :ncols 3 :row-stride 2 :col-stride 1))
  (defparameter *c* (window *a* :nrows 3 :row-offset 3))
  (defparameter *d* (window *a* :nrows 3 :ncols 2 :row-offset 3 :col-offset 2))
  (format nil "Data initialized"))

(orientation *b*)

;; Striding
(typep *b* 'lisp-matrix::strided-matview)
(typep *b* 'lisp-matrix::window-matview)
(typep *b* 'strided-matview)
(typep *b* 'window-matview)

(parent *b*)
(offset *b*) (offset *a*)
(row-offset *a*) (col-offset *a*)
(row-offset *b*) (col-offset *b*)
(row-offset *c*) (row-offset *c*)
(col-stride *b*)  (row-stride *b*) (nrows (parent *b*))

(equal  (data *a*)
	(data *b*))
;; col 0 =  1  3  5 indicies; currently getting  1 13 25  (+ 12, not + 2)
;; col 1 =  7  9 11 indicies
;;
(m= (princ  (col *b* 0))
    (princ  (make-matrix 3 1 :initial-contents '((1d0) (11d0) (21d0)))))
(m= (col *b* 1) 
    (make-matrix 3 1 :initial-contents '((2d0) (12d0) (22d0))))
(m= (col *b* 2)
    (make-matrix 3 1 :initial-contents '((3d0) (13d0) (23d0))))
(m= (col *b* 3)
    (make-matrix 3 1 :initial-contents '((4d0) (14d0) (24d0))))
(m= (col *b* 4)
    (make-matrix 3 1 :initial-contents '((5d0) (15d0) (25d0))))

#+end_src
** Demo (broken things)
#+begin_src common-lisp
;;; Precursor systems
(in-package :cl-user)
;; (asdf:oos 'asdf:compile-op 'ffa :force t)
;; (asdf:oos 'asdf:compile-op 'array-operations :force t)

;; (asdf:oos 'asdf:compile-op 'org.middleangle.foreign-numeric-vector :force t)
;; (asdf:oos 'asdf:compile-op 'org.middleangle.cl-blapack :force t) ;  :force t

;;; The main thing...
;; (delete-package 'lisp-matrix) ;; fails, but we need to cleanup a bit more.

;; (asdf:oos 'asdf:compile-op 'lisp-matrix :force t)
;; (asdf:oos 'asdf:compile-op 'lisp-matrix)
;; (asdf:oos 'asdf:load-op 'lisp-matrix)

;; (asdf:oos 'asdf:compile-op 'cffi :force t)

(in-package :lisp-matrix-unittests)
;; Tests = 69, Failures = 0, Errors = 12 ;; 26.2.2009
(run-tests :suite 'lisp-matrix-ut)
(describe (run-tests :suite 'lisp-matrix-ut))
;; or simply...
(run-lisp-matrix-tests)
(describe  (run-lisp-matrix-tests))

;; failures:

;; Note that when unit tests fail in m*- tests, it seems to do with a
;; "macro vs defun" problem, related to compile-time vs. run-time
;; evaluation that I (tony) am not quite understanding, causing a
;; possible increase in the number of errors beyond the number
;; reported above.
;;
;; The current two errors are:  
;; * foreign arrays with integer values are not supported.
;; * mixed CL-BLAPACK calls are not yet supported (lisp/foreign stored
;;   matrix-like calls).
;; I'm sure there will be more.

(in-package :lisp-matrix-user)

;; (lisp-matrix-unittests:run-lisp-matrix-tests)
;; (describe (lisp-matrix-unittests:run-lisp-matrix-tests))

(describe 
 (lift::run-test
  :test-case  'lisp-matrix-unittests::strided-matrix-column-access
  :suite 'lisp-matrix-ut-vectors))


;; Here is what we need to fix, based on the above:
;; #  creation of foreign-array matrices which are integer valued
;;    fails.


;; Just a reminder:
;; (typep -1 '(integer 0 *))   ;=> nil
;; (typep  2 '(integer 0 *))   ;=> T
;; (typep  3 '(integer -1 2))  ;=> nil
;; (typep  2 '(integer -1 2))  ;=> T

;;; FIXME FOLLOWING ERRORS: MIGRATE INTO UNITTESTS...

(progn  ;;#FIXME: writing out R matrices -- as strings and via RCLG

  (defparameter *x-temp*
    (make-matrix 4 5
		 :implementation :lisp-array
		 :element-type 'double-float
		 :initial-contents #2A((11d0 12d0 13d0 14d0 15d0)
				       (21d0 22d0 23d0 24d0 25d0)
				       (31d0 32d0 33d0 34d0 35d0)
				       (41d0 42d0 43d0 44d0 45d0))))

  ;; bad:  (min (values (list 4d0 2d0 3d0 5d0 3d0)))
  (reduce #'min (list 4d0 2d0 3d0 5d0 3d0))
  (reduce #'min (list 2d0 4d0 3d0 5d0 3d0))
  (reduce #'min (list 4d0 3d0 5d0 3d0 2d0))

  (reduce #'(lambda (x y) (concatenate 'string x y))
	  "test"
	  " "
	  (list "a2" " s3 " "asdf")
	  "end.")

  (defun lispmatrix2r (m &key (rvarname "my.mat"))
    "Write out a string that can be used to read in the matrix into R.
Used for creating verfication scripts and test cases."
    (check-type m matrix-like)
    (apply 
     #'concatenate 'string
     (format nil "~%~s <- matrix ( data = c(" rvarname)
     (let ((result (list)))
		    (dotimes (i (matrix-dimension m 0))
		      (dotimes (j (matrix-dimension m 1))
			(cons (format nil "~d," (mref m i j)) result)))
		    (reverse result))
     (list  (format nil "), nrows=~d, ncols=~d, by.row=TRUE)"
	     (matrix-dimension m 0)
	     (matrix-dimension m 1)))))

  (lispmatrix2R *x-temp*)


  (let ((result (make-array (list 3 5) :element-type 'string)))
    (dotimes (i 3)
      (dotimes (j 5)
	(format t "~s ~s ~%" i j)
	(setf (aref result i j) (format t "(~d ~d)," i j))))
    (reverse result))

  )


#+nil 
(progn   ;; QR decomp

  (let* ((state1 (make-random-state))
	 (state2 (make-random-state state1)))
    (m= (rand 2 3 :state state1)
	(rand 2 3 :state state2)))

  ;;; Problems here...
  (geqrf (make-matrix 2 2 :initial-contents #2A(( 1d0 2d0 ) (2d0 1d0))))
  (geqrf (make-matrix 2 2 :initial-contents '(( 1d0 2d0 ) (2d0 1d0))))
  ;;  (make-vector 2 :type :column :initial-contents '((1d0)(1d0))))

  )


#+nil
(progn ;; FIXME: R's apply across array indicies

  ;; Thought 1 (currently not planned for implementation)
  ;; consider using affi as a general iterator/walker generator.
  ;; So, R has a notion of apply, sapply, tapply, lapply -- what we
  ;; should do is something like
  ;;
  ;;     (map-matrix with-fn this-matrix
  ;;                 :by iterator
  ;;                 :result-type 'list)
  ;;
  ;; silly or for later:        :computation-type [:parallel|:serial]
  ;;
  ;; or similar, where :result-type is something that can be coerced to
  ;; from a sequence, and computation-type might drive whether there are
  ;; dependencies or not.   (this last is probably too premature).

  ;; The basic idea is to use vector functions (taking a vector, and
  ;; returning a object) and use them to provide an object that can be
  ;; part of a list (or generally, a sequence of homogeneous objects).

  ;; Reviewing Tamas Papp's affi package provides one approach to this
  ;; challenge.  He suggests that an obvious approach would be to
  ;; break up the 2 actions needed for selection consist of describing
  ;; the mapping from array to structure, and then walking the
  ;; structure to extract (for copy or use).  For our needs, we need a
  ;; means of doing this to partition the space, and then
  ;; post-partition, deciding which partitions need to be considered
  ;; for further processing, and which ones get discarded.

  ;; So to clarify how this might work: 
  ;; 1. we need a function which takes a matrix and creates a list of
  ;; matrix-like or vector-like elements.
  ;; 2. we have functions which operate in general on matrix-like or
  ;; vector-like objects.
  ;; 3. we use mapcar or similar to create the results.  
  ;; 3a. multi-value return could be used to create multiple lists of
  ;; vector-like or matrix-like objects, for example to get a complex
  ;; computation using inner-products.   So for instance:
  ;;   list1: v1a v2a v3a
  ;;   list2: m1  m2  m3
  ;;   list3: v1b v2b v3b
  ;; and we compute
  ;;   (list-of (IP v#a m1 v#b )) 
  ;; via
  ;;   (mapcar #'IP (list-of-vector-matrix-vector M))

  ;; We would need such an "extractor" to make things work out right.  
  #+nil(mapcar #'function-on-matrix (make-list-of-matrices original-matrix)) 


  (list->vector-like (list 1d0 2d0 3d0) :orientation :row)

  (make-vector 3 :type :column 
	       :initial-contents
	       (mapcar #'(lambda (x) (list (coerce x 'double-float)))
		       (list 1d0 2d0 3d0)))

  (make-vector 3 :type :row 
	       :initial-contents
	       (list (mapcar  #'(lambda (x) (coerce x 'double-float))
			      (list 1d0 2d0 3d0))))

  ;; The following approach would be required to do a proper map-back.
  #+nil(list->vector-like (map 'list #'function-of-2-args (list1) (list2)) :type :row) ; or :column
  ;; this would take a list and create an appropriate vector-like of
  ;; the appropriate type.

  ;; Thought 2, the current immediate approach:
  ;; What we currently do is break it out into components.

  (defparameter *m1-app* (ones 2 3))
  (let ((col-list (list-of-columns *m1-app*)))
    (dotimes (i (length col-list))
	  (princ (v= (nth i col-list)
		      (ones 2 1)))))

  (list-of-columns *m1-app*)
  (list-of-rows *m1-app*)
  
  (mapcar #'princ (list-of-columns *m1-app*))

  (format nil "R-Apply approach"))


#+nil
(progn
  ;; Studies in Class inheritance

  (subtypep 'LA-SIMPLE-VECTOR-DOUBLE 'VECTOR-LIKE)
  (subtypep 'LA-SLICE-VECVIEW-DOUBLE 'VECTOR-LIKE)
  (subtypep 'LA-SIMPLE-VECTOR-DOUBLE 'LA-SLICE-VECVIEW-DOUBLE)
  (subtypep  'LA-SLICE-VECVIEW-DOUBLE 'LA-SIMPLE-VECTOR-DOUBLE)

  (subtypep 'FA-SIMPLE-VECTOR-DOUBLE 'MATRIX-LIKE)

  ;;; weird!
  (m- (make-vector 2 :initial-contents '((1d0 1d0)))
      (make-vector 2 :initial-contents '((1d0 1d0))))

  (let ((*default-implementation* :foreign-array))
    (m- (make-vector 2 :initial-contents '((1d0 1d0)))
	(make-vector 2 :initial-contents '((1d0 1d0)))))

  (let ((*default-implementation* :lisp-array))
    (m- (make-vector 2 :initial-contents '((1d0 1d0)))
	(make-vector 2 :initial-contents '((1d0 1d0)))))

  (m- (make-vector 2
		   :implementation :lisp-array
		   :initial-contents '((1d0 1d0)))
      (make-vector 2
		   :implementation :foreign-array
		   :initial-contents '((1d0 1d0))))

  (typep  (first *lm-result*) 'vector-like)
  (typep  (first *lm-result*) 'matrix-like)
  (typep  (second *lm-result*) 'vector-like)
  (typep  (second *lm-result*) 'matrix-like)
  (typep *x-temp* 'vector-like)
  (typep *x-temp* 'matrix-like) ; => T ,rest of this paragraph are false.

  (m- *x-temp* *x-temp*))

#+end_src

* Examples

#+NAME: loadit
#+BEGIN_SRC lisp
  (asdf:oos 'asdf:load-op :lisp-matrix)
  ;; (ql:quickload :lisp-matrix)
#+END_SRC

  Need to autogenerate approach for documenting what we can do with
  this. Until then, simple reference.

  Instantiates a supported matrix type:
  - lisp/foreign
  - single/double/complex-single/complex-double/integer
  - (TODO: need to consider normal or mmap'd structures as well) 
  by:

#+NAME: matrixExData
#+BEGIN_SRC lisp
  (make-matrix  )
#+END_SRC

  right now, we are being numerical analysts, and only allow for a
  single modality, i.e. lisp-integer, foriegn-doubleFloat, etc.

  A different package, based on this, should manage mixed-data type
  typed matrices/arrays.

  Referencing elements is done using the xarray system, so that needs
  to be a dependency of this. (one can use the native system, but it
  would be so much better to have a uniform table-access and
  manipulation API, xarray or grid or affi or...)

#+name: NewMetaAPI
#+begin_src lisp
  (xref mat   x    y
        :return-as 'matrix)               ; for a single mat[x,y] value
  (xref mat
        (rows x1 x2 x3)
        (columns y1 y2 y3))               ; for a 3x3 matrix restricted
                                          ; to the appropriate rows and
                                          ; columns.  A better approach
                                          ; might be to use a
                                          ; cross-product API, or
                                          ; serial-list-then-row-or-column-major-fill-to-spec-d-format
  
  (xref mat
        (except-for-rows x1 x2 x3)
        (except-for-columns x1 x2 x3))
  
  ;; 1-d 1x4 array
  (xref mat
        (shaped-return (list (list x1 y1) (list x2 y2) (list x3 y3) (list x4 y4)))) 
  
  ;; 2-d 2x2 array
  (xref mat
        (shaped-return (list (list (list x1 y1) (list x2 y2))
                             (list (list x3 y3) (list x4 y4)))))
#+end_src

And then there is the older stuff.

#+NAME: OldNativeAPI
#+begin_src lisp
(mref mat x y) get/set
(bind2 mat1 mat2 :by [:row|:column] )
(diagonal mat)
(m* mat1 mat2) => selection of the correct ZYYmm type (gemm for general mat mult)
(m+ mat1 mat2)
(m- mat1 mat3)
(axpy a mat1 mat2) => (scalar * matrix) + matrix
#+end_src

which we need to consider, perhaps through some sort of macro package?

* Tasks [1/4]
** TODO [#B] Migrate DITZ issues into this file.
   - State "TODO"       from ""           [2010-06-07 Mon 16:53]
** TODO [#B] Refactor src into "lisp-matrix", "support", etc.
   - State "TODO"       from ""           [2010-06-07 Mon 16:39]
** TODO [#B] fix and illustrate the use of the class structure for "transpose"
** DONE [#B] Lisp-matrix in own package
   - State "DONE"       from "CURR"       [2010-06-07 Mon 16:39] \\
     Finished a while back.
   - State "CURR"       from "TODO"       [2010-06-07 Mon 16:39]
   - State "TODO"       from ""           [2010-06-07 Mon 16:39]
   supports a lisp-matrix-user playground.
* Disserata
  say what.


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 lisp-matrix

Author

Mark Hoemmen <mhoemmen@cs.berkeley.edu>

License

BSD sans advertising clause

Description

linear algebra library

Long Description

Linear algebra library for ANSI Common Lisp;
implemented at the lowest level using CFFI to call the BLAS and LAPACK. Should run on any ANSI CL implementation that supports CFFI. Uses both lisp-centric and foreign-centric storage, in a manner friendly to the complimentary other storage facility.

Version

0.3

Dependencies
Source

lisp-matrix.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Modules

Modules are listed depth-first from the system components tree.


Next: , Previous: , Up: Modules   [Contents][Index]

3.1 lisp-matrix/package-init

Parent

lisp-matrix (system)

Location

src/

Component

package.lisp (file)


Next: , Previous: , Up: Modules   [Contents][Index]

3.2 lisp-matrix/basics

Dependencies
Parent

lisp-matrix (system)

Location

src/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.3 lisp-matrix/implementations

Dependencies
Parent

lisp-matrix (system)

Location

src/

Components

Next: , Previous: , Up: Modules   [Contents][Index]

3.4 lisp-matrix/api

Dependencies
Parent

lisp-matrix (system)

Location

src/

Component

numerical-linear-algebra.lisp (file)


Previous: , Up: Modules   [Contents][Index]

3.5 lisp-matrix/testing

Dependencies
Parent

lisp-matrix (system)

Location

src/unittests/

Components

Next: , Previous: , Up: Top   [Contents][Index]

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

4.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.1 lisp-matrix.asd

Location

lisp-matrix.asd

Systems

lisp-matrix (system)

Packages

lisp-matrix-asd


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.2 lisp-matrix/package-init/package.lisp

Parent

package-init (module)

Location

src/package.lisp

Packages

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.3 lisp-matrix/basics/utils.lisp

Parent

basics (module)

Location

src/utils.lisp

Internal Definitions

make-symbol* (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.4 lisp-matrix/basics/macros.lisp

Parent

basics (module)

Location

src/macros.lisp

Internal Definitions

define-abstract-class (macro)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.5 lisp-matrix/basics/matrix.lisp

Parent

basics (module)

Location

src/matrix.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.6 lisp-matrix/basics/vector.lisp

Dependency

matrix.lisp (file)

Parent

basics (module)

Location

src/vector.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.7 lisp-matrix/basics/data-transform.lisp

Dependencies
Parent

basics (module)

Location

src/data-transform.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.8 lisp-matrix/basics/matrix-implementations.lisp

Dependencies
Parent

basics (module)

Location

src/matrix-implementations.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.9 lisp-matrix/implementations/matrix-lisp-array.lisp

Parent

implementations (module)

Location

src/matrix-lisp-array.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.10 lisp-matrix/implementations/matrix-foreign-array.lisp

Dependency

matrix-lisp-array.lisp (file)

Parent

implementations (module)

Location

src/matrix-foreign-array.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.11 lisp-matrix/implementations/lapack-utils.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-utils.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.12 lisp-matrix/implementations/lapack-methods.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-methods.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.13 lisp-matrix/implementations/lapack-cholesky.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-cholesky.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.14 lisp-matrix/implementations/lapack-lu.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-lu.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.15 lisp-matrix/implementations/lapack-qr.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-qr.lisp

Exported Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.16 lisp-matrix/implementations/lapack-svd.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-svd.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.17 lisp-matrix/implementations/lapack-ls.lisp

Dependencies
Parent

implementations (module)

Location

src/lapack-ls.lisp

Exported Definitions
Internal Definitions

least-squares-gelsy (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.18 lisp-matrix/implementations/matrix-operations.lisp

Dependencies
Parent

implementations (module)

Location

src/matrix-operations.lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.19 lisp-matrix/api/numerical-linear-algebra.lisp

Parent

api (module)

Location

src/numerical-linear-algebra.lisp

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.20 lisp-matrix/testing/unittests.lisp

Parent

testing (module)

Location

src/unittests/unittests.lisp

Exported Definitions

run-lisp-matrix-tests (function)

Internal Definitions

Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.21 lisp-matrix/testing/unittests-transform.lisp

Dependency

unittests.lisp (file)

Parent

testing (module)

Location

src/unittests/unittests-transform.lisp

Internal Definitions

lisp-matrix-ut-datatrans (class)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.22 lisp-matrix/testing/unittests-matrix.lisp

Dependency

unittests.lisp (file)

Parent

testing (module)

Location

src/unittests/unittests-matrix.lisp

Internal Definitions

lisp-matrix-ut-matrix (class)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.23 lisp-matrix/testing/unittests-matrix-view.lisp

Dependencies
Parent

testing (module)

Location

src/unittests/unittests-matrix-view.lisp

Internal Definitions

lisp-matrix-ut-matrix-views (class)


Next: , Previous: , Up: Lisp files   [Contents][Index]

4.1.24 lisp-matrix/testing/unittests-matrix-lapack.lisp

Dependencies
Parent

testing (module)

Location

src/unittests/unittests-matrix-lapack.lisp

Internal Definitions

Previous: , Up: Lisp files   [Contents][Index]

4.1.25 lisp-matrix/testing/unittests-vector.lisp

Dependency

unittests.lisp (file)

Parent

testing (module)

Location

src/unittests/unittests-vector.lisp

Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

5.1 lisp-matrix-asd

Source

lisp-matrix.asd

Use List

Next: , Previous: , Up: Packages   [Contents][Index]

5.2 lisp-matrix-unittests

Unit, validation, and regression testing for lisp-matrix

Source

package.lisp (file)

Use List
Exported Definitions

run-lisp-matrix-tests (function)

Internal Definitions

Next: , Previous: , Up: Packages   [Contents][Index]

5.3 lisp-matrix-user

User experimentation package for lisp-matrix

Source

package.lisp (file)

Use List

Previous: , Up: Packages   [Contents][Index]

5.4 lisp-matrix

Source

package.lisp (file)

Use List
Used By List
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

6.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.1 Special variables

Special Variable: *default-element-type*

Possible values:
’double-float ’single-float ’complex-single-float but this list is probably incomplete.

Package

lisp-matrix

Source

matrix.lisp (file)

Special Variable: *default-implementation*

One of :LISP-ARRAY (use FFA package) or :FOREIGN-ARRAY (uses FNV package).

Package

lisp-matrix

Source

matrix.lisp (file)

Special Variable: *implementations*

Table of available implementations.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Special Variable: *supported-datatypes*

Association list mapping each supported datatype to its BLAS/LAPACK letter.

Package

lisp-matrix

Source

lapack-utils.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.2 Macros

Macro: make-predicate-macro FORM

Trying to fix make-predicate, through a macro approach. DOES NOT WORK! Idea: we want to return an anonymous function which implements the predicate desired. However, this isn’t used any where (though it could be used in countless situations).

Package

lisp-matrix

Source

lapack-utils.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.3 Functions

Function: assert-valid-matrix-index MATRIX I J
Package

lisp-matrix

Source

matrix.lisp (file)

Function: copy MATRIX

Return a deep identical copy of MATRIX (same implementation and element-type).

Package

lisp-matrix

Source

matrix.lisp (file)

Function: copy-maybe MATRIX TEST

Return a deep copy of MATRIX if TEST is satisfied, or return MATRIX
itself. TEST is a function of one argument that will be applied to MATRIX.

Example uses:
1. copy if small enough, and use the original if too large.
2. copy if a particular implementation, use original if correct implementation.

Package

lisp-matrix

Source

matrix.lisp (file)

Function: copy-maybe* MATRIX TEST IMPLEMENTATION

Same as COPY-MAYBE but one can specify the implementation.

Package

lisp-matrix

Source

matrix.lisp (file)

Function: datatype->letter DATATYPE

Converts the given DATATYPE to the letter that symbolizes it in the BLAS and LAPACK.

Use Example:
(string= "D" (datatype->letter ’double))

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: diagonalf MAT &key TYPE

This function provides a deep copy alternative to the diagonal class structure, and also might be cleaner to work with. But might not be quite so flexible.

Package

lisp-matrix

Source

vector.lisp (file)

Function: eye NROWS NCOLS &key IMPLEMENTATION ELEMENT-TYPE

Create a NROWS x NCOLS matrix with ones on the diagonal, and zeros elsewhere. Mnemonic: eye for I(n,m)

Package

lisp-matrix

Source

matrix.lisp (file)

Function: flatten-matrix-indices-1 MATRIX I J
Package

lisp-matrix

Source

matrix.lisp (file)

Function: list->vector-like LISTVAR &key COERCE-TO ORIENTATION

Create a vector-like using default implementation. Use globals to change implementation, etc. By default, we assume lists are variables, not cases (i.e. follow lispstat convention), and therefore convert to column.

Package

lisp-matrix

Source

data-transform.lisp (file)

Function: list-of-columns M

Returns a list of vector-like elements from matrix M. FIXME: AWFUL.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Function: list-of-rows M

Returns a list of vector-like elements from matrix M. FIXME: AWFUL IMPLEMENTATION

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Function: make-matrix NROWS NCOLS &key IMPLEMENTATION ELEMENT-TYPE INITIAL-ELEMENT INITIAL-CONTENTS

Create a NROWS x NCOLS matrix with
MATRIX-IMPLEMENTATION as underlying implementation. ELEMENT-TYPE is the lisp type to be stored in the matrix, and INITIAL-ELEMENT an element that may be used to initially fill the matrix.

If INITIAL-ELEMENT is not specified, the matrix is not initialized, and accessing its elements will thus return spurious values.

If INITIAL-CONTENTS is specified, it is used to initialize the matrix, by using the generic function COPY!.

IMPLEMENTATION can be one of :LISP-ARRAY and :FOREIGN-ARRAY

Package

lisp-matrix

Source

matrix.lisp (file)

Function: make-predicate FORM

From an expression combining predicates, construct a function of one argument that evaluates the logical expression on the element, where each predicate is applied to the argument to obtain its logical value.

FORM may be constructed as follows: a symbol whose f-value is a function of one argument; a list whose car is ’OR and whose CDR is a list of predicates; a list whose car is ’AND and whose CDR is a list of predicates; T; NIL.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: make-vector NELTS &key TYPE IMPLEMENTATION ELEMENT-TYPE INITIAL-ELEMENT INITIAL-CONTENTS

Make a vector containing NELTS elements of type ELEMENT-TYPE, and with IMPLEMENTATION as underlying implementation. The vector is a row vector if TYPE is :ROW, and a column vector if TYPE is :COLUMN.

If INITIAL-ELEMENT is not specified, the vector is not initialized, and accessing its elements will thus return spurious values.

If INITIAL-CONTENTS is specified, it is used to initialize the vector, by using the generic function COPY!.

IMPLEMENTATION can be one of :LISP-ARRAY and :FOREIGN-ARRAY

Package

lisp-matrix

Source

vector.lisp (file)

Function: map-vec UNIFCN VEC

Apply univariate function to each element of old vector, returning
new one.
(map-vec #’(lambda (x) (* 2.0 x))
(make-vector 4 :initial-element 2d0))
=> #<LA-SIMPLE-VECTOR-DOUBLE (1 x 4) 4.0 4.0 4.0 4.0>
(map-vec #’sqrt
(make-vector 4 :initial-element 2d0))
=> #<LA-SIMPLE-VECTOR-DOUBLE (1 x 4) 1.4142135623730951 1.4142135623730951 1.4142135623730951 1.4142135623730951>

Package

lisp-matrix

Source

vector.lisp (file)

Function: matrix-like-symmetric-p M

FIXME REFACTOR-ME: basically right, but too inefficient.

Package

lisp-matrix

Source

matrix.lisp (file)

Function: minv-cholesky A

invert A using LU Factorization. A must be symmetric.

Package

lisp-matrix

Source

lapack-cholesky.lisp (file)

Function: minv-lu A

invert A using LU Factorization

Package

lisp-matrix

Source

lapack-lu.lisp (file)

Function: msolve-cholesky A B

Compute ‘x1’ solving ‘A x = b’, with LU factorization.

Package

lisp-matrix

Source

lapack-cholesky.lisp (file)

Function: msolve-lu A B

Compute ‘x1’ solving ‘A x = b’, with LU factorization.

Package

lisp-matrix

Source

lapack-lu.lisp (file)

Function: ones NROWS NCOLS &key IMPLEMENTATION ELEMENT-TYPE

Create a NROWS x NCOLS matrix filled with ones.

Package

lisp-matrix

Source

matrix.lisp (file)

Function: opposite-orientation ORIENTATION
Package

lisp-matrix

Source

matrix.lisp (file)

Function: rand NROWS NCOLS &key IMPLEMENTATION ELEMENT-TYPE STATE VALUE

Create a NROWS x NCOLs matrix filled with uniformly distributed pseudo-random numbers between 0 and VALUE.

Package

lisp-matrix

Source

matrix.lisp (file)

Function: run-lisp-matrix-tests ()

Check everything...!

Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Function: trap2mat M &key TYPE

Copy the trapezoid, lower or upper, into the other side (i.e. upper triagular storage into full storage). For non-square matrices, there might be a bit of excess to ignore; but we only handle the top square of the rectangle.

Package

lisp-matrix

Source

data-transform.lisp (file)

Function: valid-orientation-p ORIENTATION
Package

lisp-matrix

Source

matrix.lisp (file)

Function: vector-like->list VECVAR

Create a list from a vector-like.

Package

lisp-matrix

Source

data-transform.lisp (file)

Function: zeros NROWS NCOLS &key IMPLEMENTATION ELEMENT-TYPE

Create a NROWS x NCOLS matrix filled with zeros.

Package

lisp-matrix

Source

matrix.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.4 Generic functions

Generic Function: asum X

Wrapper for lapack methods %SASUM, %DASUM, %SCASUM, %DZASUM.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: asum (X la-matrix-complex-double)
Method: asum (X fa-matrix-complex-double)
Method: asum (X la-matrix-complex-single)
Method: asum (X fa-matrix-complex-single)
Method: asum (X la-matrix-double)
Method: asum (X fa-matrix-double)
Method: asum (X la-matrix-single)
Method: asum (X fa-matrix-single)
Generic Function: axpy ALPHA X Y

Wrapper for lapack methods %SAXPY, %DAXPY, %CAXPY, %ZAXPY.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: axpy ALPHA (X la-matrix-complex-double) (Y la-matrix-complex-double)
Method: axpy ALPHA (X fa-matrix-complex-double) (Y fa-matrix-complex-double)
Method: axpy ALPHA (X la-matrix-complex-single) (Y la-matrix-complex-single)
Method: axpy ALPHA (X fa-matrix-complex-single) (Y fa-matrix-complex-single)
Method: axpy ALPHA (X la-matrix-double) (Y la-matrix-double)
Method: axpy ALPHA (X fa-matrix-double) (Y fa-matrix-double)
Method: axpy ALPHA (X la-matrix-single) (Y la-matrix-single)
Method: axpy ALPHA (X fa-matrix-single) (Y fa-matrix-single)
Generic Function: bind2 M1 M2 &key BY

Simple experiment, not necessarily part of the API
yet! When type is :row, If the number of columns of m1 and m2 match, join them. Think of a sandwich approach, resulting in:

m1

m2

The ARGS can be matrices, vectors, or lists. Arguments are bound into a matrix along their rows. Example:

(bind2 #2a((1 2)(3 4)) #(5 6) :by :row)
returns
#2a((1 2)(3 4)(5 6))

When type is :column, if the number of rows of m1 and m2 match, join them. Think of a pair of columns, resulting in

m1 | m2

API should result with the ARGS as matrices, vectors, or
lists. Arguments are bound into a matrix along their columns. Example:
(bind2 #2a((1 2)(3 4)) #(5 6) :by :column)
returns
#2a((1 2 5)(3 4 6))

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: bind2 (M1 matrix-like) (M2 matrix-like) &key BY

Binding for matrix, columns, deep copy into a new matrix of the right size. Could we solve the row-binding approach by transpose?

Generic Function: col MATRIX J

Return a view on a given column of MATRIX.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: col (MATRIX transpose-matview) (J integer)
Method: col (MATRIX matrix-like) (J integer)
Method: col (MATRIX window-matview) (J integer)
Method: col (MATRIX strided-matview) (J integer)
Generic Function: col-offset OBJECT
Package

lisp-matrix

Methods
Method: col-offset (MAT matrix-like)

If we are not specialize, then we need to consider that we no longer need to think about anything but 0.

Source

matrix.lisp (file)

Method: col-offset (WINDOW-MATVIEW window-matview)

automatically generated reader method

Source

matrix.lisp (file)

Generic Function: col-stride OBJECT
Package

lisp-matrix

Methods
Method: col-stride (STRIDED-MATVIEW strided-matview)

Stride in the column direction

Source

matrix.lisp (file)

Generic Function: col-vector-p MATRIX
Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: col-vector-p (MATRIX matrix-like)

A general matrix cannot be a column vector. We will arrange for functions building matrices to return column vectors when appropriate.

Method: col-vector-p (MATRIX vector-like)
Generic Function: copy! A B

Copy A into B if they are not the same object, and
return B. A and B should be matrices or vectors with the same dimensions, but not necessarily of the same implementation.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: copy! (A list) (B matrix-like)

Copy A into B. This particular method is weird – dictates that the LOL datastructure presents a row-major orientation for the lists. Is there any reason to consider a column-major orientation for the lists used to form the matrix? Or do we just figure it out from the structure of the lists which are used for input.

Method: copy! (A array) (B matrix-like)
Method: copy! (A matrix-like) (B matrix-like)
Generic Function: copy* MATRIX IMPLEMENTATION

Same as COPY but specify the implementation.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: copy* (MATRIX matrix-like) IMPLEMENTATION
Generic Function: cross-product MATA MATB
Package

lisp-matrix

Source

matrix-operations.lisp (file)

Generic Function: data MATRIX

Return the underlying data of the matrix.

Package

lisp-matrix

Source

matrix.lisp (file)

Writer

(setf data) (generic function)

Methods
Method: data (FA-SIMPLE-MATRIX-COMPLEX-DOUBLE fa-simple-matrix-complex-double)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: data (FA-SIMPLE-MATRIX-COMPLEX-SINGLE fa-simple-matrix-complex-single)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: data (FA-SIMPLE-MATRIX-DOUBLE fa-simple-matrix-double)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: data (FA-SIMPLE-MATRIX-SINGLE fa-simple-matrix-single)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-T la-simple-matrix-t)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-INTEGER la-simple-matrix-integer)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-FIXNUM la-simple-matrix-fixnum)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-COMPLEX-DOUBLE la-simple-matrix-complex-double)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-COMPLEX-SINGLE la-simple-matrix-complex-single)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-DOUBLE la-simple-matrix-double)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (LA-SIMPLE-MATRIX-SINGLE la-simple-matrix-single)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: data (MATRIX matview)
Generic Function: (setf data) NEW-VALUE OBJECT
Package

lisp-matrix

Reader

data (generic function)

Methods
Method: (setf data) NEW-VALUE (FA-SIMPLE-MATRIX-COMPLEX-DOUBLE fa-simple-matrix-complex-double)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: (setf data) NEW-VALUE (FA-SIMPLE-MATRIX-COMPLEX-SINGLE fa-simple-matrix-complex-single)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: (setf data) NEW-VALUE (FA-SIMPLE-MATRIX-DOUBLE fa-simple-matrix-double)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: (setf data) NEW-VALUE (FA-SIMPLE-MATRIX-SINGLE fa-simple-matrix-single)

The FNV object holding the elements.

Source

matrix-foreign-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-T la-simple-matrix-t)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-INTEGER la-simple-matrix-integer)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-FIXNUM la-simple-matrix-fixnum)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-COMPLEX-DOUBLE la-simple-matrix-complex-double)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-COMPLEX-SINGLE la-simple-matrix-complex-single)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-DOUBLE la-simple-matrix-double)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Method: (setf data) NEW-VALUE (LA-SIMPLE-MATRIX-SINGLE la-simple-matrix-single)

The lisp simple-array of rank 1 holding the elements.

Source

matrix-lisp-array.lisp (file)

Generic Function: diagonal! MAT &key TYPE

create a vector representing the diagonal of matrix
x. This is a deep copy, NOT a view. It might be easy to write the view as a class with appropriate
vref x i
pulling out
mref x i i
should we write such a view?

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: diagonal! (MAT matrix-like) &key TYPE
Generic Function: dot X Y

Wrapper for lapack methods %SDOT, %DDOT.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: dot (X la-matrix-double) (Y la-matrix-double)
Method: dot (X fa-matrix-double) (Y fa-matrix-double)
Method: dot (X la-matrix-single) (Y la-matrix-single)
Method: dot (X fa-matrix-single) (Y fa-matrix-single)
Generic Function: dotc X Y

Wrapper for lapack methods %CDOTC, %ZDOTC.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: dotc (X la-matrix-complex-double) (Y la-matrix-complex-double)
Method: dotc (X fa-matrix-complex-double) (Y fa-matrix-complex-double)
Method: dotc (X la-matrix-complex-single) (Y la-matrix-complex-single)
Method: dotc (X fa-matrix-complex-single) (Y fa-matrix-complex-single)
Generic Function: dotu X Y

Wrapper for lapack methods %CDOTU, %ZDOTU.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: dotu (X la-matrix-complex-double) (Y la-matrix-complex-double)
Method: dotu (X fa-matrix-complex-double) (Y fa-matrix-complex-double)
Method: dotu (X la-matrix-complex-single) (Y la-matrix-complex-single)
Method: dotu (X fa-matrix-complex-single) (Y fa-matrix-complex-single)
Generic Function: fill-matrix MATRIX FILL-ELEMENT

Set each element of MATRIX to FILL-ELEMENT.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: fill-matrix (MATRIX la-matrix) FILL-ELEMENT
Source

matrix-lisp-array.lisp (file)

Method: fill-matrix (MATRIX matrix-like) FILL-ELEMENT before
Method: fill-matrix (MATRIX matrix-like) FILL-ELEMENT
Generic Function: flatten-matrix-indices MATRIX I J

Given an index pair (I,J) into the given matrix
MATRIX, returns the 1-D index corresponding to the location in the underlying storage in which the element MATRIX(i,j) is stored.

The default implementation is for a column-major dense storage, corresponding to the default implementation of the generic function ORIENTATION.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: flatten-matrix-indices (MATRIX strided-matview) I J
Method: flatten-matrix-indices (MATRIX window-matview) I J
Method: flatten-matrix-indices (MATRIX transpose-matview) I J
Method: flatten-matrix-indices (MATRIX matrix-like) I J
Generic Function: gelsy A B RCOND &optional JPVT

Wrapper for lapack methods %SGELSY, %DGELSY.

Package

lisp-matrix

Source

lapack-ls.lisp (file)

Methods
Method: gelsy (A la-matrix-double) (B la-matrix-double) RCOND &optional JPVT
Method: gelsy (A fa-matrix-double) (B fa-matrix-double) RCOND &optional JPVT
Method: gelsy (A la-matrix-single) (B la-matrix-single) RCOND &optional JPVT
Method: gelsy (A fa-matrix-single) (B fa-matrix-single) RCOND &optional JPVT
Generic Function: gemm ALPHA A B BETA C

Wrapper for lapack methods %SGEMM, %DGEMM, %CGEMM, %ZGEMM.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: gemm ALPHA (A la-matrix-complex-double) (B la-matrix-complex-double) BETA (C la-matrix-complex-double)
Method: gemm ALPHA (A fa-matrix-complex-double) (B fa-matrix-complex-double) BETA (C fa-matrix-complex-double)
Method: gemm ALPHA (A la-matrix-complex-single) (B la-matrix-complex-single) BETA (C la-matrix-complex-single)
Method: gemm ALPHA (A fa-matrix-complex-single) (B fa-matrix-complex-single) BETA (C fa-matrix-complex-single)
Method: gemm ALPHA (A la-matrix-double) (B la-matrix-double) BETA (C la-matrix-double)
Method: gemm ALPHA (A fa-matrix-double) (B fa-matrix-double) BETA (C fa-matrix-double)
Method: gemm ALPHA (A la-matrix-single) (B la-matrix-single) BETA (C la-matrix-single)
Method: gemm ALPHA (A fa-matrix-single) (B fa-matrix-single) BETA (C fa-matrix-single)
Generic Function: geqrf A

Wrapper for lapack methods %SGEQRF, %DGEQRF, %CGEQRF, %ZGEQRF.

Package

lisp-matrix

Source

lapack-qr.lisp (file)

Methods
Method: geqrf (A la-matrix-complex-double)
Method: geqrf (A fa-matrix-complex-double)
Method: geqrf (A la-matrix-complex-single)
Method: geqrf (A fa-matrix-complex-single)
Method: geqrf (A la-matrix-double)
Method: geqrf (A fa-matrix-double)
Method: geqrf (A la-matrix-single)
Method: geqrf (A fa-matrix-single)
Generic Function: getrf A &optional IPIV

Wrapper for lapack methods %SGETRF, %DGETRF, %CGETRF, %ZGETRF.

Package

lisp-matrix

Source

lapack-lu.lisp (file)

Methods
Method: getrf (A la-matrix-complex-double) &optional IPIV
Method: getrf (A fa-matrix-complex-double) &optional IPIV
Method: getrf (A la-matrix-complex-single) &optional IPIV
Method: getrf (A fa-matrix-complex-single) &optional IPIV
Method: getrf (A la-matrix-double) &optional IPIV
Method: getrf (A fa-matrix-double) &optional IPIV
Method: getrf (A la-matrix-single) &optional IPIV
Method: getrf (A fa-matrix-single) &optional IPIV
Generic Function: getri A IPIV

Wrapper for lapack methods %SGETRI, %DGETRI, %CGETRI, %ZGETRI.

Package

lisp-matrix

Source

lapack-lu.lisp (file)

Methods
Method: getri (A la-matrix-complex-double) IPIV
Method: getri (A fa-matrix-complex-double) IPIV
Method: getri (A la-matrix-complex-single) IPIV
Method: getri (A fa-matrix-complex-single) IPIV
Method: getri (A la-matrix-double) IPIV
Method: getri (A fa-matrix-double) IPIV
Method: getri (A la-matrix-single) IPIV
Method: getri (A fa-matrix-single) IPIV
Generic Function: getrs A B IPIV-A

Wrapper for lapack methods %SGETRS, %DGETRS, %CGETRS, %ZGETRS.

Package

lisp-matrix

Source

lapack-lu.lisp (file)

Methods
Method: getrs (A la-matrix-complex-double) (B la-matrix-complex-double) IPIV-A
Method: getrs (A fa-matrix-complex-double) (B fa-matrix-complex-double) IPIV-A
Method: getrs (A la-matrix-complex-single) (B la-matrix-complex-single) IPIV-A
Method: getrs (A fa-matrix-complex-single) (B fa-matrix-complex-single) IPIV-A
Method: getrs (A la-matrix-double) (B la-matrix-double) IPIV-A
Method: getrs (A fa-matrix-double) (B fa-matrix-double) IPIV-A
Method: getrs (A la-matrix-single) (B la-matrix-single) IPIV-A
Method: getrs (A fa-matrix-single) (B fa-matrix-single) IPIV-A
Generic Function: iamax X

Wrapper for lapack methods %ISAMAX, %IDAMAX, %ICAMAX, %IZAMAX.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: iamax (X la-matrix-complex-double)
Method: iamax (X fa-matrix-complex-double)
Method: iamax (X la-matrix-complex-single)
Method: iamax (X fa-matrix-complex-single)
Method: iamax (X la-matrix-double)
Method: iamax (X fa-matrix-double)
Method: iamax (X la-matrix-single)
Method: iamax (X fa-matrix-single)
Generic Function: m* A B

Matrix multiplication: A * B. Defaults to the element type of the first matrix.

Better approach would be to consider lowest-common-type?

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m* (A matrix-like) (B matrix-like)
Generic Function: m+ A B

Matrix addition: A + B.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m+ (A matrix-like) (B matrix-like)
Generic Function: m- A B

Matrix subtraction: A - B.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m- (A matrix-like) (B matrix-like)
Generic Function: m.* MATA MATB

same as m+ which is inherently an element-wise
operation. How should we handle coercion? probably the right way to do this will be to consider the least specific form, and coerce back. HOWEVER, this could be done simpler by barfing (forcing explicit coercion) and this would be safer, numerically.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m.* (MATA matrix-like) (MATB matrix-like)
Generic Function: m.+ MATA MATB

same as m+ which is inherently an element-wise operation.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m.+ (MATA matrix-like) (MATB matrix-like)
Generic Function: m.- MATA MATB

same as m- which is inherently an element-wise operation.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m.- (MATA matrix-like) (MATB matrix-like)
Generic Function: m= A B

Test for strict equality of dimensions and of each matrix element of A and B.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: m= (A matrix-like) (B matrix-like)
Generic Function: make-matrix* NROWS NCOLS IMPLEMENTATION &key ELEMENT-TYPE INITIAL-ELEMENT

Create a NROWS x NCOLS matrix with IMPLEMENTATION
as underlying implementation. ELEMENT-TYPE is the lisp type to be stored in the matrix, and INITIAL-ELEMENT an element that may be used to initially fill the matrix.

If INITIAL-ELEMENT is not specified, the matrix is not initialized, and accessing its elements will thus return spurious values.

Tony notes: principle seems to be to use a function for the API, dispatching to generics for the meat of the work.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: make-matrix* NROWS NCOLS (MATRIX-IMPLEMENTATION (eql foreign-array)) &key ELEMENT-TYPE INITIAL-ELEMENT
Source

matrix-foreign-array.lisp (file)

Method: make-matrix* NROWS NCOLS (MATRIX-IMPLEMENTATION (eql lisp-array)) &key ELEMENT-TYPE INITIAL-ELEMENT
Source

matrix-lisp-array.lisp (file)

Generic Function: matrix-dimension MATRIX AXIS-NUMBER

Like ARRAY-DIMENSION for matrix-like objects.

Is it worth subclassing a set of symbols or sub-range of integers to use here, so as to not have to worry about typing, and let CLOS do error checking?

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: matrix-dimension (MATRIX matrix-like) AXIS-NUMBER
Generic Function: matrix-dimensions MATRIX

Like ARRAY-DIMENSIONS for matrix-like objects.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: matrix-dimensions (MATRIX matrix-like)
Generic Function: mref MATRIX I J

(MREF MATRIX I J) gives you the (I,J)-th element of
MATRIX. This method is slow as it requires CLOS method dispatch and index calculation(s), and should thus be replaced with vectorized or block operations whenever possible.

Package

lisp-matrix

Source

matrix.lisp (file)

Writer

(setf mref) (generic function)

Methods
Method: mref (MATRIX fa-simple-matrix-complex-double) I J
Source

matrix-foreign-array.lisp (file)

Method: mref (MATRIX fa-simple-matrix-complex-single) I J
Source

matrix-foreign-array.lisp (file)

Method: mref (MATRIX fa-simple-matrix-double) I J
Source

matrix-foreign-array.lisp (file)

Method: mref (MATRIX fa-simple-matrix-single) I J
Source

matrix-foreign-array.lisp (file)

Method: mref (MATRIX la-matrix) I J
Source

matrix-lisp-array.lisp (file)

Method: mref (MATRIX slice-vecview) I J
Source

vector.lisp (file)

Method: mref (MAT diagonal-vecview) I J
Source

vector.lisp (file)

Method: mref (MATRIX strided-matview) I J
Method: mref (MATRIX window-matview) I J
Method: mref (MATRIX transpose-matview) I J
Generic Function: (setf mref) VALUE MATRIX I J

Set the (I,J)-th element of MATRIX to VALUE. This
method is slow as it requires CLOS method dispatch and index calculation(s), and should thus be replaced with vectorized or block operations whenever possible.

Package

lisp-matrix

Source

matrix.lisp (file)

Reader

mref (generic function)

Methods
Method: (setf mref) VALUE (MATRIX fa-simple-matrix-complex-double) I J
Source

matrix-foreign-array.lisp (file)

Method: (setf mref) VALUE (MATRIX fa-simple-matrix-complex-single) I J
Source

matrix-foreign-array.lisp (file)

Method: (setf mref) VALUE (MATRIX fa-simple-matrix-double) I J
Source

matrix-foreign-array.lisp (file)

Method: (setf mref) VALUE (MATRIX fa-simple-matrix-single) I J
Source

matrix-foreign-array.lisp (file)

Method: (setf mref) VALUE (MATRIX la-matrix) I J
Source

matrix-lisp-array.lisp (file)

Method: (setf mref) VALUE (MATRIX strided-matview) I J
Method: (setf mref) VALUE (MATRIX window-matview) I J
Method: (setf mref) VALUE (MATRIX transpose-matview) I J
Generic Function: ncols MATRIX

Number of columns in the matrix.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: ncols (MATRIX-LIKE matrix-like)

automatically generated reader method

Generic Function: nelts MATRIX

Default method for computing the number of elements
of a matrix. For obvious reasons, this will be overridden for subclasses that implement sparse matrices. The main purpose of this is to estimate size and memory requirements.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: nelts (MATRIX matrix-like)
Generic Function: nrm2 X

Wrapper for lapack methods %SNRM2, %DNRM2, %SCNRM2, %DZNRM2.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: nrm2 (X la-matrix-complex-double)
Method: nrm2 (X fa-matrix-complex-double)
Method: nrm2 (X la-matrix-complex-single)
Method: nrm2 (X fa-matrix-complex-single)
Method: nrm2 (X la-matrix-double)
Method: nrm2 (X fa-matrix-double)
Method: nrm2 (X la-matrix-single)
Method: nrm2 (X fa-matrix-single)
Generic Function: nrows MATRIX

Number of rows in the matrix.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: nrows (MATRIX-LIKE matrix-like)

automatically generated reader method

Generic Function: offset MATRIX

Offset of the first element of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: offset (SLICE-VECVIEW slice-vecview)

automatically generated reader method

Source

vector.lisp (file)

Method: offset (MATRIX matrix-like)
Generic Function: orientation MATRIX

lisp-matrix objects are stored by default in
column-major order for compatibility with the BLAS and LAPACK, which are Fortran-based.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: orientation (MATRIX transpose-matview)
Method: orientation (MATRIX matview)
Method: orientation (MATRIX matrix-like)
Generic Function: parent MATRIX

For a MATVIEW matrix, returns the parent matrix to which this matrix view relates.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: parent (VECVIEW vecview)

The "parent" object to which this vector view relates.

Source

vector.lisp (file)

Method: parent (MATRIX matrix-like)
Method: parent (MATVIEW matview)

The "parent" object to which this matrix view relates.

Generic Function: potrf A

Wrapper for lapack methods %SPOTRF, %DPOTRF, %CPOTRF, %ZPOTRF.

Package

lisp-matrix

Source

lapack-cholesky.lisp (file)

Methods
Method: potrf (A la-matrix-complex-double)
Method: potrf (A fa-matrix-complex-double)
Method: potrf (A la-matrix-complex-single)
Method: potrf (A fa-matrix-complex-single)
Method: potrf (A la-matrix-double)
Method: potrf (A fa-matrix-double)
Method: potrf (A la-matrix-single)
Method: potrf (A fa-matrix-single)
Generic Function: potri A

Wrapper for lapack methods %SPOTRI, %DPOTRI, %CPOTRI, %ZPOTRI.

Package

lisp-matrix

Source

lapack-cholesky.lisp (file)

Methods
Method: potri (A la-matrix-complex-double)
Method: potri (A fa-matrix-complex-double)
Method: potri (A la-matrix-complex-single)
Method: potri (A fa-matrix-complex-single)
Method: potri (A la-matrix-double)
Method: potri (A fa-matrix-double)
Method: potri (A la-matrix-single)
Method: potri (A fa-matrix-single)
Generic Function: potrs A B IPIV-A

Wrapper for lapack methods %SPOTRS, %DPOTRS, %CPOTRS, %ZPOTRS.

Package

lisp-matrix

Source

lapack-cholesky.lisp (file)

Methods
Method: potrs (A la-matrix-complex-double) (B la-matrix-complex-double) IPIV-A
Method: potrs (A fa-matrix-complex-double) (B fa-matrix-complex-double) IPIV-A
Method: potrs (A la-matrix-complex-single) (B la-matrix-complex-single) IPIV-A
Method: potrs (A fa-matrix-complex-single) (B fa-matrix-complex-single) IPIV-A
Method: potrs (A la-matrix-double) (B la-matrix-double) IPIV-A
Method: potrs (A fa-matrix-double) (B fa-matrix-double) IPIV-A
Method: potrs (A la-matrix-single) (B la-matrix-single) IPIV-A
Method: potrs (A fa-matrix-single) (B fa-matrix-single) IPIV-A
Generic Function: real-stride VECTOR

Return the stride that VECTOR has when considering
the ancestor matrix as base. If VECTOR is constructed so that it has no simple stride (for example a slice on a windowed matrix considered as a vector may have a different stride when jumping columns of the matrix), then return NIL.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: real-stride (VECTOR matrix-like)
Method: real-stride (VECTOR matview)

For MATVIEW vectors, in the general case I don’t know how to compute the real stride.

Method: real-stride (VECTOR transpose-matview)
Method: real-stride (VECTOR slice-vecview)
Generic Function: row MATRIX I

Return a view on a given row of MATRIX.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: row (MATRIX matrix-like) (I integer)
Method: row (MATRIX transpose-matview) (I integer)
Method: row (MATRIX window-matview) (I integer)
Method: row (MATRIX strided-matview) (I integer)
Generic Function: row-offset OBJECT
Package

lisp-matrix

Methods
Method: row-offset (MAT matrix-like)

If we are not specialize, then we need to consider that we no longer need to think about anything but 0.

Source

matrix.lisp (file)

Method: row-offset (WINDOW-MATVIEW window-matview)

automatically generated reader method

Source

matrix.lisp (file)

Generic Function: row-stride OBJECT
Package

lisp-matrix

Methods
Method: row-stride (STRIDED-MATVIEW strided-matview)

Stride in the row direction

Source

matrix.lisp (file)

Generic Function: row-vector-p MATRIX
Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: row-vector-p (MATRIX matrix-like)

A general matrix cannot be a row vector. We will arrange for functions building matrices to return row vectors when appropriate.

Method: row-vector-p (MATRIX vector-like)
Generic Function: scal ALPHA X

Wrapper for lapack methods %SSCAL, %DSCAL, %CSCAL, %ZSCAL.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Methods
Method: scal ALPHA (X la-vector-double)
Method: scal ALPHA (X la-matrix-complex-double)
Method: scal ALPHA (X fa-matrix-complex-double)
Method: scal ALPHA (X la-matrix-complex-single)
Method: scal ALPHA (X fa-matrix-complex-single)
Method: scal ALPHA (X la-matrix-double)
Method: scal ALPHA (X fa-matrix-double)
Method: scal ALPHA (X la-matrix-single)
Method: scal ALPHA (X fa-matrix-single)
Generic Function: slice MATRIX &key OFFSET STRIDE NELTS TYPE

Create a slice view of MATRIX. To be precise, this
results in a vector (matrix subclass) which is done by
:type : output shape (:column or :row)
:offset : number of observations (in col/row major matrix-dependent order) to skip over before starting extraction
:stride : index increment between current and next element, i.e. 0 = repeat same value; 1, as ordered, 2 every other, etc...
one of the challenges is that this seems to prefer col-oriented matrices, but we need to know whether we are column- or row- oriented. Perhaps we should be checking so to decide how to walk down the matrix?

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: slice (MATRIX transpose-matview) &key OFFSET STRIDE NELTS TYPE

For transposed matrices, the storage is the same, so we can slice its parent with the same arguments.

Method: slice (MATRIX slice-vecview) &key OFFSET STRIDE NELTS TYPE

If MATRIX is a SLICE-VECVIEW, we can directly slice its parents by slightly modifying the parameters.

Method: slice MATRIX &key OFFSET STRIDE NELTS TYPE
Generic Function: strides MATRIX &key NROWS NCOLS ROW-OFFSET COL-OFFSET ROW-STRIDE COL-STRIDE

Creates a strided view of the given matrix-like
object MATRIX. The resulting matrix may be a WINDOW-MATVIEW, a STRIDED-MATVIEW or a SLICE-VECVIEW depending on the parameters.

FIXME: consider a variant of this which allows for vector-recycling of the strides specification. For example, #(1 2) will do the right indexing until the matrix range/indicies are exhausted. This is good for data manipulation but not clear if the right motif for numerics.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: strides (MATRIX matrix-like) &key NROWS NCOLS ROW-OFFSET COL-OFFSET ROW-STRIDE COL-STRIDE
Method: strides (MATRIX window-matview) &key NROWS NCOLS ROW-OFFSET COL-OFFSET ROW-STRIDE COL-STRIDE

A strided view on a windowed view is the same as a window on its parent but with modified parameters.

Method: strides (MATRIX strided-matview) &key NROWS NCOLS ROW-OFFSET COL-OFFSET ROW-STRIDE COL-STRIDE

A strided view on a strided view is the same as a stride on its parent but with modified parameters.

Generic Function: transpose-class MATRIX

Return the name of the class to be used for a transpose of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: transpose-class (MATRIX fa-vector-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-vector-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-vector-double)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-vector-single)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX fa-matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: transpose-class (MATRIX la-vector-t)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-integer)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-complex-double)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-complex-double)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-complex-single)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-complex-single)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-double)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-double)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-vector-single)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX la-matrix-single)
Source

matrix-lisp-array.lisp (file)

Method: transpose-class (MATRIX vector-like)
Source

vector.lisp (file)

Method: transpose-class (MATRIX matrix-like)
Generic Function: transpose-matrix MATRIX

Creates a transpose view of the given matrix-like
object MATRIX. Returns the original matrix if transposed two times.

General approach is to ensure that we only change the class, not the matrix itself, and we rely on reference semantics for this to happen.

(FIXME: is that a good idea? It is probably ok since TRANSPOSE does not copy the data anyway; if we want a copy, we do it explicitly.)

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: transpose-matrix (MATRIX matrix-like)
Method: transpose-matrix (MATRIX transpose-matview)
Generic Function: transposed-p MATRIX

Is MATRIX a transposed view of its ancestor matrix?

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: transposed-p (MATRIX matrix-like)
Method: transposed-p (MATRIX matview)
Method: transposed-p (MATRIX transpose-matview)
Generic Function: unit-strides-p MATRIX

Tests for "unit stride." (The strided matrix view
is the only view which causes itself and its children possibly not to have unit stride.)

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: unit-strides-p (MATRIX slice-vecview)
Source

vector.lisp (file)

Method: unit-strides-p (MATRIX matrix-like)
Method: unit-strides-p (MATRIX matview)
Method: unit-strides-p (MATRIX strided-matview)
Generic Function: v* X Y &optional RETURN-TYPE

add a vector-like, vector, or list and return in a vector-like structure unless return-type is something else

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v* (X vector-like) (Y vector-like) &optional RETURN-TYPE
Method: v* (X vector-like) (Y vector) &optional RETURN-TYPE
Method: v* (X vector) (Y vector-like) &optional RETURN-TYPE
Method: v* (X vector-like) (Y list) &optional RETURN-TYPE
Method: v* (X list) (Y vector-like) &optional RETURN-TYPE
Generic Function: v+ X Y &optional RETURN-TYPE

add a vector-like, vector, or list and return in a vector-like structure unless return-type is something else

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v+ (X vector-like) (Y vector-like) &optional RETURN-TYPE
Method: v+ (X vector-like) (Y vector) &optional RETURN-TYPE
Method: v+ (X vector) (Y vector-like) &optional RETURN-TYPE
Method: v+ (X vector-like) (Y list) &optional RETURN-TYPE
Method: v+ (X list) (Y vector-like) &optional RETURN-TYPE
Generic Function: v- X Y &optional RETURN-TYPE

add a vector-like, vector, or list and return in a vector-like structure unless return-type is something else

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v- (X vector-like) (Y vector-like) &optional RETURN-TYPE
Method: v- (X vector-like) (Y vector) &optional RETURN-TYPE
Method: v- (X vector) (Y vector-like) &optional RETURN-TYPE
Method: v- (X vector-like) (Y list) &optional RETURN-TYPE
Method: v- (X list) (Y vector-like) &optional RETURN-TYPE
Generic Function: v/ X Y &optional RETURN-TYPE

add a vector-like, vector, or list and return in a vector-like structure unless return-type is something else

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v/ (X vector-like) (Y vector-like) &optional RETURN-TYPE
Method: v/ (X vector-like) (Y vector) &optional RETURN-TYPE
Method: v/ (X vector) (Y vector-like) &optional RETURN-TYPE
Method: v/ (X vector-like) (Y list) &optional RETURN-TYPE
Method: v/ (X list) (Y vector-like) &optional RETURN-TYPE
Generic Function: v= X Y

Test for equality of both number of elements and
of the elements themselves, for the two vectors X and Y.

A row vector and a column vector with the same number of elements are equal. To distinguish them, use M= instead.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v= (A vector-like) (B vector-like)
Generic Function: vector-dimension VECTOR

Like ARRAY-DIMENSION for vector-like objects. One can also used ARRAY-DIMENSION as well

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: vector-dimension (VECTOR vector-like)
Generic Function: vref VECTOR I

Return the I-th element of VECTOR. This method is
slow as it requires CLOS method dispatch and index calculation(s), and should thus be replaced with vectorized or block operations whenever possible

Package

lisp-matrix

Source

vector.lisp (file)

Writer

(setf vref) (generic function)

Methods
Method: vref (VECTOR fa-simple-matrix-complex-double) I
Source

matrix-foreign-array.lisp (file)

Method: vref (VECTOR fa-simple-matrix-complex-single) I
Source

matrix-foreign-array.lisp (file)

Method: vref (VECTOR fa-simple-matrix-double) I
Source

matrix-foreign-array.lisp (file)

Method: vref (VECTOR fa-simple-matrix-single) I
Source

matrix-foreign-array.lisp (file)

Method: vref (VECTOR la-matrix) I

We define VREF on LA-MATRIX instead of directly on LA-VECTOR since we can view a matrix as its underlying vector.

Source

matrix-lisp-array.lisp (file)

Method: vref (MATRIX matview) I
Method: vref (VECTOR slice-vecview) I
Method: vref (VEC diagonal-vecview) I
Method: vref (VECTOR transpose-vecview) I
Generic Function: (setf vref) VALUE VECTOR I

Set the I-th element of VECTOR to VALUE. This
method is slow as it requires CLOS method dispatch and index calculation(s), and should thus be replaced with vectorized or block operations whenever possible.

Package

lisp-matrix

Source

vector.lisp (file)

Reader

vref (generic function)

Methods
Method: (setf vref) VALUE (VECTOR fa-simple-matrix-complex-double) I
Source

matrix-foreign-array.lisp (file)

Method: (setf vref) VALUE (VECTOR fa-simple-matrix-complex-single) I
Source

matrix-foreign-array.lisp (file)

Method: (setf vref) VALUE (VECTOR fa-simple-matrix-double) I
Source

matrix-foreign-array.lisp (file)

Method: (setf vref) VALUE (VECTOR fa-simple-matrix-single) I
Source

matrix-foreign-array.lisp (file)

Method: (setf vref) VALUE (VECTOR la-matrix) I

We define (SETF VREF) on LA-MATRIX instead of directly on LA-VECTOR since we can view a matrix as its underlying vector.

Source

matrix-lisp-array.lisp (file)

Method: (setf vref) VALUE (VECTOR slice-vecview) I
Method: (setf vref) VALUE (VEC diagonal-vecview) I
Method: (setf vref) VALUE (VECTOR transpose-vecview) I
Generic Function: window MATRIX &key NROWS NCOLS ROW-OFFSET COL-OFFSET

Creates a window view of the given matrix-like
object MATRIX. Note that window views ALWAYS have the same orientation as their parents.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: window (MATRIX matrix-like) &key NROWS NCOLS ROW-OFFSET COL-OFFSET
Generic Function: window-class MATRIX

Return the name of the class to be used for a window of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: window-class (MATRIX fa-matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: window-class (MATRIX fa-matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: window-class (MATRIX fa-matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: window-class (MATRIX fa-matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: window-class (MATRIX la-matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-complex-double)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-complex-single)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-double)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX la-matrix-single)
Source

matrix-lisp-array.lisp (file)

Method: window-class (MATRIX matrix-like)
Generic Function: zero-offset-p MATRIX

Has MATRIX a zero offset (as for window and stride views)?

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: zero-offset-p (MATRIX slice-vecview)
Source

vector.lisp (file)

Method: zero-offset-p (MATRIX matrix-like)
Method: zero-offset-p (MATRIX matview)
Method: zero-offset-p (MATRIX window-matview)

Next: , Previous: , Up: Exported definitions   [Contents][Index]

6.1.5 Classes

Class: fa-simple-matrix-double ()

Dense matrix holding elements of type DOUBLE-FLOAT, implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

fa-matrix-double (class)

Direct subclasses

fa-simple-vector-double (class)

Direct methods
Direct slots
Slot: data

The FNV object holding the elements.

Type

org.middleangle.foreign-numeric-vector:fnv-double

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: fa-simple-vector-double ()

Dense vector holding elements of type DOUBLE-FLOAT, implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: la-simple-matrix-complex-double ()

Dense matrix holding elements of type (COMPLEX DOUBLE-FLOAT), implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-complex-double (class)

Direct subclasses

la-simple-vector-complex-double (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array (complex double-float) (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-matrix-complex-single ()

Dense matrix holding elements of type (COMPLEX SINGLE-FLOAT), implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-complex-single (class)

Direct subclasses

la-simple-vector-complex-single (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array (complex single-float) (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-matrix-double ()

Dense matrix holding elements of type DOUBLE-FLOAT, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-double (class)

Direct subclasses

la-simple-vector-double (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array double-float (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-matrix-fixnum ()

Dense matrix holding elements of type FIXNUM, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-fixnum (class)

Direct subclasses

la-simple-vector-fixnum (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array fixnum (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-matrix-integer ()

Dense matrix holding elements of type INTEGER, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-integer (class)

Direct subclasses

la-simple-vector-integer (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array integer (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-matrix-single ()

Dense matrix holding elements of type SINGLE-FLOAT, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-single (class)

Direct subclasses

la-simple-vector-single (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array single-float (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-vector-complex-double ()

Dense vector holding elements of type (COMPLEX DOUBLE-FLOAT), implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-simple-vector-complex-single ()

Dense vector holding elements of type (COMPLEX SINGLE-FLOAT), implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-simple-vector-double ()

Dense vector holding elements of type DOUBLE-FLOAT, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-simple-vector-integer ()

Dense vector holding elements of type INTEGER, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-simple-vector-single ()

Dense vector holding elements of type SINGLE-FLOAT, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-complex-double ()

Slice view of a LA-SIMPLE-VECTOR-COMPLEX-DOUBLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-complex-single ()

Slice view of a LA-SIMPLE-VECTOR-COMPLEX-SINGLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-double ()

Slice view of a LA-SIMPLE-VECTOR-DOUBLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-integer ()

Slice view of a LA-SIMPLE-VECTOR-INTEGER vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-single ()

Slice view of a LA-SIMPLE-VECTOR-SINGLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: matrix-like ()

Abstract base class for 2-D matrices and matrix
views. We assume for now that matrices are stored in column order (Fortran style), for BLAS and LAPACK compatibility.
There is NO DATA in the base class! (storage only comes with derived classes). Matrix-like data only has nrows/ncols as essential data – derived classes will have additional slots.

However, we insist that the xarray API be usable here. REQUIREMENT, not a suggestion.

Package

lisp-matrix

Source

matrix.lisp (file)

Direct superclasses

standard-object (class)

Direct subclasses
Direct methods
Direct slots
Slot: nrows
Initargs

:nrows

Initform

0

Readers

nrows (generic function)

Slot: ncols
Initargs

:ncols

Initform

0

Readers

ncols (generic function)

Class: strided-matview ()

A STRIDED-MATVIEW views a window of the matrix with
a particular stride in each direction (the stride can be different in each direction).

Package

lisp-matrix

Source

matrix.lisp (file)

Direct superclasses

window-matview (class)

Direct subclasses
Direct methods
Direct slots
Slot: row-stride

Stride in the row direction

Initargs

:row-stride

Initform

1

Readers

row-stride (generic function)

Slot: col-stride

Stride in the column direction

Initargs

:col-stride

Initform

1

Readers

col-stride (generic function)

Class: vector-like ()

Abstract base class for 1-D vectors and vector views. Subclasses from the matrix-like superclass

Package

lisp-matrix

Source

vector.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: window-matview ()

A WINDOW-MATVIEW views a block of elements in the
underlying matrix that is conceptually 2-D contiguous. If the underlying matrix is column-oriented, the elements in each column of a WINDOW-MATVIEW are stored contiguously, and horizontally adjacent elements are separated by a constant stride ("LDA" in BLAS terms). (vice-verse for row-oriented).

Tony adds: the basic idea is to offset row and column; we don’t make the size any smaller, i.e. by adding max row/column, or # rows/cols.

Package

lisp-matrix

Source

matrix.lisp (file)

Direct superclasses

matview (class)

Direct subclasses
Direct methods
Direct slots
Slot: row-offset
Initargs

:row-offset

Initform

0

Readers

row-offset (generic function)

Slot: col-offset
Initargs

:col-offset

Initform

0

Readers

col-offset (generic function)


Previous: , Up: Exported definitions   [Contents][Index]

6.1.6 Types

Type: complex-double ()
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Type: double ()
Package

lisp-matrix

Source

matrix-implementations.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

6.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.1 Special variables

Special Variable: *fnv-type-table*
Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Special Variable: *la-default-value-table*

Table of default element types.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Special Variable: *type-table*

Table with information about lisp-matrix types, which are used in the class names of typed matrices and correspond to their element type.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.2 Macros

Macro: call-with-work (LWORK WORK TYPE) CALL

This macro computes the needed workspace, and then recalls the function with the correct-sized array (appropriately allocated). lwork, work are the appropriate symbols, and type should be the replaceable type from def-lapack-method.

Package

lisp-matrix

Source

lapack-methods.lisp (file)

Macro: construct-fa-matrix ELEMENT-TYPE
Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Macro: construct-la-matrix ELEMENT-TYPE DEFAULT-VALUE

Construct a matrix class holding elements of type ELEMENT-TYPE based on lisp arrays.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Macro: def-lapack-method NAME-AND-OPTIONS (&rest LAMBDA-LIST) &body BODY

Define methods for supported datatypes for the lapack method named NAME. The symbols !FUNCTION, !DATA-TYPE, and !MATRIX-TYPE are respectively bound to the actual lapack function to be called from the package CL-BLAPACK, the data type (float, double, complex-float or complex-double), and the corresponding abstract matrix
type (e.g. matrix-double-like).

NAME-AND-OPTIONS is either: NAME, or (NAME &KEY FUNCTION-NAMES).

If FUNCTION-NAMES is not set, the names are automatically generated by prepending NAME by the character #\% and one of the characters ’(#\s #\d #\c #\z) which correspond to the data types supported by fortran. If one function name does not exist, it is ignored so it is safe to use this for example for xDOT which has only %SDOT and %DDOT as functions. If FUNCTION-NAMES is set, then it is a list where each element is of the form (FUNCTION-NAME TYPE) where FUNCTION-NAME is the symbol to use for the function to call, and TYPE is the lisp type to use, which is one of ’(single-float double-float (complex double-float) (complex single-float)).

See for example the definition of GEMM for how to use this macro.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Macro: def-lisp-matrix-type NAME LISP-TYPE &key CFFI-TYPE

Define a new lisp-matrix type of name NAME from the lisp type TYPE.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Macro: def-m*-test NAME A B
Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: define-abstract-class CLASSNAME SUPER-LIST &body BODY

A wrapper for DEFCLASS that lets you define abstract base classes.
If you try to instantiate an object of this class, a warning is signaled.

Package

lisp-matrix

Source

macros.lisp (file)

Macro: for-all-implementations &body BODY
Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: for-implementations (&rest IMPLEMENTATIONS) &body BODY

Execute BODY for each implementation in IMPLEMENTATIONS.

Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: make-matrix-class-hierarchy IMPLEMENTATION ELEMENT-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Macro: make-vector-class-hierarchy IMPLEMENTATION ELEMENT-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Macro: silly-test B2 B5
Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: silly-test2 B2 B5
Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: test-matrix-size MATRIX N M

test all size functions of MATRIX against N and M

Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Macro: with-copies (&rest FORMS) RESULT &body BODY

Each form in FORMS is a lambda-list defined as (VARIABLE PREDICATE &optional COPY-BACK-P). VARIABLE is a symbol bound to a matrix, that is to be copied if the predicate obtained from PREDICATE applied to the matrix is true. All variables are bound
to (possible) copies of the original matrices, and body is executed. After that, variables for which COPY-BACK-P is true are copied back to the original matrices, and the evaluation of RESULT is returned with the variables bound to the original matrices. (and hence are destructive variants of the methods).

The PREDICATE value may be constructed as follows: a symbol whose f-value is a function of one argument; a list whose car is ’OR and whose CDR is a list of predicates; a list whose car is ’AND and whose CDR is a list of predicates; T; NIL.

See the file ‘lapack-methods.lisp’ for examples of use.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Macro: with-pinned-arrays (&rest ARRAYS) &body BODY

Make sure that every array will not be moved by the GC in ARRAYS is pinned during the execution of BODY.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Macro: with-pinned-copies (&rest FORMS) RESULT &body BODY

Same as WITH-COPIES, but make sure that the arrays obtained after eventual copying are pinned while executing BODY.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Macro: with-typed-values (&rest BINDINGS) MATRIX &body BODY

Each binding in BINDINGS is of the form (VARIABLE VALUE). VARIABLE is bound to VALUE coerced to the element type of MATRIX.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Macro: with-unique-names (&rest BINDINGS) &body BODY

Evaluate BODY with BINDINGS bound to fresh unique symbols.

Syntax: WITH-UNIQUE-NAMES ( [ var | (var x) ]* ) declaration* form*

Executes a series of forms with each VAR bound to a fresh, uninterned symbol. The uninterned symbol is as if returned by a call to GENSYM with the string denoted by X - or, if X is not supplied, the string denoted by VAR - as argument.

The variable bindings created are lexical unless special declarations are specified. The scopes of the name bindings and declarations do not include the Xs.

The forms are evaluated in order, and the values of all but the last are discarded (that is, the body is an implicit PROGN).

Package

lisp-matrix-unittests

Source

unittests.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.3 Functions

Function: %clean-lambda-list LAMBDA-LIST

Helper for DEF-LAPACK-METHOD.

Clean LAMBDA-LIST so that it can be the lambda-list of a generic function.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: %get-functions NAME-AND-OPTIONS

Used in DEF-LAPACK-METHOD.

NAME-AND-OPTIONS is either: NAME, or (NAME &KEY FUNCTION-NAMES).

If FUNCTION-NAMES is not set, the names are automatically generated by prepending NAME by the character #\% and one of the characters ’(#\s #\d #\c #\z) which correspond to the data types supported by fortran. If one function name does not exist, it is ignored so it is safe to use this for example for xDOT which has only %SDOT and %DDOT as functions. If FUNCTION-NAMES is set, then it is a list where each element is of the form (FUNCTION-NAME TYPE) where FUNCTION-NAME is the symbol to use for the function to call, and TYPE is the lisp type to use, which is one of ’(single-float double-float (complex double-float) (complex single-float)).

Example use:
(%get-functions ’gemm)
(%get-functions ’(nrm2 :function-names
((%snrm2 single-float)
(%dnrm2 double-float)
(%scnrm2 (complex single-float))
(%dznrm2 (complex double-float)))))

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: %get-name NAME-AND-OPTIONS

Used in DEF-LAPACK-METHOD.

NAME-AND-OPTIONS is either: NAME, or (NAME &KEY FUNCTION-NAMES).

Returns NAME.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: add-la-default-value ELEMENT-TYPE VALUE

Add VALUE as default value for ELEMENT-TYPE.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Function: add-type &key LISP-TYPE LISP-MATRIX-TYPE CFFI-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: check-info INFO FUNCTION-NAME
Package

lisp-matrix

Source

lapack-methods.lisp (file)

Function: check-m* A B
Package

lisp-matrix-unittests

Source

unittests-matrix-lapack.lisp (file)

Function: copy-type-info INSTANCE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: define-implementation KEYWORD SHORT-NAME

Define an implementation named KEYWORD and with SHORT-NAME (a string) as abbreviated name.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: element-type->fnv-type ELEMENT-TYPE

Return the FNV type corresponding to ELEMENT-TYPE.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Function: fnv-type->element-type FNV-TYPE

Return the lisp type corresponding to FNV-TYPE.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Function: gen-integer &key MAX MIN

Returns a generator which produces random integers greater than or equal to MIN and less than or equal to MIN.

Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Function: implementation-short-name IMPLEMENTATION
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: la-default-value ELEMENT-TYPE

Default value for a given ELEMENT-TYPE.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Function: la-matrix->pointer MATRIX
Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: la-matrix-class ELEMENT-TYPE &optional TYPE

Return the LA-MATRIX class name corresponding to ELEMENT-TYPE.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Function: la-vector-class ELEMENT-TYPE &optional TYPE

Return the LA-VECTOR class name corresponding to ELEMENT-TYPE.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Function: least-squares-gelsy X Y

Solves:
X beta = Y, for beta.

Package

lisp-matrix

Source

lapack-ls.lisp (file)

Function: lisp-matrix-type->lisp-type LISP-MATRIX-TYPE

Return the lisp type corresponding to LISP-MATRIX-TYPE.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: lisp-matrix-type-info LISP-MATRIX-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: lisp-matrix-type-size LISP-MATRIX-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: lisp-type->lisp-matrix-type LISP-TYPE

Return the LISP-MATRIX-TYPE corresponding to the lisp type LISP-TYPE.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: lisp-type-info LISP-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: lisp-type-size LISP-TYPE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: make-symbol* &rest ARGS

build a symbol by concatenating each element of ARGS, and intern it in the current package. Elements can be strings or symbols.

Package

lisp-matrix

Source

utils.lisp (file)

Function: make-type-info &key (LISP-TYPE LISP-TYPE) (LISP-MATRIX-TYPE LISP-MATRIX-TYPE) (CFFI-TYPE CFFI-TYPE) (SIZE SIZE)
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: matrix-class CLASS-TYPE &optional IMPLEMENTATION ELEMENT-TYPE

Return the matrix class name corresponding to CLASS-TYPE. When IMPLEMENTATION-SHORTNAME is given, it gives the class for the given implementation, and when ELEMENT-TYPE-SHORTNAME is given, a specialized class for that element type.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: orientation->letter ORIENTATION

Return the LAPACK letter corresponding to ORIENTATION.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: orientation-letter MATRIX

Return the LAPACK letter corresponding to the orientation of MATRIX.

Package

lisp-matrix

Source

lapack-utils.lisp (file)

Function: random-array N M

Return a random 2D array of size N x M. Useful as input into a make-matrix initial contents, reproducible if we set seed initially.

Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Function: type-info-cffi-type INSTANCE
Function: (setf type-info-cffi-type) VALUE INSTANCE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: type-info-lisp-matrix-type INSTANCE
Function: (setf type-info-lisp-matrix-type) VALUE INSTANCE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: type-info-lisp-type INSTANCE
Function: (setf type-info-lisp-type) VALUE INSTANCE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: type-info-p OBJECT
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: type-info-size INSTANCE
Function: (setf type-info-size) VALUE INSTANCE
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Function: vector-class CLASS-TYPE &optional IMPLEMENTATION ELEMENT-TYPE

Return the vector class name corresponding to CLASS-TYPE. When IMPLEMENTATION-SHORTNAME is given, it gives the class for the given implementation, and when ELEMENT-TYPE-SHORTNAME is given, a specialized class for that element type.

Package

lisp-matrix

Source

matrix-implementations.lisp (file)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.4 Generic functions

Generic Function: ancestor MATRIX

For a MATVIEW matrix, return the ancestor matrix to which this matrix view relates.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: ancestor (MATRIX matrix-like)
Method: ancestor (MATRIX matview)
Generic Function: check-invariant VECTOR

Check the class invariant of VECTOR, namely that it has one column or one row.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: check-invariant (VECTOR vector-like)
Generic Function: eigensystems X

Compute the eigenvectors and values of X.

Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Methods
Method: eigensystems (X matrix-like)
Generic Function: element-type MATRIX

Type of the elements of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: element-type (MATRIX matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: element-type (MATRIX matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: element-type (MATRIX matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: element-type (MATRIX matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: element-type (MATRIX matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: element-type (MATRIX matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: element-type (MATRIX matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: element-type (MATRIX matview)
Generic Function: element-type-size MATRIX

Size in memory of the elements of MATRIX (useful
for pointer arithmetic when calling foreign functions).

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: element-type-size (MATRIX matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: element-type-size (MATRIX matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: element-type-size (MATRIX matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: element-type-size (MATRIX matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: element-type-size (MATRIX matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: element-type-size (MATRIX matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: element-type-size (MATRIX matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Generic Function: factorization-type OBJECT
Package

lisp-matrix

Methods
Method: factorization-type (FACTORIZED-MATRIX-RESULTS factorized-matrix-results)

automatically generated reader method

Source

numerical-linear-algebra.lisp (file)

Generic Function: factorize A &key BY

matrix decomposition, M -> SVD/LU/AtA etc.
FIXME: do we want a default type? If BY is NIL then return A untouched.

Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Methods
Method: factorize (A matrix-like) &key BY
Generic Function: factorized-matrix A

Return the matrix (and not the structure). The
latter is the standard result from factorization routine.

Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Methods
Method: factorized-matrix (A factorized-matrix-results)
Method: factorized-matrix (A matrix-like)
Generic Function: gesvd A

Wrapper for lapack methods %SGESVD, %DGESVD.

Package

lisp-matrix

Source

lapack-svd.lisp (file)

Methods
Method: gesvd (A la-matrix-double)
Method: gesvd (A fa-matrix-double)
Method: gesvd (A la-matrix-single)
Method: gesvd (A fa-matrix-single)
Generic Function: implementation MATRIX

Underlying implementation of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: implementation (MATRIX fa-matrix)
Source

matrix-foreign-array.lisp (file)

Method: implementation (MATRIX la-matrix)
Source

matrix-lisp-array.lisp (file)

Method: implementation (MATRIX matview)
Generic Function: invert A &optional BY

compute inverse of A using the appropriate factorization.

Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Methods
Method: invert (A factorized-matrix-results) &optional BY
Method: invert (A matrix-like) &optional BY
Generic Function: least-squares Y X &key W

Compute the (weighted/generalized) least-squares solution B to W(Y-XB)

Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Methods
Method: least-squares (Y vector-like) (X matrix-like) &key W
Generic Function: m./ MATA MATB

same as m+ which is inherently an element-wise
operation. How should we handle coercion? probably the right way to do this will be to consider the least specific form, and coerce back. HOWEVER, this could be done simpler by barfing (forcing explicit coercion) and this would be safer, numerically.

Package

lisp-matrix

Source

matrix-operations.lisp (file)

Methods
Method: m./ (MATA matrix-like) (MATB matrix-like)
Generic Function: make-fa-matrix NROWS NCOLS FNV-TYPE &key INITIAL-ELEMENT

Same as MAKE-MATRIX*, but specific to matrix of implementation :FOREIGN-ARRAY and specialize on FNV-TYPE.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Methods
Method: make-fa-matrix NROWS NCOLS (FNV-TYPE (eql complex-double)) &key INITIAL-ELEMENT
Method: make-fa-matrix NROWS NCOLS (FNV-TYPE (eql complex-float)) &key INITIAL-ELEMENT
Method: make-fa-matrix NROWS NCOLS (FNV-TYPE (eql double)) &key INITIAL-ELEMENT
Method: make-fa-matrix NROWS NCOLS (FNV-TYPE (eql float)) &key INITIAL-ELEMENT
Generic Function: matview-p MATRIX

Is MATRIX a MATVIEW?

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: matview-p (MATRIX matrix-like)
Method: matview-p (MATRIX matview)
Generic Function: real-ncols MATRIX

Return the actual number of columns of the matrix
into which MATRIX is stored, i.e. the number of columns of the ancestor of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: real-ncols (MATRIX matrix-like)
Method: real-ncols (MATRIX matview)
Generic Function: real-nelts MATRIX

Return the actual number of elements of the vector
in which MATRIX is stored, namely the number of columns of the ancestor of MATRIX.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: real-nelts (MATRIX matrix-like)
Method: real-nelts (MATRIX matview)
Generic Function: real-nrows MATRIX

Return the actual number of rows of the matrix into
which MATRIX is stored, i.e. the number of rows of the ancestor of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: real-nrows (MATRIX matrix-like)
Method: real-nrows (MATRIX matview)
Generic Function: results OBJECT
Package

lisp-matrix

Methods
Method: results (FACTORIZED-MATRIX-RESULTS factorized-matrix-results)

automatically generated reader method

Source

numerical-linear-algebra.lisp (file)

Generic Function: slice-class MATRIX

Return the name of the class to be used for a slice of MATRIX.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: slice-class (MATRIX fa-matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: slice-class (MATRIX fa-matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: slice-class (MATRIX fa-matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: slice-class (MATRIX fa-matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: slice-class (MATRIX la-matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-complex-double)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-complex-single)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-double)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX la-matrix-single)
Source

matrix-lisp-array.lisp (file)

Method: slice-class (MATRIX matrix-like)
Generic Function: stride OBJECT
Package

lisp-matrix

Methods
Method: stride (SLICE-VECVIEW slice-vecview)

automatically generated reader method

Source

vector.lisp (file)

Generic Function: stride-class MATRIX

Return the name of the class to be used for a stride of MATRIX.

Package

lisp-matrix

Source

matrix.lisp (file)

Methods
Method: stride-class (MATRIX fa-matrix-complex-double)
Source

matrix-foreign-array.lisp (file)

Method: stride-class (MATRIX fa-matrix-complex-single)
Source

matrix-foreign-array.lisp (file)

Method: stride-class (MATRIX fa-matrix-double)
Source

matrix-foreign-array.lisp (file)

Method: stride-class (MATRIX fa-matrix-single)
Source

matrix-foreign-array.lisp (file)

Method: stride-class (MATRIX la-matrix-t)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-integer)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-fixnum)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-complex-double)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-complex-single)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-double)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX la-matrix-single)
Source

matrix-lisp-array.lisp (file)

Method: stride-class (MATRIX matrix-like)
Generic Function: v=2 &rest ARGS

Test for equality of both number of elements and
of the elements themselves, for the two vectors X and Y.

A row vector and a column vector with the same number of elements are equal. To distinguish them, use M= instead.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: v=2 &rest ARGS
Generic Function: vector-orientation VECTOR

Whether the vector is considered as a row
vector (:ROW) or a column vector (:COLUMN) for matrix operations. This has no effect on storage since the values are stored contiguously, or with a stride for vector views.

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: vector-orientation (VECTOR vector-like)
Generic Function: vecview-p VECTOR

Is VECTOR a VECVIEW?

Package

lisp-matrix

Source

vector.lisp (file)

Methods
Method: vecview-p VECTOR
Method: vecview-p (VECTOR vecview)

Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.5 Structures

Structure: type-info ()
Package

lisp-matrix

Source

matrix-implementations.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: lisp-type
Type

(or symbol cons)

Initform

t

Readers

type-info-lisp-type (function)

Writers

(setf type-info-lisp-type) (function)

Slot: lisp-matrix-type
Type

symbol

Initform

t

Readers

type-info-lisp-matrix-type (function)

Writers

(setf type-info-lisp-matrix-type) (function)

Slot: cffi-type
Type

symbol

Readers

type-info-cffi-type (function)

Writers

(setf type-info-cffi-type) (function)

Slot: size
Type

(unsigned-byte 32)

Initform

0

Readers

type-info-size (function)

Writers

(setf type-info-size) (function)


Next: , Previous: , Up: Internal definitions   [Contents][Index]

6.2.6 Classes

Class: diagonal-vecview ()
Package

lisp-matrix

Source

vector.lisp (file)

Direct superclasses

vecview (class)

Direct methods
  • mref (method)
  • vref (method)
  • vref (method)
Class: fa-matrix ()
Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: fa-matrix-complex-double ()

Base class for dense matrices holding elements of type (COMPLEX DOUBLE-FLOAT) for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: fa-matrix-complex-single ()

Base class for dense matrices holding elements of type (COMPLEX SINGLE-FLOAT) for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: fa-matrix-double ()

Base class for dense matrices holding elements of type DOUBLE-FLOAT for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: fa-matrix-single ()

Base class for dense matrices holding elements of type SINGLE-FLOAT for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: fa-simple-matrix-complex-double ()

Dense matrix holding elements of type (COMPLEX DOUBLE-FLOAT), implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

fa-matrix-complex-double (class)

Direct subclasses

fa-simple-vector-complex-double (class)

Direct methods
Direct slots
Slot: data

The FNV object holding the elements.

Type

org.middleangle.foreign-numeric-vector:fnv-complex-double

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: fa-simple-matrix-complex-single ()

Dense matrix holding elements of type (COMPLEX SINGLE-FLOAT), implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

fa-matrix-complex-single (class)

Direct subclasses

fa-simple-vector-complex-single (class)

Direct methods
Direct slots
Slot: data

The FNV object holding the elements.

Type

org.middleangle.foreign-numeric-vector:fnv-complex-float

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: fa-simple-matrix-single ()

Dense matrix holding elements of type SINGLE-FLOAT, implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

fa-matrix-single (class)

Direct subclasses

fa-simple-vector-single (class)

Direct methods
Direct slots
Slot: data

The FNV object holding the elements.

Type

org.middleangle.foreign-numeric-vector:fnv-float

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: fa-simple-vector-complex-double ()

Dense vector holding elements of type (COMPLEX DOUBLE-FLOAT), implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-simple-vector-complex-single ()

Dense vector holding elements of type (COMPLEX SINGLE-FLOAT), implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-simple-vector-single ()

Dense vector holding elements of type SINGLE-FLOAT, implemented as a foreign array.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-slice-vecview-complex-double ()

Slice view of a FA-SIMPLE-VECTOR-COMPLEX-DOUBLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-slice-vecview-complex-single ()

Slice view of a FA-SIMPLE-VECTOR-COMPLEX-SINGLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-slice-vecview-double ()

Slice view of a FA-SIMPLE-VECTOR-DOUBLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-slice-vecview-single ()

Slice view of a FA-SIMPLE-VECTOR-SINGLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-strided-matview-complex-double ()

Strided view of a FA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-strided-matview-complex-single ()

Strided view of a FA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-strided-matview-double ()

Strided view of a FA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-strided-matview-single ()

Strided view of a FA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-matview-complex-double ()

Transposed view of a FA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-matview-complex-single ()

Transposed view of a FA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-matview-double ()

Transposed view of a FA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-matview-single ()

Transposed view of a FA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-vecview-complex-double ()

Transposed view of a FA-SIMPLE-VECTOR-COMPLEX-DOUBLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-vecview-complex-single ()

Transposed view of a FA-SIMPLE-VECTOR-COMPLEX-SINGLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-vecview-double ()

Transposed view of a FA-SIMPLE-VECTOR-DOUBLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-transpose-vecview-single ()

Transposed view of a FA-SIMPLE-VECTOR-SINGLE vector.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-vector ()
Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Class: fa-vector-complex-double ()

Base class for dense vectors holding elements of type (COMPLEX DOUBLE-FLOAT) for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: fa-vector-complex-single ()

Base class for dense vectors holding elements of type (COMPLEX SINGLE-FLOAT) for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: fa-vector-double ()

Base class for dense vectors holding elements of type DOUBLE-FLOAT for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: fa-vector-single ()

Base class for dense vectors holding elements of type SINGLE-FLOAT for the implementation FOREIGN-ARRAY.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: fa-window-matview-complex-double ()

Windowed view of a FA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-window-matview-complex-single ()

Windowed view of a FA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-window-matview-double ()

Windowed view of a FA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: fa-window-matview-single ()

Windowed view of a FA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses
Class: factorized-matrix-results ()
Package

lisp-matrix

Source

numerical-linear-algebra.lisp (file)

Direct superclasses

standard-object (class)

Direct methods
Direct slots
Slot: results
Initargs

:results

Readers

results (generic function)

Slot: factorization-type
Initargs

:type

Readers

factorization-type (generic function)

Class: la-matrix ()
Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: la-matrix-complex-double ()

Base class for dense matrices holding elements of type (COMPLEX DOUBLE-FLOAT) for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-complex-single ()

Base class for dense matrices holding elements of type (COMPLEX SINGLE-FLOAT) for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-double ()

Base class for dense matrices holding elements of type DOUBLE-FLOAT for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-fixnum ()

Base class for dense matrices holding elements of type FIXNUM for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-integer ()

Base class for dense matrices holding elements of type INTEGER for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-single ()

Base class for dense matrices holding elements of type SINGLE-FLOAT for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-matrix-t ()

Base class for dense matrices holding elements of type T for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-simple-matrix-t ()

Dense matrix holding elements of type T, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

la-matrix-t (class)

Direct subclasses

la-simple-vector-t (class)

Direct methods
Direct slots
Slot: data

The lisp simple-array of rank 1 holding the elements.

Type

(simple-array t (*))

Initargs

:data

Readers

data (generic function)

Writers

(setf data) (generic function)

Class: la-simple-vector-fixnum ()

Dense vector holding elements of type FIXNUM, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-simple-vector-t ()

Dense vector holding elements of type T, implemented as a lisp array.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-fixnum ()

Slice view of a LA-SIMPLE-VECTOR-FIXNUM vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-slice-vecview-t ()

Slice view of a LA-SIMPLE-VECTOR-T vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-complex-double ()

Strided view of a LA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-complex-single ()

Strided view of a LA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-double ()

Strided view of a LA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-fixnum ()

Strided view of a LA-SIMPLE-MATRIX-FIXNUM matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-integer ()

Strided view of a LA-SIMPLE-MATRIX-INTEGER matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-single ()

Strided view of a LA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-strided-matview-t ()

Strided view of a LA-SIMPLE-MATRIX-T matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-complex-double ()

Transposed view of a LA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-complex-single ()

Transposed view of a LA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-double ()

Transposed view of a LA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-fixnum ()

Transposed view of a LA-SIMPLE-MATRIX-FIXNUM matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-integer ()

Transposed view of a LA-SIMPLE-MATRIX-INTEGER matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-single ()

Transposed view of a LA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-matview-t ()

Transposed view of a LA-SIMPLE-MATRIX-T matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-complex-double ()

Transposed view of a LA-SIMPLE-VECTOR-COMPLEX-DOUBLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-complex-single ()

Transposed view of a LA-SIMPLE-VECTOR-COMPLEX-SINGLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-double ()

Transposed view of a LA-SIMPLE-VECTOR-DOUBLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-fixnum ()

Transposed view of a LA-SIMPLE-VECTOR-FIXNUM vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-integer ()

Transposed view of a LA-SIMPLE-VECTOR-INTEGER vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-single ()

Transposed view of a LA-SIMPLE-VECTOR-SINGLE vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-transpose-vecview-t ()

Transposed view of a LA-SIMPLE-VECTOR-T vector.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-vector ()
Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Class: la-vector-complex-double ()

Base class for dense vectors holding elements of type (COMPLEX DOUBLE-FLOAT) for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-vector-complex-single ()

Base class for dense vectors holding elements of type (COMPLEX SINGLE-FLOAT) for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-vector-double ()

Base class for dense vectors holding elements of type DOUBLE-FLOAT for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods
Class: la-vector-fixnum ()

Base class for dense vectors holding elements of type FIXNUM for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-vector-integer ()

Base class for dense vectors holding elements of type INTEGER for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-vector-single ()

Base class for dense vectors holding elements of type SINGLE-FLOAT for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-vector-t ()

Base class for dense vectors holding elements of type T for the implementation LISP-ARRAY.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Direct subclasses
Direct methods

transpose-class (method)

Class: la-window-matview-complex-double ()

Windowed view of a LA-SIMPLE-MATRIX-COMPLEX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-complex-single ()

Windowed view of a LA-SIMPLE-MATRIX-COMPLEX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-double ()

Windowed view of a LA-SIMPLE-MATRIX-DOUBLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-fixnum ()

Windowed view of a LA-SIMPLE-MATRIX-FIXNUM matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-integer ()

Windowed view of a LA-SIMPLE-MATRIX-INTEGER matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-single ()

Windowed view of a LA-SIMPLE-MATRIX-SINGLE matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: la-window-matview-t ()

Windowed view of a LA-SIMPLE-MATRIX-T matrix.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses
Class: lisp-matrix-ut ()
Package

lisp-matrix-unittests

Source

unittests.lisp (file)

Direct superclasses

test-mixin (class)

Direct subclasses
Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((107) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests.lisp")
Class: lisp-matrix-ut-datatrans ()
Package

lisp-matrix-unittests

Source

unittests-transform.lisp (file)

Direct superclasses

lisp-matrix-ut (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((117) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-transform.lisp")
Class: lisp-matrix-ut-matrix ()
Package

lisp-matrix-unittests

Source

unittests-matrix.lisp (file)

Direct superclasses

lisp-matrix-ut (class)

Direct subclasses
Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((114) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix.lisp")
Class: lisp-matrix-ut-matrix-gemm ()
Package

lisp-matrix-unittests

Source

unittests-matrix-lapack.lisp (file)

Direct superclasses

lisp-matrix-ut-matrix (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((121) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp")
Class: lisp-matrix-ut-matrix-lapack ()
Package

lisp-matrix-unittests

Source

unittests-matrix-lapack.lisp (file)

Direct superclasses

lisp-matrix-ut-matrix (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((121) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp")
Class: lisp-matrix-ut-matrix-views ()
Package

lisp-matrix-unittests

Source

unittests-matrix-view.lisp (file)

Direct superclasses

lisp-matrix-ut-matrix (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((119) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-view.lisp")
Class: lisp-matrix-ut-vectors ()
Package

lisp-matrix-unittests

Source

unittests-vector.lisp (file)

Direct superclasses

lisp-matrix-ut (class)

Direct subclasses

lisp-matrix-ut-vectors-gemm (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((114) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-vector.lisp")
Class: lisp-matrix-ut-vectors-gemm ()
Package

lisp-matrix-unittests

Source

unittests-vector.lisp (file)

Direct superclasses

lisp-matrix-ut-vectors (class)

Direct methods

setup-test (method)

Direct Default Initargs
InitargValue
:test-source-file#a((114) base-char . "/home/quickbuilder/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-vector.lisp")
Class: matrix-complex-double ()

Base class for matrices holding elements of type (COMPLEX DOUBLE-FLOAT).

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-complex-single ()

Base class for matrices holding elements of type (COMPLEX SINGLE-FLOAT).

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-double ()

Base class for matrices holding elements of type DOUBLE-FLOAT.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-fixnum ()

Base class for matrices holding elements of type FIXNUM.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-integer ()

Base class for matrices holding elements of type INTEGER.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-single ()

Base class for matrices holding elements of type SINGLE-FLOAT.

Package

lisp-matrix

Source

matrix-foreign-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matrix-t ()

Base class for matrices holding elements of type T.

Package

lisp-matrix

Source

matrix-lisp-array.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Class: matview ()

An abstract class representing a "view" into a
matrix. That view may be treated as a (readable and writeable) reference to the elements of the matrix.

Package

lisp-matrix

Source

matrix.lisp (file)

Direct superclasses

matrix-like (class)

Direct subclasses
Direct methods
Direct slots
Slot: parent

The "parent" object to which this matrix view relates.

Type

lisp-matrix:matrix-like

Initargs

:parent

Readers

parent (generic function)

Class: slice-vecview ()
Package

lisp-matrix

Source

vector.lisp (file)

Direct superclasses

vecview (class)

Direct subclasses
Direct methods
Direct slots
Slot: offset
Initargs

:offset

Initform

0

Readers

offset (generic function)

Slot: stride
Initargs

:stride

Initform

1

Readers

stride (generic function)

Class: transpose-matview ()

A TRANSPOSE-MATVIEW views the transpose of a
matrix. If you want a deep copy, call the appropriate COPY function on the transpose view. The reason for this is to avoid expensive operations whenever possible. Many BLAS and LAPACK routines have a "TRANSA" argument (or similar) that lets you specify that the operation should work with the transpose of the matrix. This means that it usually isn’t necessary to compute an explicit transpose, at least for input arguments.

Package

lisp-matrix

Source

matrix.lisp (file)

Direct superclasses

matview (class)

Direct subclasses
Direct methods
Class: transpose-vecview ()
Package

lisp-matrix

Source

vector.lisp (file)

Direct superclasses
Direct subclasses