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< Entry > | m_data |
storage for Entry structures More... | |
std::vector< Row > | m_row |
storage for Row structures More... | |
specialized container class for multi-class SVM problems
Definition at line 56 of file QpSparseArray.h.
|
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.
|
inline |
Set a specific value. Note that entries can not be changed once they are added, and that adding elements must be done row-wise, and in order within each row. However, the order of rows does not matter.
Definition at line 128 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::m_data, shark::QpSparseArray< QpFloatType >::m_row, shark::QpSparseArray< QpFloatType >::m_used, shark::QpSparseArray< QpFloatType >::row(), SHARK_CHECK, and shark::QpSparseArray< QpFloatType >::Entry::value.
Referenced by shark::McReinforcedSvmTrainer< InputType, CacheType >::train(), shark::McSvmCSTrainer< InputType, CacheType >::train(), shark::McSvmMMRTrainer< InputType, CacheType >::train(), shark::McSvmLLWTrainer< InputType, CacheType >::train(), shark::McSvmADMTrainer< InputType, CacheType >::train(), shark::McSvmWWTrainer< InputType, CacheType >::train(), shark::McSvmATMTrainer< InputType, CacheType >::train(), and shark::McSvmATSTrainer< InputType, CacheType >::train().
|
inline |
number of rows
Definition at line 99 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::m_height.
|
inline |
obtain an element of the matrix
Definition at line 103 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::Row::defaultvalue, shark::QpSparseArray< QpFloatType >::Row::entry, shark::QpSparseArray< QpFloatType >::Entry::index, shark::QpSparseArray< QpFloatType >::m_row, shark::QpSparseArray< QpFloatType >::row(), shark::QpSparseArray< QpFloatType >::Row::size, and shark::QpSparseArray< QpFloatType >::Entry::value.
|
inline |
obtain a row of the matrix
Definition at line 115 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::m_row.
Referenced by shark::QpSparseArray< QpFloatType >::add(), shark::QpSparseArray< QpFloatType >::operator()(), shark::QpSparseArray< QpFloatType >::setDefaultValue(), shark::BiasSolver< Matrix >::solve(), and shark::BiasSolverSimplex< Matrix >::solve().
|
inline |
set the default value, that is, the value of all implicitly defined elements of a row
Definition at line 120 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::m_row, and shark::QpSparseArray< QpFloatType >::row().
Referenced by shark::McReinforcedSvmTrainer< InputType, CacheType >::train(), shark::McSvmCSTrainer< InputType, CacheType >::train(), shark::McSvmMMRTrainer< InputType, CacheType >::train(), shark::McSvmLLWTrainer< InputType, CacheType >::train(), shark::McSvmADMTrainer< InputType, CacheType >::train(), shark::McSvmWWTrainer< InputType, CacheType >::train(), shark::McSvmATMTrainer< InputType, CacheType >::train(), and shark::McSvmATSTrainer< InputType, CacheType >::train().
|
inline |
number of columns
Definition at line 95 of file QpSparseArray.h.
References shark::QpSparseArray< QpFloatType >::m_width.
|
protected |
storage for Entry structures
Definition at line 153 of file QpSparseArray.h.
Referenced by shark::QpSparseArray< QpFloatType >::add().
|
protected |
number of rows
Definition at line 147 of file QpSparseArray.h.
Referenced by shark::QpSparseArray< QpFloatType >::height().
|
protected |
storage for Row structures
Definition at line 156 of file QpSparseArray.h.
Referenced by shark::QpSparseArray< QpFloatType >::add(), shark::QpSparseArray< QpFloatType >::operator()(), shark::QpSparseArray< QpFloatType >::QpSparseArray(), shark::QpSparseArray< QpFloatType >::row(), and shark::QpSparseArray< QpFloatType >::setDefaultValue().
|
protected |
current total number of non-default components
Definition at line 150 of file QpSparseArray.h.
Referenced by shark::QpSparseArray< QpFloatType >::add().
|
protected |
number of columns
Definition at line 144 of file QpSparseArray.h.
Referenced by shark::QpSparseArray< QpFloatType >::width().