Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions lectures/opt_transport.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,17 @@ print("z:", res.x)
print("X:", res.x.reshape((m,n), order='F'))
```

Notice how, in the line `C_vec = C.reshape((m*n, 1), order='F')`, we are
careful to vectorize using the flag `order='F'`.

This is consistent with converting $C$ into a vector by stacking all of its
columns into a column vector.

Here `'F'` stands for "Fortran", and we are using Fortran style column-major order.

(For an alternative approach, using Python's default row-major ordering, see [this
lecture by Alfred
Galichon](https://www.math-econ-code.org/mec-optim-b04).)

**Interpreting the warning:**

Expand Down