31 #ifndef NUMCPP_NO_USE_BOOST
36 #include "boost/random/triangle_distribution.hpp"
64 template<
typename dtype,
typename GeneratorType = std::mt19937>
65 dtype
triangle(GeneratorType& generator, dtype inA = 0, dtype inB = 0.5, dtype inC = 1)
84 const bool aLessB = inA <= inB;
85 const bool bLessC = inB <= inC;
86 if (!(aLessB && bLessC))
91 boost::random::triangle_distribution<dtype> dist(inA, inB, inC);
92 return dist(generator);
111 template<
typename dtype,
typename GeneratorType = std::mt19937>
113 triangle(GeneratorType& generator,
const Shape& inShape, dtype inA = 0, dtype inB = 0.5, dtype inC = 1)
132 const bool aLessB = inA <= inB;
133 const bool bLessC = inB <= inC;
134 if (!(aLessB && bLessC))
141 boost::random::triangle_distribution<dtype> dist(inA, inB, inC);
145 [&generator, &dist](dtype& value) ->
void { value = dist(generator); });
164 template<
typename dtype>
165 dtype
triangle(dtype inA = 0, dtype inB = 0.5, dtype inC = 1)
185 template<
typename dtype>
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:36
#define STATIC_ASSERT_FLOAT(dtype)
Definition: StaticAsserts.hpp:45
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
iterator end() noexcept
Definition: NdArrayCore.hpp:1479
iterator begin() noexcept
Definition: NdArrayCore.hpp:1171
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
dtype triangle(GeneratorType &generator, dtype inA=0, dtype inB=0.5, dtype inC=1)
Definition: triangle.hpp:65
dtype triangle(dtype inA=0, dtype inB=0.5, dtype inC=1)
Definition: triangle.hpp:165
static std::mt19937_64 generator_
generator function
Definition: generator.hpp:37
void for_each(InputIt first, InputIt last, UnaryFunction f)
Definition: StlAlgorithms.hpp:227
Definition: Coordinate.hpp:45