Hi Daniel, hi Kohei,
Daniel Rentz schrieb:
Kohei Yoshida schrieb:
Hi Regina,
On Sun, 2008-08-03 at 18:53 +0200, Regina Henschel wrote:
Hello,
I'm writing a function, which is local in interpr3.cxx. For this
function I need erfc() or getErfc() from scaddins. How to get it?
Looks to me like the easiest way to get there is via UNO call;
instantiate a service "com.sun.star.sheet.addin.Analysis", which should
find and instantiate the AnalysisAddIn class in the scaddins module.
You can then query the interface for XAnalysis (in the same namespace as
the service) to call getErfc().
ScDocument has this GetServcieManager() call to get you the service
manager instance, and from that you can instantiate UNO services.
That is beyond my current skills and I would need detailed instructions,
but I have read Daniels comment already, to do not use that functions at
all.
IMHO it is not a good idea to rely on the Analysis addin from Calc core
code, as the addin may not be installed, thus the creation of the
AnalysisAddIn class would fail. The only save way is to copy&paste the
code from scaddins module.
I've learned now, that I can get erfc(z) by GetUpRegIGamma(0.5,z^2), so
I need no copy&paste. GetUpRegIGamma is a private function of
ScInterpreter, in file interpr6.cxx. But now I have the next problem:
The structure now is:
We have a public function
void ScInterpreter::ScBetaDist()
Inside this, and in some other functions too, there is a call to the
private function
double ScInterpreter::GetBetaDist
This function is so complex, that I thought, it would be a good idea to
swap out some steps into local functions. For example, I have defined a
function
lcl_GetBetaHelperContFrac
which calculates a continued fraction needed for GetBetaDist. Thats
works good, because it uses only 'normal' functions.
But the next part, which I want to modularize, is the algoritm known as
BASYM (Didonato/Morris algoritm 708). It is a part of about 90 lines.
Unfortunately it needs the private functions
double ScInterpreter::GetUpRegIGamma( double fA, double fX )
and
double ScInterpreter::GetLogBeta(double fAlpha, double fBeta)
How to solve this? I know, if I would make it a private function of
ScInterpreter too, I can access GetUpRegIGamma and GetLogBeta. But is
that the structure you want? Are there other, better ways to get access
to that functions?
kind regards
Regina
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]