Docs
Toggle main menu visibility
Loading...
Searching...
No Matches
Datax.hpp
Go to the documentation of this file.
1
14
15
#pragma once
16
17
#include "
ClusterInfo.hpp
"
18
#include "
Data.hpp
"
19
#include <memory>
20
30
class
Datax
:
public
Data
{
31
32
protected
:
33
std::vector<std::shared_ptr<ClusterInfo>>
cluster_info
;
34
35
void
compact_cluster
(
int
old_cluster);
36
37
public
:
38
Datax
(
const
utils_params
&
p
, std::vector<std::shared_ptr<ClusterInfo>> ci,
39
const
Eigen::VectorXi &initial_allocations = Eigen::VectorXi())
40
:
Data
(
p
, initial_allocations),
cluster_info
(std::move(ci)) {}
41
48
void
set_allocation
(
int
index,
int
cluster)
override
;
49
55
void
set_allocations
(
const
Eigen::VectorXi &new_allocations)
override
;
56
67
void
68
restore_state
(Eigen::VectorXi &old_allocations,
69
std::unordered_map<
int
, std::vector<int>> &old_cluster_members,
70
int
old_K)
override
;
71
72
virtual
~Datax
() =
default
;
73
};
ClusterInfo.hpp
Abstract base class for managing cluster information and caches.
Data.hpp
Data structure for managing point distances and cluster allocations.
Data::Data
Data(const utils_params &p, const Eigen::VectorXi &initial_allocations=Eigen::VectorXi())
Constructs a Data object with a distance matrix.
Definition
Data.cpp:10
Data::p
const utils_params & p
Reference to model parameters.
Definition
Data.hpp:28
Datax::restore_state
void restore_state(Eigen::VectorXi &old_allocations, std::unordered_map< int, std::vector< int > > &old_cluster_members, int old_K) override
Restores allocations, cluster memberships, and cluster count from a saved state.
Definition
Datax.cpp:84
Datax::Datax
Datax(const utils_params &p, std::vector< std::shared_ptr< ClusterInfo > > ci, const Eigen::VectorXi &initial_allocations=Eigen::VectorXi())
Definition
Datax.hpp:38
Datax::set_allocation
void set_allocation(int index, int cluster) override
Assigns a point to a cluster.
Definition
Datax.cpp:58
Datax::compact_cluster
void compact_cluster(int old_cluster)
Definition
Datax.cpp:9
Datax::set_allocations
void set_allocations(const Eigen::VectorXi &new_allocations) override
Sets all cluster allocations at once.
Definition
Datax.cpp:77
Datax::~Datax
virtual ~Datax()=default
Datax::cluster_info
std::vector< std::shared_ptr< ClusterInfo > > cluster_info
Definition
Datax.hpp:33
utils_params
Parameter struct for utility parameters and data structures.
Definition
utils-params.hpp:17
BNPClust
utils
Datax.hpp
Generated by
1.17.0