# \#column-major

**URL:** https://discourse.julialang.org/tag/column-major/605.md

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

---

## [Checking strided array storage order](https://discourse.julialang.org/t/checking-strided-array-storage-order/128685)

<div class="topic-metadata">

**Author:** [@stemann](https://discourse.julialang.org/u/stemann)\
**Replies:** 1\
**Last updated:** [May 4, 2025, 11:18am UTC](https://discourse.julialang.org/t/checking-strided-array-storage-order/128685 "2025-05-04T11:18:08Z")

</div>

Is strides(array) == Base.size\_to\_strides(1, size(array)...) a sane way to check if a strided array is in column-major (alias co-lexicographic, alias Fortran, alias Julia) order, storage-wise? Cf. julia/base/abstracta…

---

## [Why column major?](https://discourse.julialang.org/t/why-column-major/24374)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 58\
**Last updated:** [February 17, 2024, 11:31pm UTC](https://discourse.julialang.org/t/why-column-major/24374 "2024-02-17T23:31:03Z")

</div>

Why Julia arrays are stored in column-major order? Column-major vs row-major are not entirely symmetric regarding code style, because when we access the i,j’th element of an array, we write A\[i,j\] with the row index fir…

---

## [What are the pros and cons of row/column major ordering?](https://discourse.julialang.org/t/what-are-the-pros-and-cons-of-row-column-major-ordering/110045)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 10\
**Last updated:** [February 13, 2024, 4:53pm UTC](https://discourse.julialang.org/t/what-are-the-pros-and-cons-of-row-column-major-ordering/110045 "2024-02-13T16:53:10Z")

</div>

I understand that because matrices in Julia are stored in column major order, it is best to iterate over them in column major order. What is less clear to me is why one would want to store matrices in column major order…

---

## [Matrix Multiplication of a Large Number of Small Matrices](https://discourse.julialang.org/t/matrix-multiplication-of-a-large-number-of-small-matrices/93531)

<div class="topic-metadata">

**Author:** [@andrewkhardy](https://discourse.julialang.org/u/andrewkhardy)\
**Replies:** 12\
**Last updated:** [February 8, 2023, 7:47pm UTC](https://discourse.julialang.org/t/matrix-multiplication-of-a-large-number-of-small-matrices/93531 "2023-02-08T19:47:04Z")

</div>

Im interested in computing the matrix multiplication of 2x2 matrices, but these are sampled at a very large number of points. Here is my current benchmark using Tullio,TensorCast, LinearAlgebra, StaticArrays function M…

---

## [Should \`reshape\` have an option for row-major order?](https://discourse.julialang.org/t/should-reshape-have-an-option-for-row-major-order/6929)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 28\
**Last updated:** [December 4, 2022, 7:10pm UTC](https://discourse.julialang.org/t/should-reshape-have-an-option-for-row-major-order/6929 "2022-12-04T19:10:18Z")

</div>

Currently reshape can only rearrange the raw linearly ordered data into Julia’s default column-major order (or colexicographical order, for higher-dimensional arrays). Would it be worth adding an optional keyword argumen…

---

## [Row and column major order for arrays of different shape](https://discourse.julialang.org/t/row-and-column-major-order-for-arrays-of-different-shape/79297)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 23\
**Last updated:** [April 12, 2022, 1:05pm UTC](https://discourse.julialang.org/t/row-and-column-major-order-for-arrays-of-different-shape/79297 "2022-04-12T13:05:12Z")

</div>

In the following code the functions r\_major and c\_major iterate over array a in the row and column major order: using BenchmarkTools function r\_major!(a) N1, N2 = size(a) for i=1:N1 for j=1:N2 a\[i,j…

---

## [Why is \`copy(adjoint)\` not an adjoint object?](https://discourse.julialang.org/t/why-is-copy-adjoint-not-an-adjoint-object/55371)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 12\
**Last updated:** [February 18, 2021, 7:03am UTC](https://discourse.julialang.org/t/why-is-copy-adjoint-not-an-adjoint-object/55371 "2021-02-18T07:03:11Z")

</div>

This surprised me: julia\> typeof(copy(rand(4,4)')) Matrix{Float64} (alias for Array{Float64, 2}) julia\> typeof(deepcopy(rand(4,4)')) LinearAlgebra.Adjoint{Float64, Matrix{Float64}} I have an algorithm which looks pret…

---

## [Scalar multiplication makes array reallocation](https://discourse.julialang.org/t/scalar-multiplication-makes-array-reallocation/48421)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 14\
**Last updated:** [October 15, 2020, 11:39am UTC](https://discourse.julialang.org/t/scalar-multiplication-makes-array-reallocation/48421 "2020-10-15T11:39:47Z")

</div>

Hi everyone, While testing the fastest approach to multiply a matrix to a vector a discovered a nasty fact about reallocation. Multiplying a matrix for a constant-defined value (namely a scalar) makes Julia reallocate …

---

## [Would matrix multiplication benefit if Julia allowed for row-major arrays as well?](https://discourse.julialang.org/t/would-matrix-multiplication-benefit-if-julia-allowed-for-row-major-arrays-as-well/15214)

<div class="topic-metadata">

**Author:** [@AdamR](https://discourse.julialang.org/u/AdamR)\
**Replies:** 1\
**Last updated:** [September 20, 2018, 11:37am UTC](https://discourse.julialang.org/t/would-matrix-multiplication-benefit-if-julia-allowed-for-row-major-arrays-as-well/15214 "2018-09-20T11:37:16Z")

</div>

Just a random thought. Consider multiplication of three matrices: A \* (B \* C) If A is column-major, would the execution times of the outer product be substantially smaller (if the size of the product B \* C and matrix A …
