Module Slap_ppx

module Slap_ppx: sig .. end
PPX syntactic extensions for SLAP. (This is a dummy module.)

For use of the extensions, you need to pass -ppx ppx_slap to the OCaml compiler, or specify -package slap.ppx to OCamlfind. You can also use by

#use "topfind";;
#require "slap.ppx";;

on interactive mode.

Literals

Vector literals

Vector literals like [%vec.kind [e1; e2; ...; eN]] are supported where e1 ... eN are elements and kind specifies the type and precision of the elements. It corresponds to Bigarray kind:

You can omit a kind if you open Slap.[SDCZ]:

For examples, [%vec.float64 [42.0; 123.0; 456.0]] is a three-dimensional vector that has 64-bit real numbers 42.0, 123.0 and 456.0. If you open Slap.D, the vector literal is the same as [%vec [42.0; 123.0; 456.0]].

Matrix literals

Matrix literals can be written as

[%mat.kind [ [e11; e12; ...; e1N];
             [e21; e22; ...; e2N];
             [...; ...; ...; ...];
             [eM1; eM2; ...; eMN] ]]

or

[%mat.kind [ e11, e12, ..., e1N;
             e21, e22, ..., e2N;
             ..., ..., ..., ...;
             eM1, eM2, ..., eMN ]]

where kind is one of the above-mentioned identifiers. You can also use [%mat ...] and [%rmat ...] (referring Slap.[SDCZ].prec and Slap.[SDCZ].rprec respectively) as similar to vector literals.