simple-squiggle

A restricted subset of Squiggle
Log | Files | Refs | README

ctranspose.js (1018B)


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