Package r.data.RComplex

Examples of r.data.RComplex.Complex


                }
            }

            @Override
            public Complex getComplex(int i) {
                Complex acmp = a.getComplex(i);
                double areal = acmp.realValue();
                double aimag = acmp.imagValue();
                if (!arithIsNA && !RComplexUtils.arithEitherIsNA(areal, aimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here


                }
            }

            @Override
            public Complex getComplex(int i) {
                Complex bcmp = b.getComplex(i);
                double breal = bcmp.realValue();
                double bimag = bcmp.imagValue();
                if (!arithIsNA && !RComplexUtils.arithEitherIsNA(breal, bimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here

        public double opImag(ASTNode ast, double a, double b, double c, double d) {
            return b + d;
        }
        @Override
        public Complex opComplex(ASTNode ast, double a, double b, double c, double d) {
            return new Complex(a + c, b + d);
        }
View Full Code Here

        public double opImag(ASTNode ast, double a, double b, double c, double d) {
            return b - d;
        }
        @Override
        public Complex opComplex(ASTNode ast, double a, double b, double c, double d) {
            return new Complex(a - c, b - d);
        }
View Full Code Here

            if (na == nb) {
                if (na > 1) {
                    return arit.opComplexImplEqualSize(ast, (ComplexImpl) a.materialize(), (ComplexImpl) b.materialize(), na, dim, names, attributes);
                } else {
                    // scalars
                    Complex acomp = a.getComplex(0);
                    Complex bcomp = b.getComplex(0);
                    Complex res = arit.opComplexCheckingNA(ast, acomp.realValue(), acomp.imagValue(), bcomp.realValue(), bcomp.imagValue());
                    // FIXME: it may really be worth having Complex == ScalarComplexImpl
                    return RComplex.RComplexFactory.getScalar(res.realValue(), res.imagValue(), dim, names, attributes);
                }
            } else if (nb == 1) {
                Complex bcomp = b.getComplex(0);
                return arit.opComplexImplScalarCheckingNA(ast, (ComplexImpl) a.materialize(), bcomp.realValue(), bcomp.imagValue(), na, dim, names, attributes);
            } else if (na == 1) {
                Complex acomp = a.getComplex(0);
                return arit.opScalarComplexImplCheckingNA(ast, acomp.realValue(), acomp.imagValue(), (ComplexImpl) b.materialize(), nb, dim, names, attributes);
            } else {
                int n = resultSize(ast, na, nb);
                if (n == na) {
                    return arit.opComplexImplASized(ast, (ComplexImpl) a.materialize(), (ComplexImpl) b.materialize(), n, nb, dim, names, attributes);
                } else {
View Full Code Here

                    ai = i;
                } else {
                    ai = i;
                    bi = i;
                }
                Complex acmp = a.getComplex(ai);
                Complex bcmp = b.getComplex(bi);
                double areal = acmp.realValue();
                double aimag = acmp.imagValue();
                double breal = bcmp.realValue();
                double bimag = bcmp.imagValue();
                if (!RComplexUtils.arithEitherIsNA(areal, aimag) && !RComplexUtils.arithEitherIsNA(breal, bimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here

            @Override
            public Complex getComplex(int i) {
                int ai = i;
                int bi = i % nb;
                Complex acmp = a.getComplex(ai);
                Complex bcmp = b.getComplex(bi);
                double areal = acmp.realValue();
                double aimag = acmp.imagValue();
                double breal = bcmp.realValue();
                double bimag = bcmp.imagValue();
                if (!RComplexUtils.arithEitherIsNA(areal, aimag) && !RComplexUtils.arithEitherIsNA(breal, bimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here

            @Override
            public Complex getComplex(int i) {
                int ai = i % na;
                int bi = i;
                Complex acmp = a.getComplex(ai);
                Complex bcmp = b.getComplex(bi);
                double areal = acmp.realValue();
                double aimag = acmp.imagValue();
                double breal = bcmp.realValue();
                double bimag = bcmp.imagValue();
                if (!RComplexUtils.arithEitherIsNA(areal, aimag) && !RComplexUtils.arithEitherIsNA(breal, bimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here

                }
            }

            @Override
            public Complex getComplex(int i) {
                Complex acmp = a.getComplex(i);
                Complex bcmp = b.getComplex(i);
                double areal = acmp.realValue();
                double aimag = acmp.imagValue();
                double breal = bcmp.realValue();
                double bimag = bcmp.imagValue();
                if (!RComplexUtils.arithEitherIsNA(areal, aimag) && !RComplexUtils.arithEitherIsNA(breal, bimag)) {
                    return arit.opComplex(ast, areal, aimag, breal, bimag);
                } else {
                    return RComplex.COMPLEX_BOXED_NA;
                }
View Full Code Here

            return opTMP[1];
        }
        @Override
        public Complex opComplex(ASTNode ast, double a, double b, double c, double d) {
            cmult(a, b, c, d, opTMP, 0);
            return new Complex(opTMP[0], opTMP[1]);
        }
View Full Code Here

TOP

Related Classes of r.data.RComplex.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.