Skip to content

Commit

Permalink
+ constructor from base class in multiclass labels
Browse files Browse the repository at this point in the history
  • Loading branch information
iglesias committed May 21, 2012
1 parent e8a662e commit 5f02a4a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/shogun/labels/MulticlassLabels.cpp
Expand Up @@ -21,6 +21,11 @@ CMulticlassLabels::CMulticlassLabels(CFile* loader) : CDenseLabels(loader)
{
}

CMulticlassLabels::CMulticlassLabels(CLabels* const base_labels) : CDenseLabels()
{
m_labels = ((CMulticlassLabels*) base_labels)->m_labels;
}

bool CMulticlassLabels::is_valid()
{
ASSERT(m_labels.vector);
Expand Down
6 changes: 6 additions & 0 deletions src/shogun/labels/MulticlassLabels.h
Expand Up @@ -54,6 +54,12 @@ class CMulticlassLabels : public CDenseLabels
*/
CMulticlassLabels(CFile* loader);

/** constructor (can be used to downcast CLabels)
*
* @param labs its dynamic type must be CMulticlassLabels
*/
CMulticlassLabels(CLabels* const base_labels);

/** is_valid checks if labeling is a multi-class labeling
*
* possible with subset
Expand Down

0 comments on commit 5f02a4a

Please sign in to comment.