31 #ifndef NUMCPP_NO_USE_BOOST
39 #include "boost/random/triangle_distribution.hpp"
60 template<
typename dtype>
61 dtype
triangle(dtype inA = 0, dtype inB = 0.5, dtype inC = 1)
80 const bool aLessB = inA <= inB;
81 const bool bLessC = inB <= inC;
82 if (!(aLessB && bLessC))
87 boost::random::triangle_distribution<dtype> dist(inA, inB, inC);
105 template<
typename dtype>
125 const bool aLessB = inA <= inB;
126 const bool bLessC = inB <= inC;
127 if (!(aLessB && bLessC))
134 boost::random::triangle_distribution<dtype> dist(inA, inB, inC);
137 [&dist](dtype& value) ->
void
139 value = dist(generator_);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:43
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
iterator end() noexcept
Definition: NdArrayCore.hpp:1474
iterator begin() noexcept
Definition: NdArrayCore.hpp:1166
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
dtype triangle(dtype inA=0, dtype inB=0.5, dtype inC=1)
Definition: triangle.hpp:61
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:39
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:213
Definition: Coordinate.hpp:45