Prev Next Index-> contents reference index search external Up-> CppAD speed speed_utility uniform_01 uniform_01.hpp speed-> speed_main speed_utility speed_double speed_adolc speed_cppad speed_fadbad speed_sacado speed_utility-> det_by_lu det_of_minor det_by_minor det_33 det_grad_33 mat_sum_sq ode_evaluate sparse_jac_fun sparse_hes_fun uniform_01 uniform_01-> uniform_01.hpp uniform_01.hpp Headings

$\newcommand{\W}[1]{ \; #1 \; } \newcommand{\R}[1]{ {\rm #1} } \newcommand{\B}[1]{ {\bf #1} } \newcommand{\D}[2]{ \frac{\partial #1}{\partial #2} } \newcommand{\DD}[3]{ \frac{\partial^2 #1}{\partial #2 \partial #3} } \newcommand{\Dpow}[2]{ \frac{\partial^{#1}}{\partial {#2}^{#1}} } \newcommand{\dpow}[2]{ \frac{ {\rm d}^{#1}}{{\rm d}\, {#2}^{#1}} }$
Source: uniform_01
# ifndef CPPAD_UNIFORM_01_HPP # define CPPAD_UNIFORM_01_HPP # include <cstdlib> namespace CppAD { inline void uniform_01(size_t seed) { std::srand( (unsigned int) seed); } template <class Vector> void uniform_01(size_t n, Vector &x) { static double factor = 1. / double(RAND_MAX); while(n--) x[n] = std::rand() * factor; } } # endif 
Input File: omh/uniform_01_hpp.omh