Re: (newbie) Find Max Number In An Array



Nektarios - Greece wrote:
<snip>

X Y
--------
25 0.571
26 0.555
27 0.534
28 0.530
29 0.535
30 0.541
etc

You can use a variant of Newton's approximation for roots of an
equation.

You can readily find the value of an integer for which Y is the
"minimum by integer". As you do that store the values for X and Y for
the values of X BEFORE that, and also store the values of X and Y AFTER
that one.

Lets call the values BEFORE the integer minimum X[L] and Y[L], the
values at the integer minimum X[M] and Y[M], and the values AFTER the
integer minimum X[N] and Y[N].

Then a better value for XMin is ...

X[M] - ( (Y[N] - Y[L]) / (2(Y[L] + Y[N] - (Y[M] * 2))) )

.... or in the example 28 - 0.055 =~ 27.95

Alan Lloyd

.



Relevant Pages

  • RE: IAzClientContext AccessCheck returns 0x80070057
    ... I get a successful access check. ... Could you post a text representation of your XML store? ... > VARIANT varOperationIdArray; ...
    (microsoft.public.platformsdk.security)
  • Re: Invalid use of Null error question
    ... string variable if nothing's been selected: string variables cannot be set ... only store numbers (Byte, Integer and Long can only store integer values, ... Variant is another type of variable. ... Dim strsql As String ...
    (microsoft.public.access.formscoding)
  • Re: Advice on storage and retrieval
    ... I guess in that interface i was already thinking about implemening using ... ...don't I need Item (as variant) to store and return the actual "thing" ... ..Item as String ...
    (microsoft.public.vb.general.discussion)
  • RE: Using StdRegProv::SetDWORDValue in C++
    ... IWbemClassObject* pInParamsDefinition = NULL; ... VARIANT varCommand; ... // Store the value for the in parameters ... NULL, pClassInstance, &pOutParams, NULL); ...
    (microsoft.public.win32.programmer.wmi)
  • Re: Type Mismatch Error in Array
    ... Dim OutOfNetwork As Variant ... You then have an 0-based variant array and you can use that like this: ... "label" for a store, and the number that is entered by ...
    (microsoft.public.excel.programming)