package tezos-benchmark

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Tezos_benchmark.Scikit_matrixSource

Sourcetype t

Matrices implemented as 2d bigarrays.

Sourceval create : lines:int -> cols:int -> t

Create a matrix and initializes it to 0.0

Sourceval init : lines:int -> cols:int -> f:(int -> int -> float) -> t

Create and initializes a matrix.

Sourceval dim1 : t -> int

Number of lines.

Sourceval dim2 : t -> int

Number of columns.

Sourceval shape : t -> int * int

Lines x Columns

Sourceval set : t -> int -> int -> float -> unit

set m i j v sets the element on line i and column j of m to v.

Sourceval get : t -> int -> int -> float

get m i j gets the element on line i and column j.

Sourceval map : t -> (float -> float) -> t

map m f creates a new matrix by mapping f pointwise to m.

Sourceval column : t -> int -> t

column m i returns the ith column (starting from 0)

Sourceval concat_columns_horiz : t list -> t

concat_columns_horiz [c1;...;cn] returns the matrix having c1...cn as rows. The function fails if the columns have incoherent dimensions.

Sourceval to_genarray : t -> gen

Converts the 2d bigarray to a genarray.

Sourceval of_genarray : gen -> t

Converts a 2d genarray back to a matrix.

Sourceval to_numpy : t -> Pytypes.pyobject

Converts to a numpy Python object.

Converts a vector to a numpy Python object.

Sourceval of_numpy : Pytypes.pyobject -> t

Converts from a numpy Python object.

Sourceval numpy_mul : t -> t -> t
Sourceval numpy_add : t -> t -> t
Sourceval numpy_sub : t -> t -> t

Numpy implementations of matrix operations.

Sourceval numpy_show : t -> string

String representation of matri via numpy.

OCaml

Innovation. Community. Security.