vec(4rheolef)
π vec β the distributed vector, but make it fashion π
okay bestie, welcome to vec(4rheolef) β yes that's section 4rheolef, the rheolef-7.2 era, and this page is literally about the vector class and it's a whole vibe. grab a strawberry π and let's go.
β¨ NAME β¨
vec β a distributed vector (from rheolef-7.2, no cap) π¦
β¨ DESCRIPTION β¨
so the tea is: this vector class is that girl because she supports both the sequential memory model and the distributed memory model. she contains multitudes π . and on top of all that, standard linear algebra is supported too. iconic behavior, honestly. π
β¨ EXAMPLE β¨
here's her in her natural habitat, looking gorgeous:
vec<double> x (100, 3.14);
vec<double> y (100, 6.28);
vec<double> z = 2.5*x + y;
dout << x << endl;
like?? 2.5*x + y just working like that? she ate and left no crumbs π₯
β¨ IMPLEMENTATION β¨
ngl, this documentation was generated straight from the file linalg/lib/vec.h β so you know it's the real thing, not a rumor πΈ
the vec class is a template class, and it takes both the floating type and the memory model as parameters. the implementation is based on the disarray(4) container, which is giving foundation, giving support system π«Ά
template <class T, class M = rheo_default_memory_model>
class vec : public disarray<T, M> {
public:
// typedef:
typedef disarray<T, M> base;
typedef T value_type;
typedef typename base::size_type size_type;
typedef std::ptrdiff_t difference_type;
typedef range range_type;
typedef typename base::reference reference;
typedef typename base::const_reference const_reference;
typedef typename base::iterator iterator;
typedef typename base::const_iterator const_iterator;
typedef typename float_traits <value_type>::type float_type;
// allocator/deallocator:
vec (const vec<T,M>&);
vec<T,M>& operator= (const vec<T,M>& x);
vec (const distributor& ownership,
const T& init_val = std::numeric_limits<T>::max());
vec (const std::initializer_list<details::vec_concat_value<T,M> >& init_list);
vec<T,M>& operator= (const std::initializer_list<details::vec_concat_value<T,M> >& init_list);
vec(size_type dis_size = 0,
const T& init_val = std::numeric_limits<T>::max());
void resize (
const distributor& ownership,
const T& init_val = std::numeric_limits<T>::max());
void resize (
size_type size = 0,
const T& init_val = std::numeric_limits<T>::max());
// accessors:
const_reference operator[] (size_type i) const;
reference operator[] (size_type i);
T min () const;
T max () const;
T max_abs () const;
int constraint_process_rank() const;
// range:
vec(const vec_range<T,M>& vr);
vec(const vec_range_const<T,M>& vr);
vec<T,M>& operator= (const vec_range<T,M>& vr);
vec<T,M>& operator= (const vec_range_const<T,M>& vr);
vec_range_const<T,M> operator[] (const range_type& r) const;
vec_range<T,M> operator[] (const range_type& r);
// assignment to a constant:
vec<T,M>& operator= (const int& expr);
vec<T,M>& operator= (const T& expr);
// expression template:
template <class Expr,
class Sfinae
= typename std::enable_if<
details::is_vec_expr_v2_arg<Expr>::value
&& ! details::is_vec<Expr>::value
>::type>
vec (const Expr& expr);
template <class Expr,
class Sfinae
= typename std::enable_if<
details::is_vec_expr_v2_arg<Expr>::value
&& ! details::is_vec<Expr>::value
>::type>
vec<T, M>& operator= (const Expr& expr);
};
like, the typedefs? the constructors? the expression templates with std::enable_if doing her little sfinae dance? main character energy fr fr π every single one of these is exactly as written, don't let anyone tell you otherwise.
β¨ AUTHOR β¨
the legend herself/himself: Pierre Saramito <Pierre.Saramito@imag.fr> ππ
β¨ COPYRIGHT β¨
Copyright (C) 2000-2018 Pierre Saramito <Pierre.Saramito@imag.fr>
GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. (bestie that's the legal version of "no refunds" π but also slay, free software rights π)
okay that's the whole page, and yeah β this is from rheolef, Version 7.2, and the page is vec(4rheolef). go forth and distribute your vectors, babe π¦β¨π
π¦ where this page comes from
- debian trixie: librheolef-dev 7.2-4 Β· GPL-3.0-or-later
- ubuntu noble: librheolef-dev 7.2-3build5 Β· GPL-3.0-or-later
- ubuntu questing: librheolef-dev 7.2-4build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms