<html><!-- Created using the cpp_pretty_printer from the dlib C++ library.  See http://dlib.net for updates. --><head><title>dlib C++ Library - multiclass_tools_abstract.h</title></head><body bgcolor='white'><pre>
<font color='#009900'>// Copyright (C) 2010  Davis E. King (davis@dlib.net)
</font><font color='#009900'>// License: Boost Software License   See LICENSE.txt for the full license.
</font><font color='#0000FF'>#undef</font> DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_
<font color='#0000FF'>#ifdef</font> DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_

<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>vector<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> <font color='#5555FF'>&lt;</font>map<font color='#5555FF'>&gt;</font>
<font color='#0000FF'>#include</font> "<a style='text-decoration:none' href='../unordered_pair.h.html'>../unordered_pair.h</a>"

<font color='#0000FF'>namespace</font> dlib
<b>{</b>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> label_type<font color='#5555FF'>&gt;</font>
    std::vector<font color='#5555FF'>&lt;</font>label_type<font color='#5555FF'>&gt;</font> <b><a name='select_all_distinct_labels'></a>select_all_distinct_labels</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> std::vector<font color='#5555FF'>&lt;</font>label_type<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> labels
    <font face='Lucida Console'>)</font>;
    <font color='#009900'>/*!
        ensures
            - Determines all distinct values present in labels and stores them
              into a sorted vector and returns it.  They are sorted in ascending 
              order.
    !*/</font>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
    <font color='#0000FF'>template</font> <font color='#5555FF'>&lt;</font><font color='#0000FF'>typename</font> label_type, <font color='#0000FF'>typename</font> U<font color='#5555FF'>&gt;</font>
    std::vector<font color='#5555FF'>&lt;</font>unordered_pair<font color='#5555FF'>&lt;</font>label_type<font color='#5555FF'>&gt;</font> <font color='#5555FF'>&gt;</font> <b><a name='find_missing_pairs'></a>find_missing_pairs</b> <font face='Lucida Console'>(</font>
        <font color='#0000FF'>const</font> std::map<font color='#5555FF'>&lt;</font>unordered_pair<font color='#5555FF'>&lt;</font>label_type<font color='#5555FF'>&gt;</font>,U<font color='#5555FF'>&gt;</font><font color='#5555FF'>&amp;</font> binary_decision_functions 
    <font face='Lucida Console'>)</font>;
    <font color='#009900'>/*!
        ensures
            - Let L denote the set of all label_type values present in binary_decision_functions.
            - This function finds all the label pairs with both elements distinct and in L but
              not also in binary_decision_functions.  All these missing pairs are stored
              in a sorted vector and returned.  They are sorted in ascending order.
    !*/</font>

<font color='#009900'>// ----------------------------------------------------------------------------------------
</font>
<b>}</b>

<font color='#0000FF'>#endif</font> <font color='#009900'>// DLIB_MULTICLASS_TOoLS_ABSTRACT_Hh_
</font>

</pre></body></html>