Example usage for java.lang Double doubleToLongBits

List of usage examples for java.lang Double doubleToLongBits

Introduction

In this page you can find the example usage for java.lang Double doubleToLongBits.

Prototype

@HotSpotIntrinsicCandidate
public static long doubleToLongBits(double value) 

Source Link

Document

Returns a representation of the specified floating-point value according to the IEEE 754 floating-point "double format" bit layout.

Usage

From source file:com.opengamma.analytics.math.statistics.distribution.GammaDistribution.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//  ww  w . j  a  v a 2s .  c om
    temp = Double.doubleToLongBits(_k);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_theta);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:it_minds.dk.eindberetningmobil_android.models.GPSCoordinateModel.java

@Override
public int hashCode() {
    int result;/*  w w w.j  a va2 s . c o m*/
    long temp;
    temp = Double.doubleToLongBits(Latitude);
    result = (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(Longitude);
    result = 31 * result + (int) (temp ^ (temp >>> 32));
    result = 31 * result + (IsViaPoint ? 1 : 0);
    return result;
}

From source file:com.opengamma.analytics.financial.model.interestrate.curve.PriceIndexCurveAddPriceIndexFixedCurve.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + _curve.hashCode();
    result = prime * result + _curveFixed.hashCode();
    long temp;//  www  .jav a2s  .c  om
    temp = Double.doubleToLongBits(_sign);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.math.minimization.DoubleRangeLimitTransform.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//  w  w w  .  ja v  a  2 s.c o  m
    temp = Double.doubleToLongBits(_lower);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_upper);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.model.option.definition.GapOptionDefinition.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//w ww .  j a  va  2s. c om
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final GapOptionDefinition other = (GapOptionDefinition) obj;
    if (Double.doubleToLongBits(_payoffStrike) != Double.doubleToLongBits(other._payoffStrike)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.maths.lowlevelapi.functions.utilities.Unique.java

/**
 * Uniques the data, duplicates are removed based on bitwise comparison of data.
 * @param data double[] the data to unique
 * @return the double[] uniqued data//from   w w w.j a v  a  2 s.  c  o m
 */
public static double[] bitwise(double[] data) {
    Validate.notNull(data);
    int n = data.length;
    double[] sorteddata = Sort.stateless(data);
    int j = 0;
    for (int i = 1; i < n; i++) {
        if (Double.doubleToLongBits(sorteddata[i]) != Double.doubleToLongBits(sorteddata[j])) {
            j++;
            sorteddata[j] = sorteddata[i];
        }
    }
    return Arrays.copyOf(sorteddata, j + 1);
}

From source file:com.opengamma.analytics.financial.model.option.definition.CashOrNothingOptionDefinition.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   w w w . j a va 2 s.  c  om*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final CashOrNothingOptionDefinition other = (CashOrNothingOptionDefinition) obj;
    if (Double.doubleToLongBits(_payment) != Double.doubleToLongBits(other._payment)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.model.option.pricing.analytic.formula.BlackFunctionData.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }//from   w w  w  .  j  a va  2s.co  m
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final BlackFunctionData other = (BlackFunctionData) obj;
    if (Double.doubleToLongBits(_numeraire) != Double.doubleToLongBits(other._numeraire)) {
        return false;
    }
    if (Double.doubleToLongBits(_f) != Double.doubleToLongBits(other._f)) {
        return false;
    }
    return Double.doubleToLongBits(_sigma) == Double.doubleToLongBits(other._sigma);
}

From source file:com.eTilbudsavis.etasdk.model.Size.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    Size other = (Size) obj;//from  w ww.j  a v  a  2s  .c  o m
    if (Double.doubleToLongBits(mFrom) != Double.doubleToLongBits(other.mFrom))
        return false;
    if (Double.doubleToLongBits(mTo) != Double.doubleToLongBits(other.mTo))
        return false;
    return true;
}

From source file:com.eTilbudsavis.etasdk.model.Si.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    Si other = (Si) obj;// ww  w . j a  v  a  2s  . c o  m
    if (Double.doubleToLongBits(mFactor) != Double.doubleToLongBits(other.mFactor))
        return false;
    if (mSymbol == null) {
        if (other.mSymbol != null)
            return false;
    } else if (!mSymbol.equals(other.mSymbol))
        return false;
    return true;
}