2using System.Collections.Generic;
8#pragma warning disable 1591
10 public class DictionaryMap<T>
12 Dictionary<int, T> m_rgMap =
new Dictionary<int, T>();
15 public DictionaryMap(T dfDefault)
17 m_dfDefault = dfDefault;
20 public DictionaryMap(
int nCount, T dfDefault)
22 m_dfDefault = dfDefault;
24 for (
int i = 0; i < nCount; i++)
26 m_rgMap.Add(i, dfDefault);
30 public T
this[
int nIdx]
34 if (m_rgMap.ContainsKey(nIdx))
42 if (m_rgMap.ContainsKey(nIdx))
43 m_rgMap[nIdx] = value;
45 m_rgMap.Add(nIdx, value);
51 get {
return m_rgMap.Count; }
59 public Dictionary<int, T> Map
61 get {
return m_rgMap; }
64#pragma warning restore 1591
The MyCaffe.basecode contains all generic types used throughout MyCaffe.