Skip to content
Joris Gillis edited this page Apr 4, 2023 · 2 revisions

Standard documentation for Function.map:

 [INTERNAL] 

::

 map(self, int n, str parallelization) -> Function
 map(self, int n, [bool] reduce_in, [bool] reduce_out, dict opts) -> Function
 map(self, int n, str parallelization, int max_num_threads) -> Function
 map(self, str name, str parallelization, int n, [str] reduce_in, [str] reduce_out, dict opts) -> Function
 map(self, str name, str parallelization, int n, [int] reduce_in, [int] reduce_out, dict opts) -> Function

Map with reduction.

A subset of the inputs are non-repeated and a subset of the outputs summed up.

Extra doc: https://github.com/casadi/casadi/wiki/L_1wk

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L745

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L605-L611

.......

::

 map(self, int n, [bool] reduce_in, [bool] reduce_out, dict opts)

[INTERNAL] Map with reduction.

A subset of the inputs are non-repeated and a subset of the outputs summed up.

Extra doc: https://github.com/casadi/casadi/wiki/L_1wk

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L745

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L605-L611

.............

.......

::

 map(self, str name, str parallelization, int n, [str] reduce_in, [str] reduce_out, dict opts)

[INTERNAL] Map with reduction.

A subset of the inputs are non-repeated and a subset of the outputs summed up.

Extra doc: https://github.com/casadi/casadi/wiki/L_1wk

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L741

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L636-L643

.............

.......

::

 map(self, str name, str parallelization, int n, [int] reduce_in, [int] reduce_out, dict opts)

[INTERNAL] Map with reduction.

A subset of the inputs are non-repeated and a subset of the outputs summed up.

Extra doc: https://github.com/casadi/casadi/wiki/L_1wk

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L737

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L613-L634

.............

.......

::

 map(self, int n, str parallelization, int max_num_threads)

[INTERNAL]

.............

.......

::

 map(self, int n, str parallelization)

[INTERNAL] Create a mapped version of this function.

Suppose the function has a signature of:

::

    f: (a, p) -> ( s )

The the mapped version has the signature:

::

    F: (A, P) -> (S )

     with
         A: horzcat([a0, a1, ..., a_(N-1)])
         P: horzcat([p0, p1, ..., p_(N-1)])
         S: horzcat([s0, s1, ..., s_(N-1)])
     and
         s0 <- f(a0, p0)
         s1 <- f(a1, p1)
         ...
         s_(N-1) <- f(a_(N-1), p_(N-1))

Parameters:

parallelization: Type of parallelization used: unroll|serial|openmp

Extra doc: https://github.com/casadi/casadi/wiki/L_1wj

Doc source: https://github.com/casadi/casadi/blob/develop/casadi/core/function.hpp#L726

Implementation: https://github.com/casadi/casadi/blob/develop/casadi/core/function.cpp#L677-L712

.............

Extra documentation

To edit, see writing tips.

Clone this wiki locally