Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7642297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:09:13+00:00 2026-05-31T09:09:13+00:00

Premise A When talking about Column Major matrices in linear memory, columns are specified

  • 0

Premise A

When talking about “Column Major” matrices in linear memory, columns are specified one after another, such that the first 4 entries in memory correspond to the first column in the matrix. “Row Major” matrices, on the other hand, are understood to specify rows one after another, such that the first 4 entries in memory specify the first row of the matrix.


A GLKMatrix4 looks like this:

union _GLKMatrix4
{
    struct
    {
        float m00, m01, m02, m03;
        float m10, m11, m12, m13;
        float m20, m21, m22, m23;
        float m30, m31, m32, m33;
    };
    float m[16];
}
typedef union _GLKMatrix4 GLKMatrix4;

The documentation on the m member says:

A one-dimensional array of the matrix’s elements in column-major
order.

Premise B

A “row” in a GLKMatrix4 is a set of 4 floats declared horizontally ([m00, m01, m02, m03] would be the first “row”). Thus, those entries can be interpreted as mRowCol (m12 would be the entry at row 1, column 2).


If we look at how those GLKMatrix struct members are laid out based on the order of the declarations, we see:

[m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, ...]

Where the first 4 entries clearly represent the first row of the matrix, not the first column.

Conclusion

m is not actually Column Major, and the docs are wrong.


Now, I should note that I don’t actually believe the conclusion, but the two premises seem pretty reasonable. Really, I distrust premise B the most, but it seems strange to define a “row” to be vertical and a “column” to be horizontal. Can someone explain this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T09:09:15+00:00Added an answer on May 31, 2026 at 9:09 am

    The declaration is a bit confusing, but the matrix is in column major order. The four rows in the struct represent the columns in the matrix, with m0* being column 0 and m3* being column 3. This is easy to verify, just create a translation matrix and check values m30, m31 and m32 for the translation components.

    I am guessing your confusion is coming from the fact that the struct lays out the floats in rows, when they are in fact representing columns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Premise : The requirements for an upcoming project include the fact that no one
Premise I believe that there is a way to objectively define "Good" and "Bad"
Premise: This Wikipedia page suggests that the computational complexity of Schoolbook long division is
I am writing a minimal replacement for mod_python's publisher.py The basic premise is that
This is a long one, The Premise Was called in to help out a
When I study about cloud-computing, I usually see these terms: on-premise, off-premise applications. I
What is the basic premise behind technology such as is found in Oblivion (and
Something that has been bugging me since I read an answer on another stackoverflow
Premise: I am parsing a file that is quite nearly XML, but not quite.
I'm building a program that has a very basic premise. For X amount of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.