Skip to main content

Crate procrustes

Crate procrustes 

Source
Expand description

procrustes — orthogonal Procrustes, signed-permutation alignment, and Generalised Procrustes Analysis (GPA).

§Convention

All four alignment functions return a transform T such that a · T ≈ reference minimizes the Frobenius norm under their respective constraints. For orthogonal and rotation_only, T = R is a K×K orthogonal matrix (with rotation_only further restricted to det(R) = +1). For signed_permutation, T = P · diag(signs) where P is the permutation encoded by assigned; equivalently, column k of a · T equals signs[k] · a[:, assigned[k]]. For sign_align, T = diag(signs) (the degenerate identity-permutation case). Matches SciPy’s (A @ R) - B minimization convention in scipy.linalg.orthogonal_procrustes. For multi-matrix consensus alignment, see generalized.

Structs§

GpaAlignment
Result of generalized.
GpaOptions
Options for generalized. Construct via GpaOptions::default() and override fields with struct-update syntax.
OrthogonalAlignment
Result of orthogonal.
SignAlignment
Result of sign_align.
SignedPermutationAlignment
Result of signed_permutation.

Enums§

GpaInit
Initial consensus seed for generalized.
InnerAligner
Inner per-iteration aligner used by generalized.
ProcrustesError
Error variants returned by the alignment functions (orthogonal, rotation_only, signed_permutation, sign_align, generalized).

Functions§

generalized
Generalised Procrustes Analysis: iterative consensus alignment of N matrices.
orthogonal
Solve min_R ‖a · R − reference‖_F over orthogonal K×K R.
rotation_only
Orthogonal Procrustes restricted to proper rotations (det(R) = +1, R ∈ SO(K)).
sign_align
Sign-only alignment: for each column k, choose s[k] ∈ {−1, +1} to maximise ⟨s[k] · a[:, k], reference[:, k]⟩. Closed-form, O(M·K).
signed_permutation
Solve min_{P ∈ S_K, s ∈ {±1}^K} ‖a · P · diag(s) − reference‖_F exactly.

Type Aliases§

Mat
heap allocated resizable matrix, similar to a 2d alloc::vec::Vec
MatRef
immutable view over a matrix, similar to an immutable reference to a 2d strided slice