[Maude-help] Efficiency question: lists vs. vectors

Todd Wilson twilson at csufresno.edu
Sat Mar 13 13:03:37 CST 2010


I am writing a functional module to deal with 60-element vectors that
support operations that (1) permute the elements of the vector and (2)
recursively loop over the elements in order, and I'm trying to find the
most efficient representation, since I will be performing thousands of
these operations at a time.

A sixty-argument constructor seems to work well for the permutation
operations, and (non-associative) lists seem to work well for the
recursive operations, but each data structure doesn't seem to support
the other kind of operation well.  Is there anything better than
converting the vector to a list in order to do a recursion over it, and
then converting the result back to a vector when I'm done, so that later
permutations on it are efficient?  Is there any documentation for the
C++/special interface, so that I might define my own "built-in" module
that supports all of my operations efficiently?

Todd Wilson


More information about the Maude-help mailing list