Package com.numb3r3.common.io

Examples of com.numb3r3.common.io.FileUtils


        }
        return sum;
    }

    private Matrix cofactor() {
        Matrix mat = new InMemoryJBlasMatrix(this.getRowsNum(),
                this.getColumnsNum(), this.errorProcessor);
        for (int i = 0; i < this.getRowsNum(); i++) {
            for (int j = 0; j < this.getColumnsNum(); j++) {
                mat.put(i, j,
                        changeSign(i) * changeSign(j)
                                * createSubMatrix(i, j).det());
            }
        }

View Full Code Here


        if (row > this.getRowsNum()) {
            errorProcessor.error("the row is out of boundary.");
            throw new UnsupportedOperationException(
                    "the row is out of boundary.");
        } else {
            Matrix dump = this.dup();
            return new InMemoryJBlasMatrix(
                    ((DoubleMatrix) dump.getData()).getRow(row), null);
        }

    }
View Full Code Here

    }

    @Override
    public Matrix getColumn(int column) {
        Matrix dump = this.dup();
        return new InMemoryJBlasMatrix(
                ((DoubleMatrix) dump.getData()).getColumn(column), null);
    }
View Full Code Here

    }

    @Override
    public Matrix add(Matrix other) {
        Matrix dump = this.dup();
        dump.addi(other);
        return dump;
    }
View Full Code Here

        }
    }

    @Override
    public Matrix add(double scale) {
        Matrix dump = this.dup();
        dump.addi(scale);
        return dump;
    }
View Full Code Here

    }

    @Override
    public Matrix sub(Matrix other) {
        if (this.isSameDim(other)) {
            Matrix dump = this.dup();
            dump.subi(other);
            return dump;
        } else {
            errorProcessor
                    .error("the two matrices should have same dimensions.");
            return null;
View Full Code Here

    }

    @Override
    public Matrix sub(double scale) {
        Matrix dump = this.dup();
        dump.subi(scale);
        return dump;
    }
View Full Code Here

    }

    @Override
    public Matrix mult(Matrix other) {
        Matrix dump = this.dup();
        dump.multi(other);
        return dump;
    }
View Full Code Here

        }
    }

    @Override
    public Matrix mult(double scale) {
        Matrix dump = this.dup();
        dump.multi(scale);
        return dump;
    }
View Full Code Here

    }

    @Override
    public Matrix product(final Matrix other) {
        if (this.getColumnsNum() == other.getRowsNum()) {
            Matrix temp = new InMemoryJBlasMatrix(this.getRowsNum(),
                    other.getColumnsNum(), errorProcessor);
            // System.out.println(temp + "\n");
            for (int i = 0; i < this.getRowsNum(); i++) {
                for (int j = 0; j < other.getColumnsNum(); j++) {
                    // System.out.println(this.getRow(i) + "\t" +
                    // other.getColumn(j) + "\n");
                    // System.out.println(i + ":" + j + "\t" +
                    // this.getRow(i).dot(other.getColumn(j)));
                    // temp.put(i, j, 0.0);
                    temp.put(i, j, this.getRow(i).dot(other.getColumn(j)));
                }
            }
            return temp;
        } else {
            errorProcessor
View Full Code Here

TOP

Related Classes of com.numb3r3.common.io.FileUtils

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.