c++ - For storage of sparse matrices which is better a vector or a vector for each row different -
i using data structure storing sparse matrices follow. if having matrix follows
i using vector of pairs store data. better store these value in single vector this:-
or better store them this:-
i using seperate vector store data starting , end indexes each row.
which of 2 methods use less memory?????
because vector allocates single block of contiguous memory (unlike list), single vector use less memory consolidating heap overhead. assume client interface same regardless (overloading operator[], example), question memory efficency.
Comments
Post a Comment