Package stallone.api.ints

Examples of stallone.api.ints.IIntList


    /**
    @return all indexes whose values are minVal <= val < maxVal
     */
    public IIntArray withinIndexes(IDoubleArray arr, double minVal, double maxVal)
    {
        IIntList res = Ints.create.list(arr.size() / 2);
        for (int i = 0; i < arr.size(); i++)
        {
            if (minVal <= arr.get(i) && arr.get(i) < maxVal)
            {
                res.append(i);
            }
        }
        return (res);
    }
View Full Code Here


        }
    }

    public IIntList findAll(IDoubleArray arr, double val)
    {
        IIntList res = Ints.create.list(0);
        findAll(arr, val, res);
        return (res);
    }
View Full Code Here

        return (res);
    }

    public IIntList findAll(IDoubleArray arr, IDoubleArray vals)
    {
        IIntList res = Ints.create.list(0);
        for (int i = 0; i < vals.size(); i++)
        {
            findAll(arr, vals.get(i), res);
        }
        return (res);
View Full Code Here

        return (findBackwards(arr, val, 0));
    }

    public IIntArray findAllRows(IDoubleArray arr, IDoubleArray val)
    {
        IIntList res = Ints.create.list(0);
        for (int i = 0; i < arr.size(); i++)
        {
            if (equal(arr.viewRow(i), val))
            {
                res.append(i);
            }
        }
        return (res);
    }
View Full Code Here

        return res;
    }
   
    public int[] nonzeroIndexes1D(IDoubleArray arr)
    {
        IIntList list = intsNew.list(arr.rows());
        for (IDoubleIterator it = arr.nonzeroIterator(); it.hasNext();)
        {
            IDoubleElement de = it.next();
            list.append(de.index());
        }
        return list.getArray();
    }
View Full Code Here

TOP

Related Classes of stallone.api.ints.IIntList

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.