shark::QpSparseArray< QpFloatType > Class Template Reference

specialized container class for multi-class SVM problems More...

#include <shark/Algorithms/QP/QpSparseArray.h>

Classes

struct  Entry
 Non-default (non-zero) array entry. More...
 
struct  Row
 Data structure describing a row of the sparse array. More...
 

Public Member Functions

 QpSparseArray (std::size_t height, std::size_t width, std::size_t space)
 
std::size_t width () const
 number of columns More...
 
std::size_t height () const
 number of rows More...
 
QpFloatType operator() (std::size_t row, std::size_t col) const
 obtain an element of the matrix More...
 
Row const & row (std::size_t row) const
 obtain a row of the matrix More...
 
void setDefaultValue (std::size_t row, QpFloatType defaultvalue)
 
void add (std::size_t row, std::size_t col, QpFloatType value)
 

Protected Attributes

std::size_t m_width
 number of columns More...
 
std::size_t m_height
 number of rows More...
 
std::size_t m_used
 current total number of non-default components More...
 
std::vector< Entrym_data
 storage for Entry structures More...
 
std::vector< Rowm_row
 storage for Row structures More...
 

Detailed Description

template<class QpFloatType>
class shark::QpSparseArray< QpFloatType >

specialized container class for multi-class SVM problems

This sparse matrix container allows to explicitly store only those entries of a matrix row that deviate from a row wise default value. This allows for efficient storage of the "kernel modifiers" used to encode dual multi-class support vector machine problems.

Definition at line 56 of file QpSparseArray.h.

Constructor & Destructor Documentation

§ QpSparseArray()

template<class QpFloatType>
shark::QpSparseArray< QpFloatType >::QpSparseArray ( std::size_t  height,
std::size_t  width,
std::size_t  space 
)
inline

Constructor. The space parameter is an upper limit on the number of non-default (aka non-zero) entries of the array.

Definition at line 81 of file QpSparseArray.h.

References shark::QpSparseArray< QpFloatType >::m_row.

Member Function Documentation

§ add()

§ height()

template<class QpFloatType>
std::size_t shark::QpSparseArray< QpFloatType >::height ( ) const
inline

number of rows

Definition at line 99 of file QpSparseArray.h.

References shark::QpSparseArray< QpFloatType >::m_height.

§ operator()()

§ row()

§ setDefaultValue()

§ width()

template<class QpFloatType>
std::size_t shark::QpSparseArray< QpFloatType >::width ( ) const
inline

number of columns

Definition at line 95 of file QpSparseArray.h.

References shark::QpSparseArray< QpFloatType >::m_width.

Member Data Documentation

§ m_data

template<class QpFloatType>
std::vector<Entry> shark::QpSparseArray< QpFloatType >::m_data
protected

storage for Entry structures

Definition at line 153 of file QpSparseArray.h.

Referenced by shark::QpSparseArray< QpFloatType >::add().

§ m_height

template<class QpFloatType>
std::size_t shark::QpSparseArray< QpFloatType >::m_height
protected

number of rows

Definition at line 147 of file QpSparseArray.h.

Referenced by shark::QpSparseArray< QpFloatType >::height().

§ m_row

§ m_used

template<class QpFloatType>
std::size_t shark::QpSparseArray< QpFloatType >::m_used
protected

current total number of non-default components

Definition at line 150 of file QpSparseArray.h.

Referenced by shark::QpSparseArray< QpFloatType >::add().

§ m_width

template<class QpFloatType>
std::size_t shark::QpSparseArray< QpFloatType >::m_width
protected

number of columns

Definition at line 144 of file QpSparseArray.h.

Referenced by shark::QpSparseArray< QpFloatType >::width().


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