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 viaGpaOptions::default()and override fields with struct-update syntax. - Orthogonal
Alignment - Result of
orthogonal. - Sign
Alignment - Result of
sign_align. - Signed
Permutation Alignment - Result of
signed_permutation.
Enums§
- GpaInit
- Initial consensus seed for
generalized. - Inner
Aligner - Inner per-iteration aligner used by
generalized. - Procrustes
Error - Error variants returned by the alignment functions (
orthogonal,rotation_only,signed_permutation,sign_align,generalized).
Functions§
- generalized
- Generalised Procrustes Analysis: iterative consensus alignment of
Nmatrices. - orthogonal
- Solve
min_R ‖a · R − reference‖_Fover orthogonalK×KR. - rotation_
only - Orthogonal Procrustes restricted to proper rotations (
det(R) = +1,R ∈ SO(K)). - sign_
align - Sign-only alignment: for each column
k, chooses[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‖_Fexactly.
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