CppLcpFinder is a C++ class for finding least-cost paths (LCPs) using a Quadtree as a resistance surface. The average user should not need to interact with this class at all - all of the LCP functionality is made available through the LcpFinder S4 class.

Details

This class is defined in 'src/LcpFinderWrapper.h' and 'src/LcpFinderWrapper.cpp'. When made available to R, it is exposed as CppLcpFinder rather than LcpFinderWrapper. LcpFinderWrapper contains a pointer to a LcpFinder C++ object (defined in 'src/LcpFinder.h' and 'src/LcpFinder.cpp'). All of the core functionality is in the LcpFinder C++ class. LcpFinderWrapper is a wrapper class that adds the 'Rcpp' code required for it to be accessible from R.

Note that there is no constructor made accessible to R - a CppLcpFinder is created by using the getLcpFinder method of the CppQuadtree class.

Fields

getAllPathsSummary
  • Description: Returns a matrix summarizing all the LCPs calculated so far. summarize_lcps() is a wrapper for this function - see documentation of that function for more details.

  • Parameters: none

  • Returns: a matrix with one row per LCP. See documentation of summarize_lcps() for details.

getLcp
  • Description: Finds the LCP from the starting point to another point. find_lcp is a wrapper for this function - see its documentation for more details.

  • Parameters:

    • endPoint: two-element numeric vector (x,y) - the point to find a shortest path to

  • Returns: A matrix representing the least-cost path. See find_lcp() for details on the return matrix.

getSearchLimits
  • Description: Returns the x and y limits of the search area.

  • Parameters: none

  • Returns: four-element numeric vector, in this order: xmin, xmax, ymin, ymax

getStartPoint
  • Description: Returns the start point

  • Parameters: none

  • Returns: two-element numeric vector (x,y)

makeNetworkAll
  • Description: Calculates LCPs to all cells in the search area. This is used by find_lcps when limit is NULL. See documentation of that function for more details.

  • Parameters: none

  • Returns: void - no return value. Specific paths can be retrieved using getLcp, and getAllPathsSummary can be used to summarize all paths that have been found.

makeNetworkCostDist
  • Description: Calculates all LCPs whose cost-distance is less than a given threshold. This is used in find_lcps when limit is not NULL. See documentation of that function for more details.

  • Parameters:

    • constraint: double; the maximum cost-distance allowed for a LCP

  • Returns: void - no return value. Specific paths can be retrieved using getLcp, and getAllPathsSummary can be used to summarize all paths that have been found.