32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
;;MAKE-HOMOGENEOUS-N-BY-3
|
|
;; By Peter Reidy
|
|
;; Filed as {ERIS}<LISPCORE>TEST>DISPLAY>MATMULT>MAKE-HOMOGENEOUS-N-BY-3.TEST
|
|
;; Syntax: (MAKE-HOMOGENEOUS-N-BY-3 N &key INITIAL-ELEMENT)
|
|
;; 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-n-by-3-group
|
|
:before
|
|
(il:load? '{eris}<lispcore>test>display>matmult>matmult-test.source)
|
|
;;
|
|
(do-test n-by-3-simple-case
|
|
(let* ((n (random 50))
|
|
(matrix (il:make-homogeneous-n-by-3 n))
|
|
)
|
|
(2dtest matrix n 3 #'(lambda nil (lastcolumn matrix)))
|
|
)
|
|
)
|
|
;;
|
|
(do-test n-by-3-with-key
|
|
(let* ((val (- (random most-positive-single-float)))
|
|
(n (random 50))
|
|
(matrix (il:make-homogeneous-n-by-3 n :initial-element val))
|
|
)
|
|
(2dtest matrix n 3 #'(lambda nil (lastcolumn matrix)))
|
|
) ; let
|
|
)
|
|
)
|
|
END
|
|
|
|
|