Created
February 16, 2009 23:59
-
-
Save joho/65476 to your computer and use it in GitHub Desktop.
Slow crappy implementation of a sparse vector in c#
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public double this[string key] { | |
get | |
{ | |
if (InnerHashtable.ContainsKey(key)) | |
{ | |
return (double)InnerHashtable[key] | |
} | |
else | |
{ | |
return 0.0d | |
} | |
} | |
set | |
{ | |
InnerHashtable[key] = value; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment