Package flanagan.complex

Examples of flanagan.complex.ComplexMatrix


        return this.getArray_as_Complex_columnMatrix();
    }

    public ComplexMatrix getArray_as_Complex_columnMatrix(){
        Complex[] cc = this.getArray_as_Complex();
        ComplexMatrix mat = ComplexMatrix.columnMatrix(cc);
        return mat;
    }
View Full Code Here


    public ComplexMatrix subarray_as_Complex_rowMatrix(int start, int end){
        if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1));
        Complex[] cc = this.getArray_as_Complex();
        Complex[] retArray = new Complex[end-start+1];
        for(int i=start; i<=end; i++)retArray[i-start] = cc[i];
        ComplexMatrix mat = ComplexMatrix.rowMatrix(retArray);
        return mat;
    }
View Full Code Here

    public ComplexMatrix subarray_as_Complex_columnMatrix(int start, int end){
        if(end>=this.length)throw new IllegalArgumentException("end, " + end + ", is greater than the highest index, " + (this.length-1));
        Complex[] cc = this.getArray_as_Complex();
        Complex[] retArray = new Complex[end-start+1];
        for(int i=start; i<=end; i++)retArray[i-start] = cc[i];
        ComplexMatrix mat = ComplexMatrix.columnMatrix(retArray);
        return mat;
    }
View Full Code Here

            return pp;
        }

        // Converts a 2D complex array to a phasor matrix (PhasorMatix)
        public static PhasorMatrix toPhasorMatrix(Complex[][] carray){
            ComplexMatrix cc = new ComplexMatrix(carray);
            PhasorMatrix pp = new PhasorMatrix(cc.getNrow(), cc.getNcol() );
            for(int i=0; i<pp.nrow; i++){
                for(int j=0; j<pp.ncol; i++){
                    pp.matrix[i][j] = Phasor.toPhasor(cc.getElementCopy(i,j));
                }
            }
            return pp;
        }
View Full Code Here

        // Converts a phasor matrix (PhasorMatix) to a complex matrix (ComplexMatrix) - instance method
        public ComplexMatrix toComplexMatrix(){
            int nr = this.getNrow();
            int nc = this.getNcol();
            ComplexMatrix cc = new ComplexMatrix(nr, nc);
            for(int i=0; i<nr; i++){
                for(int j=0; j<nc; i++){
                    cc.setElement(i, j, this.matrix[i][j].toRectangular());
                }
            }
            return cc;
        }
View Full Code Here

        // Converts a phasor matrix (PhasorMatix) to a complex matrix (ComplexMatrix) - static method
        public static ComplexMatrix toComplexMatrix(PhasorMatrix pp){
            int nr = pp.getNrow();
            int nc = pp.getNcol();
            ComplexMatrix cc = new ComplexMatrix(nr, nc);
            for(int i=0; i<nr; i++){
                for(int j=0; j<nc; i++){
                    cc.setElement(i, j, pp.matrix[i][j].toRectangular());
                }
            }
            return cc;
        }
View Full Code Here

TOP

Related Classes of flanagan.complex.ComplexMatrix

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.