62 # include "rheolef/disarray.h"
63 # include "rheolef/range.h"
67 template <
class T,
class M>
class vec_range;
68 template <
class T,
class M>
class vec_range_const;
71 template <
class Expr>
struct is_vec;
72 template <
class Expr>
struct is_vec_expr_v2_arg;
73 template <
class T,
class M>
class vec_concat_value;
78 template <
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<
153 template <
class Expr,
155 =
typename std::enable_if<
166 template <
class T,
class M>
172 template <
class T,
class M>
180 template <
class T,
class M>
188 template <
class T,
class M>
196 template <
class T,
class M>
203 base::resize (ownership, init_val);
205 template <
class T,
class M>
212 base::resize (dis_size, init_val);
215 template <
class T,
class M>
223 template <
class T,
class M>
231 template <
class T,
class M>
238 std::copy (vr.
begin(), vr.
end(), base::begin());
241 template <
class T,
class M>
249 template <
class T,
class M>
256 template <
class T,
class M>
263 template <
class T,
class M>
268 return base::operator[] (i);
270 template <
class T,
class M>
275 return base::operator[] (i);
277 template <
class T,
class M>
284 template <
class T,
class M>
291 template <
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>());
304 template <
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>());
317 template <
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);
337 template <
class T,
class M>
342 iorheo::flag_type format = iorheo::flags(ods.
os()) & iorheo::format_field;
344 return x.data().put_matlab (ods);
347 return x.put_values(ods);
349 #ifdef _RHEOLEF_HAVE_MPI
353 operator >> (idiststream& ips, vec<T,distributed>& x)
355 return x.get_values(ips);
361 operator << (odiststream& ods,
const vec<T,distributed>& x)
363 iorheo::flag_type format = iorheo::flags(ods.os()) & iorheo::format_field;
365 return x.put_matlab (ods);
368 return x.put_values(ods);
376 template<
class T,
class M>
384 template<
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
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())
verbose clean transpose logscale grid shrink ball stereo iso volume skipvtk deformation fastfieldload lattice reader_on_stdin color format format format format format format format format format format format format format format format matlab
rheolef::details::is_vec dot
This file is part of Rheolef.
idiststream & operator>>(idiststream &ips, vec< T, sequential > &x)
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
see the range page for the full documentation
ostream & operator<<(ostream &os, const tiny_element &K)