Package stallone.doubles

Examples of stallone.doubles.ForeignBufferDoubleArray


    IDoubleArray arr;

    @Before
    public void setUp() throws Exception
    {
        this.arr = new ForeignBufferDoubleArray(
                ByteBuffer.allocateDirect(10*Double.SIZE), 10, 1);
    }
View Full Code Here


    @Test
    public void testForeignBufferDoubleArray()
    {
        ByteBuffer buff = ByteBuffer.allocateDirect(10 * Double.SIZE);
        ForeignBufferDoubleArray array = new ForeignBufferDoubleArray(buff, 10, 1);
       
        Assert.assertEquals(10, array.rows());
        Assert.assertEquals(1, array.columns());
        Assert.assertEquals(10, array.size());
    }
View Full Code Here

    @Test
    public void testGetIntInt()
    {
        // create matrix;
        ByteBuffer bb = ByteBuffer.allocateDirect(10*Double.SIZE);
        IDoubleArray a = new ForeignBufferDoubleArray(bb, 5, 5);
       
        // set values
        for(int i = 0; i < 5; i++)
            for(int j = 0; j < 5; j++) {
                a.set(i, j, i+j);
            }
       
        // compare values
        for(int i = 0; i < 5; i++)
            for(int j = 0; j < 5; j++) {
                double d = a.get(i, j);
                Assert.assertEquals(i+j, d, 0);
            }
    }
View Full Code Here

TOP

Related Classes of stallone.doubles.ForeignBufferDoubleArray

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.