range(4rheolef)
β¨ 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 π
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
- 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