[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Memory management in .oct files
From: |
Richard Hindmarsh |
Subject: |
Re: Memory management in .oct files |
Date: |
Tue, 22 Mar 2005 23:52:05 +0000 |
User-agent: |
Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.7.1) Gecko/20040707 |
John W. Eaton wrote:
On 19-Mar-2005, Richard Hindmarsh <address@hidden> wrote:
| I guess this means that you decided not to impelemt e.g.
|
| xout1(ic1,ir1) = xin1(ir1,ic1);
|
| using a helper class.
In what way are you suggesting using a "helper class" and what do you
mean by that?
I learnt the technique from
From: Corey Kosak
<http://groups.google.co.uk/groups?hl=en&lr=&safe=off&q=author:kosak%40adonis.nectar.cs.cmu.edu+>
(address@hidden <mailto:kosak%40adonis.nectar.cs.cmu.edu>)
Subject: Re: operator[] - lvalue and rvalue
View: Complete Thread (9 articles)
<http://groups.google.co.uk/groups?hl=en&lr=&safe=off&threadm=vzxu2zsihuu.fsf%40adonis.nectar.cs.cmu.edu&rnum=4&prev=/groups%3Fhl%3Den%26lr%3D%26safe%3Doff%26selm%3Dvzxu2zsihuu.fsf%2540adonis.nectar.cs.cmu.edu%26rnum%3D4>
Original Format
<http://groups.google.co.uk/groups?selm=vzxu2zsihuu.fsf%40adonis.nectar.cs.cmu.edu&output=gplain>
Newsgroups: comp.lang.c++.moderated
<http://groups.google.co.uk/groups?hl=en&lr=&safe=off&group=comp.lang.c%2B%2B.moderated>,
comp.lang.c++
<http://groups.google.co.uk/groups?hl=en&lr=&safe=off&group=comp.lang.c%2B%2B>
Date: 1998/11/22
This is the only way I know to distinguish an lvalue from a rvalue -
maybe there are some others?
| The upside of this is speed; the downside is that statements such as
|
| double y = xin1(ir+1,ic+1);
|
| do not trip an error
I meant this to be equivalent to
double y = xin1(end+1,end+1)
which should trip an error.
I also noticed that the Matrix class is zero-based.
I think you are looking for
the set_index, index and assign methods in the Array classes. I would
bet that you will not like the interface much, but it seemed to be
what I needed for the implementation of the scripting language way
back when, and it seems that so far, no one has contributed the code
to do it in a better way.
I am looking for an alternative to the Matlab C++ library, which
Mathworks have stopped supporting. This has several desrable features
from an Octave users point of view. I wrote a matrix class with my ideal
properties (including helper classes) but got to the point where it was
exposing my deficiencies as a C++ programmer. It looks as though to
recreate the Matlab C++ library one would have to inherit a further
class from Array or Matrix with lvalue/rvalue distinction as above and
one-based indexing etc. There are quite a few Matrix C++ classes about,
but it's not clear what their long-term survival prospects are. One
based on Octave would be much more convincing.
R
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------