Examples of abs()


Examples of mikera.matrixx.AMatrix.abs()

    private double diffNormF(AMatrix tempA, AMatrix tempB)
    {
        AMatrix temp = tempA.copy();
        temp.sub(tempB);
        double total = temp.elementSquaredSum();
        temp.abs();
        double scale = temp.elementMax();
        return Math.abs(scale-0) > 1e-12 ? total/scale : 0;
    }

    /**
 
View Full Code Here

Examples of mikera.vectorz.AVector.abs()

      } else {
        if (!line.isFullyMutable()) {
          line = line.sparseClone();
          data[i] = line;
        }
        line.abs();
      }
    }
  }
 
  @Override
View Full Code Here

Examples of net.fortytwo.ripple.model.NumericValue.abs()

        NumericValue a, result;

        a = mc.toNumericValue(stack.getFirst());
        stack = stack.getRest();

        result = a.abs();

        solutions.put(
                stack.push(result));
    }
View Full Code Here

Examples of org.apache.commons.math.complex.Complex.abs()

        LaguerreSolver solver = new LaguerreSolver();
        result = solver.solveAll(coefficients, initial);

        expected = new Complex(0.0, -2.0);
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.0, 2.0);
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
 
View Full Code Here

Examples of org.apache.commons.math.complex.Complex.abs()

                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.0, 2.0);
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.5, 0.5 * Math.sqrt(3.0));
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
 
View Full Code Here

Examples of org.apache.commons.math.complex.Complex.abs()

                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.5, 0.5 * Math.sqrt(3.0));
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(-1.0, 0.0);
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
 
View Full Code Here

Examples of org.apache.commons.math.complex.Complex.abs()

                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(-1.0, 0.0);
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.5, -0.5 * Math.sqrt(3.0));
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
 
View Full Code Here

Examples of org.apache.commons.math.complex.Complex.abs()

                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);

        expected = new Complex(0.5, -0.5 * Math.sqrt(3.0));
        tolerance = Math.max(solver.getAbsoluteAccuracy(),
                    Math.abs(expected.abs() * solver.getRelativeAccuracy()));
        TestUtils.assertContains(result, expected, tolerance);
    }

    /**
     * Test of parameters for the solver.
View Full Code Here

Examples of org.apache.commons.math3.complex.Complex.abs()

                delta = N1.multiply((N.multiply(H)).subtract(G2));
                // choose a denominator larger in magnitude
                Complex deltaSqrt = delta.sqrt();
                Complex dplus = G.add(deltaSqrt);
                Complex dminus = G.subtract(deltaSqrt);
                denominator = dplus.abs() > dminus.abs() ? dplus : dminus;
                // Perturb z if denominator is zero, for instance,
                // p(x) = x^3 + 1, z = 0.
                if (denominator.equals(new Complex(0.0, 0.0))) {
                    z = z.add(new Complex(absoluteAccuracy, absoluteAccuracy));
                    oldz = new Complex(Double.POSITIVE_INFINITY,
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.abs()

        // get the sign of the big decimal
        int sign = dec.compareTo(HiveDecimal.ZERO);

    // we'll encode the absolute value (sign is separate)
    dec = dec.abs();

    // get the scale factor to turn big decimal into a decimal < 1
    int factor = dec.precision() - dec.scale();
    factor = sign == 1 ? factor : -factor;
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.