From: Renato P. <re...@gm...> - 2018-06-27 22:55:09
|
Nice. It is important to identify the source of that value (elem. number, for example). Is it safe to use the template parameter <T> as a custom class overriding the sorting operators? Something like: class MyClass { double number_to_classify; unsigned int elem_id; operator< ( ... ) { ... number_to_classify ...} } On Wed, Jun 27, 2018 at 7:00 PM, John Peterson <jwp...@gm...> wrote: > > > On Wed, Jun 27, 2018 at 3:58 PM, Renato Poli <re...@gm...> wrote: > >> Hi, >> >> I need to evaluate the "greatest" value of a vector that is created in >> parallel. It is a matter of iterating over all the local elements and >> calculate the parts of this distributed vector. >> >> What is the best way to syncronize this vector to all processors - so they >> can have the whole set of data and can find out the "greatest" value? Any >> example to suggest? >> > > Are you using NumericVector? It has a max() member. > > -- > John > |