37 lines
1.3 KiB
Plaintext
37 lines
1.3 KiB
Plaintext
;;MAKE-HOMOGENEOUS-3-BY-3
|
|
;; By Peter Reidy
|
|
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>MAKE-HOMOGENEOUS-3-BY-3.TEST
|
|
;; Syntax: (MAKE-HOMOGENEOUS-3-BY-3 &key A00 A01 A10 A20 A21)
|
|
;; Function description: returns a 3-by-3 matrix of element-type single-float; some elements can be specified in the keywords; the 2, 2 element is always 1.0. Other elements default to 0.0.
|
|
;; Arguments: keywords: where x and y are the two digits in the keyword, the corresponding matrix element will be set to the keyword value.
|
|
;;
|
|
(do-test-group make-homogeneous-3-by-3-group
|
|
:before
|
|
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
|
|
;;
|
|
(do-test 3-by-3-simple-case
|
|
(let ((matrix33a (il:make-homogeneous-3-by-3)))
|
|
(2dtest matrix33a 3 3 #'(lambda nil (deftest33 matrix33a '(a22))))
|
|
)
|
|
)
|
|
;;
|
|
(do-test 3-by-3-with-keys
|
|
(let ((randnum (- (random most-positive-single-float)))
|
|
(mat33 (il:make-homogeneous-3-by-3 :a20 most-positive-single-float :a21 Most-negative-single-float :a10 randnum :a01 0 :a00 4761))
|
|
)
|
|
(2dtest mat33 3 3
|
|
#'(lambda nil
|
|
(deftest33 mat33 '(a00 a01 a10 a20 a21 a22))
|
|
)
|
|
'(a00 a01 a10 a20 a21)
|
|
(list 4761 0 randnum most-positive-single-float Most-negative-single-float)
|
|
) ; 3by3.test
|
|
) ; let
|
|
)
|
|
;;
|
|
(do-test 3-by-3-error (expect-errors (error) (il:make-homogeneous-3-by-3 :a00 #c(0 3))))
|
|
)
|
|
END
|
|
|
|
|