views:

29

answers:

1

Suppose that I have a multimap (which maps multiple values to a single key), and then I decide that I need to remove all but the first/last/predicate-matching value for all keys. After this operation, I have a traditional map (which maps a single value to a single key).

Is there a word that describes this operation? The best I've come up with is "remove-duplicates", but it doesn't feel right. "filter" feels too generic. "trim" is a string operation. "compact" / "compress" carry the wrong connotations (i.e. reversibility).

EDIT: I eventually went with "Collapse" based on the idea that multimap[i] is (y1, y2, ... yn) which describes a curve, and that I wanted to "collapse the curve to a single point" using a "priority function" to select the first element. I hope that makes sense.

A: 

how about pruning?

your best weapon for terminology might be http://www.thesaurus.com

Scott Vercuski
Seems interesting, when you prune something you remove parts that you don't need in order to highlight things that you do. Let's see if anyone else comes up with something.
Dave
Yeah, I wouldn't bother stackoverflow if I'd found anything useful on thesaurus.com. I'm looking for the appropriate comp-sci term; which that site usually fails at providing. Wikipedia wasn't much better.
Dave
@Dave: true, going by the dictionary definition/connotation you're right. That's why I suggested thesaurus.com good luck to you !
Scott Vercuski
@Dave: another good point, sorry, can't think of anything else other than pruning at the moment.
Scott Vercuski
Pruning was my first thought as well. Struggling to come up with anything better.
David M
maybe condense? compress? collapse? (very "C" centric here)
Scott Vercuski