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) The Type template type parameter can be any integral or floating point type. If you don't specify one, size_t is what you get. The parameters minimum and maximum define the range of the generated random values. And listen β€” minimum must be less or equal to maximum, or an exception is thrown. Like, that's not a suggestion bestie, she will absolutely throw hands (an exception) πŸ™ˆ The mtSeed parameter is used to initialize (seed) the mt19937 Mercenne 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 infinite while (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 says RandomMt<double> β€” lowercase t β€” while the class is RandomMT. 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 🌸

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’. 🌈


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