Skip to content

Commit

Permalink
Added missing doc
Browse files Browse the repository at this point in the history
It covers the Multinomial, NonCentralChiSquare and P1LagrangeEvaluation classes.
  • Loading branch information
regislebrun committed Oct 19, 2023
1 parent 8e2b86c commit afaf904
Show file tree
Hide file tree
Showing 3 changed files with 182 additions and 8 deletions.
84 changes: 76 additions & 8 deletions python/src/Multinomial_doc.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ N : int

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setN
"Accessor to the number of experiments parameter :math:`N`.

Parameters
----------
N : int, :math:`\sum_{i = 1}^n x_i \leq N`
Number of experiments :math:`N`."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::getP
"Accessor to the component probabilities parameter :math:`\vect{p}`.

Expand All @@ -76,20 +86,78 @@ P : :class:`~openturns.Point`

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setN
"Accessor to the number of experiments parameter :math:`N`.
%feature("docstring") OT::Multinomial::setP
"Accessor to the component probabilities parameter :math:`\vect{p}`.

Parameters
----------
N : int, :math:`\sum_{i = 1}^n x_i \leq N`
Number of experiments :math:`N`."
P : sequence of float, :math:`0 \leq p_i, i = 1, \ldots, n` and :math:`\sum_{i = 1}^n p_i \leq 1`
Component probabilities (all positive with sum less than unity)."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setP
"Accessor to the component probabilities parameter :math:`\vect{p}`.
%feature("docstring") OT::Multinomial::getEta
"Accessor to the maximum absolute error in CDF computation.

Returns
-------
eta : float
The maximum absolute error in the Poisson summation-based CDF computation."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setEta
"Accessor to the maximum absolute error in CDF computation.

Parameters
----------
P : sequence of float, :math:`0 \leq p_i, i = 1, \ldots, n` and :math:`\sum_{i = 1}^n p_i \leq 1`
Component probabilities (all positive with sum less than unity)."
eta : float
The maximum absolute error in the Poisson summation-based CDF computation."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::getEta
"Accessor to the maximum absolute error in CDF computation.

Returns
-------
eta : float
The maximum absolute error in the Poisson summation-based CDF computation."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setEta
"Accessor to the maximum absolute error in CDF computation.

Parameters
----------
eta : float
The maximum absolute error in the Poisson summation-based CDF computation."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::getSmallA
"Accessor to the threshold in generating function computation.

Returns
-------
smallA : float
The threshold triggering the algorithm for the computation of the generating
function of a truncated Poisson distribution. If the argument of the
generating function is smaller than *smallA* the computation is done using
the polynomial form of the generating function, otherwise it is done as a
correction of the generating function of the untruncated Poisson distribution."

// ---------------------------------------------------------------------

%feature("docstring") OT::Multinomial::setSmallA
"Accessor to the threshold in generating function computation.

Parameters
----------
smallA : float
The threshold triggering the algorithm for the computation of the generating
function of a truncated Poisson distribution. If the argument of the
generating function is smaller than *smallA* the computation is done using
the polynomial form of the generating function, otherwise it is done as a
correction of the generating function of the untruncated Poisson distribution."
22 changes: 22 additions & 0 deletions python/src/NonCentralChiSquare_doc.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,25 @@ nu : float, :math:`\nu > 0`
Generalised number degrees of freedom :math:`\nu`.
lambda : float
Non-centrality parameter :math:`\lambda`."

// ---------------------------------------------------------------------

%feature("docstring") OT::NonCentralChiSquare::getMaximumIteration
"Accessor to the maximum iteration number for PDF and CDF computation.

Returns
-------
maximumIteration : int
Maximum iteration number for :class:`~openturns.DistFunc.dNonCentralChiSquare` and
:class:`~openturns.DistFunc.pNonCentralChiSquare`."

// ---------------------------------------------------------------------

%feature("docstring") OT::NonCentralChiSquare::setMaximumIteration
"Accessor to the maximum iteration number for PDF and CDF computation.

Parameters
----------
maximumIteration : int
Maximum iteration number for :class:`~openturns.DistFunc.dNonCentralChiSquare` and
:class:`~openturns.DistFunc.pNonCentralChiSquare`."
84 changes: 84 additions & 0 deletions python/src/P1LagrangeEvaluation_doc.i.in
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ Create a P1 Lagrange evaluation:
>>> evaluation = ot.P1LagrangeEvaluation(field)
>>> print(evaluation([2.3]))
[0.55]"

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::getField
Expand All @@ -55,3 +56,86 @@ Parameters
----------
field : :class:`~openturns.Field`
The field defining the function."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::getEnclosingSimplexAlgorithm
"Accessor to the algorithm used to find the simplex containing a given point.

Returns
-------
algo : :class:`~openturns.EnclosingSimplexAlgorithm`
The algorithm used to find the simplex containing a given point."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::setEnclosingSimplexAlgorithm
"Accessor to the algorithm used to find the simplex containing a given point.

Parameters
----------
algo : :class:`~openturns.EnclosingSimplexAlgorithm`
The algorithm used to find the simplex containing a given point."

// ---------------------------------------------------------------------

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::getNearestNeighbourAlgorithm
"Accessor to the algorithm used to find the vertex nearest to a given point.

Returns
-------
algo : :class:`~openturns.NearestNeighbourAlgorithm`
The algorithm used to find the vertex nearest to a given point."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::setNearestNeighbourAlgorithm
"Accessor to the algorithm used to find the vertex nearest to a given point.

Parameters
----------
algo : :class:`~openturns.NearestNeighbourAlgorithm`
The algorithm used to find the vertex nearest to a given point."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::getMesh
"Accessor to the mesh over which the interpolation is defined.

Returns
-------
mesh : :class:`~openturns.Mesh`
The mesh over which the interpolation is defined."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::setMesh
"Accessor to the mesh over which the interpolation is defined.

Parameters
----------
mesh : :class:`~openturns.Mesh`
The mesh over which the interpolation is defined."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::getValues
"Accessor to the values in which the interpolation is done.

Returns
-------
values : :class:`~openturns.Sample`
The values in which the interpolation is done."

// ---------------------------------------------------------------------

%feature("docstring") OT::P1LagrangeEvaluation::setValues
"Accessor to the values in which the interpolation is done.

Parameters
----------
mesh : 2-d sequence of floats
The values in which the interpolation is done."

0 comments on commit afaf904

Please sign in to comment.