annotate core/tools/NaiveHash.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
rev   line source
Daniel@0 1 classdef NaiveHash < handle
Daniel@0 2
Daniel@0 3 properties
Daniel@0 4
Daniel@0 5 last_key = 0;
Daniel@0 6 map;
Daniel@0 7 end
Daniel@0 8
Daniel@0 9 % ---
Daniel@0 10 % the methods
Daniel@0 11 % ---
Daniel@0 12 methods
Daniel@0 13 function ht = NaiveHash(data)
Daniel@0 14
Daniel@0 15 ht.Map = containers.Map('KeyType', 'int32', 'ValueType', 'int32');
Daniel@0 16 end
Daniel@0 17
Daniel@0 18 function put(ht, data)
Daniel@0 19
Daniel@0 20 % get new key
Daniel@0 21 last_key = last_key + 1;
Daniel@0 22 ticketMap(data) = last_key;
Daniel@0 23 end
Daniel@0 24
Daniel@0 25 function data(ht, data)
Daniel@0 26
Daniel@0 27 end
Daniel@0 28
Daniel@0 29 function out = key(ht, data)
Daniel@0 30
Daniel@0 31 out = ht.Map(data);
Daniel@0 32 end
Daniel@0 33
Daniel@0 34 function iskey(ht, key)
Daniel@0 35
Daniel@0 36 end
Daniel@0 37
Daniel@0 38 end
Daniel@0 39
Daniel@0 40 end