Class NearbyConeSearcher

Class Documentation

class NearbyConeSearcher

Class to manage caching and computation of cone distance, vector, and angle information.

Public Types

using CacheKey = std::pair<size_t, ConeType>
using CacheValue = std::tuple<SearchDirectionsCache, AngleMaskCache, arma::fmat, arma::cube>

Public Functions

NearbyConeSearcher()
CacheValue get_caches(const arma::mat &cones, ConeType cone_type)

Retrieve or compute cache data for a set of cones and a given cone type.

Parameters:
  • cones – Matrix of cone positions (each row is a cone, columns should include at least x and y).

  • cone_type – Enum identifier for the type of cone.

Returns:

A tuple containing search direction cache, angle mask cache, squared distance matrix, and cone vectors.

std::tuple<arma::fvec, arma::fvec> number_cones_per_side(const arma::mat &cones, const arma::imat &configurations, ConeType cone_type, double max_distance, double max_angle)

Compute the number of cones per side based on geometric and angular constraints.

Parameters:
  • cones – Matrix of cone positions.

  • configurations – Integer matrix of configurations (indices of cones).

  • cone_type – Enum identifier for the cone type.

  • max_distance – Maximum allowed distance between cones.

  • max_angle – Maximum allowed angle for valid configurations.

Returns:

Tuple of float vectors: (number of cones on the left, number on the right).

Public Members

std::deque<std::pair<CacheKey, CacheValue>> caches_cache
const size_t max_cache_size = 20