package owl

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

Source file owl_matrix_check.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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# 1 "src/owl/core/owl_matrix_check.ml"
(*
 * OWL - OCaml Scientific Computing
 * Copyright (c) 2016-2022 Liang Wang <liang@ocaml.xyz>
 *)

open Bigarray
open Owl_core_types

external owl_float32_matrix_is_triu
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float32_matrix_is_triu"

external owl_float64_matrix_is_triu
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float64_matrix_is_triu"

external owl_complex32_matrix_is_triu
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex32_matrix_is_triu"

external owl_complex64_matrix_is_triu
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex64_matrix_is_triu"

let _matrix_is_triu : type a b. (a, b) kind -> (a, b) owl_arr -> bool = function
  | Float32   -> owl_float32_matrix_is_triu
  | Float64   -> owl_float64_matrix_is_triu
  | Complex32 -> owl_complex32_matrix_is_triu
  | Complex64 -> owl_complex64_matrix_is_triu
  | _         -> failwith "_matrix_is_triu: unsupported operation"


external owl_float32_matrix_is_tril
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float32_matrix_is_tril"

external owl_float64_matrix_is_tril
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float64_matrix_is_tril"

external owl_complex32_matrix_is_tril
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex32_matrix_is_tril"

external owl_complex64_matrix_is_tril
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex64_matrix_is_tril"

let _matrix_is_tril : type a b. (a, b) kind -> (a, b) owl_arr -> bool = function
  | Float32   -> owl_float32_matrix_is_tril
  | Float64   -> owl_float64_matrix_is_tril
  | Complex32 -> owl_complex32_matrix_is_tril
  | Complex64 -> owl_complex64_matrix_is_tril
  | _         -> failwith "_matrix_is_tril: unsupported operation"


external owl_float32_matrix_is_diag
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float32_matrix_is_diag"

external owl_float64_matrix_is_diag
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float64_matrix_is_diag"

external owl_complex32_matrix_is_diag
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex32_matrix_is_diag"

external owl_complex64_matrix_is_diag
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex64_matrix_is_diag"

let _matrix_is_diag : type a b. (a, b) kind -> (a, b) owl_arr -> bool = function
  | Float32   -> owl_float32_matrix_is_diag
  | Float64   -> owl_float64_matrix_is_diag
  | Complex32 -> owl_complex32_matrix_is_diag
  | Complex64 -> owl_complex64_matrix_is_diag
  | _         -> failwith "_matrix_is_diag: unsupported operation"


external owl_float32_matrix_is_symmetric
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float32_matrix_is_symmetric"

external owl_float64_matrix_is_symmetric
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float64_matrix_is_symmetric"

external owl_complex32_matrix_is_symmetric
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex32_matrix_is_symmetric"

external owl_complex64_matrix_is_symmetric
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex64_matrix_is_symmetric"

let _matrix_is_symmetric : type a b. (a, b) kind -> (a, b) owl_arr -> bool = function
  | Float32   -> owl_float32_matrix_is_symmetric
  | Float64   -> owl_float64_matrix_is_symmetric
  | Complex32 -> owl_complex32_matrix_is_symmetric
  | Complex64 -> owl_complex64_matrix_is_symmetric
  | _         -> failwith "_matrix_is_symmetric: unsupported operation"


external owl_float32_matrix_is_hermitian
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float32_matrix_is_hermitian"

external owl_float64_matrix_is_hermitian
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_float64_matrix_is_hermitian"

external owl_complex32_matrix_is_hermitian
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex32_matrix_is_hermitian"

external owl_complex64_matrix_is_hermitian
  :  ('a, 'b) owl_arr
  -> bool
  = "stub_complex64_matrix_is_hermitian"

let _matrix_is_hermitian : type a b. (a, b) kind -> (a, b) owl_arr -> bool = function
  | Float32   -> owl_float32_matrix_is_hermitian
  | Float64   -> owl_float64_matrix_is_hermitian
  | Complex32 -> owl_complex32_matrix_is_hermitian
  | Complex64 -> owl_complex64_matrix_is_hermitian
  | _         -> failwith "_matrix_is_hermitian: unsupported operation"
OCaml

Innovation. Community. Security.