consistency API

Luna-Flow/linear-algebra/consistency はテスト専用のパッケージです。公開項目はなく、インターフェースファイルは空です。immut、mutable、immut.MatrixFn の間でパッケージ横断の一致テストを実行するために存在します。

ソース: src/consistency/core_wbtest.mbt。何をなぜ比較するかは consistency の設計 で説明しています。

公開項目

ありません。このパッケージはインポートされることを想定していません。

テストスイート

テスト一致すべきもの
matrix core operations stay alignedimmut と mutable の格納順、+、*、転置、トレース
matrix constructors and conversions stay alignedmake、new、from_2d_array、from_array、to_2d_array、退化した形状
matrix and vector conversions stay alignedベクトルから作る行行列・列行列・対角行列
semantic differences stay explicit文書化された違い(インプレース更新か、新しい値を返す更新か)
shared same_index_swap stays alignedswap_rows(i, i) と swap_cols(i, i) はどちらでも何もしない
identity and transpose laws stay alignedAI=AAI = A, IA=AIA = A, (AB)T=BTAT(AB)^{\mathsf T} = B^{\mathsf T} A^{\mathsf T}
trace and multiplication associativity stay alignedtr⁡(AT)=tr⁡(A)\operatorname{tr}(A^{\mathsf T}) = \operatorname{tr}(A), (AB)C=A(BC)(AB)C = A(BC)
vector tensor and matrix conversion laws stay aligned外積、行行列、列行列
cross-package matrix semiring laws on small integersquickcheck: + の結合性、分配性、積の一致
zero-column multiplication stays aligned(2×0)(0×0)(2 \times 0)(0 \times 0) の積
immut and fn_matrix stay aligned on core laws+、転置、行列式、pow に関する Matrix と MatrixFn の比較
all matrix implementations stay aligned under random small inputsquickcheck: ランダムな 2×22 \times 2 入力に対する三つの実装すべて

実行方法:

moon test -p consistency