Skip to content

Map-like helper functions #3339

Description

@WardBrian

The map-family of functions would make writing certain kinds of models easier. Because we lack closures (#2197) it would make sense to make them variadic, so a basic map would have the signature

map(f, T, ...) which would call f(T[1], ...), f(T[2], ...) etc.

A few variants of this would be useful, such as map2 which maps over two containers of the same size,
and specialized row_map/column_map for matrices, which would allow e.g.

  matrix[N, K] x;  // original covariates
  matrix[N, K] x_std = row_map(standardize, x);  // standardized covariates

(suggested by @bob-carpenter)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions