8#include <Eigen/SparseCore>
35 std::size_t
size() {
return c.size(); }
43 std::vector<int>::iterator
begin(
const int i);
51 std::vector<int>::iterator
end(
const int i);
59 std::vector<int>::const_iterator
cbegin(
const int i)
const;
67 std::vector<int>::const_iterator
cend(
const int i)
const;
94 double coeff(
const int i)
const;
107 const std::vector<double>&
coeffs()
const;
127 void update(
const int old_index,
const int new_index,
const double c_new);
133 void update(
const Eigen::VectorXd& beta);
142 std::vector<double> c;
143 std::vector<int> c_ind;
153 void reorder(
const int old_index,
const int new_index);
160 void merge(
const int old_index,
const int new_index);
172Eigen::SparseMatrix<int>
Representation of the clusters in SLOPE.
void update(const int old_index, const int new_index, const double c_new)
Updates the cluster structure when an index is changed.
double coeff(const int i) const
Returns the coefficient of the cluster with the given index.
void update(const Eigen::VectorXd &beta)
Updates the cluster structure with the given beta vector.
std::size_t size()
Returns the number of clusters.
const std::vector< int > & indices() const
Returns a vector containing the indices of all clusters.
int cluster_size(const int i) const
Returns the size of the cluster with the given index.
int pointer(const int i) const
Returns the pointer of the cluster with the given index.
std::vector< std::vector< int > > getClusters() const
Returns the clusters as a vector of vectors.
Clusters(const Eigen::VectorXd &beta)
Constructs a Clusters object with the given beta vector.
void setCoeff(const int i, const double x)
Sets the coefficient of the cluster with the given index.
std::vector< int >::iterator begin(const int i)
Returns an iterator pointing to the beginning of the cluster with the given index.
Clusters()=default
Constructs an Clusters object.
std::vector< int >::const_iterator cend(const int i) const
Returns a constant iterator pointing to the end of the cluster with the given index.
std::vector< int >::iterator end(const int i)
Returns an iterator pointing to the end of the cluster with the given index.
const std::vector< double > & coeffs() const
Returns a vector containing the coefficients of all clusters.
int size() const
Returns the number of clusters.
const std::vector< int > & pointers() const
Returns a vector containing the pointers of all clusters.
std::vector< int >::const_iterator cbegin(const int i) const
Returns a constant iterator pointing to the beginning of the cluster with the given index.
Namespace containing SLOPE regression implementation.
Eigen::SparseMatrix< int > patternMatrix(const Eigen::VectorXd &beta)
Returns the cluster pattern as a sparse matrix.