Sha256: d6dc0a3ed1cd477648bda0a919bf7581a4389a5e3fc375273fb75aa3a132194f

Contents?: true

Size: 1.09 KB

Versions: 13

Compression:

Stored size: 1.09 KB

Contents

// Copyright (C) 2013  Davis E. King (davis@dlib.net)
// License: Boost Software License   See LICENSE.txt for the full license.
#undef DLIB_COUNT_BiTS_ABSTRACT_Hh_
#ifdef DLIB_COUNT_BiTS_ABSTRACT_Hh_


namespace dlib
{

// ----------------------------------------------------------------------------------------

    template <
        typename T
        >
    T count_bits (
        T v
    );
    /*!
        requires
            - T is an unsigned integral type
        ensures
            - returns the number of bits in v which are set to 1.
    !*/

// ----------------------------------------------------------------------------------------

    template <
        typename T
        >
    T hamming_distance (
        const T& a,
        const T& b
    );
    /*!
        requires
            - T is an unsigned integral type
        ensures
            - returns the number of bits which differ between a and b.  (I.e. returns
              count_bits(a^b).)
    !*/

// ----------------------------------------------------------------------------------------

}

#endif // DLIB_COUNT_BiTS_ABSTRACT_Hh_


Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
dlib-1.2.2 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.2.1 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.2.0 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.5 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.4 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.3 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.2 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.1 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.1.0 ext/dlib-19.4/dlib/general_hash/count_bits_abstract.h
dlib-1.0.3 ext/dlib-18.13/dlib/general_hash/count_bits_abstract.h
dlib-1.0.2 ext/dlib-18.13/dlib/general_hash/count_bits_abstract.h
dlib-1.0.1 ext/dlib-18.13/dlib/general_hash/count_bits_abstract.h
dlib-1.0.0 ext/dlib-18.13/dlib/general_hash/count_bits_abstract.h