Why are vectors not supported?

I am doing some matrix algorithms, and although the stackarray library has some basic functionality, I am definitely going to have to modify it to allow deleting elements at an arbitrary index, extracting elements at positions, etc.

I am not very experienced in C/++ (I have a little experience a lot of languages) and it seems like I have to be missing something. I figure the possibilities are:
(A) It is incredibly difficult to implement vectors and just not worth the effort. (probably not)
(B) It is so trivial that no one bothered to write up a fully functional library.
(C) Vectors call for some form of memory allocation that is not well suited for an arduino.
(D) No one needs vectors.

Vectors seem like the most likely reason you would want dynamic memory allocation, so it seems very strange to me that it is not implemented. I suppose I will post the final result of my modification of stackarray if there is really nothing else out there.

Now, this should have been a poll. Then, we would have all voted for C.

Dynamic memory allocation on a system with very limited memory is not something that works well. With extreme care, you can do a small amount of memory allocation/deallocation.

The problems arise when you've fragmented memory by allocating lots of different sized objects, and freeing stuff in a different order that they objects were allocated. You end up with a bunch of non-contiguous memory.

Since the Arduino can't throw an exception when there is no more memory, you have to deal with that possibility at every turn, adding a lot of complexity to the code.

dynamic memory is available using malloc apparantly, topics seem to dislike it for its overhead. If you implemented your own global operator new using malloc, maybe the vector may start working.

a system implementing placement operator new might be good for a static sized but dynamic feeling vector. If you only allocate once, the overhead may be small.

and maybe your answer (D), a basic stack might suffice most.

EDIT: PaulS above beat me in with good info too. Pretty much what I've read.

You could put a bathtub on a bicycle just because a house has one. It would make about as much sense.

You could put a bathtub on a bicycle just because a house has one. It would make about as much sense.

This gets my vote for the most relevant post of the day.

long long ago on a forum far far away there was a matrixlib - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1292439462 -

might be what you were searching for