MCPcopy Create free account
hub / github.com/Axect/Peroxide / test_row_map

Function test_row_map

tests/matrix.rs:64–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62
63#[test]
64fn test_row_map() {
65 let m = ml_matrix("1 2;3 4");
66 let n = m.row_map(|v| v.normalize(Norm::L2));
67 let o = matrix(
68 vec![
69 1f64 / 5f64.sqrt(),
70 2f64 / 5f64.sqrt(),
71 3f64 / 5f64,
72 4f64 / 5f64,
73 ],
74 2,
75 2,
76 Row,
77 );
78 assert_eq!(n, o);
79}
80
81#[test]
82fn test_col_map() {

Callers

nothing calls this directly

Calls 4

ml_matrixFunction · 0.85
matrixFunction · 0.85
row_mapMethod · 0.45
normalizeMethod · 0.45

Tested by

no test coverage detected