-
Notifications
You must be signed in to change notification settings - Fork 1
/
floatvec--1.1.1.sql
113 lines (89 loc) · 2.13 KB
/
floatvec--1.1.1.sql
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
/* floatvec--1.1.1.sql */
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION floatvec" to load this file. \quit
-- add
CREATE OR REPLACE FUNCTION
vec_add(anyarray, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_add_with_vec'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_add(anyarray, anyelement)
RETURNS anyarray
AS 'floatvec', 'vec_add_with_scalar'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_add(anyelement, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_add_with_scalar'
LANGUAGE c;
-- sub
CREATE OR REPLACE FUNCTION
vec_sub(anyarray, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_sub_with_vec'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_sub(anyarray, anyelement)
RETURNS anyarray
AS 'floatvec', 'vec_sub_with_scalar'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_sub(anyelement, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_sub_with_scalar'
LANGUAGE c;
-- mul
CREATE OR REPLACE FUNCTION
vec_mul(anyarray, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_mul_with_vec'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_mul(anyarray, anyelement)
RETURNS anyarray
AS 'floatvec', 'vec_mul_with_scalar'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_mul(anyelement, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_mul_with_scalar'
LANGUAGE c;
-- div
CREATE OR REPLACE FUNCTION
vec_div(anyarray, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_div_with_vec'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_div(anyarray, anyelement)
RETURNS anyarray
AS 'floatvec', 'vec_div_with_scalar'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_div(anyelement, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_div_with_scalar'
LANGUAGE c;
-- pow
CREATE OR REPLACE FUNCTION
vec_pow(anyarray, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_pow_with_vec'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_pow(anyarray, anyelement)
RETURNS anyarray
AS 'floatvec', 'vec_pow_with_scalar'
LANGUAGE c;
CREATE OR REPLACE FUNCTION
vec_pow(anyelement, anyarray)
RETURNS anyarray
AS 'floatvec', 'vec_pow_with_scalar'
LANGUAGE c;
-- elements
CREATE OR REPLACE FUNCTION
vec_elements(anyarray, integer[])
RETURNS anyarray
AS 'floatvec', 'vec_elements_from_int'
LANGUAGE c;