pub struct UnitDistanceSet { /* private fields */ }Expand description
Builder for generating unit-distance point sets.
§Behaviour by construction type
SquareGrid: Returnsrows × colspoints;n_targetis ignored.MoserSpindle: Always returns exactly 7 points;n_targetis ignored.TriangularGrid: Returns exactlyn_targetpoints.Multiquadratic: Returns exactlyn_targetpoints from the native multiquadratic prototype.
Implementations§
Source§impl UnitDistanceSet
impl UnitDistanceSet
Sourcepub fn square_grid(rows: usize, cols: usize) -> Self
pub fn square_grid(rows: usize, cols: usize) -> Self
Creates a new builder for a square grid.
Sourcepub fn triangular_grid() -> Self
pub fn triangular_grid() -> Self
Creates a new builder for a triangular grid.
Sourcepub fn moser_spindle() -> Self
pub fn moser_spindle() -> Self
Creates a new builder for the Moser Spindle.
Sourcepub fn try_new_multiquadratic(
generators: Vec<i64>,
split_prime: i64,
k: usize,
) -> Result<Self, GenerationError>
pub fn try_new_multiquadratic( generators: Vec<i64>, split_prime: i64, k: usize, ) -> Result<Self, GenerationError>
Creates a validated builder for the native finite multiquadratic prototype.
generators are the positive squarefree integers generating the real subfield.
The imaginary generator -1 is appended automatically if not already present.
split_prime must be an odd prime split completely in K.
k is the exponent/depth parameter.
§Examples
use erdos_unit_distance::{ConstructionType, MultiquadraticConfig, UnitDistanceSet};
let config = MultiquadraticConfig::builder(vec![5, 17], 101, 1).build().unwrap();
let set = UnitDistanceSet::multiquadratic(config);
match set.construction() {
ConstructionType::Multiquadratic(config) => assert!(config.generators().contains(&-1)),
_ => unreachable!(),
}pub fn multiquadratic(config: MultiquadraticConfig) -> Self
pub fn construction(&self) -> &ConstructionType
Sourcepub fn generate(
&self,
n_target: usize,
) -> Result<Vec<[f64; 2]>, GenerationError>
pub fn generate( &self, n_target: usize, ) -> Result<Vec<[f64; 2]>, GenerationError>
Generates the point set of target size n_target.
For SquareGrid and MoserSpindle, the n_target parameter is ignored
and the natural point count of the construction is returned.
pub fn generate_points( &self, n_target: usize, ) -> Result<Vec<Point2>, GenerationError>
Sourcepub fn generate_certified(
&self,
n_target: usize,
) -> Result<CertifiedPointSet, GenerationError>
pub fn generate_certified( &self, n_target: usize, ) -> Result<CertifiedPointSet, GenerationError>
Generates a point set plus a machine-checkable certificate for the finite output.
The certificate is authoritative for verification; floating coordinates are still exposed for display, export, and downstream numerical workflows.
Trait Implementations§
Source§impl Clone for UnitDistanceSet
impl Clone for UnitDistanceSet
Source§fn clone(&self) -> UnitDistanceSet
fn clone(&self) -> UnitDistanceSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more