transport_plan_1d — COLORTRANSPORT transport op

Data kinds: signal × signaltransport_plan

Call: import fullseye as fs; fs.ledger.transport_plan_1d(u_values, v_values) (to call the implementation directly, import colortransport; colortransport.transport_plan_1d(u_values, v_values); from the registry, opscolortransport.get("transport_plan_1d"))

Usage

The exact 1-D transport plan (north-west corner rule). Returns an `(n, m)` mass matrix.

> The detailed description below is the original text — the summary and the headings are translated.

行和が `1/n、列和が 1/m` になる ―― これは構成上厳密で、

数値誤差以外でずれることはない(テストで固定)。

手順: `u(n 個)と v(m` 個)をそれぞれ昇順に並べ、小さいほうから

順に質量 `min(残り u, 残り v)` を割り当てる(単調な結合)。各標本の質量は

等しく `1/n1/m`(重み付きは受けない)。1 次元では距離の凸関数

コストとする限りこの単調結合が最適解なので、`wasserstein_1d` と同じ

輸送を「どの標本がどこへ行くか」の行列として得られる。

• `u_values, v_values: 1 次元に潰す(ravel`)。長さは違ってよい。

空なら `MetricContractError`。有限性は検査しない(NaN はソートで末尾に

回り、黙って結合される)。

• 返り値: `(n, m) の float64(transport_plan 型)。plan[i, j]` は入力の

元の並びで `u[i] から v[j] へ運ぶ質量。非零要素は高々 n + m - 1`。

`n == m なら置換行列 / n`(一対一対応)。

• 計算量は `O((n + m) log) のソート + O(n + m)` の走査だが、返す行列は

`n × m` の密行列なので画素数規模の標本には向かない(その場合は

`histogram_matchsinkhorn`)。

`apply_transport(plan, v)u` 側の各標本の行き先の値(重心)を、

`transport_cost(plan, cost)` で総コストを取る。

Background guides (the physics and conventions behind this op)

colorimetry — 測色と分光の知識 — 色は「分光 × 光源 × 観測者」でしか決まらない

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

color_transportpy -3.11 examples/color_transport.py

Ops the type connects to (they accept transport_plan as input)

transport_cost · apply_transport

Same category (transport)

wasserstein_1d · sinkhorn · sinkhorn_distance · sinkhorn_divergence


*Provenance: colortransport.py — COLORTRANSPORT operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.