Java Code Examples for org.apache.commons.math.complex.Complex#abs()

The following examples show how to use org.apache.commons.math.complex.Complex#abs() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 2
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 3
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 4
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 * 
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 5
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 * 
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 6
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 * 
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 7
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 * 
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 8
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Check whether the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min Lower bound for the interval.
 * @param max Upper bound for the interval.
 * @param z Complex root.
 * @return {@code true} if z is a real zero.
 */
public boolean isRoot(double min, double max, Complex z) {
    if (isSequence(min, z.getReal(), max)) {
        double tolerance = FastMath.max(getRelativeAccuracy() * z.abs(), getAbsoluteAccuracy());
        return (FastMath.abs(z.getImaginary()) <= tolerance) ||
             (z.abs() <= getFunctionValueAccuracy());
    }
    return false;
}
 
Example 9
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 10
Source File: LaguerreSolver.java    From cacheonix-core with GNU Lesser General Public License v2.1 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 * 
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 11
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 12
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 13
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 14
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 15
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Check whether the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min Lower bound for the interval.
 * @param max Upper bound for the interval.
 * @param z Complex root.
 * @return {@code true} if z is a real zero.
 */
public boolean isRoot(double min, double max, Complex z) {
    if (isSequence(min, z.getReal(), max)) {
        double tolerance = FastMath.max(getRelativeAccuracy() * z.abs(), getAbsoluteAccuracy());
        return (FastMath.abs(z.getImaginary()) <= tolerance) ||
             (z.abs() <= getFunctionValueAccuracy());
    }
    return false;
}
 
Example 16
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = FastMath.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (FastMath.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}
 
Example 17
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Check whether the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min Lower bound for the interval.
 * @param max Upper bound for the interval.
 * @param z Complex root.
 * @return {@code true} if z is a real zero.
 */
public boolean isRoot(double min, double max, Complex z) {
    double tolerance = FastMath.max(getRelativeAccuracy() * z.abs(), getAbsoluteAccuracy());
    return (isSequence(min, z.getReal(), max)) &&
        (FastMath.abs(z.getImaginary()) <= tolerance ||
         z.abs() <= getFunctionValueAccuracy());
}
 
Example 18
Source File: LaguerreSolver.java    From astor with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Returns true iff the given complex root is actually a real zero
 * in the given interval, within the solver tolerance level.
 *
 * @param min the lower bound for the interval
 * @param max the upper bound for the interval
 * @param z the complex root
 * @return true iff z is the sought-after real zero
 */
protected boolean isRootOK(double min, double max, Complex z) {
    double tolerance = Math.max(relativeAccuracy * z.abs(), absoluteAccuracy);
    return (isSequence(min, z.getReal(), max)) &&
           (Math.abs(z.getImaginary()) <= tolerance ||
            z.abs() <= functionValueAccuracy);
}