slope 6.0.1
Loading...
Searching...
No Matches
slope::Clusters Class Reference

Representation of the clusters in SLOPE. More...

#include <clusters.h>

Public Member Functions

 Clusters ()=default
 Constructs an Clusters object.
 
 Clusters (const Eigen::VectorXd &beta)
 Constructs a Clusters object with the given beta vector.
 
std::size_t size ()
 Returns the number of clusters.
 
std::vector< int >::iterator begin (const int i)
 Returns an iterator pointing to the beginning 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.
 
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.
 
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.
 
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.
 
int size () const
 Returns the number of clusters.
 
double coeff (const int i) const
 Returns the coefficient of the cluster with the given index.
 
void setCoeff (const int i, const double x)
 Sets the coefficient of the cluster with the given index.
 
const std::vector< double > & coeffs () const
 Returns a vector containing the coefficients of all clusters.
 
const std::vector< int > & indices () const
 Returns a vector containing the indices of all clusters.
 
const std::vector< int > & pointers () const
 Returns a vector containing the pointers of all clusters.
 
void update (const int old_index, const int new_index, const double c_new)
 Updates the cluster structure when an index is changed.
 
void update (const Eigen::VectorXd &beta)
 Updates the cluster structure with the given beta vector.
 
std::vector< std::vector< int > > getClusters () const
 Returns the clusters as a vector of vectors.
 

Detailed Description

Representation of the clusters in SLOPE.

Definition at line 17 of file clusters.h.

Constructor & Destructor Documentation

◆ Clusters()

slope::Clusters::Clusters ( const Eigen::VectorXd &  beta)

Constructs a Clusters object with the given beta vector.

Parameters
betaThe beta vector.

Member Function Documentation

◆ begin()

std::vector< int >::iterator slope::Clusters::begin ( const int  i)

Returns an iterator pointing to the beginning of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
An iterator pointing to the beginning of the cluster.

◆ cbegin()

std::vector< int >::const_iterator slope::Clusters::cbegin ( const int  i) const

Returns a constant iterator pointing to the beginning of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
A constant iterator pointing to the beginning of the cluster.

◆ cend()

std::vector< int >::const_iterator slope::Clusters::cend ( const int  i) const

Returns a constant iterator pointing to the end of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
A constant iterator pointing to the end of the cluster.

◆ cluster_size()

int slope::Clusters::cluster_size ( const int  i) const

Returns the size of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
The size of the cluster.

◆ coeff()

double slope::Clusters::coeff ( const int  i) const

Returns the coefficient of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
The coefficient of the cluster.

◆ coeffs()

const std::vector< double > & slope::Clusters::coeffs ( ) const

Returns a vector containing the coefficients of all clusters.

Returns
A vector containing the coefficients.

◆ end()

std::vector< int >::iterator slope::Clusters::end ( const int  i)

Returns an iterator pointing to the end of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
An iterator pointing to the end of the cluster.

◆ getClusters()

std::vector< std::vector< int > > slope::Clusters::getClusters ( ) const

Returns the clusters as a vector of vectors.

Returns
The clusters as a vector of vectors.

◆ indices()

const std::vector< int > & slope::Clusters::indices ( ) const

Returns a vector containing the indices of all clusters.

Returns
A vector containing the indices.

◆ pointer()

int slope::Clusters::pointer ( const int  i) const

Returns the pointer of the cluster with the given index.

Parameters
iThe index of the cluster.
Returns
The pointer of the cluster.

◆ pointers()

const std::vector< int > & slope::Clusters::pointers ( ) const

Returns a vector containing the pointers of all clusters.

Returns
A vector containing the pointers.

◆ setCoeff()

void slope::Clusters::setCoeff ( const int  i,
const double  x 
)

Sets the coefficient of the cluster with the given index.

Parameters
iThe index of the cluster.
xThe new coefficient value.

◆ size() [1/2]

std::size_t slope::Clusters::size ( )
inline

Returns the number of clusters.

Returns
The size of the cluster.

Definition at line 35 of file clusters.h.

◆ size() [2/2]

int slope::Clusters::size ( ) const

Returns the number of clusters.

Returns
The number of clusters.

◆ update() [1/2]

void slope::Clusters::update ( const Eigen::VectorXd &  beta)

Updates the cluster structure with the given beta vector.

Parameters
betaThe beta vector.

◆ update() [2/2]

void slope::Clusters::update ( const int  old_index,
const int  new_index,
const double  c_new 
)

Updates the cluster structure when an index is changed.

Parameters
old_indexThe old index.
new_indexThe new index.
c_newThe new coefficient value.

The documentation for this class was generated from the following file: