[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: User-defined Data Types
From: |
en254 |
Subject: |
Re: User-defined Data Types |
Date: |
Sun, 23 Apr 2000 13:54:06 -0400 (EDT) |
On Fri, 21 Apr 2000, Rafael Laboissiere wrote:
> In the Octave manual, there is an almost empty section called "User-defined
> Data Types" that points to the source files under src/. Since there is a
> huge amount of interrelated files there, it is difficult to just grasp what
> is essential for the creation of a new user-defined data type. Hence my
> question: did someone come up with a simple example of user-defined data
> type creation so that it is possible to define it in a .oct file and use it
> after loading from the command line?
the file examples/make_int.cc is a very good template. It does
not depend on any other files.
address@hidden examples]# mkoctfile-2.1.19 make_int.cc
address@hidden examples]# octave-2.1.19
octave-2.1.19:1> a=make_int(2);
installing integer type at type-id = 18
octave-2.1.19:2> whos
*** local user variables:
prot type rows cols name
==== ==== ==== ==== ====
rwd integer 1 1 a
error: evaluating binary operator `+' near line 3, column 2
octave-2.1.19:3> a+make_int(4)
installing integer type at type-id = 18
ans =
6
If you need a more complex/complete example of user defined types
(for 2.1.x versions) take a look at my octave sparse functions
at:
http://www.che.wisc.edu/octave/mailing-lists/octave-sources/1999/99
As you mention, user defined types are not well documented, but,
in my opinion they are well designed, and, once you understand
the class structure, a pleasure to use.
______________________________________________________________
Andy Adler, address@hidden
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------
- User-defined Data Types, Rafael Laboissiere, 2000/04/21
- Re: User-defined Data Types,
en254 <=
- octave 2.1.30 and example/make_int.cc, en254, 2000/04/23
- Re: octave 2.1.30 and example/make_int.cc, Ben Sapp, 2000/04/24
- Re: octave 2.1.30 and example/make_int.cc, en254, 2000/04/24
- Re: octave 2.1.30 and example/make_int.cc, John W. Eaton, 2000/04/25
- Re: octave 2.1.30 and example/make_int.cc, en254, 2000/04/25
- Re: octave 2.1.30 and example/make_int.cc, John W. Eaton, 2000/04/25
- Re: octave 2.1.30 and example/make_int.cc, en254, 2000/04/27
- octave 2.1.30 and example/make_int.cc, John W. Eaton, 2000/04/25