ctranspose.js (1224B)
1 "use strict"; 2 3 Object.defineProperty(exports, "__esModule", { 4 value: true 5 }); 6 exports.createCtranspose = void 0; 7 8 var _factory = require("../../utils/factory.js"); 9 10 var name = 'ctranspose'; 11 var dependencies = ['typed', 'transpose', 'conj']; 12 var 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 }); 45 exports.createCtranspose = createCtranspose;