Git Product home page Git Product logo

sfmt-class's Introduction

SFMT-class

Build Status

This is an unofficial wrapper of SFMT for C++. It can also be used as just a simple installer of SFMT for C/C++. SFMT is a new variant of Mersenne Twister (MT) introduced by Mutsuo Saito and Makoto Matsumoto.

http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/

Installation

The easiest way is to use Homebrew:

% brew install heavywatal/tap/sfmt-class

Alternatively, you can get the source code from GitHub manually:

% git clone https://github.com/heavywatal/sfmt-class.git
% cd sfmt-class/
% git submodule update --init
% mkdir build
% cd build/
% cmake -DCMAKE_INSTALL_PREFIX=${HOME}/local ..
% make
% make install

Header files are installed to ${CMAKE_INSTALL_PREFIX}/include/. This library can be imported from other CMake projects:

find_package(sfmt)
target_link_libraries(${YOUR_TARGET} PRIVATE wtl::sfmt)

Usage in C++

C++ header sfmt.hpp is installed in addition to the original C headers. A wrapper class wtl::sfmt19937 is compatible with std::mt19937 and can be used in combination with std::*_distribution in <random>. For convenience, a static object is initialized with std::random_device, and its reference is provided through an inline function sfmt(). See test/example.cpp and try ctest -V. The 64-bit version wtl::sfmt19937_64 and wtl::sfmt64() are also available, and faster than 32-bit version in most cases.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.