Skip to content

Instantly share code, notes, and snippets.

@joho
Created February 16, 2009 23:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joho/65476 to your computer and use it in GitHub Desktop.
Save joho/65476 to your computer and use it in GitHub Desktop.
Slow crappy implementation of a sparse vector in c#
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