[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Graphics and memory opinions
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: Graphics and memory opinions |
Date: |
Sun, 14 Dec 2008 12:22:31 -0600 |
2008/12/14 Daniel J Sebald <address@hidden>:
> John W. Eaton wrote:
>>
>> On 14-Dec-2008, Jordi Gutiérrez Hermoso wrote:
>>
>> | Right, std::list triples the storage size. Clearly std::deque or
>>
>> I don't see how a deque helps, it is just another variant of a list, with
>> overhead for each element.
>>
>> | std::vector are the ones to use here.
>>
>> Then you will just have to copy them into an Octave Array<> object. So why
>> not just use that to begin with? If you are going to use an array/vector
>> object then trick is efficiently approximating the the size of the matrix so
>> you can minimize the number of times you have
>> to resize and copy.
>>
>> | Give me a clue on what function I should play with... It is |
>> read_ascii_data(...), right?
>>
>> Look at the functions in ls-mat-ascii.cc.
>
> Yeah, this can't be very fast. Things are done one character at a time.
> That's taking the object oriented paradigm to too granular of a level.
> (OOP is great, but...) In particular
I don't think C++ or OOP are to blame here. I have implemented reading
matrices from ASCII files in my own code using std::list op>> for
matrices[1], using as much of the stdlib as I could, and it's
reasonably fast, quite faster than current Octave, and probably I
could make it faster if I used std::vector instead of std::list.
Things like stringstreams can greatly help with the parsing, and it's
not done one character at at time. Memory usage is a problem right now
with my own code (because of std::list and because I create
temporaries and copy them), but I think I can fix that too. I'm
basically trying to think of how to transplant this idea to Octave.
- Jordi G. H.
[1]
http://inversethought.com/jordi/rbf-doc/namespacelinalg.html#7c9337265246bee3e732da05240af7dc
- Graphics and memory opinions, Daniel J Sebald, 2008/12/05
- Graphics and memory opinions, John W. Eaton, 2008/12/13
- Re: Graphics and memory opinions, Jordi Gutiérrez Hermoso, 2008/12/13
- Re: Graphics and memory opinions, John W. Eaton, 2008/12/13
- Message not available
- Re: Graphics and memory opinions, John W. Eaton, 2008/12/14
- Re: Graphics and memory opinions, Jordi Gutiérrez Hermoso, 2008/12/14
- Re: Graphics and memory opinions, Daniel J Sebald, 2008/12/14
- Re: Graphics and memory opinions,
Jordi Gutiérrez Hermoso <=
- Re: Graphics and memory opinions, Jaroslav Hajek, 2008/12/14
- Re: Graphics and memory opinions, Daniel J Sebald, 2008/12/13