Student-t + Uniform Scoring API

The scale-free marginal score of "RANSAC Scoring Done Right" (moved from RANSACScoringDoneRight, which keeps its research outlier models, grids and loss-width families on these types): the scorer, its label priors and outlier models, its workspace and the one partition sweep. The scoring contract it implements is on the Robust Estimation API page.

VisualGeometryToolkitCore.AbstractOutlierModel — Type
AbstractOutlierModel

The outlier component of StudentTUniformScoring: what a partition's complement pays. Core's is the supplied uniform half-width, FixedHalfwidth. A model that ESTIMATES the support from the residuals (RANSACScoringDoneRight's extreme-value and generalized Pareto models) is scored by the estimated-support sweep, model-certain at codimension 1, through its methods of outlier_cost and scored_outlier_halfwidth (and optionally outlier_context!).

source
VisualGeometryToolkitCore.BetaLabelPrior — Type
BetaLabelPrior(alpha, beta)

The inlier probability integrated out under its conjugate prior Beta(alpha, beta) (BetaLabelPrior(0.5, 0.5) is Jeffreys'): the partition gains log B(k + alpha, N - k + beta) - log B(alpha, beta). Both parameters are the caller's (a configuration's alpha and beta keys).

source
VisualGeometryToolkitCore.FixedHalfwidth — Type
FixedHalfwidth(outlier_halfwidth)

The uniform outlier density at a supplied half-width per axis (the profile-marginal score): the complement pays log(2·outlier_halfwidth) per point and axis.

source
VisualGeometryToolkitCore.RadixPermBuffers — Type
RadixPermBuffers{K, I}(n)    # a permutation of integer type I (an Int32 permutation of a device's sort, say)
RadixPermBuffers{K}(n)       # I = Int
RadixPermBuffers(n)          # K = UInt32 (Float32 key precision), I = Int — THE default

Scratch buffers for radix_sortperm! — the allocation-free stable LSD radix sortperm used by the sweep! single-sort fast path. Owned by ScoringWorkspace; sized to the data count and resized with the other sweep buffers (resize!(sws, n)).

Key width K — the sort-precision knob (2026-07-26)

The radix does sizeof(K) byte iterations, each scattering a K key plus an Int perm entry, so the key width sets both the iteration count and the scatter bandwidth. K = UInt32 (sort keys at Float32 precision) is the default: measured 1.65× faster than UInt64 on real PhotoTourism residual columns (10.12 → 6.15 µs/hypothesis; ≈1.16× on the whole marginal per-pair scorer), and it loses nothing, because the scored residuals are Float32 to begin with — a pool's residual matrix is a Matrix{Float32}, so the Float64 sweep buffer holds an exactly-representable widening and the round trip back to Float32 is lossless. Verified on that pool: the emitted permutation is BYTE-IDENTICAL to the UInt64 path in 150/150 hypotheses (worst residual delta exactly 0.0).

K = UInt64 remains available and is the right choice for a caller whose residuals carry genuine Float64 information (they are then ordered at full precision). Both widths run the SAME generic code below — the width is a type parameter, not a second implementation.

Ordering semantics at K = UInt32: the key is monotone but not injective on Float64 (values within one Float32 ulp collapse to equal keys). Stability then orders such a tie group by index, exactly as a stable comparison sort under an isless that cannot separate them. Every sweep prefix boundary inside such a group is between residuals equal to Float32 precision.

source
VisualGeometryToolkitCore.ScoringWorkspace — Type
ScoringWorkspace

Pre-allocated scratch buffers for the scale-free marginal score (Algorithm 1), the scoring contract's scoring_workspace of a StudentTUniformScoring: the scorer carries only the immutable spec, the mutable workspace lives with the caller (a RANSAC's workspace holds one per thread).

Prior consistency

The log Γ table is built at allocation time with a specific α₀ — once a ScoringWorkspace is constructed it is committed to that scale prior, and to one codimension d_g (the table's log Γ(k·d_g/2 + α₀), recorded as its dg, which every sweep on it reads), and its label-prior table to that label prior (rebuilt for the swept n when it differs from the table's). scale_prior(sws) is the single source of truth for which prior the buffers are configured for; the bare sweep!(sws, …) reads it from here rather than accepting one, which would risk pairing a Jeffreys table with an inverse-gamma score.

Read it through its accessors: sweep_order (the order of the last sweep; its first k* entries are the consensus set), penalties and sort_key (the predictive score's per-point penalty and ordering key, filled before a sweep), lg_table, scale_prior. Build it with scoring_workspace(scoring, n, d_g) (= alloc_scoring_workspace) or default_scoring_workspace(n; dg, scale_prior, label_prior).

source
Base.resize! — Method
resize!(sws::ScoringWorkspace, n) -> sws

Size every per-point buffer of sws for a problem of n points: the sort permutation and its scratch, the predictive penalties (zeroed, as a fresh workspace has them) and sort_key, the radix perm-sort scratch — keeping the exact-size radix fast path of sweep! reachable — and the launch's sorted column. A label-prior table is REBUILT for n from the workspace's label prior, since its terms depend on N. The estimated-support buffers, when present, are resized with the rest.

The log Γ table is not resized: its entries depend on k (and the workspace's codimension) alone, so a table of capacity ≥ n serves any n. n > length(lg_table(sws)) throws; build a larger workspace instead.

source
VisualGeometryToolkitCore.default_scoring_workspace — Method
default_scoring_workspace(n; dg = 1, scale_prior, label_prior) -> ScoringWorkspace

A scoring workspace for callers that sweep without a StudentTUniformScoring in hand (a per-blob adaptation, a host-side seed loop): length-n buffers for a problem of n points with codimension dg, committed to scale_prior (the log Γ table's α₀) and label_prior (e.g. FlatLabelPrior()), both required — the stack's default priors are a configuration's, not this function's.

source
VisualGeometryToolkitCore.estimates_outlier_support — Method
estimates_outlier_support(model::AbstractOutlierModel) -> Bool

Whether model estimates the outlier support from the residuals (true for every model but the supplied half-width, FixedHalfwidth): its workspace then carries the estimated-support sweep's buffers (the sorted distances and their two suffix sums).

source
VisualGeometryToolkitCore.ig_sweep_kernel! — Method
OnBackend(backend; workgroupsize = 1)(ig_sweep_kernel!)(scores_out, sorted_sq_flat, pair_offset, K_per_pair,
                 M_per_pair, lg_table, log_two_outlier_halfwidth_grid, model_dof, dg, prior, p_offset,
                 sorted_penalties, prior_table, best_k_out; ndrange = (n, M_max, T))

One work-item per (pair, model, grid-point) of a flat pool layout (per pair its models' sorted squared residuals, K_per_pair[p] each, from pair_offset[p]; Core's exact_pm_score_kernel! layout): ONE sequential sweep over the model's K sorted squared residuals, writing the best partition score max_k S(k) to scores_out[p_local, m, t] (Float64). S(k) is the one per-partition formula (partition_score, indexed by the partition size) at the grid point's log(2·outlier_halfwidth), less half the running sum of sorted_penalties (per point, in the same order; nothing: none) and plus prior_table[k] (nothing: none). RSS and the penalty sum accumulate in Float64. With best_k_out of nonzero size, the first k at the best score goes to best_k_out[p_local, m, t] (0 when no partition scores above −Inf). This is the stack's ONE prefix sweep: a pool grid (RANSACScoringDoneRight's marginal grid, penalty- and prior-free, no k) and sweep! (one work item on the CPU backend over its sorted column) both launch it. Work-items beyond a pair's model count write nothing. A work item is a loop over the model's residuals: launch it at one item per workgroup through OnBackend, the stack's launch policy (every thread on the CPU, one warp per workgroup on a device).

source
VisualGeometryToolkitCore.label_prior_table — Method
label_prior_table(n, label_prior) -> Vector{Float64}

The label prior's term for k = 1..n inliers of n points (a workspace's table; empty for the flat prior, which adds nothing).

The profiled prior's term is the log of γ̂^{k}(1−γ̂)^{n−k} at γ̂ = k/n, k·log(k/n) + (n−k)·log((n−k)/n) (−n·H(k/n), H the binary entropy; 0·log 0 = 0, so the k = n term is 0); the Beta prior's log B(k + α, n − k + β) − log B(α, β).

source
VisualGeometryToolkitCore.log_gamma_table — Function
log_gamma_table(n, d_g = 1; alpha0 = 0.0) -> Vector{Float64}

log Γ(k·d_g/2 + α₀) for k = 1..n (SpecialFunctions' loggamma): the sweep's table, one path for Jeffreys (α₀ = 0) and the inverse-gamma prior (α₀ > 0). A sweep reads entry k − m (the inliers' ν/2 = d_g·(k − m)/2).

Cost: ~5000 host-side loggamma calls per probe (~0.5 ms total), read-only on the device for the entire sweep. (A log recurrence specialised on Jeffreys was retired for this one path: uniform Float64 values, no recurrence drift.)

source
VisualGeometryToolkitCore.outlier_context! — Method
outlier_context!(model, z, T1, T2, n) -> context

What an outlier model that estimates the support precomputes once per hypothesis, from the sorted distances z[1:n] and their suffix sums (suffix_sums!: T1, T2, each of length n + 1, T1 free to be overwritten as scratch); handed to every outlier_cost. nothing by default.

source
VisualGeometryToolkitCore.outlier_cost — Function
outlier_cost(model, context, z, T1, T2, k, n) -> Float64

The complement's cost (-log density) of the partition of the k smallest of the sorted distances z[1:n] (k < n), under an outlier model that estimates the support: the hook the estimated-support sweep calls per prefix. A model implements it (the fallback is an ArgumentError).

source
VisualGeometryToolkitCore.partition_score — Method
partition_score(prior::IGPrior, lg_half_dof, half_dof, RSS, outlier_cost) -> T

The marginal score of one inlier/outlier partition: the log evidence of its inliers under the Gaussian with the scale integrated out against prior (the inverse-gamma IGPrior(α₀, β₀); Jeffreys at IGPrior(0, 0)), minus the outliers' cost,

S = lg_half_dof − (ν/2)·log 2π − (ν/2 + α₀)·log(RSS/2 + β₀) − outlier_cost,

with half_dof = ν/2 (ν = dg·(k − m), the inliers' residual dof), `lghalfdof = log Γ(ν/2 + α₀)(a sweep's log Γ table entry, or a device lgamma's value) andRSSthe inliers' squared residual sum, floored by the caller. Every sweep of the stack scores its partitions with this one formula —sweep!, the parametric and estimated-support sweeps, the device grid kernel (igsweep_kernel!) and a downstream device sweep (BlobBoards' per-blob sweep). Plain arithmetic inRSS's precisionT` (Float32 on a device), callable inside a KernelAbstractions kernel.

source
VisualGeometryToolkitCore.penalties — Method
penalties(sws::ScoringWorkspace) -> Vector{Float64}

Per-point log-determinant penalties ℓᵢ = log|Vᵢ| of predictive scoring (StudentTUniformScoring{Predictive}), filled before a sweep.

source
VisualGeometryToolkitCore.prefix_sweep — Method
prefix_sweep(T, sorted_sq, base, K, lg_table, model_dof, dg, prior, log_two_outlier_halfwidth,
             sorted_penalties, prior_table) -> (S*, k*)

The loop body of the stack's one prefix sweep (ig_sweep_kernel!), callable inside a KernelAbstractions kernel on every backend: ONE sequential sweep over the K ascending squared residuals sorted_sq[base + 1 : base + K] (a global array, or a kernel's @localmem with base = 0), returning the best partition score S* = max_k S(k) and the first k* at it (k* = 0 when no partition scores above −Inf, as when K ≤ model_dof). S(k) is partition_score under prior at ν = dg·(k − model_dof), with the log Γ entry lg_table[k − model_dof] (log_gamma_table(K, dg; alpha0 = prior.alpha0)), the RSS floored at eps(T) and the K − k outliers paying dg·log(2·outlier_halfwidth) each; less half the running sum of sorted_penalties (in the same order; nothing: none) and plus prior_table[k] (nothing: none). RSS and the penalty sum accumulate in T (Float64 in the grid kernel and sweep!; a device kernel may sweep in its own Float32). Positional arguments only, so it compiles inside a kernel.

source
VisualGeometryToolkitCore.radix_key — Method
radix_key(K, x) -> K
radix_key(x) -> UInt64

Monotone key: radix_key(K, a) < radix_key(K, b) ⟹ isless(a, b). For K = UInt64 the converse holds too — radix_key(a) == radix_key(b) ⟺ neither isless(a, b) nor isless(b, a) (every NaN maps to the single maximum key). Total-order equivalent of isless on all Float64 values, including ±0.0 (distinct, -0.0 < +0.0 — exactly isless's ordering) and ±Inf. radix_key(x) is the UInt64 (full-Float64) width.

For K = UInt32 a Float64 is first rounded to Float32 (the precision the scored residuals actually carry); the map stays monotone non-decreasing, so the emitted order is a valid ascending order, with ties broken by index through LSD stability. A Float32 at UInt32 keys is the identity precision (exact isless order), at UInt64 keys a lossless widening.

source
VisualGeometryToolkitCore.radix_sortperm! — Method
radix_sortperm!(perm, target, rb::RadixPermBuffers, n) -> nothing

perm a Vector{I} of the buffers' integer type I. Fill perm[1:n] with the stable ascending-isless permutation of target[1:n] under the key radix_key(K, ·): bitwise identical to sortperm!(perm, target) for every input when the key is injective on it (K = UInt64, or Float32 target; the stability argument in the header comment). The default K = UInt32 on Float64 input orders values within one Float32 ulp by index, not by value. O(n): one fused histogram scan, then ≤ 8 stable counting iterations over byte digits, skipping digits on which all keys agree (a stable no-op). Allocation-free; buffers may have capacity ≥ n.

source
VisualGeometryToolkitCore.scale_prior — Method
scale_prior(sws::ScoringWorkspace) -> IGPrior

The scale prior the workspace is committed to (that sweep!(sws, …) scores under); a StudentTUniformScoring carries its own (the scoring contract's scale_prior).

source
VisualGeometryToolkitCore.scored_outlier_halfwidth — Function
scored_outlier_halfwidth(model, context, z, T1, T2, k, n) -> Float64

The uniform-equivalent outlier half-width the selected partition (k of n) was scored with, recorded on the workspace (what the scorer's decision_boundary reads); NaN for a model that states none. A model implements it (the fallback is an ArgumentError).

source
VisualGeometryToolkitCore.sort_key — Method
sort_key(sws::ScoringWorkspace) -> Vector{Float64}

The per-point sweep ordering key of predictive scoring (the unit-scale Mahalanobis q), filled before a sweep.

source
VisualGeometryToolkitCore.suffix_sums! — Method
suffix_sums!(T1, T2, z) -> (T1, T2)

The suffix sums of the sorted values z (length n) into T1 and T2 (length n + 1, T·[n+1] = 0): T1[g] = Σ_{l≥g} z[l], T2[g] = Σ_{l≥g} (n-l+1)·z[l], ranks counted from the top, so a short tail's moments never come from a difference of two large sums.

source
VisualGeometryToolkitCore.sweep! — Method
sweep!(perm, lg_table, model_dof, log_two_outlier_halfwidth, dg, scores, n;
       scratch, penalties, sort_key, prior_table, scale_prior, radix, launch) -> (S*, k*)

The sort-and-sweep of the scale-free marginal score (Algorithm 1): sorts the points (ascending by scores, or sort_key if given), then sweeps the prefixes k = m+1, …, n scoring each partition by partition_score under scale_prior (required: the stack's default prior is a configuration's). Returns the best score S* and its inlier count k*; perm[1:k*] is the selected support. Mutates perm.

The per-hypothesis path — the one KernelAbstractions kernel

The prefix sweep is ONE KernelAbstractions kernel, ig_sweep_kernel!: a pool grid launches it per (pair, model, width), and this function launches it as one work item on the CPU backend over the hypothesis's sorted column (the owner's ruling on the 2026-11-11 twin audit, V2: the host's own scan is gone). This function is the DRIVER around it: the sort (the radix below), the gather of the sorted column and its per-point penalties, the label prior's table, and the exact parametric sweep for heterogeneous gains (a different enumeration, no prefix scan). With the workspace's launch buffers (every sweep! on a ScoringWorkspace) the hypothesis allocates nothing; without them the call allocates its column and launch state.

Complexity — depends on which sort path is taken (see Sizing)

  • Θ(n) on the exact-size fast path: radix_sortperm! is an LSD radix over monotone unsigned keys — one fused histogram scan plus at most sizeof(K) stable counting iterations (4 for the default UInt32), with trivial digits skipped. The sweep itself is a single Θ(n) scan.
  • Θ(n log n) on the partial-buffer path, which falls back to the comparison-based Base.sortperm!.

This is not a constant-factor distinction: an oversized workspace silently changes the complexity class (measured on PT-E-SIFT-4K, 2026-07-26: 51.5 µs per hypothesis through the partial path, 21.7 through the radix path). resize!(sws, n) resizes every sortable buffer to n for exactly this reason.

Sizing

  • Exact-size fast path (length(perm) == n and length(sort_target) == n): sorts via radix_sortperm! when radix buffers of capacity ≥ n are present, else via sortperm! directly.
  • Partial-buffer path (length(perm) > n or length(sort_target) > n): sorts views of the first-n prefix through sortperm! (one workspace sized to the largest n, per-call n varying).

Heterogeneous penalties — the parametric sweep

When per-point gains g_i = -penalties_i/2 VARY, the optimal support is a top-k set of t_i(μ) = g_i - μ·q_i at the support's own profiled μ_I = ν_k/(2 Q_I) (the generalized sweep lemma), enumerated EXACTLY by the parametric sweep. When all gains are equal (the model-certain score, constant penalties) there are no crossings and the single sort is exact; it is taken untouched, bit-identically.

source
VisualGeometryToolkitCore.sweep! — Method
sweep!(sws::ScoringWorkspace, sq_distances, n; model_dof, log_two_outlier_halfwidth) -> (S*, k*)

The sort-and-sweep on a bare ScoringWorkspace, for callers without a StudentTUniformScoring (a per-blob posterior adaptation, a host-side seed loop). The codimension, the scale prior and the label prior are the workspace's, committed at allocation time (default_scoring_workspace(n; dg, scale_prior, label_prior)); the label prior's table is the one for n. The keyword codimension is retired (the workspace's dg is the one its log Γ table was built at). A forwarder: no sweep loop of its own.

source
VisualGeometryToolkitCore.sweep_order — Method
sweep_order(sws::ScoringWorkspace) -> Vector{Int}

The order the last sweep! visited the points in: sweep_order(sws)[1:k] is the support of the partition it returned k for (the scoring contract's consensus_order).

source
VisualGeometryToolkitCore.SCORING_TAGS — Constant
SCORING_TAGS

The TagRegistry of the scoring families: "ransac" (RansacScoring), "msac" (MsacScoring) and "student_t_uniform" (StudentTUniformScoring), snake_case of the type's name with the family's suffix Scoring stripped. A package that adds families (RANSACScoringDoneRight's MLESAC, MAGSAC++, …) declares its own registry of the same family and suffix, TagRegistry(:scoring, "Scoring", …; retired), and its loaders read merge(VgtkCore.SCORING_TAGS, its_tags). VisualGeometryToolkitEstimation's scoring_from_toml reads a scorer table through it.

source
VisualGeometryToolkitCore.Predictive — Type
Predictive

Type tag for the predictive variant of StudentTUniformScoring: StudentTUniformScoring{Predictive} incorporates the model's estimation uncertainty Σ̃θ (`solvercovariance, of a minimal-sample model or of a refit on its consensus set) into the per-point scores;StudentTUniformScoring{Nothing}` treats the model as exact (Σ_θ = 0). An option, not a default: measured against model-certain scoring it ties or loses on pooled ΔAUC@10° and costs 13–565× per hypothesis (VisualGeometryToolkitEstimation's docs/src/guide/scoring.md).

source
VisualGeometryToolkitCore.StudentTUniformScoring — Type
StudentTUniformScoring{P, DG, L, O} <: AbstractScoring

The scale-free marginal score of the Student-t inlier + uniform outlier model (Section 3, Eq. 12 of "RANSAC Scoring Done Right") — spec only: the immutable configuration of the score. Its scratch lives on its ScoringWorkspace, the scoring contract's scoring_workspace.

  • P: Nothing (model-certain) or Predictive (model-uncertain);
  • DG::Int: the codimension d_g of the model's constraint;
  • L, O: the label prior and the outlier model (type parameters, so the sweep dispatches on them statically).

The score marginalizes σ² under the scale prior:

S(θ, I) = log Γ(ν/2 + α₀) − (ν/2)·log 2π − (ν/2 + α₀)·log(RSS_I/2 + β₀) − n_o·d_g·log(2h) [+ label prior]

with ν = d_g·(n_I − m), RSS_I = Σᵢ∈I rᵢ², n_o = N − n_I and h the outlier half-width.

Build it with

StudentTUniformScoring(problem | model_dof, outlier; scale_prior, label_prior[, codimension])
StudentTUniformScoring{Predictive}(problem | model_dof, outlier; scale_prior, label_prior[, codimension])

scale_prior (an IGPrior: JeffreysPrior() or IGPrior(α₀, β₀)) and label_prior (FlatLabelPrior, ProfiledLabelPrior, BetaLabelPrior) are REQUIRED: the stack's default is its configuration's, a scorer table read by VisualGeometryToolkitEstimation's scoring_from_toml (its defaults in Estimation's configs/default.toml). The model_dof form takes codimension (1 when absent: a scalar constraint).

The outlier component outlier is a supplied half-width (a number, or FixedHalfwidth: the profile-marginal score) or an outlier model that estimates the support (an AbstractOutlierModel of another package: RANSACScoringDoneRight's extreme-value and generalized Pareto models). Those have no length parameter and take model-certain scalar residuals (d_g = 1), since the scorer receives one distance per point.

Accessors: minimal_sample_size (m), codimension, scale_prior, label_prior, outlier_model, outlier_halfwidth (a supplied width only).

source
VisualGeometryToolkitCore.alloc_scoring_workspace — Method
alloc_scoring_workspace(problem, scoring::StudentTUniformScoring) -> ScoringWorkspace
alloc_scoring_workspace(n::Int, dg::Int, scoring::StudentTUniformScoring) -> ScoringWorkspace

The scratch of the Algorithm 1 sweep for n points (data_size(problem)) of codimension dg (codimension(problem)): the log Γ table at the scorer's scale prior, the label prior's table, the estimated-support buffers when the outlier model estimates the support. The scoring contract's scoring_workspace(scoring, n, dg) is the second form. dg must be the scorer's own codimension, the one its sweep's ν = d_g·(k − m) reads (an ArgumentError otherwise: a scorer built from a bare model DOF has d_g = 1 unless given codimension; one built from the problem has the problem's).

source
VisualGeometryToolkitCore.outlier_halfwidth — Method
outlier_halfwidth(scoring::StudentTUniformScoring{P, DG, L, FixedHalfwidth}) -> Float64

The supplied half-width of the uniform outlier support per axis. The sweep charges log(2·outlier_halfwidth) per point and axis. A scorer whose outlier model estimates the support has none: the scoring contract's nothing.

source
VisualGeometryToolkitCore.score_residuals! — Method
score_residuals!(sws, q, scoring, residuals, n; sample_idx = nothing) -> (S, k)

Score from precomputed residuals (model-certain, isotropic noise): squares residuals[1:n] into q, pads q[n+1:end] with typemax, zeros the sws penalties, and sweeps for the optimal partition (overwriting the sws sweep buffers). The sample_idx points get q = 0. Returns (S, k): sweep score and optimal inlier count. The residuals are in the caller's unit, the one scoring's outlier half-width is in.

julia> using VisualGeometryToolkitCore: StudentTUniformScoring, JeffreysPrior, FlatLabelPrior,
           alloc_scoring_workspace, score_residuals!

julia> r = [0.010, -0.020, 0.015, 0.005, -0.010, 0.012, -0.008, 0.40, -0.45, 0.30];

julia> scoring = StudentTUniformScoring(2, 0.5; scale_prior = JeffreysPrior(), label_prior = FlatLabelPrior());

julia> sws = alloc_scoring_workspace(length(r), 1, scoring);

julia> S, k = score_residuals!(sws, zeros(length(r)), scoring, r, length(r));

julia> k   # the seven small residuals are the inliers
7
source
VisualGeometryToolkitCore.score_sq_residuals! — Function
score_sq_residuals!(sws, q, scoring, problem, model, [Σ̃_θ,] [sample_idx,] n) -> (S, k)

The score of a model from its problem's squared whitened residuals: q[1:n] is filled with them (q[n+1:end] with typemax), the scorer's partition sweep runs over them in the workspace sws, and the result is (S, k), the sweep's score and its optimal inlier count. The generic function of the Student-t + uniform scoring's problem-and-model form; its methods (below) are the plain score, the predictive score of a model with covariance Σ̃_θ, and its minimal-sample form (sample_idx). The residual-buffer form is score_residuals!.

source
VisualGeometryToolkitCore.score_sq_residuals! — Method
score_sq_residuals!(sws, q, scoring::StudentTUniformScoring{Predictive}, problem, model, sample_idx, n) -> (S, k)

Predictive variant: the model-uncertain scores qᵢ from the solver covariance solver_covariance(problem, model, sample_idx), then the sort-and-sweep (Algorithm 1, Eq. 20). A DEGENERATE sample — the provider returns nothing — is no hypothesis: (-Inf, 0), with q and sws untouched; it is never scored model-certain.

source
VisualGeometryToolkitCore.score_sq_residuals! — Method
score_sq_residuals!(sws, q, scoring, problem, model, n) -> (S, k)

Score a model by computing per-point squared whitened residuals and sweeping for the optimal partition (Algorithm 1, Eq. 12). Fills q[1:n] with squared whitened residuals, q[n+1:end] with typemax, and overwrites the sws sweep buffers. Returns (S, k): sweep score and optimal inlier count.

source
VisualGeometryToolkitCore.score_sq_residuals! — Method
score_sq_residuals!(sws, q, scoring::StudentTUniformScoring{Predictive}, problem, model, Σ̃_θ,
                    sample_idx, n; residuals = nothing) -> (S, k)

Predictive scoring at a GIVEN unit-scale model covariance Σ̃_θ (multiplicative convention, Σ_θ = s²·Σ̃_θ): fills q[i] with the predictive squared residual rᵢᵀ Ṽᵢ⁻¹ rᵢ and the sws penalties with log|Ṽᵢ|, then sort-and-sweeps (Algorithm 1, Eq. 20). The minimal sample's points (sample_idx, or nothing) get zero q and penalty. When residuals is supplied it receives each point's Mahalanobis distance, the norm of its whitened_residual from the same constraint evaluation (≥ 0).

source
VisualGeometryToolkitCore.scored_model — Method
scored_model(scoring::StudentTUniformScoring{Predictive}, problem, θ, sample) -> Uncertain | nothing

The model with the unit-scale covariance of its fit on the points sample (solver_covariance); nothing for a degenerate sample — no hypothesis, skipped like a failed solve, never scored model-certain.

source
VisualGeometryToolkitCore.sweep! — Method
sweep!(sws::ScoringWorkspace, scoring::StudentTUniformScoring, scores, n) -> (S*, k*)

The scorer's sort-and-sweep of the per-point scores scores[1:n] on its workspace: the supplied half-width's prefix sweep, the predictive score's (with the workspace's penalties), or the estimated-support sweep of an outlier model that estimates the support. Records the half-width the selected partition was scored with on the workspace.

source
VisualGeometryToolkitCore.with_width — Method
with_width(scoring::StudentTUniformScoring, width::OutlierHalfwidth) -> StudentTUniformScoring

The same scorer at the supplied outlier half-width width (every other field kept); a scorer whose outlier model estimates the support takes none (the contract's ArgumentError).

source

Index