Add specialized matrix types for float matrices

This commit is contained in:
Renaud Casenave-Péré 2014-01-02 20:13:35 +09:00
parent a2b8b9da8c
commit 04544e9742
4 changed files with 87 additions and 1 deletions

24
src/maths/float22.lisp Normal file
View file

@ -0,0 +1,24 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float22
(:nicknames :float22 :f22)
(:use :cl)
(:export :mat :mat-null :mat-ident))
(in-package :stoe.maths.float22)
(deftype float22 () '(simple-array single-float (2 2)))
(defun mat (e00 e01 e10 e11)
(m:mat e00 e01 e10 e11))
(defun mat-null ()
(mat 0 0
0 0))
(defun mat-ident ()
(mat 1 0
0 1))

28
src/maths/float33.lisp Normal file
View file

@ -0,0 +1,28 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float33
(:nicknames :float33 :f33)
(:use :cl)
(:export :mat :mat-null :mat-ident))
(in-package :stoe.maths.float33)
(deftype float33 () '(simple-array single-float (3 3)))
(defun mat (e00 e01 e02 e10 e11 e12 e20 e21 e22)
(m:mat e00 e01 e02
e10 e11 e12
e20 e21 e22))
(defun mat-null ()
(mat 0 0 0
0 0 0
0 0 0))
(defun mat-ident ()
(mat 1 0 0
0 1 0
0 0 1))

31
src/maths/float44.lisp Normal file
View file

@ -0,0 +1,31 @@
#|
This file is a part of stoe project.
Copyright (c) 2014 Renaud Casenave-Péré (renaud@casenave-pere.fr)
|#
(in-package :cl-user)
(defpackage stoe.maths.float44
(:nicknames :float44 :f44)
(:use :cl)
(:export :mat :mat-null :mat-ident))
(in-package :stoe.maths.float44)
(deftype float44 () '(simple-array single-float (4 4)))
(defun mat (e00 e01 e02 e03 e10 e11 e12 e13 e20 e21 e22 e23 e30 e31 e32 e33)
(m:mat e00 e01 e02 e03
e10 e11 e12 e13
e20 e21 e22 e23
e30 e31 e32 e33))
(defun mat-null ()
(mat 0 0 0 0
0 0 0 0
0 0 0 0
0 0 0 0))
(defun mat-ident ()
(mat 1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1))

View file

@ -28,7 +28,10 @@
(:file "float2")
(:file "float3")
(:file "float4")
(:file "matrix")))
(:file "matrix")
(:file "float22")
(:file "float33")
(:file "float44")))
(:file "utils")
(:file "thread"
:depends-on ("utils"))