FBB:...domMT(3bobcat)
π FBB:...domMT(3bobcat) π
okay bestie, welcome to the 3bobcat girlies' corner of the manual pages β we're looking at FBB::...domMT today (yes the title got eaten, we don't talk about it, the page is iconic regardless) β¨
πΈ NAME πΈ
FBB::RandomMT β a class template that generates random numbers, no cap fr fr π²
β¨ SYNOPSIS β¨
#include <bobcat/randommt>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
okay so here's the whole vibe: the class template RandomMT uses the std::mt19937 Mercenne Twister to produce random numbers. That's it, that's the job, and she does it flawlessly π
She takes exactly one template type parameter, and that parameter can be any integral or floating point type. Whatever floats your boat (literally, if you pick double).
By default? She generates size_t-valued random numbers. Lowkey a good default, highkey a great one π«Ά
π NAMESPACE π
FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB. Everything. All of it. Family reunion in FBB π
π INHERITS FROM π
-
Nothing. Zero. Zilch. She inherits from no one β she's self-made, main character energy, standing on her own two feet πβ¨
π CONSTRUCTORS π
RandomMT<typename Type = size_t>::RandomMT(Type minimum, Type maximum, size_t mtSeed)TheTypetemplate type parameter can be any integral or floating point type. If you don't specify one,size_tis what you get. The parametersminimumandmaximumdefine the range of the generated random values. And listen βminimummust be less or equal tomaximum, or an exception is thrown. Like, that's not a suggestion bestie, she will absolutely throw hands (an exception) π ThemtSeedparameter is used to initialize (seed) themt19937Mercenne Twister. Seeding is the whole personality trait here.
The default copy and move constructors and assignment operators are available β she shares and she moves, respectfully π«Ά
β OVERLOADED OPERATORS β
Type operator()()The function call operator returns the next random value. Just call her. She delivers. Every single time π₯
π EXAMPLE π
#include <iostream>
#include <bobcat/randommt>
using namespace std;
using namespace FBB;
int main(int argc, char **argv)
try
{
if (argc == 1)
{
cout << "arg[1]: minimum value, arg[2]: maximum value,\n"
"arg[3]: (optional) seed (or time(0))\n";
return 0;
}
// specify, e.g., RandomMt<double> to generate random double values
RandomMT<> rmt( stoull(argv[1]), stoull(argv[2]),
argc >= 4 ? stoull(argv[3]) : time(0) );
while (true)
{
cout << rmt() << "\n"
"Enter: next";
cin.ignore(1000, β\nβ);
}
}
catch (exception const &exc)
{
cerr << exc.what() << β\nβ;
}
β οΈ heads up babe: that's an infinitewhile (true)loop, so this program does not end on its own. She's committed. Ctrl+C is your friend π (also: note that the comment in the original code saysRandomMt<double>β lowercasetβ while the class isRandomMT. Copy-paste the comment as-is, it's part of the lore π)
π FILES π
bobcat/randommtβ defines the class interface π
π§ SEE ALSO π§
bobcat(7), irandstream(3bobcat), rand(3), randbuf(3bobcat), srand(3)
the whole random-number friend group, all linked up ππ
π BUGS π
None Reported.
(not a single one. she's perfect. we love that for her π)
πΈ BOBCAT PROJECT FILES πΈ
- https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
β¨ BOBCAT β¨
Bobcat is an acronym of `Brokkenβs Own Base Classes And Templatesβ. π
π COPYRIGHT π
This is free software, distributed under the terms of the GNU General Public License (GPL). Free as in freedom, bestie π«Ά
π AUTHOR π
Frank B. Brokken (f.b.brokken@rug.nl). The legend himself π
and that's the whole page!! mwah π this one shipped in libbobcat-dev_6.15.01, dated 2005-2026 β a whole two-decade era of randomness, we stan a timeless queen π¦β¨ periodt π
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms