pub fn with_levels(dimensions: usize, state: S, levels: usize) -> (Self, Vec<ID>) {
        let (mut qdf, _) = Self::new(dimensions, state);
        for _ in 0..levels {
            let spaces = qdf.spaces().cloned().collect::<Vec<ID>>();
            for id in spaces {
                qdf.increase_space_density(id).unwrap();
            }
        }
        let spaces = qdf.spaces().cloned().collect();
        (qdf, spaces)
    }
/// Creates new QDF information universe and increase its levels of density.
///
/// # Arguments
/// * `dimensions` - Number of dimensions which space contains.
/// * `state` - State of space.
/// * `levels` - Number of levels of uniform density.
///
/// # Returns
/// Tuple of new QDF object and vector of space ids.
///
/// # Examples
/// ```
/// use quantized_density_fields::{QDF, State};
///
/// // Creates 2d space with `27` as root state and 2 levels of uniform density.
/// let (qdf, spaces) = QDF::with_levels(2, 27, 2);
/// assert_eq!(spaces.len(), (qdf.dimensions() + 1).pow(2));
/// assert_eq!(*qdf.space(spaces[0]).state(), 3);
/// assert_eq!(
///     State::merge(&qdf.spaces().map(|id| *qdf.space(*id).state()).collect::<Vec<i32>>()),
///     27,
/// );
/// ```
Creates new QDF information universe and increase its levels of density.
Creates new QDF information universe and increase its levels of density .
pub fn with_levels(dimensions: usize, state: S, levels: usize) -> (Self, Vec<ID>) {
        let (mut qdf, _) = Self::new(dimensions, state);
        for _ in 0..levels {
            let spaces = qdf.spaces().cloned().collect::<Vec<ID>>();
            for id in spaces {
                qdf.increase_space_density(id).unwrap();
            }
        }
        let spaces = qdf.spaces().cloned().collect();
        (qdf, spaces)
    }
pub fn with_levels ( dimensions : usize , state : S , levels : usize ) -> ( Self , Vec < ID > ) { let ( mut qdf , _ ) = Self :: new ( dimensions , state ) ; for _ in 0 .. levels { let spaces = qdf . spaces ( ) . cloned ( ) . collect :: < Vec < ID > > ( ) ; for id in spaces { qdf . increase_space_density ( id ) . unwrap ( ) ; } } let spaces = qdf . spaces ( ) . cloned ( ) . collect ( ) ; ( qdf , spaces ) }
Creates new QDF information universe and increase its levels of density.
Creates new QDF information universe and increase its levels of density .
dimensions
usize
state
S
levels
usize
Tuple of new QDF object and vector of space ids.
Tuple of new QDF object and vector of space ids .
dimensions
usize
state
S
levels
usize
examples
```
use quantized_density_fields::{QDF, State}.

Creates 2d space with `27` as root state and 2 levels of uniform density.
` ` ` use quantized_density_fields :: { QDF State } . Creates 2d space with ` 27 ` as root state and 2 levels of uniform density .