Package org.neo4j.graphalgo.core.utils
Class AtomicDoubleArray
- java.lang.Object
-
- org.neo4j.graphalgo.core.utils.AtomicDoubleArray
-
public class AtomicDoubleArray extends java.lang.Object
Atomic double Array implementation
-
-
Constructor Summary
Constructors Constructor Description AtomicDoubleArray(int capacity)
Create a new AtomicDoubleArray
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, double value)
add argument to value at index.void
clear()
set all elements to 0double
get(int index)
get the value at indexint
length()
return capacityvoid
set(int index, double value)
Sets the element at position i to the given value.double[]
toArray()
java.lang.String
toString()
-
-
-
Method Detail
-
get
public double get(int index)
get the value at index- Parameters:
index
- the index- Returns:
- value at index
-
set
public void set(int index, double value)
Sets the element at position i to the given value.- Parameters:
index
- the indexvalue
- the value
-
add
public void add(int index, double value)
add argument to value at index. Behaves exactly like standard java double arithmetic.- Parameters:
index
- indexvalue
- value to add
-
length
public int length()
return capacity- Returns:
- the capacity
-
clear
public void clear()
set all elements to 0
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
toArray
public double[] toArray()
-
-