ctranspose.js 1.2 KB

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