![]() |
Blitz Support : |
From: Julian C. Cummings (cummings_at_[hidden])
Date: 2004-03-02 00:01:46
Hi Andrius,
The trouble is with the comparison operators like < or > defined for
TinyVector, since you can imagine many possible ways of defining such
comparisons. The max function for an Array does the simple-minded thing of
looping over all the elements and comparing them using > to find the largest
one. This fails for TinyVector because the > operator returns an
elementwise result as a TinyVector of bools. So I think you will have to
loop over the Array elements yourself and do something special here to
implement the max() function.
Regards, Julian C.
P.S. One solution might be to compute the maximum of each component of the
multicomponent Array as a separate scalar result, and then simply take the
largest of these results.
> -----Original Message-----
> From: blitz-support-bounces_at_[hidden]
> [mailto:blitz-support-bounces_at_[hidden]] On Behalf Of
> Andrius Kurtinaitis
> Sent: Saturday, February 28, 2004 1:16 AM
> To: Support list for Blitz++
> Subject: [Blitz-support] max on arrays of tynies
>
>
> Hello,
> what should I do to compile the attached program with the uncommented
> line with max output? I would like to get the maximum double
> number from
> the resulting expression array.
> Is there a way to override some max function, or I should
> rather write a
> simple loop to get the max?
> Thank you.
> Andrius
>