diff --git a/lectures/opt_transport.md b/lectures/opt_transport.md index 7a5cb8660..6257c2f1a 100644 --- a/lectures/opt_transport.md +++ b/lectures/opt_transport.md @@ -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:**