Skip to content

Commit 85b3ea5

Browse files
committed
core: expose ufunc square
1 parent 4a0687a commit 85b3ea5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/eigenpy/ufunc.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//
2-
// Copyright (c) 2020-2021 INRIA
2+
// Copyright (c) 2020-2025 INRIA
33
// code aptapted from
44
// https://github.com/numpy/numpy/blob/41977b24ae011a51f64faa75cb524c7350fdedd9/numpy/core/src/umath/_rational_tests.c.src
55
//
@@ -151,6 +151,7 @@ EIGENPY_REGISTER_BINARY_OPERATOR(greater_equal, >=)
151151
}
152152

153153
EIGENPY_REGISTER_UNARY_OPERATOR(negative, -)
154+
EIGENPY_REGISTER_UNARY_OPERATOR(square, x *)
154155

155156
} // namespace internal
156157

@@ -258,6 +259,7 @@ void registerCommonUfunc() {
258259

259260
// Unary operators
260261
EIGENPY_REGISTER_UNARY_UFUNC(negative, type_code, Scalar, Scalar);
262+
EIGENPY_REGISTER_UNARY_UFUNC(square, type_code, Scalar, Scalar);
261263

262264
Py_DECREF(numpy);
263265
}

0 commit comments

Comments
 (0)