Mercurial > hg > camir-aes2014
annotate core/tools/NaiveHash.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
rev | line source |
---|---|
wolffd@0 | 1 classdef NaiveHash < handle |
wolffd@0 | 2 |
wolffd@0 | 3 properties |
wolffd@0 | 4 |
wolffd@0 | 5 last_key = 0; |
wolffd@0 | 6 map; |
wolffd@0 | 7 end |
wolffd@0 | 8 |
wolffd@0 | 9 % --- |
wolffd@0 | 10 % the methods |
wolffd@0 | 11 % --- |
wolffd@0 | 12 methods |
wolffd@0 | 13 function ht = NaiveHash(data) |
wolffd@0 | 14 |
wolffd@0 | 15 ht.Map = containers.Map('KeyType', 'int32', 'ValueType', 'int32'); |
wolffd@0 | 16 end |
wolffd@0 | 17 |
wolffd@0 | 18 function put(ht, data) |
wolffd@0 | 19 |
wolffd@0 | 20 % get new key |
wolffd@0 | 21 last_key = last_key + 1; |
wolffd@0 | 22 ticketMap(data) = last_key; |
wolffd@0 | 23 end |
wolffd@0 | 24 |
wolffd@0 | 25 function data(ht, data) |
wolffd@0 | 26 |
wolffd@0 | 27 end |
wolffd@0 | 28 |
wolffd@0 | 29 function out = key(ht, data) |
wolffd@0 | 30 |
wolffd@0 | 31 out = ht.Map(data); |
wolffd@0 | 32 end |
wolffd@0 | 33 |
wolffd@0 | 34 function iskey(ht, key) |
wolffd@0 | 35 |
wolffd@0 | 36 end |
wolffd@0 | 37 |
wolffd@0 | 38 end |
wolffd@0 | 39 |
wolffd@0 | 40 end |