Program Listing for File RowFingerprint.h

↰ Return to documentation for file (ADS/dictionary/RowFingerprint.h)

/*--------------------------------------------------------------------------*/
/*------------------------- File RowFingerprint.h --------------------------*/
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
/*----------------------------- DEFINITIONS --------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef __ADS_RowFingerprint
 #define __ADS_RowFingerprint
                      /* self-identification: #endif constant */

/*--------------------------------------------------------------------------*/
/*------------------------------ INCLUDES ----------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/Contract.h"
#include "ADS/dictionary/FastHash.h"

#include <bit>
#include <cstddef>
#include <cstdint>
#include <cstring>
#include <span>
#include <type_traits>

/*--------------------------------------------------------------------------*/
/*--------------------------- NAMESPACE ------------------------------------*/
/*--------------------------------------------------------------------------*/

namespace ADS {

/*--------------------------------------------------------------------------*/
/*------------------------------ FUNCTIONS ---------------------------------*/
/*--------------------------------------------------------------------------*/

[[nodiscard]] inline std::uint64_t canonicalWord( double x );

[[nodiscard]] std::uint64_t rowFingerprint( std::span< const double > x ,
                                            std::uint64_t seed = 0 );

template< class I >
[[nodiscard]] std::uint64_t rowFingerprint( std::size_t n , const I * ind ,
                                            const double * val ,
                                            std::uint64_t seed = 0 );

[[nodiscard]] bool sameRow( std::span< const double > a ,
                            std::span< const double > b );

template< class I >
[[nodiscard]] bool sameRow( std::size_t na , const I * ia ,
                            const double * va , std::size_t nb ,
                            const I * ib , const double * vb );

/*--------------------------------------------------------------------------*/

}  // end( namespace ADS )

/*--------------------------------------------------------------------------*/
/*-------------------------- IMPLEMENTATION --------------------------------*/
/*--------------------------------------------------------------------------*/

#include "ADS/dictionary/impl/RowFingerprint.tpp"

/*--------------------------------------------------------------------------*/

#endif  /* RowFingerprint.h included */

/*--------------------------------------------------------------------------*/
/*------------------------ End File RowFingerprint.h -----------------------*/
/*--------------------------------------------------------------------------*/