MVar.transpose()

transpose ( )

Transpose this MVar; create a new MVar object by reversing the order of the original MVar's axes. For 1-D MVar objects, this routine simply returns a copy of the original MVar.

Return value:

An MVar object representing the transpose.

Example usage:

  x = model.addMVar((4, 1))  # Resembles a "column vector"
  x_t = x.transpose()  # Same variables, but as a "row vector"
  y = model.addMVar((3, 2))
  y_t = x.transpose()  # Has shape (2, 3)