C++ Library Extensions 2022.12.09
To help learn modern C++ programming
tpf_chrono_random.hpp File Reference
#include <tpf_types.hpp>
#include <tpf_conversion.hpp>
#include <chrono>
#include <ratio>
#include <random>
#include <iostream>
#include <sstream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <execution>
Include dependency graph for tpf_chrono_random.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tpf::chrono_random::stop_watch
 
class  tpf::chrono_random::fair_dice< Type, typename >
 
class  tpf::chrono_random::random_t< Type, DistributionType, EngineType >
 
class  tpf::chrono_random::random_words< CharType, Size >
 

Namespaces

namespace  tpf
 Includes subnamespace conversion.
 
namespace  tpf::chrono_random
 Implements random number generator and stop watch.
 

Macros

#define NOMINMAX
 

Typedefs

using tpf::chrono_random::nano_t = std::nano
 
using tpf::chrono_random::micro_t = std::micro
 
using tpf::chrono_random::milli_t = std::milli
 
using tpf::chrono_random::second_t = std::ratio< 1 >
 
using tpf::chrono_random::minute_t = std::ratio< 60 >
 
using tpf::chrono_random::hour_t = std::ratio< 3600 >
 
template<typename TimeUnit >
using tpf::chrono_random::duration_t = std::chrono::duration< double, TimeUnit >
 
using tpf::chrono_random::nanoseconds_t = duration_t< nano_t >
 
using tpf::chrono_random::microseconds_t = duration_t< micro_t >
 
using tpf::chrono_random::milliseconds_t = duration_t< milli_t >
 
using tpf::chrono_random::seconds_t = duration_t< second_t >
 
using tpf::chrono_random::minutes_t = duration_t< minute_t >
 
using tpf::chrono_random::hours_t = duration_t< hour_t >
 
using tpf::chrono_random::high_resolution_clock_t = std::chrono::high_resolution_clock
 
using tpf::chrono_random::time_point_t = std::chrono::time_point< high_resolution_clock_t >
 
using tpf::chrono_random::random_engine_t = std::default_random_engine
 
template<typename IntegralType , typename Type = std::enable_if_t<types::is_integral_v<IntegralType>>>
using tpf::chrono_random::random_uniform_integral_distribution = std::uniform_int_distribution< IntegralType >
 
template<typename RealType , typename Type = std::enable_if_t<types::is_real_number_v<RealType>>>
using tpf::chrono_random::random_uniform_real_distribution = std::uniform_real_distribution< RealType >
 
template<typename IntegralType , typename Type = std::enable_if_t<types::is_integral_v<IntegralType>>>
using tpf::chrono_random::random_uniform_integer_t = random_t< IntegralType, random_uniform_integral_distribution< IntegralType >, random_engine_t >
 
template<typename RealType , typename Type = std::enable_if_t<types::is_real_number_v<RealType>>>
using tpf::chrono_random::random_uniform_real_t = random_t< RealType, random_uniform_real_distribution< RealType >, random_engine_t >
 

Functions

unsigned int tpf::chrono_random::seed ()
 
unsigned int tpf::chrono_random::get_current_tick ()
 
template<typename TimeUnit >
double tpf::chrono_random::time_difference_in_unit (const time_point_t &start_time, const time_point_t &end_time)
 
template<typename ValueType , typename RangeType1 , typename RangeType2 >
auto tpf::chrono_random::random_generator (RangeType1 range_start, RangeType2 range_end)
 
template<template< typename, typename... > class ContainerType, typename Type , typename RType , typename... Types, template< typename, typename... > class RandomGeneratorType, typename... RTypes>
void tpf::chrono_random::random_fill (ContainerType< Type, Types... > &container, const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<typename Type , std::size_t N, typename RandomGeneratorType >
void tpf::chrono_random::random_fill (Type(&container)[N], RandomGeneratorType const &random_generator)
 
template<typename Type , std::size_t M, std::size_t N, typename RandomGeneratorType >
void tpf::chrono_random::random_fill (Type(&container)[M][N], RandomGeneratorType const &random_generator)
 
template<typename Type , std::size_t L, std::size_t M, std::size_t N, typename RandomGeneratorType >
void tpf::chrono_random::random_fill (Type(&container)[L][M][N], RandomGeneratorType const &random_generator)
 
template<template< typename, std::size_t > class ContainerType, typename Type , std::size_t N, typename RType , template< typename, typename... > class RandomGeneratorType, typename... RTypes>
void tpf::chrono_random::random_fill (ContainerType< Type, N > &container, const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<template< typename, typename... > class ContainerType, typename Type , typename... Types, typename RandomGeneratorType >
void tpf::chrono_random::random_fill (ContainerType< Type, Types... > &container, RandomGeneratorType &&random_generator)
 
template<template< typename, typename... > class ContainerType, typename Type , typename... Types, typename RType , template< typename, typename... > class RandomGeneratorType, typename... RTypes>
void tpf::chrono_random::random_parallel_fill (ContainerType< Type, Types... > &container, const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<typename Type , std::size_t N, template< typename, typename... > class RandomGeneratorType, typename RType , typename... RTypes>
void tpf::chrono_random::random_parallel_fill (Type(&container)[N], const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<typename Type , std::size_t M, std::size_t N, template< typename, typename... > class RandomGeneratorType, typename RType , typename... RTypes>
void tpf::chrono_random::random_parallel_fill (Type(&container)[M][N], const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<typename Type , std::size_t L, std::size_t M, std::size_t N, template< typename, typename... > class RandomGeneratorType, typename RType , typename... RTypes>
void tpf::chrono_random::random_parallel_fill (Type(&container)[L][M][N], const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<template< typename, std::size_t > class ContainerType, typename Type , std::size_t N, typename RType , template< typename, typename... > class RandomGeneratorType, typename... RTypes>
void tpf::chrono_random::random_parallel_fill (ContainerType< Type, N > &container, const RandomGeneratorType< RType, RTypes... > &random_generator)
 
template<template< typename, typename... > class ContainerType, typename Type , typename... Types, typename RandomGeneratorType >
void tpf::chrono_random::random_parallel_fill (ContainerType< Type, Types... > &container, RandomGeneratorType &&random_generator)
 
template<template< typename, typename... > class ContainerType, typename Type , typename... Types, typename SizeType , template< typename, typename... > class RandomGeneratorType, typename... RTypes>
void tpf::chrono_random::random_fill (ContainerType< Type, Types... > &container, const RandomGeneratorType< Type, RTypes... > &random_generator, SizeType size)
 Fills the /a container with random numbers. If the /a container is /a set or /a unordered_set, the range of the random_generator should be sufficiently big, otherwise it can fall into infinity loop.
More...
 
template<typename Type , size_t ArraySize>
 tpf::chrono_random::random_words (int, int, int, const Type(&)[ArraySize]) -> random_words< Type, ArraySize >
 

Variables

auto & tpf::chrono_random::now = high_resolution_clock_t::now
 

Detailed Description

Author
your name (you@d.nosp@m.omai.nosp@m.n.com)
Version
0.1
Date
2019-04-28

Definition in file tpf_chrono_random.hpp.

Macro Definition Documentation

◆ NOMINMAX

#define NOMINMAX

Definition at line 16 of file tpf_chrono_random.hpp.