Edit this page
- The quickest way to learn how to call the ParaMonte routines is to look at an example simulation code available in the latest prebuilt release of the ParaMonte library on GitHub.
- The simulation specifications are all automatically set to the appropriate default values, if not provided by the user.
One API for usage from all programming languages
We have taken special care to develop a highly similar (if not the same) Application Programming Interface (API) for the ParaMonte library routines across all supported programming languages. In particular, every simulation performed via the ParaDRAM routine requires the user to supply only two mandatory pieces of information:
- A user-supplied density function
getLogFunc()
that the sampler must explore. - The number of dimensions
ndim
of the domain of the user-supplied density functiongetLogFunc()
.
Calling the ParaDRAM sampler
Calling the ParaDRAM sampler from C
The simulation specifications are all automatically set to the appropriate default values. However, to assign non-default values to the simulation specifications from the C language, the user must provide all or any simulation specifications as an external input file in the format described on this page. The benefits of using an external file to specify the properties of a ParaMonte simulation are also detailed here.
For a complete descriptive example of ParaDRAM usage from within C, see the ParaMonte C documentation.
Calling the ParaDRAM sampler from C++
The simulation specifications are all automatically set to the appropriate default values. However, to assign non-default values to the simulation specifications from the C++ language, the user must provide all or any simulation specifications as an external input file in the format described on this page. The benefits of using an external file to specify the properties of a ParaMonte simulation are also detailed here.
For a complete descriptive example of ParaDRAM usage from within C++, see the ParaMonte C++ documentation.
Calling the ParaDRAM sampler from Fortran
The simulation specifications are all automatically set to the appropriate default values. However, if needed, there are two ways to assign non-default values to the simulation specifications from the Fortran language:
- via the
sampler
argument in the generic interface of the ParaDRAM sampler routine getErrSampling. The simulation specifications specified would have to be set as components of the derived type paradram_type. - via an external input file passed to the ParaDRAM sampler routine getErrSampling.
For a complete descriptive example of ParaDRAM usage from within Fortran, see the ParaMonte Fortran documentation.