FastCollectionsByLeo/Src/ColHash/Hash/Number/Ul.mqh
2026-08-28 22:09:26 -05:00

105 lines
3.1 KiB
MQL5

//+------------------------------------------------------------------+
//| Ul.mqh |
//| Copyright 2026, Niquel Mendoza |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2026, Niquel Mendoza"
#property link "https://www.mql5.com"
#property strict
#ifndef FASTCOLLECTIONSBYLEO_COLHASH_HASH_GENERIC_NUMBER_UL_MQH
#define FASTCOLLECTIONSBYLEO_COLHASH_HASH_GENERIC_NUMBER_UL_MQH
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
#include "Def.mqh"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
namespace TSN
{
//+------------------------------------------------------------------+
//| Ulong |
//+------------------------------------------------------------------+
//CGenericHash_ulong_splitmix por defecto
class CGenericHash_ulong : public CGenericHash_eq_simple<ulong>
{
public:
CGenericHash_ulong() {}
~CGenericHash_ulong() {}
//---
static ulong Hash(ulong x)
{
GENERICHHASH_SPLITMIX(x)
return x;
}
};
//+------------------------------------------------------------------+
class CGenericHash_ulong_fmix : public CGenericHash_eq_simple<ulong>
{
public:
CGenericHash_ulong_fmix() {}
~CGenericHash_ulong_fmix() {}
//---
static ulong Hash(ulong x)
{
GENERICHHASH_FMIX(x)
return x;
}
};
//+------------------------------------------------------------------+
class CGenericHash_ulong_fibbo : public CGenericHash_eq_simple<ulong>
{
public:
CGenericHash_ulong_fibbo() {}
~CGenericHash_ulong_fibbo() {}
//---
static __forceinline ulong Hash(const ulong x)
{
return x * 0x9E3779B97F4A7C15;
}
};
//+------------------------------------------------------------------+
class CGenericHash_ulong_fibbo_plus : public CGenericHash_eq_simple<ulong>
{
public:
CGenericHash_ulong_fibbo_plus() {}
~CGenericHash_ulong_fibbo_plus() {}
//---
static __forceinline ulong Hash(ulong x)
{
GENERICHHASH_FIBBO_PLUS(x)
return x;
}
};
//+------------------------------------------------------------------+
class CGenericHash_ulong_murmur : public CGenericHash_eq_simple<ulong>
{
public:
CGenericHash_ulong_murmur() {}
~CGenericHash_ulong_murmur() {}
//---
static ulong Hash(ulong x)
{
GENERICHHASH_FIBBO_MURMUR(x)
return x;
}
};
//---
}
//+------------------------------------------------------------------+
#endif // FASTCOLLECTIONSBYLEO_COLHASH_HASH_GENERIC_NUMBER_UL_MQH