Examples of Square


Examples of org.jquantlib.math.functions.Square

  @Test
  public void testPolynomials() {
    checkSingleTabulated(new Constant(1.0), "f(x)=1", 2.0, 1.0e-13);
    checkSingleTabulated(new Identity(), "f(x)=x", 0.0, 1.0e-13);
    checkSingleTabulated(new Square(), "f(x)=x^2", 2.0/3.0, 1.0e-13);
    checkSingleTabulated(new Cube(), "f(x)=x^3", 0.0, 1.0e-13);
    checkSingleTabulated(new Fourth(), "f(x)=x^4", 2.0/5.0, 1.0e-13);
  }
View Full Code Here

Examples of org.jquantlib.math.functions.Square

  @Test
  public void testPolynomials() {
    checkSingleTabulated(new Constant(1.0), "f(x)=1",   2.0,     1.0e-13);
    checkSingleTabulated(new Identity(),    "f(x)=x",   0.0,     1.0e-13);
    checkSingleTabulated(new Square(),         "f(x)=x^2", 2.0/3.0, 1.0e-13);
    checkSingleTabulated(new Cube(),        "f(x)=x^3", 0.0,     1.0e-13);
    checkSingleTabulated(new Fourth(),      "f(x)=x^4", 2.0/5.0, 1.0e-13);
  }
View Full Code Here

Examples of org.jquantlib.math.functions.Square

        transform(range(augmented(range(augmented(aA)))), range(augmented(range(augmented(aB)))));
    }

    private void transform(final Array aA, final Array aB) {
        final Array tmp1 = aA.clone();
        Array result = tmp1.transform(new Square());
        if (result != tmp1) {
            fail("'transform' must return this");
        }
        if (!equals(result, aB)) {
            fail("'transform' failed");
        }

        final Array aC = new Array(new double[] { 5.0, 4.0, 9.04.0 });

        final Array tmp2 = aA.clone();
        final int offset = aA.begin();
        result = tmp2.transform(1+offset, 3+offset, new Square());
        if (result != tmp2) {
            fail("'transform' must return this");
        }
        if (!equals(result, aC)) {
            fail("'transform' failed");
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.geometricforms.Square

    /**
     * Creates a new instance of Square and modifies it.
     */
    @Override
    protected void createAndModifyEntity() {
        Square square = new Square();
        square.setSide(1);
        square.setFormType(FormType.SQUARE);
        entityManager.persist(square);
        entityManager.flush();

        square.setSide(2);
        entityManager.flush();

    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.geometricforms.Square

    /**
     * Creates a new instance of the Square and refreshes it.
     */
    @Override
    protected void createAndRefreshEntity() {
        Square square = new Square();
        square.setSide(1);
        square.setFormType(FormType.SQUARE);
        entityManager.persist(square);
        entityManager.flush();

        entityManager.refresh(square);
    }
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.geometricforms.Square

    /**
     * Creates a Square and removes it.
     */
    @Override
    protected void createAndRemoveEntity() {
        Square square = new Square();
        square.setSide(1);
        square.setFormType(FormType.SQUARE);
        entityManager.persist(square);
        entityManager.flush();

        entityManager.remove(square);
        entityManager.flush();
View Full Code Here

Examples of org.ow2.easybeans.tests.common.ejbs.entity.geometricforms.Square

    /**
     * Creates a Square.
     */
    @Override
    protected void createEntity() {
        Square square = new Square();
        square.setSide(1);
        square.setFormType(FormType.SQUARE);
        entityManager.persist(square);
        entityManager.flush();
    }
View Full Code Here

Examples of org.test.shape.Square

    PolymorphicShapeService service = new PolymorphicShapeService();
    PolymorphicShapePortType port = service.getPolymorphicShapePort();
    Shape shapeType;

        TestLogger.logger.debug("Sending Request to draw Square");
    Square shape = new Square();
    shape.setXAxis(1);
    shape.setYAxis(1);
    shape.setLength(10);
    shapeType = port.draw(shape);
    assertTrue(shapeType instanceof Square);
        TestLogger.logger.debug("Square was drawn");

        TestLogger.logger.debug("Sending Request to draw 3D Square");
View Full Code Here

Examples of org.test.shape.Square

            TestLogger.logger.debug("Drawing Circle on x =" + request.getXAxis() + " y=" +
                    request.getYAxis() + " With Radius =" + circle.getRadius());
      return request;
    }
    if(request instanceof Square){
      Square square =(Square) request;
            TestLogger.logger.debug("Drawing Square on x =" + request.getXAxis() + " y=" +
                    request.getYAxis() + " With Sides =" + square.getLength());
      return request;
    }
    return null;
  }
View Full Code Here

Examples of org.test.shape.Square

        p.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, axisEndpoint);

    Shape shapeType;

        TestLogger.logger.debug("Sending Request to draw Square");
    Square shape = new Square();
    shape.setXAxis(1);
    shape.setYAxis(1);
    shape.setLength(10);
    shapeType = port.draw(shape);
    assertTrue(shapeType instanceof Square);
        TestLogger.logger.debug("Square was drawn");

        TestLogger.logger.debug("Sending Request to draw 3D Square");
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.