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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
//! Method-form arithmetic bridges.
use crate::{array::Array, error::Result};
impl Array {
/// Element-wise addition. See [`crate::ops::arithmetic::add`].
pub fn add(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::add(self, rhs)
}
/// Element-wise subtraction. See [`crate::ops::arithmetic::subtract`].
pub fn subtract(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::subtract(self, rhs)
}
/// Element-wise multiplication. See [`crate::ops::arithmetic::multiply`].
pub fn multiply(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::multiply(self, rhs)
}
/// Element-wise division. See [`crate::ops::arithmetic::divide`].
pub fn divide(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::divide(self, rhs)
}
/// Element-wise maximum. See [`crate::ops::arithmetic::maximum`].
pub fn maximum(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::maximum(self, rhs)
}
/// Element-wise minimum. See [`crate::ops::arithmetic::minimum`].
pub fn minimum(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::minimum(self, rhs)
}
/// Element-wise power. See [`crate::ops::arithmetic::power`].
pub fn power(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::power(self, rhs)
}
/// Element-wise unary negation. See [`crate::ops::arithmetic::negative`].
pub fn negative(&self) -> Result<Array> {
crate::ops::arithmetic::negative(self)
}
/// Element-wise absolute value. See [`crate::ops::arithmetic::abs`].
pub fn abs(&self) -> Result<Array> {
crate::ops::arithmetic::abs(self)
}
/// Element-wise square root. See [`crate::ops::arithmetic::sqrt`].
pub fn sqrt(&self) -> Result<Array> {
crate::ops::arithmetic::sqrt(self)
}
/// Element-wise square. See [`crate::ops::arithmetic::square`].
pub fn square(&self) -> Result<Array> {
crate::ops::arithmetic::square(self)
}
/// Element-wise natural exponential. See [`crate::ops::arithmetic::exp`].
pub fn exp(&self) -> Result<Array> {
crate::ops::arithmetic::exp(self)
}
/// Element-wise natural logarithm. See [`crate::ops::arithmetic::log`].
pub fn log(&self) -> Result<Array> {
crate::ops::arithmetic::log(self)
}
/// Element-wise sine. See [`crate::ops::arithmetic::sin`].
pub fn sin(&self) -> Result<Array> {
crate::ops::arithmetic::sin(self)
}
/// Element-wise cosine. See [`crate::ops::arithmetic::cos`].
pub fn cos(&self) -> Result<Array> {
crate::ops::arithmetic::cos(self)
}
/// Element-wise tangent. See [`crate::ops::arithmetic::tan`].
pub fn tan(&self) -> Result<Array> {
crate::ops::arithmetic::tan(self)
}
/// Element-wise hyperbolic tangent. See [`crate::ops::arithmetic::tanh`].
pub fn tanh(&self) -> Result<Array> {
crate::ops::arithmetic::tanh(self)
}
// ───────── M2a unary long-tail ─────────
/// Element-wise base-10 logarithm. See [`crate::ops::arithmetic::log10`].
pub fn log10(&self) -> Result<Array> {
crate::ops::arithmetic::log10(self)
}
/// Element-wise base-2 logarithm. See [`crate::ops::arithmetic::log2`].
pub fn log2(&self) -> Result<Array> {
crate::ops::arithmetic::log2(self)
}
/// Element-wise `log(1 + a)`. See [`crate::ops::arithmetic::log1p`].
pub fn log1p(&self) -> Result<Array> {
crate::ops::arithmetic::log1p(self)
}
/// Element-wise `exp(a) - 1`. See [`crate::ops::arithmetic::expm1`].
pub fn expm1(&self) -> Result<Array> {
crate::ops::arithmetic::expm1(self)
}
/// Element-wise error function. See [`crate::ops::arithmetic::erf`].
pub fn erf(&self) -> Result<Array> {
crate::ops::arithmetic::erf(self)
}
/// Element-wise inverse error function. See [`crate::ops::arithmetic::erfinv`].
pub fn erfinv(&self) -> Result<Array> {
crate::ops::arithmetic::erfinv(self)
}
/// Element-wise logistic sigmoid. See [`crate::ops::arithmetic::sigmoid`].
pub fn sigmoid(&self) -> Result<Array> {
crate::ops::arithmetic::sigmoid(self)
}
/// Element-wise ceiling. See [`crate::ops::arithmetic::ceil`].
pub fn ceil(&self) -> Result<Array> {
crate::ops::arithmetic::ceil(self)
}
/// Element-wise floor. See [`crate::ops::arithmetic::floor`].
pub fn floor(&self) -> Result<Array> {
crate::ops::arithmetic::floor(self)
}
/// Element-wise round to `decimals` decimal places. See [`crate::ops::arithmetic::round`].
pub fn round(&self, decimals: i32) -> Result<Array> {
crate::ops::arithmetic::round(self, decimals)
}
/// Element-wise sign. See [`crate::ops::arithmetic::sign`].
pub fn sign(&self) -> Result<Array> {
crate::ops::arithmetic::sign(self)
}
/// Element-wise reciprocal `1 / a`. See [`crate::ops::arithmetic::reciprocal`].
pub fn reciprocal(&self) -> Result<Array> {
crate::ops::arithmetic::reciprocal(self)
}
/// Element-wise reciprocal square root. See [`crate::ops::arithmetic::rsqrt`].
pub fn rsqrt(&self) -> Result<Array> {
crate::ops::arithmetic::rsqrt(self)
}
/// Element-wise complex conjugate. See [`crate::ops::arithmetic::conjugate`].
pub fn conjugate(&self) -> Result<Array> {
crate::ops::arithmetic::conjugate(self)
}
/// Real part of a complex array. See [`crate::ops::arithmetic::real`].
pub fn real(&self) -> Result<Array> {
crate::ops::arithmetic::real(self)
}
/// Imaginary part of a complex array. See [`crate::ops::arithmetic::imag`].
pub fn imag(&self) -> Result<Array> {
crate::ops::arithmetic::imag(self)
}
/// Element-wise radians-to-degrees. See [`crate::ops::arithmetic::degrees`].
pub fn degrees(&self) -> Result<Array> {
crate::ops::arithmetic::degrees(self)
}
/// Element-wise degrees-to-radians. See [`crate::ops::arithmetic::radians`].
pub fn radians(&self) -> Result<Array> {
crate::ops::arithmetic::radians(self)
}
/// Element-wise hyperbolic sine. See [`crate::ops::arithmetic::sinh`].
pub fn sinh(&self) -> Result<Array> {
crate::ops::arithmetic::sinh(self)
}
/// Element-wise hyperbolic cosine. See [`crate::ops::arithmetic::cosh`].
pub fn cosh(&self) -> Result<Array> {
crate::ops::arithmetic::cosh(self)
}
/// Element-wise arc-sine. See [`crate::ops::arithmetic::arcsin`].
pub fn arcsin(&self) -> Result<Array> {
crate::ops::arithmetic::arcsin(self)
}
/// Element-wise arc-cosine. See [`crate::ops::arithmetic::arccos`].
pub fn arccos(&self) -> Result<Array> {
crate::ops::arithmetic::arccos(self)
}
/// Element-wise arc-tangent. See [`crate::ops::arithmetic::arctan`].
pub fn arctan(&self) -> Result<Array> {
crate::ops::arithmetic::arctan(self)
}
/// Element-wise inverse hyperbolic sine. See [`crate::ops::arithmetic::arcsinh`].
pub fn arcsinh(&self) -> Result<Array> {
crate::ops::arithmetic::arcsinh(self)
}
/// Element-wise inverse hyperbolic cosine. See [`crate::ops::arithmetic::arccosh`].
pub fn arccosh(&self) -> Result<Array> {
crate::ops::arithmetic::arccosh(self)
}
/// Element-wise inverse hyperbolic tangent. See [`crate::ops::arithmetic::arctanh`].
pub fn arctanh(&self) -> Result<Array> {
crate::ops::arithmetic::arctanh(self)
}
/// Replace `NaN`/`±inf` element-wise. See [`crate::ops::arithmetic::nan_to_num`].
pub fn nan_to_num(&self, nan: f32, posinf: Option<f32>, neginf: Option<f32>) -> Result<Array> {
crate::ops::arithmetic::nan_to_num(self, nan, posinf, neginf)
}
/// Element-wise bitwise NOT. See [`crate::ops::arithmetic::bitwise_invert`].
pub fn bitwise_invert(&self) -> Result<Array> {
crate::ops::arithmetic::bitwise_invert(self)
}
// ───────── M2a binary long-tail ─────────
/// Element-wise two-argument arc-tangent. See [`crate::ops::arithmetic::arctan2`].
pub fn arctan2(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::arctan2(self, rhs)
}
/// Element-wise floor-division. See [`crate::ops::arithmetic::floor_divide`].
pub fn floor_divide(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::floor_divide(self, rhs)
}
/// Element-wise remainder (Python `%`). See [`crate::ops::arithmetic::remainder`].
pub fn remainder(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::remainder(self, rhs)
}
/// Element-wise simultaneous quotient + remainder. See [`crate::ops::arithmetic::divmod`].
pub fn divmod(&self, rhs: &Array) -> Result<(Array, Array)> {
crate::ops::arithmetic::divmod(self, rhs)
}
/// Element-wise bitwise AND. See [`crate::ops::arithmetic::bitwise_and`].
pub fn bitwise_and(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::bitwise_and(self, rhs)
}
/// Element-wise bitwise OR. See [`crate::ops::arithmetic::bitwise_or`].
pub fn bitwise_or(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::bitwise_or(self, rhs)
}
/// Element-wise bitwise XOR. See [`crate::ops::arithmetic::bitwise_xor`].
pub fn bitwise_xor(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::bitwise_xor(self, rhs)
}
/// Element-wise left-shift. See [`crate::ops::arithmetic::left_shift`].
pub fn left_shift(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::left_shift(self, rhs)
}
/// Element-wise right-shift. See [`crate::ops::arithmetic::right_shift`].
pub fn right_shift(&self, rhs: &Array) -> Result<Array> {
crate::ops::arithmetic::right_shift(self, rhs)
}
}