62# include "rheolef/disarray.h"
63# include "rheolef/range.h"
67template <
class T,
class M>
class vec_range;
68template <
class T,
class M>
class vec_range_const;
71template <
class Expr>
struct is_vec;
72template <
class Expr>
struct is_vec_expr_v2_arg;
73template <
class T,
class M>
class vec_concat_value;
78template <
class T,
class M = rheo_default_memory_model>
101 const T& init_val = std::numeric_limits<T>::max());
107 const T& init_val = std::numeric_limits<T>::max());
111 const T& init_val = std::numeric_limits<T>::max());
115 const T& init_val = std::numeric_limits<T>::max());
145 template <
class Expr,
147 =
typename std::enable_if<
151 vec (
const Expr& expr);
153 template <
class Expr,
155 =
typename std::enable_if<
166template <
class T,
class M>
172template <
class T,
class M>
180template <
class T,
class M>
188template <
class T,
class M>
196template <
class T,
class M>
203 base::resize (ownership, init_val);
205template <
class T,
class M>
212 base::resize (dis_size, init_val);
215template <
class T,
class M>
223template <
class T,
class M>
231template <
class T,
class M>
238 std::copy (vr.
begin(), vr.
end(), base::begin());
241template <
class T,
class M>
249template <
class T,
class M>
256template <
class T,
class M>
263template <
class T,
class M>
268 return base::operator[] (i);
270template <
class T,
class M>
275 return base::operator[] (i);
277template <
class T,
class M>
284template <
class T,
class M>
291template <
class T,
class M>
295 T val = std::numeric_limits<T>::max();
296 for (
const_iterator iter = base::begin(), last = base::end(); iter != last; iter++) {
297 val = std::min(val, *iter);
299#ifdef _RHEOLEF_HAVE_MPI
300 val = mpi::all_reduce (base::comm(), val, mpi::minimum<T>());
304template <
class T,
class M>
308 T val = std::numeric_limits<T>::min();
309 for (
const_iterator iter = base::begin(), last = base::end(); iter != last; iter++) {
310 val = std::max(val, *iter);
312#ifdef _RHEOLEF_HAVE_MPI
313 val = mpi::all_reduce (base::comm(), val, mpi::maximum<T>());
317template <
class T,
class M>
322 for (
const_iterator iter = base::begin(), last = base::end(); iter != last; iter++) {
323 val = std::max(val, abs(*iter));
325#ifdef _RHEOLEF_HAVE_MPI
326 val = mpi::all_reduce (base::comm(), val, mpi::maximum<T>());
335 return x.get_values(ips);
337template <
class T,
class M>
344 return x.data().put_matlab (ods);
347 return x.put_values(ods);
349#ifdef _RHEOLEF_HAVE_MPI
355 return x.get_values(ips);
361operator << (odiststream& ods,
const vec<T,distributed>& x)
365 return x.put_matlab (ods);
368 return x.put_values(ods);
376template<
class T,
class M>
384template<
class T,
class M>
389 return sqrt(
norm2(x));
see the disarray page for the full documentation
rep::base::const_iterator const_iterator
rep::base::iterator iterator
rep::base::size_type size_type
see the distributor page for the full documentation
static const size_type decide
idiststream: see the diststream page for the full documentation
std::bitset< last > flag_type
static flag_type format_field
odiststream: see the diststream page for the full documentation
const_iterator begin() const
const_iterator end() const
see the vec page for the full documentation
vec(const vec_range_const< T, M > &vr)
base::size_type size_type
vec< T, M > & operator=(const vec< T, M > &x)
base::const_reference const_reference
vec(const vec_range< T, M > &vr)
base::const_iterator const_iterator
vec(const distributor &ownership, const T &init_val=std::numeric_limits< T >::max())
vec(size_type dis_size=0, const T &init_val=std::numeric_limits< T >::max())
int constraint_process_rank() const
std::ptrdiff_t difference_type
void resize(size_type size=0, const T &init_val=std::numeric_limits< T >::max())
base::reference reference
const_reference operator[](size_type i) const
float_traits< value_type >::type float_type
void resize(const distributor &ownership, const T &init_val=std::numeric_limits< T >::max())
This file is part of Rheolef.
std::ostream & operator<<(std::ostream &os, const catchmark &m)
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
std::istream & operator>>(std::istream &is, const catchmark &m)
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
see the range page for the full documentation