Package flanagan.complex

Examples of flanagan.complex.Complex


                                this.array.add(hold12.toString());
                                break;
                        case 13: BigInteger hold13 = (BigInteger)arrayl.get(i);
                                this.array.add(hold13.toString());
                                break;
                        case 14: Complex hold14 = (Complex)arrayl.get(i);
                                this.array.add(hold14.toString());
                                break;
                        case 15: Phasor hold15 = (Phasor)arrayl.get(i);
                                this.array.add(hold15.toString());
                                break;
                        case 17: Character hold17 = (Character)arrayl.get(i);
                                this.array.add(hold17.toString());
                                break;
                        case 18: String hold18 = (String)arrayl.get(i);
                                this.array.add(hold18);
                                break;
                        default: throw new IllegalArgumentException("Data type not identified by this method");
                        }
                    }
                    break;
            case 1: this.type = 14;
                    for(int i=0; i<this.length; i++){
                        switch(this.originalTypes[i]){
                        case 1: Double hold1= (Double)arrayl.get(i);
                                this.array.add(new Complex(hold1.doubleValue()));
                                break;
                        case 3: Float hold3 = (Float)arrayl.get(i);
                                this.array.add(new Complex(hold3.doubleValue()));
                                break;
                        case 5: Long hold5 = (Long)arrayl.get(i);
                                this.array.add(new Complex(hold5.doubleValue()));
                                break;
                        case 7: Integer hold7 = (Integer)arrayl.get(i);
                                this.array.add(new Complex(hold7.doubleValue()));
                                break;
                        case 9: Short hold9 = (Short)arrayl.get(i);
                                this.array.add(new Complex(hold9.doubleValue()));
                                break;
                        case 11: Byte hold11 = (Byte)arrayl.get(i);
                                this.array.add(new Complex(hold11.doubleValue()));
                                break;
                        case 12: BigDecimal hold12 = (BigDecimal)arrayl.get(i);
                                this.array.add(new Complex(hold12.doubleValue()));
                                break;
                        case 13: BigInteger hold13 = (BigInteger)arrayl.get(i);
                                this.array.add(new Complex(hold13.doubleValue()));
                                break;
                        case 14: Complex hold14 = (Complex)arrayl.get(i);
                                this.array.add(hold14);
                                break;
                        case 15: Phasor hold15 = (Phasor)arrayl.get(i);
                                this.array.add(Conv.convert_Phasor_to_Complex(hold15));
                                break;
                        case 17: Character hold17 = (Character)arrayl.get(i);
                                this.array.add(new Complex((double)((int)hold17.charValue())));
                                break;
                        case 18: String hold18 = (String)arrayl.get(i);
                                this.array.add(new Complex(Double.parseDouble(hold18)));
                                break;
                        default: throw new IllegalArgumentException("Data type not identified by this method");
                        }
                    }
                    break;
            case 2: this.type = 15;
                    for(int i=0; i<this.length; i++){
                        switch(this.originalTypes[i]){
                        case 1: Double hold1= (Double)arrayl.get(i);
                                this.array.add(new Phasor(hold1.doubleValue()));
                                break;
                        case 3: Float hold3 = (Float)arrayl.get(i);
                                this.array.add(new Phasor(hold3.doubleValue()));
                                break;
                        case 5: Long hold5 = (Long)arrayl.get(i);
                                this.array.add(new Phasor(hold5.doubleValue()));
                                break;
                        case 7: Integer hold7 = (Integer)arrayl.get(i);
                                this.array.add(new Phasor(hold7.doubleValue()));
                                break;
                        case 9: Short hold9 = (Short)arrayl.get(i);
                                this.array.add(new Phasor(hold9.doubleValue()));
                                break;
                        case 11: Byte hold11 = (Byte)arrayl.get(i);
                                this.array.add(new Phasor(hold11.doubleValue()));
                                break;
                        case 12: BigDecimal hold12 = (BigDecimal)arrayl.get(i);
                                this.array.add(new Phasor(hold12.doubleValue()));
                                break;
                        case 13: BigInteger hold13 = (BigInteger)arrayl.get(i);
                                this.array.add(new Phasor(hold13.doubleValue()));
                                break;
                        case 14: Complex hold14 = (Complex)arrayl.get(i);
                                this.array.add(Conv.convert_Complex_to_Phasor(hold14));
                                break;
                        case 15: Phasor hold15 = (Phasor)arrayl.get(i);
                                this.array.add(hold15);
                                break;
View Full Code Here


                    am.summ.add(bd);
                    break;
            case 13:  BigInteger bi = (BigInteger)summ.get(0);
                    am.summ.add(bi);
                    break;
            case 14:  Complex cc = (Complex)summ.get(0);
                    am.summ.add(cc);
                    break;
            case 15:  Phasor pp = (Phasor)summ.get(0);
                    am.summ.add(pp);
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
            }
        }

        am.productt = new ArrayList<Object>();
        if(this.productt.size()!=0){
            switch(this.type){
            case 0:
            case 1:
            case 2:
            case 3:
            case 18: double dd = ((Double)productt.get(0)).doubleValue();
                    am.productt.add(new Double(dd));
                    break;
            case 4:
            case 5:
            case 6:
            case 7:
            case 8:
            case 9:
            case 10:
            case 11:
            case 16:
            case 17: if(this.sumlongToDouble){
                        double dd2 = ((Double)productt.get(0)).doubleValue();
                        am.productt.add(new Double(dd2));
                    }
                    else{
                        long ll = ((Long)productt.get(0)).longValue();
                        am.productt.add(new Long(ll));
                    }
                    break;
            case 12: BigDecimal bd = (BigDecimal)productt.get(0);
                    am.productt.add(bd);
                    break;
            case 13:  BigInteger bi = (BigInteger)productt.get(0);
                    am.productt.add(bi);
                    break;
            case 14:  Complex cc = (Complex)productt.get(0);
                    am.productt.add(cc);
                    break;
            case 15:  Phasor pp = (Phasor)productt.get(0);
                    am.productt.add(pp);
                    break;
View Full Code Here

    public Complex[] getArray_as_Complex(){
        if(this.suppressMessages)Conv.suppressMessages();
        Complex[] retArray = Complex.oneDarray(this.length);
        switch(this.type){
            case 0:
            case 1: for(int i=0; i<this.length; i++)retArray[i] = new Complex(((Double)this.array.get(i)).doubleValue());
                    break;
            case 2:
            case 3: for(int i=0; i<this.length; i++)retArray[i] = new Complex(((Float)this.array.get(i)).doubleValue());
                    break;
            case 4:
            case 5: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_Long_to_double((Long)this.array.get(i)));
                    break;
            case 6:
            case 7: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_Integer_to_double((Integer)this.array.get(i)));
                    break;
            case 8:
            case 9: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_Short_to_double((Short)this.array.get(i)));
                    break;
            case 10:
            case 11: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_Byte_to_double((Byte)this.array.get(i)));
                    break;
            case 12: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_BigDecimal_to_double((BigDecimal)this.array.get(i)));
                    break;
            case 13: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_BigInteger_to_double((BigInteger)this.array.get(i)));
                    break;
            case 14: for(int i=0; i<this.length; i++)retArray[i] = (Complex)this.array.get(i);
                    break;
            case 15: for(int i=0; i<this.length; i++)retArray[i] = Conv.convert_Phasor_to_Complex((Phasor)this.array.get(i));
                    break;
            case 18: for(int i=0; i<this.length; i++){
                        String ss = (String)this.array.get(i);
                        if(ss.indexOf('i')!=-1 || ss.indexOf('j')!=-1){
                            retArray[i] = Complex.valueOf(ss);
                        }
                        else{
                            retArray[i] = new Complex(Double.valueOf(ss));
                        }
                    }
                    break;
            case 16:
            case 17: for(int i=0; i<this.length; i++)retArray[i] = new Complex(Conv.convert_int_to_double((int)((Character)this.array.get(i)).charValue()));
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
        Conv.restoreMessages();
        return retArray;
View Full Code Here

        if(this.suppressMessages)Conv.suppressMessages();
        Complex[] retArray = Complex.oneDarray(this.length);
        switch(this.type){
            case 0:
            case 1: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(((Double)this.array.get(i)).doubleValue());
                    break;
            case 2:
            case 3: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(((Float)this.array.get(i)).doubleValue());
                    break;
            case 4:
            case 5: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_Long_to_double((Long)this.array.get(i)));
                    break;
            case 6:
            case 7: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_Integer_to_double((Integer)this.array.get(i)));
                    break;
            case 8:
            case 9: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_Short_to_double((Short)this.array.get(i)));
                    break;
            case 10:
            case 11: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_Byte_to_double((Byte)this.array.get(i)));
                    break;
            case 12: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_BigDecimal_to_double((BigDecimal)this.array.get(i)));
                    break;
            case 13: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_BigInteger_to_double((BigInteger)this.array.get(i)));
                    break;
            case 14: for(int i=start; i<=end; i++)retArray[i-start] = (Complex)this.array.get(i);
                    break;
            case 15: for(int i=start; i<=end; i++)retArray[i-start] = Conv.convert_Phasor_to_Complex((Phasor)this.array.get(i));
                    break;
            case 18: for(int i=start; i<=end; i++){
                        String ss = (String)this.array.get(i);
                        if(ss.indexOf('i')!=-1 || ss.indexOf('j')!=-1){
                            retArray[i-start] = Complex.valueOf(ss);
                        }
                        else{
                            retArray[i-start] = new Complex(Double.valueOf(ss));
                        }
                    }
                    break;
            case 16:
            case 17: for(int i=start; i<=end; i++)retArray[i-start] = new Complex(Conv.convert_int_to_double((int)((Character)this.array.get(i)).charValue()));
                    break;
            default: throw new IllegalArgumentException("Data type not identified by this method");
        }
        Conv.restoreMessages();
        return retArray;
View Full Code Here

                    am.type = 12;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).plus(constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).plus(new Complex(constant)));
                    am.type = this.type;
                    break;
            case 18: for(int i=0; i<this.length; i++)am.array.add((String)this.array.get(i)+ Double.toString(constant));
                    am.type = this.type;
                    break;
View Full Code Here

                    am.type = 12;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).minus(constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).minus(new Complex(constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a double or float cannot be subtracted from a char");
            case 17: throw new IllegalArgumentException("a double or float cannot be subtracted from a Character");
            case 18: throw new IllegalArgumentException("a double or float cannot be subtracted from a String");
View Full Code Here

                    am.type = 12;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).times(constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).times(new Complex(constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a double or float cannot be multiplied by a char");
            case 17: throw new IllegalArgumentException("a double or float cannot be multiplied by a Character");
            case 18: throw new IllegalArgumentException("a double or float cannot be multiplied by a String");
View Full Code Here

                    am.type = 12;
                    break;
            case 14: for(int i=0; i<this.length; i++)am.array.add(((Complex)this.array.get(i)).over(constant));
                    am.type = this.type;
                    break;
            case 15: for(int i=0; i<this.length; i++)am.array.add(((Phasor)this.array.get(i)).over(new Complex(constant)));
                    am.type = this.type;
                    break;
            case 16: throw new IllegalArgumentException("a double or float cannot be divided by a char");
            case 17: throw new IllegalArgumentException("a double or float cannot be divided by a Character");
            case 18: throw new IllegalArgumentException("a double or float cannot be divided by a String");
View Full Code Here

            case 13:BigInteger[] bi = this.getArray_as_BigInteger();
                   for(int i=0; i<this.length; i++)am.array.add(bi[i]);
                   am.type = this.type;
                   break;
            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.floor(co[i].getReal()), Math.floor(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.floor(ph[i].getMagnitude()), Math.floor(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
View Full Code Here

            case 13:BigInteger[] bi = this.getArray_as_BigInteger();
                   for(int i=0; i<this.length; i++)am.array.add(bi[i]);
                   am.type = this.type;
                   break;
            case 14:Complex[] co = this.getArray_as_Complex();
                   for(int i=0; i<this.length; i++)am.array.add(new Complex(Math.ceil(co[i].getReal()), Math.ceil(co[i].getImag())));
                   am.type = this.type;
                   break;
            case 15:Phasor[] ph = this.getArray_as_Phasor();
                   for(int i=0; i<this.length; i++)am.array.add(new Phasor(Math.ceil(ph[i].getMagnitude()), Math.ceil(ph[i].getPhaseInDegrees())));
                   am.type = this.type;
View Full Code Here

TOP

Related Classes of flanagan.complex.Complex

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.