sc::SCVector3(3)

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

🌸 sc::SCVector3 🌸 β€” Library Functions Manual

okay so bestie, welcome to sc::SCVector3 πŸ’– it's a 3D vector class from MPQC, and this whole page is basically one giant SYNOPSIS flex. No long DESCRIPTION section, no vibes essay β€” just the full roster of constructors, operators and accessors, and we're gonna read every single one together. grab a strawberry πŸ“, hydrate, and let's go.


✨ SYNOPSIS ✨

πŸ’… Public Member Functions

  • SCVector3 (const double p[3]) β€” build one straight out of a three-element double array. that's it, that's the constructor.
  • SCVector3 (double d) β€” one double in, vector out.
  • SCVector3 (double x, double y, double z) β€” the classic: three coords, one vector. main character energy πŸ‘‘
  • SCVector3 (const SCVector3 &p) β€” copy constructor, copying a SCVector3 from another SCVector3.
  • SCVector3 (const RefSCVector &) β€” constructor taking a const RefSCVector &. no, the parameter has no name, that's just how it's written, don't @ me πŸ’€
  • SCVector3 (const Ref< KeyVal > &) β€” constructor taking a const Ref< KeyVal > &. also unnamed. iconic of them.
  • void normalize () β€” the normalize call. it does the normalize thing, bestie.
  • SCVector3 operator- () β€” unary minus, hands you back an SCVector3.
  • SCVector3 operator* (double) const β€” multiply by a double, get an SCVector3 back. const-qualified, so it behaves. πŸŽ€
  • void operator= (const double *x) β€” assignment from a const double * named x.
  • void operator= (const SCVector3 &x) β€” assignment from another SCVector3 named x.
  • void operator= (double d) β€” assignment from a plain double named d.
  • void operator-= (const SCVector3 &v) β€” subtract-and-assign, other vector is v.
  • void operator+= (const SCVector3 &v) β€” add-and-assign, other vector is v.
  • void operator*= (double m) β€” multiply-and-assign by m.
  • SCVector3 operator+ (const SCVector3 &v) const β€” vector plus vector, returns a fresh SCVector3, and it's const so it won't touch anything. 🫢
  • SCVector3 operator- (const SCVector3 &v) const β€” vector minus vector, also const, also returns an SCVector3.
  • double dot (const SCVector3 &v) const β€” the dot one. takes a const SCVector3 &v, gives you a double. the name is literally the description, iykyk.
  • SCVector3 cross (const SCVector3 &) const β€” the cross one. takes an unnamed const SCVector3 &, returns an SCVector3.
  • SCVector3 perp_unit (const SCVector3 &) const β€” perp_unit, taking an unnamed const SCVector3 &, returning an SCVector3. no cap.
  • void spherical_coord (double theta, double phi, double r) β€” sets spherical coords from theta, phi and r. note the order: theta, phi, r. don't flip it bestie 😭
  • void spherical_to_cartesian (SCVector3 &cart) const β€” converts to cartesian, dropping the result into the SCVector3 &cart you pass in. const method, so it's not messing with itself.
  • double maxabs () const β€” maxabs, returns a double.
  • double dist (const SCVector3 &) const β€” distance to another (unnamed) SCVector3, returns a double.
  • void rotate (double theta, SCVector3 &v) β€” rotate by theta with an SCVector3 &v along for the ride.
  • double norm () const β€” norm, returns a double. we love a const method πŸ’œ
  • double & elem (int xyz) β€” grab an element by index xyz, and you get a double & back. a real reference. handle with care.
  • const double & elem (int xyz) const β€” the const overload: index xyz, const double & back. no touching.
  • double & operator[] (int i) β€” bracket access with index i, returns double &. slay.
  • const double & operator[] (int i) const β€” const bracket access, const double & back.
  • double & operator() (int i) β€” call-operator access with index i, returns double &.
  • const double & operator() (int i) const β€” const call-operator access, const double & back.
  • const double * data () const β€” hands you a const double * to the underlying data. read-only situation.
  • double * data () β€” the non-const data (), hands you a plain double *. yes bestie, that's a writable pointer. be normal about it πŸ™ˆ
  • double & x () β€” reference to x.
  • double & y () β€” reference to y.
  • double & z () β€” reference to z.
  • const double & x () const β€” const reference to x.
  • const double & y () const β€” const reference to y.
  • const double & z () const β€” const reference to z.
  • double & r () β€” reference to r.
  • double & theta () β€” reference to theta.
  • double & phi () β€” reference to phi.
  • const double & r () const β€” const reference to r.
  • const double & theta () const β€” const reference to theta.
  • const double & phi () const β€” const reference to phi.
  • void print (std::ostream &=ExEnv::out0()) const β€” print it out, with the stream defaulting to ExEnv::out0(). note the &= in the signature, that's exactly how it's written, copy it character for character or perish πŸ’…
every single one of these is const-qualified or not exactly as listed β€” the const-ness is part of the contract, so don't go assuming you can mutate through the const ones. nope. not today. ✨

🫢 Friends

  • class SCMatrix3 β€” yes, SCMatrix3 is a friend. the friendship is canon, it's right there in the synopsis. 🌈

πŸ‘‘ Author

Generated automatically by Doxygen for MPQC from the source code. not a human, just a little robot that reads headers and writes manpages 🧚


and that's the whole page bestie, we ate and left no crumbs πŸ’… this was sc::SCVector3(3) from the MPQC Library Functions Manual, Version 2.3.1 β€” go forth and vector responsibly πŸ¦‹β­

πŸ“¦ where this page comes from