fn duoprism_vertices(p: &[Point<f64>], q: &[Point<f64>]) -> Vec<Point<f64>> {
    // The dimension of the points in p.
    let p_dim = if let Some(vp) = p.get(0) {
        vp.len()
    } else {
        return Vec::new();
    };

    // The dimension of the points in q.
    let q_dim = if let Some(vq) = q.get(0) {
        vq.len()
    } else {
        return Vec::new();
    };

    // The dimension of our new points.
    let dim = p_dim + q_dim;

    // We take all elements in the cartesian product p × q, and chain each
    // pair together.
    itertools::iproduct!(p.iter(), q.iter())
        .map(|(vp, vq)| Point::from_iterator(dim, vp.iter().chain(vq.iter()).copied()))
        .collect::<Vec<_>>()
}
/// Generates the vertices for a duoprism with two given vertex sets.
Generates the vertices for a duoprism with two given vertex sets.
Generates the vertices for a duoprism with two given vertex sets .
fn duoprism_vertices(p: &[Point<f64>], q: &[Point<f64>]) -> Vec<Point<f64>> {
    // The dimension of the points in p.
    let p_dim = if let Some(vp) = p.get(0) {
        vp.len()
    } else {
        return Vec::new();
    };
    // The dimension of the points in q.
    let q_dim = if let Some(vq) = q.get(0) {
        vq.len()
    } else {
        return Vec::new();
    };
    // The dimension of our new points.
    let dim = p_dim + q_dim;
    // We take all elements in the cartesian product p × q, and chain each
    // pair together.
    itertools::iproduct!(p.iter(), q.iter())
        .map(|(vp, vq)| Point::from_iterator(dim, vp.iter().chain(vq.iter()).copied()))
        .collect::<Vec<_>>()
}
fn duoprism_vertices ( p : & [ Point < f64 > ] , q : & [ Point < f64 > ] ) -> Vec < Point < f64 > > { // The dimension of the points in p. let p_dim = if let Some ( vp ) = p . get ( 0 ) { vp . len ( ) } else { return Vec :: new ( ) ; } ; // The dimension of the points in q. let q_dim = if let Some ( vq ) = q . get ( 0 ) { vq . len ( ) } else { return Vec :: new ( ) ; } ; // The dimension of our new points. let dim = p_dim + q_dim ; // We take all elements in the cartesian product p × q, and chain each // pair together. itertools :: iproduct ! ( p iter ( ) q iter ( ) ) . map ( | ( vp , vq ) | Point :: from_iterator ( dim , vp . iter ( ) . chain ( vq . iter ( ) ) . copied ( ) ) ) . collect :: < Vec < _ > > ( ) }
Generates the vertices for a duoprism with two given vertex sets.
Generates the vertices for a duoprism with two given vertex sets .
p
&[Point<f64>]
q
&[Point<f64>]