range(4rheolef)

πŸ“¦
version 7.2 Β· 4 versions
, in debian trixie, ubuntu noble, ubuntu questing

✨ range(4rheolef) ✨

okay bestie, buckle up, this is the range page from the rheolef manual (that's rheolef-7.2, the whole manual, hi hello) and it's genuinely such a lil cutie of a class, you're gonna be obsessed πŸ’–


🌸 NAME 🌸

range β€” index range for a subset of a vector, no cap πŸŽ€


πŸ’… DESCRIPTION πŸ’…

so like, this class represents a range of index, right? and what it's for is addressing a subset of the vec(4) container. that's it. that's the whole vibe. it's giving "here's the slice of the vector I want, and I'm not gonna make it complicated" ✨


πŸ¦‹ EXAMPLE πŸ¦‹

literally the whole thing in four lines, periodt:

vec<double> x (100, 3.14);
vec<double> y = x(range(0,50));
dout << y << endl;

like, you make a vec<double> x with 100 entries all chillin' at 3.14, then you grab a subset with x(range(0,50)) and that lands in y, and then you dout << y << endl and go live your life. iconic behaviour fr fr 🌈


πŸ‘‘ IMPLEMENTATION πŸ‘‘

this documentation has been generated from file linalg/lib/range.h β€” yes, that's the receipts, we don't gatekeep 🫢

struct range {
  using size_type = size_t;
  range (size_type start=0, size_type stop=0);
  size_type start() const;
  size_type size() const;
  static range all();

};

look at that struct. size_type is aliased to size_t (a whole mood). the constructor takes start=0 and stop=0 as defaults, so you can just vibe with range() if you want. then you've got start() returning a size_type, size() returning a size_type, and a static all() that β€” iykyk β€” gives you everything. πŸ’…


πŸŽ€ AUTHOR πŸŽ€

Pierre Saramito <Pierre.Saramito@imag.fr> β€” the author, the main character, we love them πŸ’œ


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. ⚠️ like, that part is serious bestie, no cap, the warranty is genuinely not there.

okay that's the whole page πŸ“ and a lil sign-off for you: this came out of rheolef, Version 7.2, and it lives at range(4rheolef) in the manual πŸ’– stay slaying, go subset some vectors ✨🧚

πŸ“¦ where this page comes from