slope 0.29.0
Loading...
Searching...
No Matches
math.h File Reference

Mathematical support functions for the slope package. More...

#include "jit_normalization.h"
#include "threads.h"
#include <Eigen/Core>
#include <Eigen/SparseCore>
#include <numeric>
#include <vector>
Include dependency graph for math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  slope
 Namespace containing SLOPE regression implementation.
 

Functions

template<typename T >
int slope::sign (T val)
 Returns the sign of a given value.
 
template<typename T >
Eigen::ArrayXd slope::cumSum (const T &x)
 
template<typename T >
slope::sigmoid (const T &x)
 
template<typename T >
slope::logit (const T &x)
 
template<typename T >
slope::clamp (const T &x, const T &lo, const T &hi)
 
Eigen::VectorXd slope::logSumExp (const Eigen::MatrixXd &a)
 
Eigen::MatrixXd slope::softmax (const Eigen::MatrixXd &a)
 
template<typename T >
Eigen::MatrixXd slope::linearPredictor (const T &x, const std::vector< int > &active_set, const Eigen::VectorXd &beta0, const Eigen::VectorXd &beta, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const JitNormalization jit_normalization, const bool intercept)
 
template<typename T >
void slope::updateGradient (Eigen::VectorXd &gradient, const T &x, const Eigen::MatrixXd &residual, const std::vector< int > &active_set, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const Eigen::VectorXd &w, const JitNormalization jit_normalization)
 
template<typename T >
void slope::offsetGradient (Eigen::VectorXd &gradient, const T &x, const Eigen::VectorXd &offset, const std::vector< int > &active_set, const Eigen::VectorXd &x_centers, const Eigen::VectorXd &x_scales, const JitNormalization jit_normalization)
 
std::vector< int > slope::setUnion (const std::vector< int > &a, const std::vector< int > &b)
 Computes the union of two sorted integer vectors.
 
std::vector< int > slope::setDiff (const std::vector< int > &a, const std::vector< int > &b)
 Computes the set difference of two sorted integer vectors.
 
template<typename T >
int slope::whichMax (const T &x)
 Returns the index of the maximum element in a container.
 
template<typename T >
int slope::whichMin (const T &x)
 Returns the index of the minimum element in a container.
 
template<typename T , typename Comparator >
int slope::whichBest (const T &x, const Comparator &comp)
 Returns the index of the minimum element in a container.
 
Eigen::ArrayXd slope::geomSpace (const double start, const double end, const int n)
 Creates an array of n numbers in geometric progression from start to end.
 
template<typename T >
Eigen::VectorXd slope::l1Norms (const T &x)
 Computes the L1 (Manhattan) norms for each column of a matrix.
 
Eigen::VectorXd slope::l2Norms (const Eigen::SparseMatrix< double > &x)
 Computes the L2 (Euclidean) norms for each column of a sparse matrix.
 
Eigen::VectorXd slope::l2Norms (const Eigen::MatrixXd &x)
 Computes the L2 (Euclidean) norms for each column of a dense matrix.
 
Eigen::VectorXd slope::maxAbs (const Eigen::SparseMatrix< double > &x)
 Computes the maximum absolute value for each column of a matrix.
 
Eigen::VectorXd slope::maxAbs (const Eigen::MatrixXd &x)
 Computes the maximum absolute value for each column of a dense matrix.
 
Eigen::VectorXd slope::means (const Eigen::SparseMatrix< double > &x)
 Computes the arithmetic mean for each column of a sparse matrix.
 
Eigen::VectorXd slope::means (const Eigen::MatrixXd &x)
 Computes the arithmetic mean for each column of a dense matrix.
 
Eigen::VectorXd slope::stdDevs (const Eigen::SparseMatrix< double > &x)
 Computes the standard deviation for each column of a matrix.
 
Eigen::VectorXd slope::stdDevs (const Eigen::MatrixXd &x)
 Computes the standard deviation for each column of a matrix.
 
Eigen::VectorXd slope::ranges (const Eigen::SparseMatrix< double > &x)
 Computes the range (max - min) for each column of a matrix.
 
Eigen::VectorXd slope::ranges (const Eigen::MatrixXd &x)
 Computes the range (max - min) for each column of a dense matrix.
 
Eigen::VectorXd slope::mins (const Eigen::SparseMatrix< double > &x)
 Computes the minimum value for each column of a sparse matrix.
 
Eigen::VectorXd slope::mins (const Eigen::MatrixXd &x)
 Computes the minimum value for each column of a dense matrix.
 

Detailed Description

Mathematical support functions for the slope package.

Definition in file math.h.