Package org.neo4j.gds.paths.delta
Class TentativeDistances.DistanceOnly
- java.lang.Object
-
- org.neo4j.gds.paths.delta.TentativeDistances.DistanceOnly
-
- All Implemented Interfaces:
TentativeDistances
- Enclosing interface:
- TentativeDistances
public static class TentativeDistances.DistanceOnly extends java.lang.Object implements TentativeDistances
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.neo4j.gds.paths.delta.TentativeDistances
TentativeDistances.DistanceAndPredecessor, TentativeDistances.DistanceOnly
-
-
Field Summary
-
Fields inherited from interface org.neo4j.gds.paths.delta.TentativeDistances
DIST_INF, NO_PREDECESSOR
-
-
Constructor Summary
Constructors Constructor Description DistanceOnly(org.neo4j.gds.collections.haa.HugeAtomicDoubleArray distances)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
compareAndExchange(long nodeId, double expectedDistance, double newDistance, long predecessor)
Atomically updates the distance and the predecessor for the given node.double
distance(long nodeId)
Returns the distance for the given node orDouble.MAX_VALUE
if not set.org.neo4j.gds.collections.haa.HugeAtomicDoubleArray
distances()
long
predecessor(long nodeId)
Returns the predecessor for the given node orLong.MAX_VALUE
if not set.java.util.Optional<org.neo4j.gds.collections.haa.HugeAtomicLongArray>
predecessors()
void
set(long nodeId, long predecessor, double distance)
Sets the distance and the predecessor for the given node.
-
-
-
Method Detail
-
distance
public double distance(long nodeId)
Description copied from interface:TentativeDistances
Returns the distance for the given node orDouble.MAX_VALUE
if not set.- Specified by:
distance
in interfaceTentativeDistances
-
predecessor
public long predecessor(long nodeId)
Description copied from interface:TentativeDistances
Returns the predecessor for the given node orLong.MAX_VALUE
if not set.- Specified by:
predecessor
in interfaceTentativeDistances
-
set
public void set(long nodeId, long predecessor, double distance)
Description copied from interface:TentativeDistances
Sets the distance and the predecessor for the given node.- Specified by:
set
in interfaceTentativeDistances
-
compareAndExchange
public double compareAndExchange(long nodeId, double expectedDistance, double newDistance, long predecessor)
Description copied from interface:TentativeDistances
Atomically updates the distance and the predecessor for the given node. The method returns the witness value, which is the value we saw when attempting a store operation. If the witness value is the expected distance, the update for both, distance and predecessor, was successful.- Specified by:
compareAndExchange
in interfaceTentativeDistances
-
distances
public org.neo4j.gds.collections.haa.HugeAtomicDoubleArray distances()
- Specified by:
distances
in interfaceTentativeDistances
-
predecessors
public java.util.Optional<org.neo4j.gds.collections.haa.HugeAtomicLongArray> predecessors()
- Specified by:
predecessors
in interfaceTentativeDistances
-
-