59 std::srand(std::time(0));
70 std::srand(std::time(0));
78 template <
typename Spline>
80 auto &
next(Spline &obj)
const {
81 static_assert(Spline::parDim() == 1 && Spline::geoDim() == 1,
82 "Interval creator requires parDim=1 and geoDim=1");
86 T xmin = std::min(x0, x1);
87 T xmax = std::max(x0, x1);
89 obj.transform([xmin, xmax](
const std::array<T, 1> X) {
90 return std::array<T, 1>{
91 static_cast<T
>(xmin + (xmax - xmin) * X[0])};
100 os << CreatorCore<T>::name() <<
"\n"
102 <<
"; x1min = " <<
x1min_ <<
", x1max = " <<
x1max_ <<
")";
126 std::srand(std::time(0));
139 const T &x1max,
const T &y0min,
const T &y0max,
140 const T &y1min,
const T &y1max)
143 std::srand(std::time(0));
151 template <
typename Spline>
153 auto &
next(Spline &obj)
const {
154 static_assert(Spline::parDim() == 2 && Spline::geoDim() == 2,
155 "Rectangle creator requires parDim=2 and geoDim=2");
159 T xmin = std::min(x0, x1);
160 T xmax = std::max(x0, x1);
164 T ymin = std::min(y0, y1);
165 T ymax = std::max(y0, y1);
167 obj.transform([xmin, xmax, ymin, ymax](
const std::array<T, 2> X) {
168 return std::array<T, 2>{
169 static_cast<T
>(xmin + (xmax - xmin) * X[0]),
170 static_cast<T
>(ymin + (ymax - ymin) * X[1])};
179 os << CreatorCore<T>::name() <<
"\n"
183 <<
"; y1min = " <<
y1min_ <<
", y1max = " <<
y1max_ <<
")";
208 std::srand(std::time(0));
224 CuboidCreator(
const T &x0min,
const T &x0max,
const T &x1min,
const T &x1max,
225 const T &y0min,
const T &y0max,
const T &y1min,
const T &y1max,
226 const T &z0min,
const T &z0max,
const T &z1min,
const T &z1max)
230 std::srand(std::time(0));
238 template <
typename Spline>
240 auto &
next(Spline &obj)
const {
241 static_assert(Spline::parDim() == 3 && Spline::geoDim() == 3,
242 "Cuboid creator requires parDim=3 and geoDim=3");
246 T xmin = std::min(x0, x1);
247 T xmax = std::max(x0, x1);
251 T ymin = std::min(y0, y1);
252 T ymax = std::max(y0, y1);
256 T zmin = std::min(z0, z1);
257 T zmax = std::max(z0, z1);
260 [xmin, xmax, ymin, ymax, zmin, zmax](
const std::array<T, 3> X) {
261 return std::array<T, 3>{
262 static_cast<T
>(xmin + (xmax - xmin) * X[0]),
263 static_cast<T
>(ymin + (ymax - ymin) * X[1]),
264 static_cast<T
>(zmin + (zmax - zmin) * X[2])};
274 os << CreatorCore<T>::name() <<
"\n"
280 <<
"; z1min = " <<
z1min_ <<
", z1max = " <<
z1max_ <<
")";
Abstract creator class.
Definition creator.hpp:28
void pretty_print(std::ostream &os) const noexcept override=0
Returns a string representation of the CreatorCore object.
Cuboid creator class.
Definition creator.hpp:197
T z0min_
Definition creator.hpp:285
T z1min_
Definition creator.hpp:286
T y0max_
Definition creator.hpp:285
T z0max_
Definition creator.hpp:286
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the RectangleCreator object.
Definition creator.hpp:273
CuboidCreator()
Default constructor.
Definition creator.hpp:204
T y0min_
Definition creator.hpp:285
T z1max_
Definition creator.hpp:286
T y1min_
Definition creator.hpp:285
T x1max_
Definition creator.hpp:285
T x1min_
Definition creator.hpp:285
T x0max_
Definition creator.hpp:285
T y1max_
Definition creator.hpp:285
auto & next(Spline &obj) const
Transforms a spline into the next randomly generated cuboid.
Definition creator.hpp:240
CuboidCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max, const T &y0min, const T &y0max, const T &y1min, const T &y1max, const T &z0min, const T &z0max, const T &z1min, const T &z1max)
Bounds constructor.
Definition creator.hpp:224
T x0min_
Bounds of the x-, y-, and z-coordinate sampling ranges.
Definition creator.hpp:285
Interval creator class.
Definition creator.hpp:52
T x1max_
Definition creator.hpp:107
IntervalCreator()
Default constructor.
Definition creator.hpp:58
T x0min_
Bounds of the two endpoint sampling ranges.
Definition creator.hpp:107
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the IntervalCreator object.
Definition creator.hpp:99
auto & next(Spline &obj) const
Transforms a spline into the next randomly generated interval.
Definition creator.hpp:80
T x1min_
Definition creator.hpp:107
IntervalCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max)
Bounds constructor.
Definition creator.hpp:67
T x0max_
Definition creator.hpp:107
Rectangle creator class.
Definition creator.hpp:116
T y0min_
Definition creator.hpp:188
T y0max_
Definition creator.hpp:188
T x1min_
Definition creator.hpp:188
RectangleCreator(const T &x0min, const T &x0max, const T &x1min, const T &x1max, const T &y0min, const T &y0max, const T &y1min, const T &y1max)
Bounds constructor.
Definition creator.hpp:138
T y1min_
Definition creator.hpp:188
T x0min_
Bounds of the x- and y-coordinate sampling ranges.
Definition creator.hpp:188
auto & next(Spline &obj) const
Transforms a spline into the next randomly generated rectangle.
Definition creator.hpp:153
T x1max_
Definition creator.hpp:188
RectangleCreator()
Default constructor.
Definition creator.hpp:123
T y1max_
Definition creator.hpp:188
T x0max_
Definition creator.hpp:188
void pretty_print(std::ostream &os) const noexcept override
Returns a string representation of the RectangleCreator object.
Definition creator.hpp:178
Full qualified name descriptor.
Definition fqn.hpp:22
Concept to identify template parameters that are derived from iganet::Spline_.
Definition bspline.hpp:3858
Full qualified name utility functions.
std::ostream & operator<<(std::ostream &os, const MemoryDebugger< id > &obj)
Prints a memory debugger object.
Definition memory.hpp:145