final boolean setWeight(int lmIdx, int nodeId, long rowSize, double value, boolean from) {
        double tmpVal = value / factor;
        if (tmpVal > Integer.MAX_VALUE)
            throw new UnsupportedOperationException("Cannot store infinity explicitly, landmark: " + lmIdx + ", node: " + nodeId + ", value: " + value);

        if (from) {
            if (tmpVal >= FROM_WEIGHT_MAX) {
                landmarkWeightDA.setInt(nodeId * rowSize + lmIdx * 4, (DELTA_INF << FROM_WEIGHT_BITS) | FROM_WEIGHT_MAX);
                return false;
            } else {
                landmarkWeightDA.setInt(nodeId * rowSize + lmIdx * 4, (DELTA_INF << FROM_WEIGHT_BITS) | (int) tmpVal);
                return true;
            }
        } else {
            int fromWeight = getFromWeight(lmIdx, nodeId);
            int delta;
            if (fromWeight == Integer.MAX_VALUE) {
                fromWeight = FROM_WEIGHT_INF;
                delta = (int) tmpVal - DELTA_INF + 1;
            } else {
                delta = (int) tmpVal - fromWeight;
            }

            if (delta >= DELTA_MAX) {
                landmarkWeightDA.setInt(nodeId * rowSize + lmIdx * 4, (DELTA_MAX << FROM_WEIGHT_BITS) | fromWeight);
                return false;
            } else if (delta <= DELTA_MIN) {
                landmarkWeightDA.setInt(nodeId * rowSize + lmIdx * 4, (DELTA_MIN << FROM_WEIGHT_BITS) | fromWeight);
                return false;
            } else {
                landmarkWeightDA.setInt(nodeId * rowSize + lmIdx * 4, (delta << FROM_WEIGHT_BITS) | fromWeight);
                return true;
            }
        }
    }
final boolean setWeight ( int lmIdx , int nodeId , long rowSize , double value , boolean from ) { double tmpVal = value / factor ; if ( tmpVal > Integer . MAX_VALUE ) throw new UnsupportedOperationException ( "Cannot store infinity explicitly, landmark: " + lmIdx + ", node: " + nodeId + ", value: " + value ) ; if ( from ) { if ( tmpVal >= FROM_WEIGHT_MAX ) { landmarkWeightDA . setInt ( nodeId * rowSize + lmIdx * 4 , ( DELTA_INF << FROM_WEIGHT_BITS ) | FROM_WEIGHT_MAX ) ; return false ; } else { landmarkWeightDA . setInt ( nodeId * rowSize + lmIdx * 4 , ( DELTA_INF << FROM_WEIGHT_BITS ) | ( int ) tmpVal ) ; return true ; } } else { int fromWeight = getFromWeight ( lmIdx , nodeId ) ; int delta ; if ( fromWeight == Integer . MAX_VALUE ) { fromWeight = FROM_WEIGHT_INF ; delta = ( int ) tmpVal - DELTA_INF + 1 ; } else { delta = ( int ) tmpVal - fromWeight ; } if ( delta >= DELTA_MAX ) { landmarkWeightDA . setInt ( nodeId * rowSize + lmIdx * 4 , ( DELTA_MAX << FROM_WEIGHT_BITS ) | fromWeight ) ; return false ; } else if ( delta <= DELTA_MIN ) { landmarkWeightDA . setInt ( nodeId * rowSize + lmIdx * 4 , ( DELTA_MIN << FROM_WEIGHT_BITS ) | fromWeight ) ; return false ; } else { landmarkWeightDA . setInt ( nodeId * rowSize + lmIdx * 4 , ( delta << FROM_WEIGHT_BITS ) | fromWeight ) ; return true ; } } }
@return false if the value capacity was reached and instead of the real value the MAX was stored.