MCPcopy Create free account
hub / github.com/TinyMPC/TinyMPC / sample

Method sample

include/Eigen/Eigen/src/Geometry/AlignedBox.h:202–216  ·  view source on GitHub ↗

\returns a random point inside the bounding box sampled with * a uniform distribution */

Source from the content-addressed store, hash-verified

200 /** \returns a random point inside the bounding box sampled with
201 * a uniform distribution */
202 EIGEN_DEVICE_FUNC inline VectorType sample() const
203 {
204 VectorType r(dim());
205 for(Index d=0; d<dim(); ++d)
206 {
207 if(!ScalarTraits::IsInteger)
208 {
209 r[d] = m_min[d] + (m_max[d]-m_min[d])
210 * internal::random<Scalar>(Scalar(0), Scalar(1));
211 }
212 else
213 r[d] = internal::random(m_min[d], m_max[d]);
214 }
215 return r;
216 }
217
218 /** \returns true if the point \a p is inside the box \c *this. */
219 template<typename Derived>

Callers

nothing calls this directly

Calls 2

dimFunction · 0.85
randomFunction · 0.85

Tested by

no test coverage detected