sc::mat4(3)
β¨ NAME β¨
sc::mat4 β okay so this is a section 3 (Library Functions Manual) page, bestie, and it's all about the mat4 class. Think 4x4 matrix energy. π
π¦ SYNOPSIS π¦
π Public Member Functions
mat4 (const vec4 &v0, const vec4 &v1, const vec4 &v2, const vec4 &v3)β build one from fourvec4s, one per row-ish situation. πmat4 (const double d)β build one from a singledouble. One number, whole matrix, it's giving minimalism. β¨mat4 (const mat4 &m)β copy constructor, the classic. Make amat4that's a twin ofm. π«Άmat4 & operator= (const mat4 &m)β assignment.m's whole vibe becomes yours, and you get*thisback. πmat4 & operator+= (const mat4 &m)β addmonto yourself, return*this. Math but make it in-place. π₯mat4 & operator-= (const mat4 &m)β same deal but subtraction. Takemaway from yourself. πmat4 & operator*= (const double d)β scale yourself by thedoubled, in place,*thisreturned. πΈmat4 & operator/= (const double d)β divide yourself bydin place. (No cap, dividing by zero is its own whole situation, be normal about it.) πvec4 & operator[] (int i)β index in with anint i, get avec4 &you can actually mess with. π§const vec4 & operator[] (int i) constβ same index, but the const version, so you get aconst vec4 &and cannot touch. Respect the boundaries. β¨mat4 transpose () constβ hands you the transpose as a freshmat4. It'sconst, so it does not touch the original. Iconic behaviour honestly. πmat4 inverse ()β hands you the inverse. Notconst, so yeah, noted. πmat4 & apply (V_FCT_PTR fct)β runs the function pointerfctover it, returns*this. β
π Protected Attributes
vec4 v [4]β the actual storage: an array of 4vec4s. Protected, so it's for the class and its friends, not for randos. π
π« Friends
These get to see the protected stuff. Bestie privileges, fr fr.
mat4 operator- (const mat4 &a)β unary minus. Negatea, get amat4. πmat4 operator+ (const mat4 &a, const mat4 &b)βaplusb, brand newmat4. πmat4 operator- (const mat4 &a, const mat4 &b)βaminusb, brand newmat4. πΈmat4 operator* (const mat4 &a, const mat4 &b)β matrix times matrix. The main character of matrix ops. πmat4 operator* (const mat4 &a, const double d)β matrix times adouble, matrix on the left. β¨mat4 operator* (const double d, const mat4 &a)β matrix times adouble, but thedoubleis on the left. Order matters, bestie, always. π₯mat4 operator/ (const mat4 &a, const double d)β matrix divided by adouble. πint operator== (const mat4 &a, const mat4 &b)β equality check, gives you anint. π¦int operator!= (const mat4 &a, const mat4 &b)β the not-equal one, also anint. πstd::ostream & operator<< (std::ostream &s, mat4 &m)β streammout intos, getsback. βstd::istream & operator>> (std::istream &s, mat4 &m)β readmin froms, getsback. πvoid swap (mat4 &a, mat4 &b)β swapaandb. Returns nothing, just vibes. π«vec4 operator* (const mat4 &a, const vec4 &v)β matrix timesvec4, you get avec4. πvec3 operator* (const mat4 &a, const vec3 &v)β matrix timesvec3, you get avec3. Note the type change, that's the whole point. π§
π Author π
Generated automatically by Doxygen for MPQC from the source code. Like, nobody hand-wrote this, the robot did it. π€π
And that's the whole page, bestie!! π This was MPQC, Version 2.3.1, and yes it's the sc::mat4(3) page we've been yapping about this entire time. Go forth and multiply (matrices). Periodt. π
β¨π¦
π¦ where this page comes from
- fedora 43: mpqc-devel 2.3.1-65.fc43 Β· GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
- fedora 43: mpqc-devel 2.3.1-65.fc43 Β· GPL-2.0-or-later AND LicenseRef-Callaway-LGPLv2+
- ubuntu noble: libsc-doc 2.3.1-22build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms