#![deny(missing_docs)]
#![forbid(unsafe_code)]
pub use faer::{Mat, MatRef};
mod gpa;
mod lap;
mod orthogonal;
mod signed_permutation;
pub use gpa::{generalized, GpaAlignment, GpaInit, GpaOptions, InnerAligner};
pub use orthogonal::{orthogonal, rotation_only, OrthogonalAlignment};
pub use signed_permutation::{
sign_align, signed_permutation, SignAlignment, SignedPermutationAlignment,
};
pub(crate) fn is_all_finite(x: MatRef<'_, f64>) -> bool {
for j in 0..x.ncols() {
for i in 0..x.nrows() {
if !x[(i, j)].is_finite() {
return false;
}
}
}
true
}
#[non_exhaustive]
#[derive(Debug, thiserror::Error)]
pub enum ProcrustesError {
#[error("dimension mismatch: a is {a_rows}×{a_cols}, reference is {ref_rows}×{ref_cols}")]
DimensionMismatch {
a_rows: usize,
a_cols: usize,
ref_rows: usize,
ref_cols: usize,
},
#[error("empty input: rows or columns is zero")]
EmptyInput,
#[error("invalid options: {0}")]
InvalidOptions(&'static str),
#[error("non-finite value in input")]
NonFinite,
}