home *** CD-ROM | disk | FTP | other *** search
- ; book p.96
-
- #|(defun make-projection (x)
- (flet ((ip (x y) (sum (* x y))))
- #'(lambda (y) (* x (/ (ip x y) (ip x x))))))
- |#
- #|
- (defun make-projection (x)
- (labels ((ip (x y) (sum (* x y)))
- (proj (y) (* x (/ (ip x y) (ip x x)))))
- #'proj))
-
- (def p (make-projection '(1 1 1 1)))
- |#
-
- ; book p.172
-
- (defun make-projection (cols)
- (let* ((x (if (matrixp cols)
- cols
- (apply #'bind-columns cols)))
- (svd (sv-decomp x))
- (u (first svd))
- (s-vals (second svd))
- (basis (select (column-list u)
- (which (> s-vals 0.0))))
- (u1 (apply #'bind-columns basis)))
- #'(lambda (y) (matmult u1 (matmult y u1)))))
-