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.HullWhiteOneFactorPiecewiseConstantParameters.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//from w  ww .  j  a  va  2  s.c o m
    temp = Double.doubleToLongBits(_meanReversion);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + _volatility.hashCode();
    result = prime * result + _volatilityTime.hashCode();
    return result;
}

From source file:com.controller.model.ProductShipment.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    long temp;//from  w  w w.j a va 2  s. co m
    temp = Double.doubleToLongBits(shipmentAmount);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result + ((shipmentAmountCurrency == null) ? 0 : shipmentAmountCurrency.hashCode());
    temp = Double.doubleToLongBits(shipmentInsuranceAmount);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    result = prime * result
            + ((shipmentInsuranceAmountCurrency == null) ? 0 : shipmentInsuranceAmountCurrency.hashCode());
    result = prime * result + ((shipmentProvider == null) ? 0 : shipmentProvider.hashCode());
    result = prime * result
            + ((shipmentProviderDurationTerms == null) ? 0 : shipmentProviderDurationTerms.hashCode());
    result = prime * result + ((shipmentProviderImage200 == null) ? 0 : shipmentProviderImage200.hashCode());
    result = prime * result + ((shipmentProviderImage75 == null) ? 0 : shipmentProviderImage75.hashCode());
    result = prime * result
            + ((shipmentProviderServiceLevelName == null) ? 0 : shipmentProviderServiceLevelName.hashCode());
    result = prime * result + ((shipmentReferenceId == null) ? 0 : shipmentReferenceId.hashCode());
    return result;
}

From source file:monasca.common.model.metric.Metric.java

@Override
public int hashCode() {
    final int prime = 31;
    int result = 1;
    result = prime * result + ((definition == null) ? 0 : definition.hashCode());
    result = prime * result + ((dimensions == null) ? 0 : dimensions.hashCode());
    result = prime * result + ((name == null) ? 0 : name.hashCode());
    result = prime * result + Arrays.hashCode(timeValues);
    result = prime * result + (int) (timestamp ^ (timestamp >>> 32));
    long temp;//from w ww. j  av a2 s.  c om
    temp = Double.doubleToLongBits(value);
    result = prime * result + (int) (temp ^ (temp >>> 32));
    return result;
}

From source file:com.opengamma.analytics.financial.forex.derivative.ForexOptionSingleBarrier.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from ww w.  j  a va2 s. c  om*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final ForexOptionSingleBarrier other = (ForexOptionSingleBarrier) obj;
    if (_barrier != other._barrier) {
        return false;
    }
    if (Double.doubleToLongBits(_rebate) != Double.doubleToLongBits(other._rebate)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingOption, other._underlyingOption)) {
        return false;
    }
    return true;
}

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

/**
 * Construct from SparseCoordinateFormatMatrix type
 * @param m is a SparseCoordinateFormatMatrix
 *///from w  w  w  .  j  a va 2  s  .co  m
public CompressedSparseRowFormatMatrix(SparseCoordinateFormatMatrix m) {
    Validate.notNull(m);
    _els = m.getNumberOfElements();
    int[] rowPtrTmp = new int[_els > 1 ? _els : 2];
    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++;
                ptr++;
            }
        }
        if (localmaxEntriesInARow > _maxEntriesInARow) { // is the number of entries on this row the largest?
            _maxEntriesInARow = localmaxEntriesInARow;
        }
    }
    rowPtrTmp[i] = ptr;
    _values = Arrays.copyOfRange(m.getNonZeroEntries(), 0, ptr);
    _colIdx = Arrays.copyOfRange(m.getColumnCoordinates(), 0, ptr);
    _rowPtr = Arrays.copyOfRange(rowPtrTmp, 0, i + 1); // yes, the +1 is correct!
    _rows = m.getNumberOfRows();
    _cols = m.getNumberOfColumns();
}

From source file:com.opengamma.analytics.financial.interestrate.future.derivative.InterestRateFutureOptionPremiumTransaction.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from   w  w  w.j a v  a  2  s. c o  m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final InterestRateFutureOptionPremiumTransaction other = (InterestRateFutureOptionPremiumTransaction) obj;
    if (!ObjectUtils.equals(_premium, other._premium)) {
        return false;
    }
    if (_quantity != other._quantity) {
        return false;
    }
    if (Double.doubleToLongBits(_tradePrice) != Double.doubleToLongBits(other._tradePrice)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingOption, other._underlyingOption)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.interestrate.future.derivative.SwapFuturesPriceDeliverableSecurity.java

@Override
public boolean equals(final Object obj) {
    if (this == obj) {
        return true;
    }/*from w w  w.  ja  v  a 2 s . c  o m*/
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final SwapFuturesPriceDeliverableSecurity other = (SwapFuturesPriceDeliverableSecurity) obj;
    if (Double.doubleToLongBits(_deliveryTime) != Double.doubleToLongBits(other._deliveryTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_lastTradingTime) != Double.doubleToLongBits(other._lastTradingTime)) {
        return false;
    }
    if (Double.doubleToLongBits(_notional) != Double.doubleToLongBits(other._notional)) {
        return false;
    }
    if (!ObjectUtils.equals(_underlyingSwap, other._underlyingSwap)) {
        return false;
    }
    return true;
}

From source file:HashCode.java

/**
 * Calculates hash code for doubles.//from   w  w  w .j a  v  a 2  s.c o  m
 */
public static int hash(int seed, double aDouble) {
    return hash(seed, Double.doubleToLongBits(aDouble));
}

From source file:ar.org.neuroph.core.Weight.java

@Override
public boolean equals(Object obj) {
    if (this == obj) {
        return true;
    }//www.j av  a2  s. com
    if (obj == null) {
        return false;
    }
    if (getClass() != obj.getClass()) {
        return false;
    }
    final Weight other = (Weight) obj;
    if (Double.doubleToLongBits(this.value) != Double.doubleToLongBits(other.value)) {
        return false;
    }
    if (Double.doubleToLongBits(this.weightChange) != Double.doubleToLongBits(other.weightChange)) {
        return false;
    }
    if (!Objects.equals(this.trainingData, other.trainingData)) {
        return false;
    }
    return true;
}

From source file:com.opengamma.analytics.financial.equity.future.derivative.CashSettledFuture.java

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

    if (!ObjectUtils.equals(_currency, other._currency)) {
        return false;
    }

    if (Double.doubleToLongBits(_unitAmount) != Double.doubleToLongBits(other._unitAmount)) {
        return false;
    }
    if (Double.doubleToLongBits(_referencePrice) != Double.doubleToLongBits(other._referencePrice)) {
        return false;
    }
    if (Double.doubleToLongBits(_timeToSettlement) != Double.doubleToLongBits(other._timeToSettlement)) {
        return false;
    }
    if (Double.doubleToLongBits(_timeToExpiry) != Double.doubleToLongBits(other._timeToExpiry)) {
        return false;
    }
    return true;

}