Class TentativeDistances.DistanceOnly

    • 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 or Double.MAX_VALUE if not set.
      org.neo4j.gds.collections.haa.HugeAtomicDoubleArray distances()  
      long predecessor​(long nodeId)
      Returns the predecessor for the given node or Long.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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DistanceOnly

        public DistanceOnly​(org.neo4j.gds.collections.haa.HugeAtomicDoubleArray distances)
    • Method Detail

      • distance

        public double distance​(long nodeId)
        Description copied from interface: TentativeDistances
        Returns the distance for the given node or Double.MAX_VALUE if not set.
        Specified by:
        distance in interface TentativeDistances
      • predecessor

        public long predecessor​(long nodeId)
        Description copied from interface: TentativeDistances
        Returns the predecessor for the given node or Long.MAX_VALUE if not set.
        Specified by:
        predecessor in interface TentativeDistances
      • 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 interface TentativeDistances
      • 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 interface TentativeDistances
      • distances

        public org.neo4j.gds.collections.haa.HugeAtomicDoubleArray distances()
        Specified by:
        distances in interface TentativeDistances
      • predecessors

        public java.util.Optional<org.neo4j.gds.collections.haa.HugeAtomicLongArray> predecessors()
        Specified by:
        predecessors in interface TentativeDistances