SOPT
Sparse OPTimisation
Classes | Namespaces | Typedefs | Functions
maths.h File Reference
#include "sopt/config.h"
#include <algorithm>
#include <complex>
#include <type_traits>
#include <Eigen/Core>
#include "sopt/exception.h"
#include "sopt/types.h"
+ Include dependency graph for maths.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sopt::details::ProjectPositiveQuadrant< SCALAR >
 Expression to create projection onto positive orthant. More...
 
class  sopt::details::ProjectPositiveQuadrant< std::complex< SCALAR > >
 Specialization for complex numbers. More...
 

Namespaces

 sopt
 
 sopt::details
 

Typedefs

template<typename SCALAR >
using sopt::details::SoftThreshhold = decltype(std::bind(soft_threshhold< SCALAR >, std::placeholders::_1, typename real_type< SCALAR >::type(1)))
 Helper template type alias to instantiate soft_threshhold that takes an Eigen object. More...
 

Functions

template<typename T >
real_type< typename T::Scalar >::type sopt::standard_deviation (Eigen::ArrayBase< T > const &x)
 Computes the standard deviation of a vector. More...
 
template<typename T >
real_type< typename T::Scalar >::type sopt::standard_deviation (Eigen::MatrixBase< T > const &x)
 Computes the standard deviation of a vector. More...
 
template<typename SCALAR >
std::enable_if< std::is_arithmetic< SCALAR >::value or is_complex< SCALAR >::value, SCALAR >::type sopt::soft_threshhold (SCALAR const &x, typename real_type< SCALAR >::type const &threshhold)
 abs(x) < threshhold ? 0: x - sgn(x) * threshhold More...
 
template<typename T >
Eigen::CwiseUnaryOp< const details::ProjectPositiveQuadrant< typename T::Scalar >, const T > sopt::positive_quadrant (Eigen::DenseBase< T > const &input)
 Expression to create projection onto positive quadrant. More...
 
template<typename T >
Eigen::CwiseUnaryOp< const details::SoftThreshhold< typename T::Scalar >, const T > sopt::soft_threshhold (Eigen::DenseBase< T > const &input, typename real_type< typename T::Scalar >::type const &threshhold)
 Expression to create soft-threshhold. More...
 
template<typename T0 , typename T1 >
std::enable_if< std::is_arithmetic< typename T0::Scalar >::value and std::is_arithmetic< typename T1::Scalar >::value, Eigen::CwiseBinaryOp< typename T0::Scalar(*)(typename T0::Scalar const &, typename T1::Scalar const &), const T0, const T1 > >::type sopt::soft_threshhold (Eigen::DenseBase< T0 > const &input, Eigen::DenseBase< T1 > const &threshhold)
 Expression to create soft-threshhold with multiple parameters. More...
 
template<typename T0 , typename T1 >
std::enable_if< is_complex< typename T0::Scalar >::value and std::is_arithmetic< typename T1::Scalar >::value, Eigen::CwiseBinaryOp< typename T0::Scalar(*)(typename T0::Scalar const &, typename T0::Scalar const &), const T0, decltype(std::declval< const T1 >).template cast< typename T0::Scalar >))> >::type sopt::soft_threshhold (Eigen::DenseBase< T0 > const &input, Eigen::DenseBase< T1 > const &threshhold)
 Expression to create soft-threshhold with multiple parameters. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::l1_norm (Eigen::ArrayBase< T0 > const &input, Eigen::ArrayBase< T1 > const &weights)
 Computes weighted L1 norm. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::l1_norm (Eigen::MatrixBase< T0 > const &input, Eigen::MatrixBase< T1 > const &weight)
 Computes weighted L1 norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::l1_norm (Eigen::ArrayBase< T0 > const &input)
 Computes L1 norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::l1_norm (Eigen::MatrixBase< T0 > const &input)
 Computes L1 norm. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::l2_norm (Eigen::ArrayBase< T0 > const &input, Eigen::ArrayBase< T1 > const &weights)
 Computes weighted L2 norm. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::l2_norm (Eigen::MatrixBase< T0 > const &input, Eigen::MatrixBase< T1 > const &weights)
 Computes weighted L2 norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::l2_norm (Eigen::ArrayBase< T0 > const &input)
 Computes weighted L2 norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::l2_norm (Eigen::MatrixBase< T0 > const &input)
 Computes weighted L2 norm. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::tv_norm (Eigen::ArrayBase< T0 > const &input, Eigen::ArrayBase< T1 > const &weights)
 Computes weighted TV norm. More...
 
template<typename T0 , typename T1 >
real_type< typename T0::Scalar >::type sopt::tv_norm (Eigen::MatrixBase< T0 > const &input, Eigen::MatrixBase< T1 > const &weights)
 Computes weighted TV norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::tv_norm (Eigen::ArrayBase< T0 > const &input)
 Computes weighted tv norm. More...
 
template<typename T0 >
real_type< typename T0::Scalar >::type sopt::tv_norm (Eigen::MatrixBase< T0 > const &input)
 Computes weighted TV norm. More...
 
t_int sopt::details::gcd (t_int a, t_int b)
 Greatest common divisor. More...