Package mikera.vectorz

Examples of mikera.vectorz.Scalar


    return true;
  }
 
  @Override
  public Scalar clone() {
    return new Scalar(get());
  }
View Full Code Here


    return true;
  }
 
  @Override
  public Scalar clone() {
    return new Scalar(get());
  }
View Full Code Here

    assertEquals(3.0,a.get(),0.0);
    assertEquals(1,a.elementCount());
    assertEquals(1,a.nonZeroCount());
    assertEquals(3.0,a.elementSum(),0.0);
   
    Scalar s=new Scalar(1.0);
    s.set(a);
    assertEquals(3.0,s.get(),0.0);
    s.set(2.0);
    a.set(s);
    assertEquals(2.0,a.get(),0.0);
   
  }
View Full Code Here

   
  }
 
  @Test public void testScalarAdd() {
    NDArray a=NDArray.newArray();
    assertEquals(a,new Scalar(0.0));
   
    a.add(1.0);
    assertEquals(a,new Scalar(1.0));
    assertFalse(a.equals(new Scalar(0.0)));
  }
View Full Code Here

TOP

Related Classes of mikera.vectorz.Scalar

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.