/usr/include/openturns/swig/KPermutations_doc.i is in libopenturns-dev 1.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | %feature("docstring") OT::KPermutations
"K permutations generator.
Available constructors:
KPermutations()
KPermutations(*n*)
KPermutations(*k, n*)
Parameters
----------
k : integer
The cardinal of the origin set
n : integer
The cardinal of the goal set
See also
--------
CombinatorialGenerator, Combinations, Tuples
Notes
-----
In the first usage, the generator is built using the default values :math:`k = 1`,
:math:`n = 1`.
In the second usage, the generator is built using the value :math:`k = n`.
In the third usage, the generator produces all the injective functions from a
set with *k* elements into a set with *n* elements. If :math:`k = n` it means
all the permutations of a set with *n* elements.
The number of indices generated is:
.. math::
\\\\frac{n!}{(n - k)!}
The combinations generator generates a collection of :class:`~openturns.Indices`
that contains all the :math:`k!` permutations of all the
:math:`\\\\frac{n!}{k! (n - k)!}` subsets with :math:`k` elements of a set with
:math:`n` elements.
The subsets are generated in lexical order, and for each subset all the
corresponding injective functions are generated in lexical order.
Examples
--------
>>> import openturns as ot
>>> kperm = ot.KPermutations(2, 4)
>>> print(kperm.generate())
[[0,1],[1,0],[0,2],[2,0],[0,3],[3,0],[1,2],[2,1],[1,3],[3,1],[2,3],[3,2]]#12
"
// ---------------------------------------------------------------------
%feature("docstring") OT::KPermutations::getK
"Accessor to the cardinal of the subsets.
Returns
-------
k : integer
The cardinal of the subsets."
// ---------------------------------------------------------------------
%feature("docstring") OT::KPermutations::getN
"Accessor to the cardinal of the base set.
Returns
-------
n : integer
The cardinal of the base set."
// ---------------------------------------------------------------------
%feature("docstring") OT::KPermutations::setK
"Accessor to the cardinal of the subsets.
Parameters
----------
k : integer
The cardinal of the subsets."
// ---------------------------------------------------------------------
%feature("docstring") OT::KPermutations::setN
"Accessor to the cardinal of the base set.
Parameters
----------
n : integer
The cardinal of the base set."
|