octave-maintainers
[Top][All Lists]
Advanced

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

mixing internal and external type definitions in octave core functions


From: CdeMills
Subject: mixing internal and external type definitions in octave core functions
Date: Sat, 6 Jul 2013 15:49:04 -0700 (PDT)

Hello,

I'm trying to use directly Octave built-in function 'binocdf' with
multi-precision (mp) objects.

The logic is quite simple:

 if (isa (x, "single") || isa (n, "single") || isa (p, "single"));
    cdf = zeros (size (x), "single");
  else
    cdf = zeros (size (x));
  endif

cdf(k) = 1 - betainc (p, tmp + 1, n - tmp);


calling binocdf (1, 2, mp(0.5)) fails. Indeed:
1) cdf is initialised as double
2) betainc returns a 'mp' , so we're trying to inject a 'mp' into a double
array.

I do not see any good solution for initialising cdf ... Maybe 
cdf = 0*x*n*p, 
which would be of the class with the highest precision. But at the same time
1) this is overkill
2) the internal zeros function does not seems to accept classes of 'unknown'
type, i.e. defined by the user. 

Any better idea ?

Regards

Pascal 



--
View this message in context: 
http://octave.1599824.n4.nabble.com/mixing-internal-and-external-type-definitions-in-octave-core-functions-tp4655280.html
Sent from the Octave - Maintainers mailing list archive at Nabble.com.


reply via email to

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