MCPcopy Index your code
hub / github.com/douchuan/algorithm / scale

Function scale

tests/test_sparse_vec.rs:22–29  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

20
21#[test]
22fn scale() {
23 let (a, _) = create();
24 let c = a.scale(2.0);
25 let expect = vec![0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.5];
26 for (i, &v) in expect.iter().enumerate() {
27 assert_relative_eq!(v, c.get(i),);
28 }
29}
30
31#[test]
32fn plus() {

Callers

nothing calls this directly

Calls 3

createFunction · 0.85
scaleMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected