Skip to content

Commit 8252769

Browse files
authored
Merge pull request #197 from QuantEcon/ot_update
Added column major order note to OT lecture
2 parents 08a15c8 + 57eddc9 commit 8252769

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lectures/opt_transport.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,17 @@ print("z:", res.x)
366366
print("X:", res.x.reshape((m,n), order='F'))
367367
```
368368
369+
Notice how, in the line `C_vec = C.reshape((m*n, 1), order='F')`, we are
370+
careful to vectorize using the flag `order='F'`.
371+
372+
This is consistent with converting $C$ into a vector by stacking all of its
373+
columns into a column vector.
374+
375+
Here `'F'` stands for "Fortran", and we are using Fortran style column-major order.
376+
377+
(For an alternative approach, using Python's default row-major ordering, see [this
378+
lecture by Alfred
379+
Galichon](https://www.math-econ-code.org/mec-optim-b04).)
369380
370381
**Interpreting the warning:**
371382

0 commit comments

Comments
 (0)