8#include <Eigen/SparseCore>
40 std::size_t
size() {
return c.size(); }
48 std::vector<int>::iterator
begin(
const int i);
56 std::vector<int>::iterator
end(
const int i);
64 std::vector<int>::const_iterator
cbegin(
const int i)
const;
72 std::vector<int>::const_iterator
cend(
const int i)
const;
99 double coeff(
const int i)
const;
117 const std::vector<double>&
coeffs()
const;
137 void update(
const int old_index,
const int new_index,
const double c_new);
143 void update(
const Eigen::VectorXd& beta);
152 std::vector<double> c;
153 std::vector<int> c_ind;
163 void reorder(
const int old_index,
const int new_index);
170 void merge(
const int old_index,
const int new_index);
182Eigen::SparseMatrix<int>
Representation of the nonzero 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 stored nonzero clusters.
const std::vector< int > & indices() const
Returns the feature indices of all stored nonzero 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 the coefficients of all stored nonzero clusters.
int size() const
Returns the number of stored nonzero clusters.
const std::vector< int > & pointers() const
Returns the pointers of all stored nonzero 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.