Package stallone.api.doubles

Examples of stallone.api.doubles.IDoubleArray.rows()


        // identify 0-columns
        IIntList zeros = Ints.create.list(0);
        for (int j=0; j<A.columns(); j++)
            {
                boolean colzero = true;
                for (int i=0; i<A.rows(); i++)
                    if (A.get(i,j) != 0)
                        colzero = false;
                if (colzero)
                    zeros.append(j);
            }
View Full Code Here


            {
                if (!Ints.util.contains(target, j) && A.get(j,j) == 0)
                    zeros.append(j);
            }

        IIntArray nonzeros = Ints.util.removeValueToNew(Ints.create.listRange(0, A.rows()), zeros);

        // clean matrix
        IDoubleArray Aclean = A.view(nonzeros.getArray(), nonzeros.getArray());

        // rhs
View Full Code Here

            calculateAlgebra();

        IDoubleArray P = prop.propagate(t);

        double res = 0;
        for (int i=0; i<P.rows(); i++)
        {
            for (int j=0; j<P.columns(); j++)
            {
                res += p0.get(i) * P.get(i,j) * a.get(j);
            }
View Full Code Here

            calculateAlgebra();

        IDoubleArray P = prop.propagate(t);

        double res = 0;
        for (int i=0; i<P.rows(); i++)
        {
            for (int j=0; j<P.columns(); j++)
            {
                res += a.get(i) * pi.get(i) * P.get(i,j) * b.get(j);
            }
View Full Code Here

    }

    public Grid(IDoubleArray bounds, double _step)
    {
        IDoubleArray griddef = doublesNew.matrix(bounds.rows(), 3);
        for (int i=0; i<griddef.rows(); i++)
        {
            griddef.set(i,0,bounds.get(i,0));
            griddef.set(i,1,_step);
            griddef.set(i,2,bounds.get(i,1));
        }
View Full Code Here

{   
    public static IDoubleArray tuneMetastability(IDoubleArray T, double timescaleFactor)
    {
        IDoubleArray Tnew = T.copy();
        //IDoubleArray Pi = doublesNew.diag(msm.stationaryDistribution(T));
        for (int i=0; i<Tnew.rows(); i++)
        {
            // scale diagonal
            Tnew.set(i,i, Math.pow(Tnew.get(i,i), 1.0/timescaleFactor));
           
            // compute off-diagonal scaling factor
View Full Code Here

    private void estimateErrorByPureness()
    {
        IDoubleArray chinorm = hmmChi.copy();
        alg.normalizeRows(chinorm,1);
       
        errors = doublesNew.array(chinorm.rows());

        for (int i=0; i<chinorm.rows(); i++)
        {
            IDoubleArray row = chinorm.viewRow(i);
            int imax = doubles.maxIndex(row);
View Full Code Here

        IDoubleArray chinorm = hmmChi.copy();
        alg.normalizeRows(chinorm,1);
       
        errors = doublesNew.array(chinorm.rows());

        for (int i=0; i<chinorm.rows(); i++)
        {
            IDoubleArray row = chinorm.viewRow(i);
            int imax = doubles.maxIndex(row);
            row.set(imax, row.get(imax)-1);
            errors.set(i, msmPi.get(i)*alg.norm(row));
 
View Full Code Here

                 {0, 3, 1000, 3, 0, 0},
                 {0, 0, 3, 1000, 3, 0},
                 {0, 0, 0, 3, 1000, 3},
                 {0, 0, 0, 0, 3, 90000}});
       
        for (int i = 0; i < C.rows(); i++)
        {
            double[] row = C.getRow(i);
            double sum = 0;
            for (int j = 0; j < row.length; j++) {
                sum += row[j];
View Full Code Here

                 {0, 3, 1000, 3, 0, 0},
                 {0, 0, 3, 1000, 3, 0},
                 {0, 0, 0, 3, 1000, 3},
                 {0, 0, 0, 0, 3, 90000}});
       
        for (int i = 0; i < C.rows(); i++)
        {
            double[] row = C.getRow(i);
            double sum = 0;
            for (int j = 0; j < row.length; j++) {
                sum += row[j];
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.