UNPKG

1.22 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.createCtranspose = void 0;
7
8var _factory = require("../../utils/factory.js");
9
10var name = 'ctranspose';
11var dependencies = ['typed', 'transpose', 'conj'];
12var createCtranspose = /* #__PURE__ */(0, _factory.factory)(name, dependencies, function (_ref) {
13 var typed = _ref.typed,
14 transpose = _ref.transpose,
15 conj = _ref.conj;
16
17 /**
18 * Transpose and complex conjugate a matrix. All values of the matrix are
19 * reflected over its main diagonal and then the complex conjugate is
20 * taken. This is equivalent to complex conjugation for scalars and
21 * vectors.
22 *
23 * Syntax:
24 *
25 * math.ctranspose(x)
26 *
27 * Examples:
28 *
29 * const A = [[1, 2, 3], [4, 5, math.complex(6,7)]]
30 * math.ctranspose(A) // returns [[1, 4], [2, 5], [3, {re:6,im:7}]]
31 *
32 * See also:
33 *
34 * transpose, diag, inv, subset, squeeze
35 *
36 * @param {Array | Matrix} x Matrix to be ctransposed
37 * @return {Array | Matrix} The ctransposed matrix
38 */
39 return typed(name, {
40 any: function any(x) {
41 return conj(transpose(x));
42 }
43 });
44});
45exports.createCtranspose = createCtranspose;
\No newline at end of file