Package org.neo4j.gds.paths.delta
Class TentativeDistances.DistanceAndPredecessor
- java.lang.Object
-
- org.neo4j.gds.paths.delta.TentativeDistances.DistanceAndPredecessor
-
- All Implemented Interfaces:
TentativeDistances
- Enclosing interface:
- TentativeDistances
public static class TentativeDistances.DistanceAndPredecessor 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 DistanceAndPredecessor(org.neo4j.gds.core.utils.paged.HugeAtomicLongArray predecessors, org.neo4j.gds.core.utils.paged.HugeAtomicDoubleArray distances)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublecompareAndExchange(long nodeId, double expectedDistance, double newDistance, long predecessor)Atomically updates the distance and the predecessor for the given node.doubledistance(long nodeId)Returns the distance for the given node orDouble.MAX_VALUEif not set.org.neo4j.gds.core.utils.paged.HugeAtomicDoubleArraydistances()longpredecessor(long nodeId)Returns the predecessor for the given node orLong.MAX_VALUEif not set.java.util.Optional<org.neo4j.gds.core.utils.paged.HugeAtomicLongArray>predecessors()voidset(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:TentativeDistancesReturns the distance for the given node orDouble.MAX_VALUEif not set.- Specified by:
distancein interfaceTentativeDistances
-
predecessor
public long predecessor(long nodeId)
Description copied from interface:TentativeDistancesReturns the predecessor for the given node orLong.MAX_VALUEif not set.- Specified by:
predecessorin interfaceTentativeDistances
-
distances
public org.neo4j.gds.core.utils.paged.HugeAtomicDoubleArray distances()
- Specified by:
distancesin interfaceTentativeDistances
-
predecessors
public java.util.Optional<org.neo4j.gds.core.utils.paged.HugeAtomicLongArray> predecessors()
- Specified by:
predecessorsin interfaceTentativeDistances
-
set
public void set(long nodeId, long predecessor, double distance)Description copied from interface:TentativeDistancesSets the distance and the predecessor for the given node.- Specified by:
setin interfaceTentativeDistances
-
compareAndExchange
public double compareAndExchange(long nodeId, double expectedDistance, double newDistance, long predecessor)Description copied from interface:TentativeDistancesAtomically 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:
compareAndExchangein interfaceTentativeDistances
-
-