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)))
9 #.
(coerce pi
'single-float
))
11 (defun make-adorned-symbol (name &key prefix suffix asterisk package
)
12 (check-type name
(or string symbol
))
13 (check-type prefix
(or symbol string null
))
14 (check-type suffix
(or symbol string null
))
15 (intern (concatenate 'string
26 (if package package
*package
*)))
28 (defmacro multiply-arguments
(operator factor arguments
)
29 `(,operator
,@(mapcar (lambda (argument) `(* ,factor
,argument
)) arguments
)))
31 (defun matrix-symbol (i j
&optional
(prefix '#:e
))
32 (find-symbol (format NIL
"~A~D~D" prefix i j
)))
34 (defun matrix-minor (x y length
&optional
(prefix '#:e
))
35 (let ((symbol-prefix (format NIL
"~A~D~:*~D" '#:matrix
(1- length
))))
36 `(,(find-symbol (concatenate 'string symbol-prefix
#.
(string '#:-determinant
*)))
37 (,(find-symbol (concatenate 'string symbol-prefix
#.
(string '#:-values
*)))
39 (for i from
1 to length
)
41 (for j from
1 to length
)
42 (unless (or (eql i x
) (eql j y
))
43 (in values
(collect (matrix-symbol (1- i
) (1- j
) prefix
))))))))))
45 (defun matrix-cofactors (length)
47 (for i from
1 to length
)
49 (for j from
1 to length
)
50 (for value
= (matrix-minor i j length
))
52 (collect (if (oddp (+ i j
))