mini / maxi functions



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

-----maxima-bounces at math.utexas.edu wrote: -----

>The?reason?for?this?particular?behavior?is?that?the?package?was?written
>to?handle?both?univariate?and?multivariate?samples.?Univariate?samples
>should?be?entered?as?lists?of?numbers?or?one-column?matrices,?and?here