sc::SCMatrix3(3)

πŸ“¦
version 2.3.1 Β· 4 versions
, in fedora 43, ubuntu noble

✨ NAME ✨

sc::SCMatrix3 β€” bestie it's a 3Γ—3 matrix class from the MPQC library (this is the Library Functions Manual page, page sc::SCMatrix3(3), in case u were wondering where u are πŸ’…)


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so here's the whole squad of public member functions, no gatekeeping:

SCMatrix3 (const SCMatrix3 &)
SCMatrix3 (const RefSCMatrix3 &)
SCMatrix3 (double x[9])
SCMatrix3 (const SCVector3 &p1, const SCVector3 &p2, const SCVector3 &p3)
SCMatrix3 & operator= (const SCMatrix3 &)
SCMatrix3 operator* (double) const
SCMatrix3 operator* (const SCMatrix3 &) const
SCVector3 operator* (const SCVector3 &v) const
SCMatrix3 operator+ (const SCMatrix3 &) const
SCMatrix3 operator- (const SCMatrix3 &) const
double & elem (int i, int j)
const double & elem (int i, int j) const
double & elem (int i)
const double & elem (int i) const
double & operator[] (int i)
const double & operator[] (int i) const
double & operator() (int i, int j)
const double & operator() (int i, int j) const
const double * data () const
void print (std::ostream &=ExEnv::out0()) const

πŸ’– DESCRIPTION πŸ’–

so like. it's sc::SCMatrix3. a 3Γ—3 matrix. that's the vibe. she's small, she's mighty, she's the main character of ur little corner of linear algebra 🌸


πŸ‘‘ PUBLIC MEMBER FUNCTIONS πŸ‘‘

the way that this class has SO many ways to be constructed and indexed... it's giving overachiever and honestly? we love that for her πŸ’œ

πŸŽ€ Constructors β€” pick ur fighter

  • SCMatrix3 (const SCMatrix3 &) β€” copy constructor bestie. makes a whole new SCMatrix3 that's a twin of an existing one. slay ✨
  • SCMatrix3 (const RefSCMatrix3 &) β€” builds one from a RefSCMatrix3. yes she can do that too.
  • SCMatrix3 (double x[9]) β€” feed her an array of double and she'll become a matrix. nine of them. that's the whole thing πŸ”₯
  • SCMatrix3 (const SCVector3 &p1, const SCVector3 &p2, const SCVector3 &p3) β€” three SCVector3s walk into a bar and out comes a SCMatrix3. iconic behavior honestly 🫢

🌈 Assignment

  • SCMatrix3 & operator= (const SCMatrix3 &) β€” the classic. takes another SCMatrix3 and copies it right on over. no cap πŸ’…

⭐ Math Time (the fun part)

  • SCMatrix3 operator* (double) const β€” scale her by a double, get a fresh SCMatrix3 back. math but make it cute.
  • SCMatrix3 operator* (const SCMatrix3 &) const β€” matrix times matrix. she said "i contain multitudes" and multiplied 🧚
  • SCVector3 operator* (const SCVector3 &v) const β€” matrix times SCVector3 v, and u get an SCVector3 back. transformation era πŸ’«
  • SCMatrix3 operator+ (const SCMatrix3 &) const β€” adding two SCMatrix3s together. wholesome.
  • SCMatrix3 operator- (const SCMatrix3 &) const β€” subtracting one SCMatrix3 from another. it's giving subtraction but make it personal 😭

πŸ“ Element Access β€” the many doors to the same room

not me realizing there are literally four different ways to grab an element. obsessed.

  • double & elem (int i, int j) β€” hand over i and j and get a mutable reference to that element. go off, change it, live ur truth πŸ’–
  • const double & elem (int i, int j) const β€” same i, j situation but read-only. look but don't touch bestie.
  • double & elem (int i) β€” just one index i, still a mutable reference. she's flexible like that.
  • const double & elem (int i) const β€” one index, read-only, no funny business.
  • double & operator[] (int i) β€” bracket notation, mutable reference. very coder-core of her.
  • const double & operator[] (int i) const β€” bracket notation but read-only. the const version said "i'm just here to look cute" πŸ’…
  • double & operator() (int i, int j) β€” call her like a function with i and j, get a mutable reference. function-call syntax in a matrix?? she contains multitudes fr fr.
  • const double & operator() (int i, int j) const β€” same call syntax, i and j, read-only. periodt.

πŸ¦„ Data + Output

  • const double * data () const β€” hands u a const double * pointing at the raw data. peek behind the curtain, but respectfully β€” it's const, so no editing πŸ™ˆ
  • void print (std::ostream &=ExEnv::out0()) const β€” prints her out. and yes, the stream argument defaults to ExEnv::out0() so if u don't pass one she'll just use that. queen of convenience πŸ‘‘

🌸 AUTHOR 🌸

Generated automatically by Doxygen for MPQC from the source code. (so if u have beef with the docs, take it up with Doxygen, not me 🫢)


that's the whole page bestie, every single member function accounted for, nothing skipped, nothing invented. iykyk πŸ’œ

and that's a wrap ✨ this was sc::SCMatrix3(3) from MPQC, Version 2.3.1 β€” stay iconic, stay const-correct, and go build urself a 3Γ—3 matrix πŸŽ€πŸ¦‹πŸ’…

πŸ“¦ where this page comes from