Query: randbuffer
OS: debian
Section: 3bobcat
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FBB::RandBuffer(3bobcat) random number streambuf FBB::RandBuffer(3bobcat)NAMEFBB::RandBuffer - std::streambuf generating random numbersSYNOPSIS#include <bobcat/randbuffer> Linking option: -lbobcatDESCRIPTIONFBB:RandBuffer objects may be used as a std::streambuf of std::istream objects to allow the extraction of random numbers from the stream.NAMESPACEFBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.INHERITS FROMstd::streambufCONSTRUCTORo Randbuffer(int min, int max, size_t seed = 1): This Randbuffer() constructor initializes the random generator. The seed is used to initialze the random number generator.Random values between min and max (inclusive) are returned.VIRTUAL MEMBERSo int underflow(): This function is called by std::istream objects using Randbuffer. It produces the next available random number, separating the ran- dom numbers by one blanks space. Random values between min and max (inclusive) are returned (see the description of the construc- tor).INHERITED MEMBERSSince the class uses public derivation from std::streambuf, all members of this class can be used.EXAMPLE#include <iostream> #include <istream> #include <bobcat/randbuffer> #include <bobcat/a2x> using namespace std; using namespace FBB; int main(int argc, char **argv) { if (argc == 1) { cout << "expect: nruns min max seed "; return 1; } Randbuffer rb(A2x(argv[2]), A2x(argv[3]), A2x(argv[4]).to<size_t>()); istream istr(&rb); for (int idx = A2x(argv[1]); idx--; ) { int c; if (!(istr >> c)) { cout << "extraction failed "; break; } cout << "next: " << c << endl; } int count = 0; while (istr.unget()) count++; cout << "number of successful unget()-calls: " << count << endl; istr.clear(); istr >> count; cout << "and read: " << count << endl; return 0; }FILESbobcat/randbuffer - defines the class interfaceSEE ALSObobcat(7), irandstream(3bobcat), rand(3), srand(3), std::streambufBUGSNone Reported.DISTRIBUTION FILESo bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location;BOBCATBobcat is an acronym of `Brokken's Own Base Classes And Templates'.COPYRIGHTThis is free software, distributed under the terms of the GNU General Public License (GPL).AUTHORFrank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::RandBuffer(3bobcat)
Related Man Pages |
---|
hostname(3bobcat) - debian |
irandstream(3bobcat) - debian |
iostream(3bobcat) - opendarwin |
level(3bobcat) - linux |
level(3bobcat) - mojave |
Similar Topics in the Unix Linux Community |
---|
Can some 1 explain why this behaviour |
g++ is OK while gcc is failed |
ltoa Behavior |
library for cout question |
std::cout and gfortran print*, don't output to the screen |