1 (in-package :cl-tuples
)
3 ;; float that fits within range of x86 hardware register minus tag (rather sbcl oriented)
5 #+sbcl
`(single-float (#.
(- (expt 2f0
64))) (#.
(expt 2f0
64)))
8 (defun make-adorned-symbol (name &key prefix suffix asterisk package
)
9 (check-type name
(or string symbol
))
10 (check-type prefix
(or symbol string null
))
11 (check-type suffix
(or symbol string null
))
12 (intern (concatenate 'string
23 (if package package
*package
*)))
25 (defmacro multiply-arguments
(operator factor arguments
)
26 `(,operator
,@(mapcar (lambda (argument) `(* ,factor
,argument
)) arguments
)))
28 (defun matrix-symbol (i j
&optional
(prefix '#:e
))
29 (find-symbol (format NIL
"~A~D~D" prefix i j
)))
31 (defun matrix-minor (x y length
&optional
(prefix '#:e
))
32 (let ((symbol-prefix (format NIL
"~A~D~:*~D" '#:matrix
(1- length
))))
33 `(,(find-symbol (concatenate 'string symbol-prefix
#.
(string '#:-determinant
*)))
34 (,(find-symbol (concatenate 'string symbol-prefix
#.
(string '#:-values
*)))
36 (for i from
1 to length
)
38 (for j from
1 to length
)
39 (unless (or (eql i x
) (eql j y
))
40 (in values
(collect (matrix-symbol (1- i
) (1- j
) prefix
))))))))))
42 (defun matrix-cofactors (length)
44 (for i from
1 to length
)
46 (for j from
1 to length
)
47 (for value
= (matrix-minor i j length
))
49 (collect (if (oddp (+ i j
))