Examples of Complex

@author Edward A. Lee, Jeff Tsay, Steve Neuendorffer, Adam Cataldo @version $Id: Complex.java,v 1.91 2007/12/06 21:57:08 cxh Exp $ @since Ptolemy II 0.2 @Pt.ProposedRating Yellow (eal) @Pt.AcceptedRating Red (cxh)
  • r.data.RComplex.Complex

  • Examples of DSP.filter.iir.Complex

       *
       * @param c    Complex object specifying the complex argument.
       * @return     Complex object specifying the resulting complex value of the rational function.
       */
      public Complex evaluate( Complex c ) {
        Complex retval = new Complex( 0.0, 0.0 );
        Complex num = N.evaluate( c );
        Complex denom = D.evaluate( c );
        if ( denom.abs() != 0.0 ) retval = num.over( denom );
       
        return retval;
      }
    View Full Code Here

    Examples of JSci.maths.Complex

        public double[] powerSpectrum(final double[] arrFunc) throws IllegalArgumentException {
            AbstractComplexVector   vecSpec = this.transform(arrFunc);
           
            double[]    arrSpec = new double[this.getDataSize()];
            for (int index=0; index<this.getDataSize(); index++)    {
                Complex cpxVal = vecSpec.getComponent(index);
                arrSpec[index] = cpxVal.modSqr();
            }

            return arrSpec;
        }
    View Full Code Here

    Examples of aspect.util.Complex

            }

            Complex[][] comp = new Complex[w][w];
            for (int i = 0; i < w; i++) {
                for (int j = 0; j < w; j++) {
                    comp[i][j] = new Complex(floats[i][j], 0);
                }
            }

            fft2(comp, w);
            //modify2(comp, w);
    View Full Code Here

    Examples of ca.eandb.jmist.math.Complex

        double[] n2d = n2.toArray();
        double[] k2d = k2 != null ? k2.toArray() : null;

        for (int i = 0; i < n1d.length; i++) {
          n1d[i] = Optics.reflectance(in,
              new Complex(n1d[i], k1d != null ? k1d[i] : 0.0),
              new Complex(n2d[i], k2d != null ? k2d[i] : 0.0),
              normal);
        }

        return colorModel.fromArray(n1d, lambda);
      }
    View Full Code Here

    Examples of cc.redberry.core.number.Complex

            if (t instanceof Power) {
                if (!isSymbolic(t.get(0)))
                    return false;
                if (!TensorUtils.isInteger(t.get(1)))
                    return false;
                Complex e = (Complex) t.get(1);
                if (!e.isReal() || e.isNumeric())
                    return false;
                return true;
            }
            for (Tensor tt : t)
                if (!isSymbolic(tt))
    View Full Code Here

    Examples of com.artemis.component.Complex

          HitPoints c = hitPointsMapper.get(e);
          c.current = _hitPoints_current;
        }
       
        if (_id_pos_x_y_) {
          Complex c = complexMapper.get(e);
          c.pos(_complex_x, _complex_y);
          _id_pos_x_y_ = false;
        }
       
        if (_id_hoho_x_y_) {
          Complex c = complexMapper.get(e);
          c.vel(_complex_x, _complex_y);
          _id_hoho_x_y_ = false;
        }
       
        if (_tag) {
          tagManager.register(_tag_tag, e);
    View Full Code Here

    Examples of com.bansheeproject.builder.entity.test.Complex

       
      }
     
      @Test
      public void testEmptyEntity() {
        Complex complex = new Complex();
       
        Parser parser = new Parser();
        String xml = parser.encode(complex);
        Assert.assertEquals("", xml);
      }
    View Full Code Here

    Examples of com.chenlb.mmseg4j.example.Complex

    public class ComplexSegTest extends TestCase {

      Complex segW;
      protected void setUp() throws Exception {
        segW = new Complex();
        //ComplexSeg.setShowChunk(true);
      }
    View Full Code Here

    Examples of com.google.gwt.user.client.rpc.EnumsTestService.Complex

      /**
       * Test that complex enums with state and non-default constructors can be used
       * over RPC and that the client state does not change.
       */
      public void testComplexEnums() {
        Complex a = Complex.A;
        a.value = "client";

        delayTestFinishForRpc();
        getService().echo(Complex.A, new AsyncCallback<Complex>() {
          @Override
    View Full Code Here

    Examples of com.nr.Complex

      @Test
      public void test() {
        int i,N=20,M=100;
        double err,errmax,sbeps;
        Complex aa,bb,cc,zz,res1,res2;
        Complex a[]={new Complex(1.0,0.0), new Complex(0.0,1.0),new Complex(1.0,0.0),new Complex(1.0,0.0),
          new Complex(1.0,0.0),new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(1.0,0.0),new Complex(0.0,1.0),new Complex(1.0,0.0),new Complex(1.0,0.0),
          new Complex(5.0,0.0),new Complex(0.0,3.0),new Complex(0.0,-4.0),new Complex(-5.0,0.0)};
        Complex b[]={new Complex(1.0,0.0),new Complex(1.0,0.0),new Complex(0.0,1.0),new Complex(1.0,0.0),
          new Complex(1.0,0.0),new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(1.0,0.0),new Complex(0.0,1.0),new Complex(0.0,1.0),new Complex(1.0,0.0),
          new Complex(0.0,5.0),new Complex(2.0,0.0),new Complex(0.0,-1.0),new Complex(3.0,0.0)};
        Complex c[]={new Complex(1.0,0.0),new Complex(1.0,0.0),new Complex(1.0,0.0),new Complex(0.0,1.0),
          new Complex(1.0,0.0),new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(2.0,0.0),new Complex(3.0,0.0),new Complex(3.0,0.0),new Complex(2.0,0.0),
          new Complex(1.0,0.0),new Complex(0.0,1.0),new Complex(1.0,0.0),new Complex(0.0,1.0),
          new Complex(0.0,-2.0),new Complex(0.0,-2.0),new Complex(7.0,0.0),new Complex(0.0,7.0)};  
        Complex z[]={new Complex(0.5,0.0),new Complex(0.5,0.0),new Complex(0.5,0.0),new Complex(0.5,0.0),
          new Complex(0.0,1.0),new Complex(0.0,1.0),new Complex(0.0,1.0),new Complex(0.0,0.0),
          new Complex(0.5,0.0),new Complex(0.5,0.0),new Complex(-0.5,0.0),new Complex(-0.5,0.0),
          new Complex(-0.5,0.0),new Complex(0.0,1.0),new Complex(1.0,1.0),new Complex(1.0,1.0),
          new Complex(1.0,1.0),new Complex(1.0,3.0),new Complex(2.0,-3.0),new Complex(5.0,7.0)};
        Complex eexpect[]={new Complex(2.0,0.0),
          new Complex(0.76923890136397212658,0.63896127631363480115),
          new Complex(0.76923890136397212658,0.63896127631363480115),
          new Complex(0.18874993960184887345,-0.73280804956611519935),
          new Complex(0.5,0.5),new Complex(0.0,0.5),new Complex(-0.25,0.25),
          new Complex(1.0,0.0),new Complex(4.0,0.0),new Complex(8.0,0.0),
          new Complex(0.29629629629629629630,0.0),
          new Complex(0.44444444444444444444,0.0),
          new Complex(0.66666666666666666667,0.0),
          new Complex(0.42882900629436784932,-0.15487175246424677819),
          new Complex(0.20787957635076190855,0.0),
          new Complex(2.4639512200927103386,5.0258643859042736965),
          new Complex(0.000782175555099748119,0.065075199065027035764),
          new Complex(-0.31205397840397702583,-0.04344693995132976350),
          new Complex(0.34836454596486382673,0.65394630061667130711),
          new Complex(617.9369000550522997,2595.6638964158808010)};
        Complex[] y=new Complex[N],expect=new Complex[N];
        System.arraycopy(eexpect, 0,expect,0, N);;
        boolean localflag, globalflag=false;

       

        // Test selected values
        System.out.println("Testing hypgeo");
        errmax=0.0;
        for (i=0;i<N;i++) {
          y[i]=hypgeo(a[i],b[i],c[i],z[i]);
          err=y[i].sub(expect[i]).abs()/expect[i].abs();
    //      System.out.printf(y[i] << "  %f\n", expect[i] << "  %f\n", err);
          if (err > errmax) errmax=err;
        }
    //    System.out.println("hypgeo: Maximum fractional discrepancy = %f\n", errmax);
        sbeps=1.e-10;
        localflag = errmax > sbeps;
        globalflag = globalflag || localflag;
        if (localflag) {
          fail("*** hypgeo: Incorrect function values");
         
        }

        // Test symmetry of a and b
        sbeps=1.e-15;
        localflag=false;
        for (i=0;i<M;i++) {
          aa=new Complex(-0.5,-5.0+0.1*i);
          bb=new Complex(0.5,5.0-0.1*i);
          cc=new Complex(-5.0+0.1*i,1.0);
          zz=new Complex(-5.0+0.1*i,-5.0+0.1*i);

          res1=hypgeo(aa,bb,cc,zz);
          res2=hypgeo(bb,aa,cc,zz);
    //      System.out.printf(abs(res1-res2));
          localflag = localflag || res1.sub(res2).abs() > sbeps;
        }
        globalflag = globalflag || localflag;
        if (localflag) {
          fail("*** hypgeo: Lack of symmetry in first two arguments");
         
        }

        // Test case a=c, b=1 where hypgeo=1/(1-z)
        sbeps=1.e-12;
        localflag=false;
        for (i=0;i<M;i++) {
          aa=new Complex(-0.5,-5.0+0.1*i);
          bb=new Complex(1.0,0.0);
          cc=new Complex(-0.5,-5.0+0.1*i);
          zz=new Complex(-5.0+0.1*i,-5.0+0.1*i);

          res1=hypgeo(aa,bb,cc,zz);
          res2=new Complex(1.0).div(new Complex(1.0).sub(zz));
    //      System.out.printf(abs(res1-res2));
          localflag = localflag || res1.sub(res2).abs() > sbeps;
        }
        globalflag = globalflag || localflag;
        if (localflag) {
          fail("*** hypgeo: Failure of special case a=c, b=1");
         
        }
       
        // Test a contiguous relationship for aa (Abromowitz & Stegun, 15.2.13)
        sbeps=1.e-12;
        localflag=false;
        for (i=0;i<M;i++) {
          aa=new Complex(-0.5,-5.0+0.1*i);
          bb=new Complex(1.0,0.0);
          cc=new Complex(-0.5,-5.0+0.1*i);
          zz=new Complex(-5.0+0.1*i,-5.0+0.1*i);
         
          //res1=(cc-2.0*aa-(bb-aa)*zz)*hypgeo(aa,bb,cc,zz)
          //  + aa*(1.0-zz)*hypgeo(aa+1.0,bb,cc,zz);
          Complex r = bb.sub(aa).mul(zz);
          r = cc.sub(aa.mul(2.0)).sub(r);
          r = r.mul(hypgeo(aa,bb,cc,zz));
          res1 = r.add( aa.mul(new Complex(1.0).sub(zz)).mul(
              hypgeo(aa.add(new Complex(1.0)),bb,cc,zz)) );
         
          //res2=(cc-aa)*hypgeo(aa-1.0,bb,cc,zz);
          //      System.out.printf(abs(res1-res2));
          r = cc.sub(aa);
          res2 = r.mul(hypgeo(aa.sub(new Complex(1.0)),bb,cc,zz));
          localflag = localflag || res1.sub(res2).abs() > sbeps;
         
        }
        globalflag = globalflag || localflag;
        if (localflag) {
          fail("*** hypgeo: Failure of contiguous relationship for aa");
         
        }
       
        // Test a contiguous relationship for cc (Abromowitz & Stegun, 15.2.27)
        sbeps=1.e-10;
        localflag=false;
        for (i=0;i<M;i++) {
          aa=new Complex(-0.5,-5.0+0.1*i);
          bb=new Complex(1.0,0.0);
          cc=new Complex(-0.5,-5.0+0.1*i);
          zz=new Complex(-5.0+0.1*i,-5.0+0.1*i);
          Complex r = cc.mul(2.0).sub(aa).sub(bb).sub(new Complex(1.0));
          r = cc.sub(new Complex(1.0)).sub(r.mul(zz));
          r = cc.mul(r).mul(hypgeo(aa,bb,cc,zz));
          Complex rr =(cc.sub(aa)).mul(cc.sub(bb)).mul(zz).mul(hypgeo(aa,bb,cc.sub(new Complex(1.0)),zz));
          res1 = r.add(rr);
          //res1=cc*(cc-1.0-(2.0*cc-aa-bb-1.0)*zz)*hypgeo(aa,bb,cc,zz)
          //  + (cc-aa)*(cc-bb)*zz*hypgeo(aa,bb,cc+1.0,zz);
          res2 = cc.mul(cc.sub(new Complex(1.0))).mul(new Complex(1.0).sub(zz));
          res2 = res2.mul(hypgeo(aa,bb,cc.sub(new Complex(1.0)),zz));
          // res2=cc*(cc-1.0)*(1.0-zz)*hypgeo(aa,bb,cc-1.0,zz);
         
    //      System.out.printf(abs(res1-res2));
          localflag = localflag || res1.sub(res2).abs() > sbeps;
         
        }
        globalflag = globalflag || localflag;
        if (localflag) {
          fail("*** hypgeo: Failure of contiguous relationship for cc");
         
        }
       
        // Test of mirror symmetry
        sbeps=1.e-15;
        localflag=false;
        for (i=0;i<M;i++) {
          aa=new Complex(-0.5,-5.0+0.1*i);
          bb=new Complex(0.5,5.0-0.1*i);
          cc=new Complex(-5.0+0.1*i,1.0);
          zz=new Complex(-5.0+0.1*i,-5.0+0.1*i);

          res1=hypgeo(aa,bb,cc,zz);
          res2=hypgeo(aa.conj(),bb.conj(),cc.conj(),zz.conj());
    //      System.out.printf(res1 << " %f\n", res2);
          localflag = localflag || res1.sub(res2.conj()).abs() > sbeps;
    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.