Boost logo

Boost Users :

Subject: Re: [Boost-users] how to get std::min_element() working with boost::multi_array?
From: Valmor de Almeida (val.lists_at_[hidden])
Date: 2010-09-02 12:40:55


On 09/01/2010 02:20 PM, Valmor de Almeida wrote:
>
> Hello,
>
> Could someone help getting std::min_element() (or a variation of) to
> work with multi_array?
>
>
> boost::multi_array<int, 2> A;
> // code for dimensioning A and filling in; deleted
> cout << *min_element(A.begin(),A.end()) << endl;
>
> Thanks,
>
> --
> Valmor

For the record, this website is helpful

http://salilab.org/imp/1.0/doc/html/classIMP_1_1algebra_1_1MultiArray.html

In short, std::min_element() is not going to work with
boost::multi_array. One has to write a wrapper function around the
boost::multi_array::data() function as is done in the above-mentioned
web site. Check the source:

http://salilab.org/imp/1.0/doc/html/MultiArray_8h-source.html

--
Valmor

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net