|
Docs
|
Cache for spatial model with binary covariates. More...
#include <binary_cache.hpp>
Classes | |
| struct | ClusterStats |
| Structure to hold statistics for each cluster. More... | |
Public Member Functions | |
| BinaryCache (const Eigen::VectorXi &allocations_ref, const Eigen::VectorXi &binary_covariates) | |
| void | set_allocation (int index, int cluster, int old_cluster) override |
| Assigns a point to a cluster. | |
| ClusterStats | get_cluster_stats (int cluster) const |
| Get cluster statistics for a specific cluster. | |
| const ClusterStats & | get_cluster_stats_ref (int cluster) const |
| Get cluster statistics reference for a specific cluster. | |
| void | recompute (const int K, const Eigen::VectorXi &allocations_in) override |
| Recomputes all cluster information from current allocations. | |
| void | move_cluster_info (int from_cluster, int to_cluster) override |
| Moves cluster information from one cluster to another. | |
| void | remove_info (int cluster) override |
| Removes information related to a specific cluster. | |
| Public Member Functions inherited from ClusterInfo | |
| ClusterInfo ()=default | |
| virtual | ~ClusterInfo ()=default |
Public Attributes | |
| const Eigen::VectorXi | binary_covariates |
Private Attributes | |
| std::vector< ClusterStats > | cluster_stats |
Cache for spatial model with binary covariates.
This class maintains cluster statistics for a spatial model that includes binary covariates.
|
inline |
|
inline |
Get cluster statistics for a specific cluster.
| cluster | Index of the cluster |
|
inline |
Get cluster statistics reference for a specific cluster.
| cluster | Index of the cluster |
|
inlineoverridevirtual |
Moves cluster information from one cluster to another.
| from_cluster | Index of the source cluster |
| to_cluster | Index of the target cluster |
Implements ClusterInfo.
|
overridevirtual |
Recomputes all cluster information from current allocations.
| K | Current number of clusters |
| allocations_in | Current allocations vector |
Implements ClusterInfo.
|
inlineoverridevirtual |
Removes information related to a specific cluster.
| cluster | Index of the cluster to remove |
Implements ClusterInfo.
|
overridevirtual |
Assigns a point to a cluster.
| index | Index of the point to reassign |
| cluster | Target cluster index (K for new cluster, -1 for unallocated) |
| old_cluster | Previous cluster index of the point |
| std::out_of_range | if index or cluster is invalid |
Implements ClusterInfo.
| const Eigen::VectorXi BinaryCache::binary_covariates |
|
private |