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.financial.model.interestrate.definition.HullWhiteTwoFactorDataBundle.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    long temp;/*from  ww w .  j  av a 2s  .  co  m*/
    temp = Double.doubleToLongBits(_correlation);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + ((_forwardRateCurve == null) ? 0 : _forwardRateCurve.hashCode());
    temp = Double.doubleToLongBits(_meanReversionLevel);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_reversionSpeed1);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_reversionSpeed2);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + ((_volatilityCurve2 == null) ? 0 : _volatilityCurve2.hashCode());
    return result;
}

From source file:org.csml.tommo.sugar.heatmap.ColorPaintScale.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;/* ww w .java  2  s  .com*/
    temp = Double.doubleToLongBits(maxValue);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(minValue);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.math.curve.ConstantDoublesCurve.java

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

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

@Override
public int hashCode() {
    final int prime = 31;
    int result = super.hashCode();
    long temp;/*from  www .j  av  a 2s  .  c  o  m*/
    temp = Double.doubleToLongBits(_cap);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_power);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

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

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   ww  w .j av a 2 s  .  c  o m*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final AsymmetricPowerOptionDefinition other = (AsymmetricPowerOptionDefinition) obj;
    if (Double.doubleToLongBits(_power) != Double.doubleToLongBits(other._power)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.simpleinstruments.definition.SimpleFXFutureDefinition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + _payCurrency.hashCode();
    result = prime * result + _receiveCurrency.hashCode();
    result = prime * result + _expiryDate.hashCode();
    result = prime * result + _settlementDate.hashCode();
    long temp;/* ww w.  j  a v  a  2 s  . com*/
    temp = Double.doubleToLongBits(_referencePrice);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(_unitAmount);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.maths.lowlevelapi.datatypes.primitive.CompressedSparseRowFormatMatrix.java

/**
 * Construct from DoubleMatrix2D type//  www  . ja  v a 2s  .  co m
 * @param m is a DoubleMatrix2D
 */
public CompressedSparseRowFormatMatrix(DoubleMatrix2D m) {
    Validate.notNull(m);

    //get number of elements
    _els = m.getNumberOfElements();

    // tmp arrays, in case we get in a fully populated matrix, intelligent design upstream should ensure that this is overkill!
    double[] dataTmp = new double[_els];
    int[] colIndTmp = new int[_els];
    int[] rowPtrTmp = new int[_els + 1];

    // we need unwind the array m into coordinate form
    int localmaxEntriesInARow;
    _maxEntriesInARow = -1; // set max entries in a row negative, so that maximiser will work
    int ptr = 0;
    int i;
    for (i = 0; i < m.getNumberOfRows(); i++) {
        rowPtrTmp[i] = ptr;
        localmaxEntriesInARow = 0;
        for (int j = 0; j < m.getNumberOfColumns(); j++) {
            if (Double.doubleToLongBits(m.getEntry(i, j)) != 0L) {
                localmaxEntriesInARow++;
                colIndTmp[ptr] = j;
                dataTmp[ptr] = m.getEntry(i, j);
                ptr++;
            }
        }
        if (localmaxEntriesInARow > _maxEntriesInARow) { // is the number of entries on this row the largest?
            _maxEntriesInARow = localmaxEntriesInARow;
        }
    }
    rowPtrTmp[i] = ptr;

    // return correct 0 to correct length of the vector buffers
    _values = Arrays.copyOfRange(dataTmp, 0, ptr);
    _colIdx = Arrays.copyOfRange(colIndTmp, 0, ptr);
    _rowPtr = Arrays.copyOfRange(rowPtrTmp, 0, i + 1); // yes, the +1 is correct, it allows the computation of the number of elements in the final row!
    _rows = m.getNumberOfRows();
    _cols = m.getNumberOfColumns();
}

From source file:com.opengamma.analytics.financial.interestrate.payments.derivative.Coupon.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from www .  j  a v  a2 s  .  c om*/
    if (!super.equals(obj)) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Coupon other = (Coupon) obj;
    if (Double.doubleToLongBits(_notional) != Double.doubleToLongBits(other._notional)) {
        return false;
    }
    if (Double.doubleToLongBits(_paymentYearFraction) != Double.doubleToLongBits(other._paymentYearFraction)) {
        return false;
    }
    return true;
}

From source file:me.timothy.ddd.entities.EntityPosition.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + height;// w w w  .j  a  v  a2 s .co m
    result = prime * result + width;
    long temp;
    temp = Double.doubleToLongBits(x);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    temp = Double.doubleToLongBits(y);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:org.springdata.ehcache.core.Book.java

@Override
public boolean equals(Object obj) {
    if (this == obj)
        return true;
    if (obj == null)
        return false;
    if (getClass() != obj.getClass())
        return false;
    Book other = (Book) obj;
    if (author == null) {
        if (other.author != null)
            return false;
    } else if (!author.equals(other.author))
        return false;
    if (id != other.id)
        return false;
    if (Double.doubleToLongBits(price) != Double.doubleToLongBits(other.price))
        return false;
    return true;//  w  w w .ja v a 2s  .c  o  m
}