help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory management in .oct files


From: John W. Eaton
Subject: Re: Memory management in .oct files
Date: Tue, 22 Mar 2005 19:44:06 -0500

On 22-Mar-2005, Richard Hindmarsh <address@hidden> wrote:

| I meant this to be equivalent to
| 
| double y = xin1(end+1,end+1)
| 
| which should trip an error.

You can get error checking for this if you enable bounds checking at
compile time.  That's not done by default for performance reasons.
But most of the time, we don't use the indexing operations this way
internally, so maybe it would not be much of a hit to enable the
bounds checking by default.

| I also noticed that the Matrix class is zero-based.

That's because it is C++, and I think it makes sense to be
zero-based.  But it does cause some trouble when converting from
Octave to C++.

| 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.

I would encourage you to report the problems you find and submit
patches or start discussions on the maintainers list about the
problems.  I think it would be better to have the Octave classes
evolve into something better than to try to start over from scratch.

jwe



-------------------------------------------------------------
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
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]