Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Find Max of "Concave" List

  • To: mathgroup at
  • Subject: [mg12991] Re: [mg12918] Find Max of "Concave" List
  • From: "Jrgen Tischer" <jtischer at>
  • Date: Sun, 28 Jun 1998 02:52:13 -0400
  • Sender: owner-wri-mathgroup at

Hi Chris,
not elegant, but quite fast: bisection:

concaveMax[li_]:= Module[{a=1,b=Length[li]},


-----Original Message-----
From: Chris Farr <farr at>
To: mathgroup at
Subject: [mg12991] [mg12918] Find Max of "Concave" List

>I have a one-dimensional list which is concave.  That is, if you did a
>ListPlot on the list you would have a concave curve.
>Given the concavity, when finding the max, it is inefficient to use
>Max[] which does a comparison on all elements of the list.
>Is there an elegant way to exploit the concavity when performing a
>Max[]?  That is, the algorithm should stop when the next element in the
> list is lower then the previous element.  This would limit the number
>of  comparisons.
>Chris Farr

  • Prev by Date: Re: Strange behavior of Sort
  • Next by Date: Re: Inconsistencies in pattern matching.
  • Previous by thread: Re: Find Max of "Concave" List
  • Next by thread: Re: Find Max of "Concave" List