package owl

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

Source file owl_dense_matrix_d.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# 1 "src/owl/dense/owl_dense_matrix_d.ml"
(*
 * OWL - OCaml Scientific and Engineering Computing
 * Copyright (c) 2016-2019 Liang Wang <liang.wang@cl.cam.ac.uk>
 *)

(** [ Real dense matrix ]  *)

[@@@warning "-34"]

open Bigarray

module M = Owl_dense_matrix_generic
include M

type elt = float
type mat = (float, float64_elt) M.t
type arr = (float, float64_elt) Owl_dense_ndarray_generic.t


(* overload functions in Owl_dense_matrix_generic *)

let empty m n = M.empty Float64 m n

let create m n a = M.create Float64 m n a

let init m n f = M.init Float64 m n f

let init_2d m n f = M.init_2d Float64 m n f

let zeros m n = M.zeros Float64 m n

let ones m n = M.ones Float64 m n

let eye m = M.eye Float64 m

let sequential ?a ?step m n = M.sequential Float64 ?a ?step m n

let uniform ?a ?b m n = M.uniform Float64 ?a ?b m n

let gaussian ?mu ?sigma m n = M.gaussian Float64 ?mu ?sigma m n

let semidef m = M.semidef Float64 m

let linspace a b n = M.linspace Float64 a b n

let logspace ?base a b n = M.logspace Float64 ?base a b n

let meshgrid xa xb ya yb xn yn = M.meshgrid Float64 xa xb ya yb xn yn

let bernoulli ?p d = M.bernoulli Float64 ?p d

let unit_basis n i = M.unit_basis Float64 n i

let hadamard n = M.hadamard Float64 n

let magic n = M.magic Float64 n

let of_array x m n = M.of_array Float64 x m n

let of_arrays x = M.of_arrays Float64 x

let load f = M.load Float64 f

let load_txt ?sep f = M.load_txt Float64 ?sep f

(* specific functions for float64 matrix *)

let vector n = empty 1 n

let vector_ones n = ones 1 n

let vector_zeros n = zeros 1 n

let vector_uniform n = uniform 1 n

let conj x = copy x
OCaml

Innovation. Community. Security.