9#ifndef IMPALGEBRA_VECTOR_GENERATORS_H
10#define IMPALGEBRA_VECTOR_GENERATORS_H
19#include "internal/grid_range_d.h"
20#include "internal/internal_vector_generators.h"
22IMPALGEBRA_BEGIN_NAMESPACE
40 return internal::get_random_vector_in(bb);
49 return internal::RandomVectorOnBB<D>::get(bb);
58 IMP_USAGE_CHECK(s.get_radius() > 0,
"The sphere must have positive radius");
62 double r2 = get_squared(s.get_radius());
66 norm = (s.get_center() - ret).get_squared_magnitude();
92 return internal::get_random_vector_on_unit_sphere();
101 return internal::get_random_vector_on(s);
118 return internal::uniform_cover_sphere(n, s.get_center(), s.get_radius(),
136 return internal::uniform_cover_sphere(n, s.get_center(), s.get_radius(),
146 return internal::get_random_vector_on(s);
155 int number_of_points_on_cycle);
165 unsigned int number_of_points);
172 unsigned int number_of_points);
181 const unsigned int dim = bb.get_dimension();
185 for (
unsigned int i = 0; i < dim; ++i) {
186 double w = bb.get_corner_1()[i] - bb.get_corner_0()[i];
188 start[i] = bb.get_corner_0()[i] + w * .5;
192 ns[i] =
static_cast<int>(std::floor(w / s));
193 spacing[i] = w / ns[i];
194 start[i] = bb.get_corner_0()[i] + spacing[i] * .5;
202 for (i = 0; i < dim; ++i) {
204 if (cur[i] == ns[i]) {
244 double points_per_square_angstrom);
245IMPALGEBRA_END_NAMESPACE
A bounding box in D dimensions.
Represent a cylinder in 3D.
Simple 3D sphere patch class.
Functions to deal with very common math operations.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
A Cartesian vector in D-dimensions.
A more IMP-like version of the std::vector.
An axis-aligned bounding box.
Represent a cylinder in 3D.
Represent a sphere in D-dimensions.
A sphere patch is defined as all points above the plane and on the sphere.
Represent a unit simplex embedded in D-dimensional real space.
Vector< VectorD< D > > get_uniform_surface_cover(const SphereD< D > &s, unsigned int n)
Generate a set of vectors which covers a sphere uniformly.
VectorD< D > get_elementwise_product(const VectorD< D > &a, const VectorD< D > &b)
Return the vector that is the elementwise product of the two.
Vector< VectorD< D > > get_uniform_upper_hemisphere_cover(const SphereD< D > &s, unsigned int n)
Generate a set of 3D points that uniformly cover a hemisphere.
VectorD< D > get_random_vector_on(const BoundingBoxD< D > &bb)
Generate a random vector on a box with uniform density.
IMP::Vector< Sphere3D > Sphere3Ds
VectorD< D > get_random_vector_in(const BoundingBoxD< D > &bb)
Generate a random vector in a box with uniform density.
Vector< VectorD< D > > get_grid_interior_cover_by_spacing(const BoundingBoxD< D > &bb, double s)
VectorD< 3 > get_random_vector_on_unit_sphere()
Vector3Ds get_grid_surface_cover(const Cylinder3D &cyl, int number_of_cycles, int number_of_points_on_cycle)
Generate a grid of 3d points on a cylinder surface.
Vector3Ds get_random_chain(unsigned int n, double r, const Vector3D &start=Vector3D(0, 0, 0), const Sphere3Ds &obstacles=Sphere3Ds())
Generate a random chain with no collisions.
Vector< VectorD< 3 > > Vector3Ds
IMP::Vector< Int > Ints
Standard way to pass a bunch of Int values.