Calling MCEuropeanEngine from Java

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Calling MCEuropeanEngine from Java

Nabil Layaida
Hi all,

I need to call the MCEuropeanEngine from Java, but the parameters declared in
the Java wrapper are of type SWIGTYPE_p_intOrNull, etc. I know I should use
native constructors for these but coud not find out to what class they correspond.
This seems to be a simple pointer for an int.

How do I create time steps as it corresponds to a native int.

Thanks for the help

Nabil

 public MCEuropeanEngine(String traits, SWIGTYPE_p_intOrNull timeSteps, SWIGTYPE_p_intOrNull timeStepsPerYear, .... ) {
    this(quantlibJNI.new_MCEuropeanEngine(traits, SWIGTYPE_p_intOrNull.getCPtr(timeSteps), SWIGTYPE_p_intOrNull.getCPtr(timeStepsPerYear), .....);
  }

Here is the C++ header :

Size is typedefed as int

MCEuropeanEngine(Size timeSteps,
                         Size timeStepsPerYear,
                         bool brownianBridge,
                         bool antitheticVariate,
                         bool controlVariate,
                         Size requiredSamples,
                         Real requiredTolerance,
                         Size maxSamples,
                         BigNatural seed);
Reply | Threaded
Open this post in threaded view
|

Re: Calling MCEuropeanEngine from Java

Luigi Ballabio
On 09/30/2005 10:46:34 AM, Nabil Layaida wrote:
> I need to call the MCEuropeanEngine from Java, but the parameters
> declared in the Java wrapper are of type SWIGTYPE_p_intOrNull, etc. I  
> know I should use native constructors for these but coud not find out  
> to what class they correspond.

Nabil,
        are you exporting the files from CVS, or using the 0.3.10  
version?

Later,
        Luigi


----------------------------------------

The first rule of intelligent tinkering is to save all the parts.
-- Paul Erlich



Reply | Threaded
Open this post in threaded view
|

Re: Calling MCEuropeanEngine from Java

Luigi Ballabio
On 09/30/2005 11:09:15 AM, Nabil Layaida wrote:
>
> I am now on the latest CVS tree, using the latest snapshot, also  
> tried on 0.3.10.

Ok, try updating from CVS now. (It might take some time for the change  
to propagate to the anonymous CVS server---you should get an updated  
version of SWIG\null.i)

Luigi

----------------------------------------

Dealing with failure is easy: work hard to improve. Success is also  
easy to handle: you've solved the wrong problem. Work hard to improve.
-- Alan Perlis