Post Reply 
Associative array / dictionary / hash / map
04-28-2018, 06:55 AM
Post: #2
RE: Associative array / dictionary / hash / map
Open Settings, select algebraic entry, after that you can do:
t["one"]:=1;
t["two"]:=2;
If t is a table, t[index] will return the value stored, or 0 if nothing is stored. The idea is to store sparse matrices with these kinds of objects for efficiency:
t:=convert(identity(3),table);
t*t;
t+t;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Associative array / dictionary / hash / map - parisse - 04-28-2018 06:55 AM



User(s) browsing this thread: 1 Guest(s)