help-octave
[Top][All Lists]
Advanced

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

Re: How to overload factorial (m-file) for a class defined in an oct-fil


From: Michael Goffioul
Subject: Re: How to overload factorial (m-file) for a class defined in an oct-file?
Date: Thu, 7 Nov 2013 07:44:46 -0500

On Thu, Nov 7, 2013 at 7:39 AM, Lukas Reichlin <address@hidden> wrote:
Dear Octave Community

I've created a class "sym" in an oct-file. Now I want to overload Octave's factorial function (an m-file) for this class in C++. How can I do this?

DEFUN_DLD (factorial, args, nargout, "factorial help")
alone doesn't help because now all factorial calls are handled by the oct-file, instead of just the arguments of class "sym". I need the C++ equivalent of @sym/factorial.m.

AFAIK you can create @sym/factorial.m or @sym/factorial.oct, and octave should pick it up. However, I don't think you can fake @sym/factorial.[m|oct] with autoload, if that's what you had in mind.

Michael.


reply via email to

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