octave-maintainers
[Top][All Lists]
Advanced

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

Re: [RFC] Integrating High-precision arithmetic into Octave Core ?


From: fgnievinski
Subject: Re: [RFC] Integrating High-precision arithmetic into Octave Core ?
Date: Fri, 21 Mar 2014 10:05:10 -0700 (PDT)

Georgios Ouzounis wrote
> On 21 March 2014 17:48, fgnievinski <

> fgnievinski@

> > wrote:
> 
>> >I fail to see how this reuse is possible -- you cannot input
>> >arbitrary-precision numbers to BLAS/LAPACK or any other library used
>> >internally by Octave.  Thus method/operator overloading seems
>> inevitable.
>> >The only question is at what level that is going to happen.  I'm arguing
>> for
>> >overloading at the Octave level.  You seem to prefer overloading at the
>> C++
>> >level.  Notice if you do the former, you can still implement any
>> individual
>> >method in C++ via MEX.
>>
>> -F.
>>
>>
> Felipe,
> 
> 
> I am quoting what Pascal Dupuis wrote as a comment under my proposal on
> Google melange site, answering one of your questions :
> 
> "what I would like to have as basic property about those MP values is that
> they become some kind of "float-on-steroids" which are transparently
> handled by .m file. If some algorithm does not make any distinction
> between
> float and doubles, and return some floating point number with the same
> accuracy (significant digits) as its input values; it should unmodified
> exhibit the same behaviour for MP value. This implies that MP become some
> basic octave class. A number of functions choke when the input data are of
> type "class"."
> 
> That is what I want to achieve! I clearly don't have all the answers yes,
> and that is why I am asking other core developers to assist on this
> project
> if they are willing to.  The question is, can you see that happening? Can
> you see that happening in the three month period of GSoC? I have never
> worked on an open source project before, so I am pretty bad at estimating
> the time needed for such a project! That is why I am asking for your
> expertise on the subject!

I did a little bit of research and it seems the best route would be
sub-classing the built-in type "double".    That way you can call methods of
the built-in class and other built-in functions directly with objects of the
subclass. 

You'd have a mixture of method implementations.  The basic arithmetic
operators would be overridden, calling MPFR internally via MEX.  

For example, you do not need to re-implement fminsearch, only the functions
and operators called by fminsearch that operate on your class.

For details, please see:
- Behavior of Built-In Functions with Subclass Objects
<http://www.mathworks.com/help/matlab/matlab_oop/subclassing-matlab-built-in-classes.html#brr3cdl-1>
- Invoking Superclass Methods in Subclass Methods
<http://www.mathworks.com/help/matlab/matlab_oop/ordinary-methods.html#brdqjju-1>

Not sure how far the Octave classdef implementation is, but I guess it'd be
a nice incentive to have one more project using it.

-F.




--
View this message in context: 
http://octave.1599824.n4.nabble.com/RFC-Integrating-High-precision-arithmetic-into-Octave-Core-tp4663230p4663248.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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