an efficient C++ finite element environment
|
|
Go to the documentation of this file.
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>());
301 #endif // _RHEOLEF_HAVE_MPI
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>());
314 #endif // _RHEOLEF_HAVE_MPI
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>());
327 #endif // _RHEOLEF_HAVE_MPI
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
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);
371 #endif // _RHEOLEF_HAVE_MPI
376 template<
class T,
class M>
384 template<
class T,
class M>
389 return sqrt(
norm2(x));
393 #endif // _RHEO_VEC_H
vec< T, M > & operator=(const vec< T, M > &x)
base::reference reference
base::const_iterator const_iterator
rheolef::std enable_if ::type dot const Expr1 expr1, const Expr2 expr2 dot(const Expr1 &expr1, const Expr2 &expr2)
dot(x,y): see the expression page for the full documentation
vec(const distributor &ownership, const T &init_val=std::numeric_limits< T >::max())
see the range page for the full documentation
rep::base::const_iterator const_iterator
see the distributor page for the full documentation
const_iterator begin() const
static const size_type decide
vec(const vec_range_const< T, M > &vr)
see the vec page for the full documentation
T norm(const vec< T, M > &x)
norm(x): see the expression page for the full documentation
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
T norm2(const vec< T, M > &x)
norm2(x): see the expression page for the full documentation
rep::base::size_type size_type
rep::base::iterator iterator
const_iterator end() const
std::istream & operator>>(std::istream &is, const catchmark &m)
This file is part of Rheolef.
odiststream: see the diststream page for the full documentation
std::ptrdiff_t difference_type
see the disarray page for the full documentation
vec(size_type dis_size=0, const T &init_val=std::numeric_limits< T >::max())
base::const_reference const_reference
vec(const vec_range< T, M > &vr)
void resize(size_type size=0, const T &init_val=std::numeric_limits< T >::max())
int constraint_process_rank() const
void resize(const distributor &ownership, const T &init_val=std::numeric_limits< T >::max())
float_traits< value_type >::type float_type
const_reference operator[](size_type i) const
std::ostream & operator<<(std::ostream &os, const catchmark &m)
base::size_type size_type