Skip to content

Latest commit

 

History

History
82 lines (67 loc) · 5.59 KB

builder.rst

File metadata and controls

82 lines (67 loc) · 5.59 KB

Expression builders

xtensor provides functions to ease the build of common N-dimensional expressions. The expressions returned by these functions implement the laziness of xtensor, that is, they don't hold any value. Values are computed upon request.

Ones and zeros

Numerical ranges

Joining expressions

Random distributions

Warning

xtensor uses a lazy generator for random numbers. You need to assign them or use :cpp:func:`xt::eval` to keep the generated values consistent.

Meshes

  • :cpp:func:`xt::meshgrid(x1, x2,...) <xt::meshgrid>`: generates N-D coordinate expressions given one-dimensional coordinate arrays x1, x2... If specified vectors have lengths Ni = len(xi), meshgrid returns (N1, N2, N3,..., Nn)-shaped arrays, with the elements of xi repeated to fill the matrix along the first dimension for x1, the second for x2 and so on.