Tabnine Logo
Reference2DoubleMap$Entry.getDoubleValue
Code IndexAdd Tabnine to your IDE (free)

How to use
getDoubleValue
method
in
it.unimi.dsi.fastutil.objects.Reference2DoubleMap$Entry

Best Java code snippets using it.unimi.dsi.fastutil.objects.Reference2DoubleMap$Entry.getDoubleValue (Showing top 11 results out of 315)

origin: it.unimi.dsi/fastutil

/**
 * {@inheritDoc}
 * 
 * @deprecated Please use the corresponding type-specific method instead.
 */
@Deprecated
@Override
default Double getValue() {
  return Double.valueOf(getDoubleValue());
}
/**
origin: it.unimi.dsi/fastutil

@SuppressWarnings("unchecked")
@Override
public boolean equals(final Object o) {
  if (!(o instanceof Map.Entry))
    return false;
  if (o instanceof Reference2DoubleMap.Entry) {
    final Reference2DoubleMap.Entry<K> e = (Reference2DoubleMap.Entry<K>) o;
    return ((key) == (e.getKey()))
        && (Double.doubleToLongBits(value) == Double.doubleToLongBits(e.getDoubleValue()));
  }
  final Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
  final Object key = e.getKey();
  final Object value = e.getValue();
  if (value == null || !(value instanceof Double))
    return false;
  return ((this.key) == ((key))) && (Double.doubleToLongBits(this.value) == Double
      .doubleToLongBits(((Double) (value)).doubleValue()));
}
@Override
origin: it.unimi.dsi/fastutil

  @Override
  public String toString() {
    final StringBuilder s = new StringBuilder();
    final ObjectIterator<Reference2DoubleMap.Entry<K>> i = Reference2DoubleMaps.fastIterator(this);
    int n = size();
    Reference2DoubleMap.Entry<K> e;
    boolean first = true;
    s.append("{");
    while (n-- != 0) {
      if (first)
        first = false;
      else
        s.append(", ");
      e = i.next();
      if (this == e.getKey())
        s.append("(this map)");
      else
        s.append(String.valueOf(e.getKey()));
      s.append("=>");
      s.append(String.valueOf(e.getDoubleValue()));
    }
    s.append("}");
    return s.toString();
  }
}
origin: it.unimi.di/mg4j-big

/** Copies the argument internally, rescaling weights so they sum up to one.
 * 
 * @param index2Weight the new map from indices to weights.
 * @return true.
 */
public synchronized boolean setWeights( final Reference2DoubleMap<Index> index2Weight ) {
  this.index2Weight.clear();
  this.index2Weight.defaultReturnValue( 0 ); // Since we're setting up values, we must assume missing indices have weight 0.
  
  double weightSum = 0;
  for( DoubleIterator i = index2Weight.values().iterator(); i.hasNext(); ) weightSum += i.nextDouble();
  if ( weightSum == 0 ) weightSum = 1; // No positive weights.
  for( ObjectIterator<Entry<Index, Double>> i = index2Weight.entrySet().iterator(); i.hasNext(); ) {
    Reference2DoubleMap.Entry<Index> e = (Reference2DoubleMap.Entry<Index>)i.next();
    this.index2Weight.put( e.getKey(), e.getDoubleValue() / weightSum );
  }
  this.index2Weight.trim();
  LOGGER.debug( "New weight map for " + this + ": " + this.index2Weight );
  return true;
}

origin: it.unimi.dsi/fastutil

@SuppressWarnings("unchecked")
@Override
public boolean contains(final Object o) {
  if (!(o instanceof Map.Entry))
    return false;
  if (o instanceof Reference2DoubleMap.Entry) {
    final Reference2DoubleMap.Entry<K> e = (Reference2DoubleMap.Entry<K>) o;
    final K k = e.getKey();
    return map.containsKey(k)
        && (Double.doubleToLongBits(map.getDouble(k)) == Double.doubleToLongBits(e.getDoubleValue()));
  }
  final Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
  final Object k = e.getKey();
  final Object value = e.getValue();
  if (value == null || !(value instanceof Double))
    return false;
  return map.containsKey(k) && (Double.doubleToLongBits(map.getDouble(k)) == Double
      .doubleToLongBits(((Double) (value)).doubleValue()));
}
@SuppressWarnings("unchecked")
origin: it.unimi.dsi/fastutil

/** {@inheritDoc} */
@SuppressWarnings({"unchecked", "deprecation"})
@Override
public void putAll(final Map<? extends K, ? extends Double> m) {
  if (m instanceof Reference2DoubleMap) {
    ObjectIterator<Reference2DoubleMap.Entry<K>> i = Reference2DoubleMaps
        .fastIterator((Reference2DoubleMap<K>) m);
    while (i.hasNext()) {
      final Reference2DoubleMap.Entry<? extends K> e = i.next();
      put(e.getKey(), e.getDoubleValue());
    }
  } else {
    int n = m.size();
    final Iterator<? extends Map.Entry<? extends K, ? extends Double>> i = m.entrySet().iterator();
    Map.Entry<? extends K, ? extends Double> e;
    while (n-- != 0) {
      e = i.next();
      put(e.getKey(), e.getValue());
    }
  }
}
/**
origin: it.unimi.dsi/mg4j-big

/** Copies the argument internally, rescaling weights so they sum up to one.
 * 
 * @param index2Weight the new map from indices to weights.
 * @return true.
 */
public synchronized boolean setWeights( final Reference2DoubleMap<Index> index2Weight ) {
  this.index2Weight.clear();
  this.index2Weight.defaultReturnValue( 0 ); // Since we're setting up values, we must assume missing indices have weight 0.
  
  double weightSum = 0;
  for( DoubleIterator i = index2Weight.values().iterator(); i.hasNext(); ) weightSum += i.nextDouble();
  if ( weightSum == 0 ) weightSum = 1; // No positive weights.
  for( ObjectIterator<Entry<Index, Double>> i = index2Weight.entrySet().iterator(); i.hasNext(); ) {
    Reference2DoubleMap.Entry<Index> e = (Reference2DoubleMap.Entry<Index>)i.next();
    this.index2Weight.put( e.getKey(), e.getDoubleValue() / weightSum );
  }
  this.index2Weight.trim();
  LOGGER.debug( "New weight map for " + this + ": " + this.index2Weight );
  return true;
}

origin: it.unimi.dsi/mg4j

/** Copies the argument internally, rescaling weights so they sum up to one.
 * 
 * @param index2Weight the new map from indices to weights.
 * @return true.
 */
public synchronized boolean setWeights( final Reference2DoubleMap<Index> index2Weight ) {
  this.index2Weight.clear();
  this.index2Weight.defaultReturnValue( 0 ); // Since we're setting up values, we must assume missing indices have weight 0.
  
  double weightSum = 0;
  for( DoubleIterator i = index2Weight.values().iterator(); i.hasNext(); ) weightSum += i.nextDouble();
  if ( weightSum == 0 ) weightSum = 1; // No positive weights.
  for( ObjectIterator<Entry<Index, Double>> i = index2Weight.entrySet().iterator(); i.hasNext(); ) {
    Reference2DoubleMap.Entry<Index> e = (Reference2DoubleMap.Entry<Index>)i.next();
    this.index2Weight.put( e.getKey(), e.getDoubleValue() / weightSum );
  }
  this.index2Weight.trim();
  LOGGER.debug( "New weight map for " + this + ": " + this.index2Weight );
  return true;
}

origin: it.unimi.di/mg4j

/** Copies the argument internally, rescaling weights so they sum up to one.
 * 
 * @param index2Weight the new map from indices to weights.
 * @return true.
 */
public synchronized boolean setWeights( final Reference2DoubleMap<Index> index2Weight ) {
  this.index2Weight.clear();
  this.index2Weight.defaultReturnValue( 0 ); // Since we're setting up values, we must assume missing indices have weight 0.
  
  double weightSum = 0;
  for( DoubleIterator i = index2Weight.values().iterator(); i.hasNext(); ) weightSum += i.nextDouble();
  if ( weightSum == 0 ) weightSum = 1; // No positive weights.
  for( ObjectIterator<Entry<Index, Double>> i = index2Weight.entrySet().iterator(); i.hasNext(); ) {
    Reference2DoubleMap.Entry<Index> e = (Reference2DoubleMap.Entry<Index>)i.next();
    this.index2Weight.put( e.getKey(), e.getDoubleValue() / weightSum );
  }
  this.index2Weight.trim();
  LOGGER.debug( "New weight map for " + this + ": " + this.index2Weight );
  return true;
}

origin: it.unimi.dsi/fastutil

@SuppressWarnings("unchecked")
@Override
public boolean remove(final Object o) {
  if (!(o instanceof Map.Entry))
    return false;
  if (o instanceof Reference2DoubleMap.Entry) {
    final Reference2DoubleMap.Entry<K> e = (Reference2DoubleMap.Entry<K>) o;
    return map.remove(e.getKey(), e.getDoubleValue());
  }
  Map.Entry<?, ?> e = (Map.Entry<?, ?>) o;
  final Object k = e.getKey();
  final Object value = e.getValue();
  if (value == null || !(value instanceof Double))
    return false;
  final double v = ((Double) (value)).doubleValue();
  return map.remove(k, v);
}
@Override
origin: it.unimi.dsi/fastutil

@Override
public double nextDouble() {
  return i.next().getDoubleValue();
};
@Override
it.unimi.dsi.fastutil.objectsReference2DoubleMap$EntrygetDoubleValue

Javadoc

Returns the value corresponding to this entry.

Popular methods of Reference2DoubleMap$Entry

  • getKey
  • setValue

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • getSystemService (Context)
  • getContentResolver (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Option (scala)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now