34 lines
963 B
Plaintext
34 lines
963 B
Plaintext
;; IDENTITY-4-BY-4
|
|
;; By Peter Reidy
|
|
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>IDENTITY-4-BY-4.TEST
|
|
;; Syntax: (IDENTITY-4-BY-4 &optional RESULT)
|
|
;; Function description: returns a 4-by-4 identity matrix - i.e. one in which every (N,N) element is 1.0 and every other is 0.0. If RESULT is supplied and is a 4-by-4 matrix of element-type single-float, the result is returned there.
|
|
;; Arguments:
|
|
;; RESULT - a 4-by-4 matrix of element-type single-float
|
|
;;
|
|
(do-test-group make-homogeneous-n-by-4-group
|
|
:before
|
|
(progn
|
|
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
|
|
(test-setq non-ident (il:make-homogeneous-4-by-4 :a00 22.77 :a10 pi))
|
|
)
|
|
;;
|
|
(do-test identity-4-by-4-simple-case
|
|
(and
|
|
(idtest (il:identity-4-by-4) 4)
|
|
(not (idtest (il:identity-3-BY-3) 4))
|
|
)
|
|
)
|
|
;;
|
|
(do-test n-by-4-with-result
|
|
(and
|
|
(not (idtest non-ident 4)) ; before
|
|
(il:identity-4-by-4 non-ident)
|
|
(idtest non-ident 4) ; after
|
|
)
|
|
)
|
|
)
|
|
END
|
|
|
|
|