mini / maxi functions



El s?b, 26-06-2010 a las 16:47 -0500, Barton Willis escribi?:
> Maybe lmax could be changed to something like
> 
> (defmacro opapply (op l)
>   `(simplify (cons (list ,op) ,l)))
> 
> (defun $lmax (x)
>   (cond ((or ($listp x) ($setp x)) (opapply '$max (margs x)))
> 	(($matrixp x)
> 	 (opapply 'mlist (mapcar #'(lambda (s) (opapply '$max s)) (apply #'mapcar #'list (mcx (margs x))))))
> 	(t (merror "The argument to lmax must be a list, set, or matrix."))))
> 
> Using 'apply' this way isn't so good (possibly limited to matrices with fewer than about 64 rows).
> But it's less fun to write the matrix case without apply. Also, maybe opapply is defined somewhere?
> 
> --Barton


Hello Barton,

Perhaps, a user not working in an statistical context would expect lmax
to return the maximum element of the matrix, not a list of column wise
maxima, which is what we are looking for.

--
Mario