Middle.SizedType
Types which have a concrete size associated, e.g. vector[n]
type 'a t =
| SInt
| SReal
| SComplex
| SVector of Mem_pattern.t * 'a
| SRowVector of Mem_pattern.t * 'a
| SMatrix of Mem_pattern.t * 'a * 'a
| SComplexVector of 'a
| SComplexRowVector of 'a
| SComplexMatrix of 'a * 'a
| SArray of 'a t * 'a
| STuple of 'a t list
val fold : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val t_of_sexp : 'a. (Sexplib0.Sexp.t -> 'a) -> Sexplib0.Sexp.t -> 'a t
val sexp_of_t : 'a. ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val hash_fold_t :
'a. (Ppx_hash_lib.Std.Hash.state -> 'a -> Ppx_hash_lib.Std.Hash.state) ->
Ppx_hash_lib.Std.Hash.state ->
'a t ->
Ppx_hash_lib.Std.Hash.state
val pp : 'a Fmt.t -> 'a t Fmt.t
val to_unsized : 'a t -> UnsizedType.t
val get_dims_io :
Expr.Typed.t t ->
Middle__Expr.Typed.Meta.t Middle__Expr.Fixed.t list
Get the dimensions with respect to sizes needed for IO. Note: The main difference from get_dims is complex, where this function treats the complex type as a dual number. Note: Tuples are treated as scalars by this function due to the inherent assumption of rectangularity. Carefully consider new usages and use io_size
when possible.
val io_size :
Middle__Expr.Typed.Meta.t Middle__Expr.Fixed.t t ->
Middle__Expr.Typed.Meta.t Middle__Expr.Fixed.t
val get_dims : 'a t -> 'a list
Get the dimensions of an object. Note: Tuples are treated as scalars by this function due to the inherent assumption of rectangularity. Carefully consider new usages!
val is_recursive_container : 'a t -> bool
* Check whether a SizedType holds indexable SizedTypes.
Return a type's array dimensions and the type inside the (possibly nested) array
Return a type's dimensions and inner scalar. Differs from get_array_dims
in that this also breaks down vectors or matrices, so a SVector d
is returned as (SReal, [d])
rather than (SVector d, [])
val contains_tuple : 'a t -> bool
val is_complex_type : 'a t -> bool
val get_mem_pattern : 'a t -> Mem_pattern.t
* Return the mem_pattern of the SizedType
val modify_sizedtype_mem : Mem_pattern.t -> 'a t -> 'a t
val has_mem_pattern : 'a t -> bool