Package org.jquantlib.math.matrixutilities

Examples of org.jquantlib.math.matrixutilities.Matrix.cols()


        final Array a2 = clone.mul(mB);

        if (a2 == clone) {
            fail("'mul' must return a new instance");
        }
        if (a2.size() != mB.cols()) {
            fail("'mul' failed");
        }

        for (int i=a2.begin(); i<a2.end(); i++) {
            final double elem = aB2.get(i);
View Full Code Here


            fail("addAssign must return <this>");
        }

        final int offset = m.offset();
        for (int row=offset; row<m.rows()+offset; row++) {
            for (int col=offset; col<m.cols()+offset; col++) {
                if (m.get(row, col) != row-offset+5) {
                    fail("addAssign failed");
                }
            }
        }
View Full Code Here

            fail("subAssign must return <this>");
        }

        final int offset = m.offset();
        for (int row=offset; row<m.rows()+offset; row++) {
            for (int col=offset; col<m.cols()+offset; col++) {
                if (m.get(row, col) != row-offset+3) {
                    fail("subAssign failed");
                }
            }
        }
View Full Code Here

            fail("mulAssign must return <this>");
        }

        final int offset = m.offset();
        for (int row=offset; row<m.rows()+offset; row++) {
            for (int col=offset; col<m.cols()+offset; col++) {
                if (!Closeness.isClose(m.get(row, col), (col-offset+1)*2.5)) {
                    fail("mulAssign failed");
                }
            }
        }
View Full Code Here

            fail("divAssign must return <this>");
        }

        final int offset = m.offset();
        for (int row=offset; row<m.rows()+offset; row++) {
            for (int col=offset; col<m.cols()+offset; col++) {
                if (!Closeness.isClose(m.get(row, col), (col-offset+1)/2.5)) {
                    fail("divAssign failed");
                }
            }
        }
View Full Code Here

        final Matrix m = mA.add(mB);
        if (m == mA) {
            fail("'add' must return a new instance");
        }
        if (m.rows() != mA.rows() || m.cols() != mA.cols()) {
            fail("'add' failed");
        }

        for (int row=0; row<m.rows(); row++) {
            for (int col=0; col<m.cols(); col++) {
View Full Code Here

        if (m.rows() != mA.rows() || m.cols() != mA.cols()) {
            fail("'add' failed");
        }

        for (int row=0; row<m.rows(); row++) {
            for (int col=0; col<m.cols(); col++) {
                if (m.get(row, col) != row+5) {
                    fail("'add' failed");
                }
            }
        }
View Full Code Here

        final Matrix m = mB.sub(mA);
        if (m == mB) {
            fail("'sub' must return a new instance");
        }
        if (m.rows() != mB.rows() || m.cols() != mB.cols()) {
            fail("'sub' failed");
        }

        for (int row=0; row<m.rows(); row++) {
            for (int col=0; col<m.cols(); col++) {
View Full Code Here

        if (m.rows() != mB.rows() || m.cols() != mB.cols()) {
            fail("'sub' failed");
        }

        for (int row=0; row<m.rows(); row++) {
            for (int col=0; col<m.cols(); col++) {
                if (m.get(row, col) != row+3) {
                    fail("'sub' failed");
                }
            }
        }
View Full Code Here

        final Matrix m = mA.mul(2.5);
        if (m == mA) {
            fail("'sub' must return a new instance");
        }
        if (m.rows() != mA.rows() || m.cols() != mA.cols()) {
            fail("'sub' failed");
        }

        for (int row=0; row<m.rows(); row++) {
            for (int col=0; col<m.cols(); col++) {
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.