octave-maintainers
[Top][All Lists]
Advanced

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

Re: Implementing categorial function


From: Mike Miller
Subject: Re: Implementing categorial function
Date: Mon, 21 Nov 2016 11:21:37 -0800
User-agent: NeoMutt/20161104 (1.7.1)

On Sun, Nov 20, 2016 at 20:59:21 -0800, NVS Abhilash wrote:
> I would want you to clarify on this, as of now as I see I don't find
> anything about categorical data type in octave source.

Correct, the categorical function / class constructor would define that
type.

> Does it mean I got to implement the whole datatype and its related
> functions. I think to provide support for a new datatype, many of the
> preexisting functions need to be modified too.

No, Octave functions overload based on the argument type. Please have a
look at the docs on object oriented programming in Octave. There is a
simple example in the Octave source tree at examples/code/@polynomial.

You could look at the quaternion or symbolic packages for more complex
examples of custom types that overload built-in functions.

-- 
mike



reply via email to

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