45 const Eigen::VectorXi *old_alloc_provider =
nullptr,
46 const std::unordered_map<
int, std::vector<int>> *old_cluster_members_provider_ =
nullptr)
48 Module(old_alloc_provider, old_cluster_members_provider_) {
Data structure for managing point distances and cluster allocations.
Base class for modules used in processes.
Manages distance matrices and cluster allocations for points.
Definition Data.hpp:27
Module(const Eigen::VectorXi *old_allocations_provider_=nullptr, const std::unordered_map< int, std::vector< int > > *old_cluster_members_provider_=nullptr)
Definition Module.hpp:31
Cache for spatial model with spatial covariates.
Definition spatial_cache.hpp:18
double compute_similarity_cls(int cls_idx, bool old_allo=false) const override
Counts internal edges within a cluster.
Definition spatial_module_cache.cpp:23
const double spatial_weight
Weighting factor for spatial similarity.
Definition spatial_module_cache.hpp:26
SpatialModuleCache(const Data &data_, SpatialCache &spatial_cache_, double spatial_coeff, const Eigen::VectorXi *old_alloc_provider=nullptr, const std::unordered_map< int, std::vector< int > > *old_cluster_members_provider_=nullptr)
Constructs a SpatialModuleCache with parameter and data references.
Definition spatial_module_cache.hpp:44
const Data & data_module
Reference to data object with cluster assignments.
Definition spatial_module_cache.hpp:25
Eigen::VectorXd compute_similarity_obs(int obs_idx) const override
Counts neighbors of an observation grouped by cluster membership.
Definition spatial_module_cache.cpp:45
SpatialCache & cache
Spatial cache for additional optimizations.
Definition spatial_module_cache.hpp:28
Cache for spatial model with spatial covariates.