Package org.apache.commons.collections.primitives

Examples of org.apache.commons.collections.primitives.DoubleList


                 new TrainingDataset(trainingData.getInputsCount(), outputsCount);

         for (int i = 0; i < inputData.size(); ++i)
         {
            Sample sample = trainingData.get(i);
            DoubleList input = sample.getInput();

            forecastPerformer.analyze(input);

            DoubleList result = forecastPerformer.getResult();

            forecast.add(new Sample(sample.getId(), input, JNMFMathUtils.roundDoubleList4(result)));
         }

         forecastPerformer.setLearningEnabled(true);
View Full Code Here


        return ListDoubleList.wrap(getList().subList(fromIndex,toIndex));
    }

    public boolean equals(Object obj) {
        if(obj instanceof DoubleList) {
            DoubleList that = (DoubleList)obj;
            if(this == that) {
                return true;
            } else if(this.size() != that.size()) {
                return false;           
            } else {
                DoubleIterator thisiter = iterator();
                DoubleIterator thatiter = that.iterator();
                while(thisiter.hasNext()) {
                    if(thisiter.next() != thatiter.next()) {
                        return false;
                    }
                }
View Full Code Here

    protected DoubleList makeEmptyDoubleList() {
        return new ArrayDoubleList();
    }
   
    protected DoubleList makeFullDoubleList() {
        DoubleList list = makeEmptyDoubleList();
        double[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add((double)elts[i]);
        }
        return list;
    }
View Full Code Here

    // collections testing framework
    // ------------------------------------------------------------------------

    protected Object makeObject() {
        DoubleList list = new ArrayDoubleList();
        for(int i=0;i<10;i++) {
            list.add((double)i);
        }
        return new DoubleCollectionCollection(list);
    }
View Full Code Here

    protected DoubleList makeEmptyDoubleList() {
        return new ArrayDoubleList();
    }
   
    protected DoubleList makeFullDoubleList() {
        DoubleList list = makeEmptyDoubleList();
        double[] elts = getFullElements();
        for(int i=0;i<elts.length;i++) {
            list.add((double)elts[i]);
        }
        return list;
    }
View Full Code Here

    // framework
    // ------------------------------------------------------------------------
    protected abstract DoubleIterator makeUnmodifiableDoubleIterator();

    protected DoubleIterator makeDoubleIterator() {
        DoubleList list = new ArrayDoubleList();
        for(double i=0;i<10;i++) {
            list.add(i);
        }
        return list.iterator();
    }
View Full Code Here

    protected DoubleIterator makeDoubleIterator() {
        return makeDoubleListIterator();
    }
   
    protected DoubleListIterator makeDoubleListIterator() {
        DoubleList list = new ArrayDoubleList();
        for(double i=0;i<10;i++) {
            list.add(i);
        }
        return list.listIterator();
    }
View Full Code Here

    public void testWrapNull() {
        assertNull(ListDoubleList.wrap(null));
    }
   
    public void testWrapSerializable() {
        DoubleList list = ListDoubleList.wrap(new ArrayList());
        assertNotNull(list);
        assertTrue(list instanceof Serializable);
    }
View Full Code Here

        assertNotNull(list);
        assertTrue(list instanceof Serializable);
    }
   
    public void testWrapNonSerializable() {
        DoubleList list = ListDoubleList.wrap(new AbstractList() {
            public Object get(int i) { throw new IndexOutOfBoundsException(); }
            public int size() { return 0; }
        });
        assertNotNull(list);
        assertTrue(!(list instanceof Serializable));
View Full Code Here

    public void testWrapNull() {
        assertNull(UnmodifiableDoubleList.wrap(null));
    }

    public void testWrapUnmodifiableDoubleList() {
        DoubleList list = makeUnmodifiableDoubleList();
        assertSame(list,UnmodifiableDoubleList.wrap(list));
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.collections.primitives.DoubleList

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.