MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testNormalize

Method testNormalize

JSAT/test/jsat/linear/SparseVectorTest.java:584–615  ·  view source on GitHub ↗

Test of normalize method, of class SparseVector.

()

Source from the content-addressed store, hash-verified

582 * Test of normalize method, of class SparseVector.
583 */
584 @Test
585 public void testNormalize()
586 {
587 System.out.println("normalize");
588
589 x.normalize();
590
591 DenseVector truth = new DenseVector(new double[]{
592 2.51976315339485e-01,
593 0.00000000000000e+00,
594 0.00000000000000e+00,
595 5.03952630678970e-01,
596 0.00000000000000e+00,
597 0.00000000000000e+00,
598 0.00000000000000e+00,
599 1.25988157669742e-01,
600 0.00000000000000e+00,
601 0.00000000000000e+00,
602 2.51976315339485e-01,
603 0.00000000000000e+00,
604 0.00000000000000e+00,
605 0.00000000000000e+00,
606 0.00000000000000e+00,
607 3.77964473009227e-01,
608 0.00000000000000e+00,
609 0.00000000000000e+00,
610 2.51976315339485e-01,
611 6.29940788348712e-01,
612 });
613
614 assertTrue(x.equals(truth, 1e-14));
615 }
616
617 /**
618 * Test of mutablePairwiseMultiply method, of class SparseVector.

Callers

nothing calls this directly

Calls 2

equalsMethod · 0.65
normalizeMethod · 0.45

Tested by

no test coverage detected