Examples of Power


Examples of cc.redberry.core.tensor.Power

    private ProviderPower() {
    }

    @Override
    public IndexMappingProvider create(IndexMappingProvider opu, Tensor from, Tensor to) {
        final Power fromP = (Power) from, toP = (Power) to;
        if (IndexMappings.mappingExists(fromP.get(1), toP.get(1)) && IndexMappings.mappingExists(fromP.get(0), toP.get(0)))
            return new DummyIndexMappingProvider(opu);
        return IndexMappingProvider.Util.EMPTY_PROVIDER;
    }
View Full Code Here

Examples of com.palepail.TestGame.Model.Items.Power

  // =====items

  public Item getDroppedPower() {
    Random random = new Random();
    float angle = 50 - random.nextInt(100);
    Power power = new Power(Power.SPEED, 0, 1f * Configuration.gameScale, 1f * Configuration.gameScale,
        new Vector2(getPosition().x + getWidth() / 2, getPosition().y + getHeight() / 2), new Vector2(
            new Vector2(getPosition().x + angle, getPosition().y + 90 - Math.abs(angle)).sub(getPosition())
                .nor()), .1f);
    return power;
  }
View Full Code Here

Examples of com.sk89q.craftbook.util.RedstoneUtil.Power

     */
    private Power isActive(Block block) {

        boolean isWired = false;
        for (BlockFace face : powerSupplyOptions) {
            Power p = RedstoneUtil.isPowered(block, face);
            switch (p) {
                case ON:
                    return Power.ON;
                case NA:
                    break;
View Full Code Here

Examples of com.sk89q.craftbook.util.RedstoneUtil.Power

        // validate
        if (!blocks.matches(getMaterial())) return;
        if (!blocks.matches("dispenser")) return;

        // detect intentions
        Power pow = isActive(blocks);
        boolean inf = "inf".equalsIgnoreCase(blocks.getSign().getLine(2));

        if(inf) {

            CartType type = CartType.fromString(blocks.getSign().getLine(0));
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

    @Test
    public void testAllMonomials() {
        for (int n = 0; n <= maxDegree; n++) {
            final double expected = getExpectedValue(n);

            final Power monomial = new Power(n);
            final double actual = integrator.integrate(monomial);

            // System.out.println(n + "/" + maxDegree + " " + integrator.getNumberOfPoints()
            //                    + " " + expected + " " + actual + " " + Math.ulp(expected));
            if (expected == 0) {
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

    }

    @Override
    protected UnivariateFunction[] createFunctions() {
        return new UnivariateFunction[] {
            new Power(2.0), new Exp(), new Expm1(),
            new Log1p(), new Cosh(), new Sinh(), new Tanh(), new Cos(),
            new Sin(), new Tan(), new Acos(), new Asin(), new Atan(),
            new Abs(), new Sqrt(), new Cbrt(), new Ceil(),
            new Floor(), new Rint(), new Signum()
        };
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

        Assert.assertEquals(3, FunctionUtils.compose(m, m).value(3), EPS);

        UnivariateFunction inv = new Inverse();
        Assert.assertEquals(-0.25, FunctionUtils.compose(inv, m, c, id).value(3), EPS);

        UnivariateFunction pow = new Power(2);
        Assert.assertEquals(81, FunctionUtils.compose(pow, pow).value(3), EPS);
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

        Assert.assertEquals(1, FunctionUtils.compose(m, m).value(new DerivativeStructure(1, 1, 0, 3)).getPartialDerivative(1), EPS);

        UnivariateDifferentiableFunction inv = new Inverse();
        Assert.assertEquals(0.25, FunctionUtils.compose(inv, m, id).value(new DerivativeStructure(1, 1, 0, 2)).getPartialDerivative(1), EPS);

        UnivariateDifferentiableFunction pow = new Power(2);
        Assert.assertEquals(108, FunctionUtils.compose(pow, pow).value(new DerivativeStructure(1, 1, 0, 3)).getPartialDerivative(1), EPS);

        UnivariateDifferentiableFunction log = new Log();
        double a = 9876.54321;
        Assert.assertEquals(pow.value(new DerivativeStructure(1, 1, 0, a)).getPartialDerivative(1) / pow.value(a),
                            FunctionUtils.compose(log, pow).value(new DerivativeStructure(1, 1, 0, a)).getPartialDerivative(1), EPS);
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

    public void testMultiply() {
        UnivariateFunction c = new Constant(4);
        Assert.assertEquals(16, FunctionUtils.multiply(c, c).value(12345), EPS);

        UnivariateFunction inv = new Inverse();
        UnivariateFunction pow = new Power(2);
        Assert.assertEquals(1, FunctionUtils.multiply(FunctionUtils.compose(inv, pow), pow).value(3.5), EPS);
    }
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Power

        UnivariateDifferentiableFunction id = new Identity();
        final double a = 1.2345678;
        Assert.assertEquals(8 * a, FunctionUtils.multiply(c, id, id).value(new DerivativeStructure(1, 1, 0, a)).getPartialDerivative(1), EPS);

        UnivariateDifferentiableFunction inv = new Inverse();
        UnivariateDifferentiableFunction pow = new Power(2.5);
        UnivariateDifferentiableFunction cos = new Cos();
        Assert.assertEquals(1.5 * FastMath.sqrt(a) * FastMath.cos(a) - FastMath.pow(a, 1.5) * FastMath.sin(a),
                            FunctionUtils.multiply(inv, pow, cos).value(new DerivativeStructure(1, 1, 0, a)).getPartialDerivative(1), EPS);

        UnivariateDifferentiableFunction cosh = new Cosh();
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.