Skip to content

Extend partial evaluator with common functions on arrays and (row)vectors #202

Open
@VMatthijs

Description

@VMatthijs

It would be useful to add support for statically evaluating functions like size, dims, num_elements, max, min, rows, cols when called on array, vector and row-vector expressions like
{4, 2, 1}
and
[123, 2, 46, 3].

Such functions are used, for example, to determine sizes of containers in Rstanarm, so it would be useful to be able to statically evaluate them in order to

  1. generate more efficient code for Rstanarm
  2. auto-generate datasets for testing Rstanarm.

A smarter implementation of this would even be able to evaluate dimensions and lengths of many containers that are not array or row_vector expressions: the sizes should often be stored in the type information. We can use a possibly_sized_type for this.

We can even evaluate indexed row_vector and array expressions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions