sc::SCVector(3)
๐ธ sc::SCVector(3) โ MPQC ๐ธ
okay so bestie, you're looking at the manual page for sc::SCVector from MPQC, and it's literally the blueprint for double valued vectors. think of it as the main character energy that all the other vector classes inherit from. no cap, this is important stuff ๐
โจ
โจ NAME โจ
sc::SCVector โ the abstract base class for double valued vectors. yeah, it's abstract, so you can't just instantiate it directly, but it's the blueprint that makes everything else work. it's giving foundation, it's giving template, it's giving "i'm the parent and you will respect me" ๐
๐ฆ SYNOPSIS ๐ฆ
so first, you gotta include the header, like:
#include <abstract.h>
and it inherits from sc::DescribedClass, which is cute. and it's inherited by sc::BlockedSCVector, sc::DistSCVector, sc::LocalSCVector, and sc::ReplSCVector โ so those are the actual implementations you'd use. the abstract one is just the vibe check ๐ซ
๐ Public Member Functions ๐
here's the whole group chat of member functions, bestie. every single one, no skips:
SCVector (const RefSCDimension &, SCMatrixKit *)โ the constructor, duh. takes aRefSCDimensionand anSCMatrixKit*and sets up your vector.virtual void save (StateOut &)โ save this in an implementation independent way. it's giving "i need to remember myself" ๐พvirtual void restore (StateIn &)โ and this one brings it back. the yin to save's yang.Ref< SCMatrixKit > kit () constโ returns theSCMatrixKitthat was used to create this object. like, where did you come from, king?virtual SCVector * copy ()โ returns a vector with the same dimension and same elements. a literal clone, but make it fashion ๐virtual SCVector * clone ()โ returns a vector with the same dimension but uninitialized memory. so it's shaped the same but empty inside, like my brain before coffee ๐ญint n () constโ returns the length of the vector. the number of elements, the count, the tea โvirtual double maxabs () constโ returns the maximum absolute value element. the biggest vibe in the vector.virtual void normalize ()โ normalizes this vector. makes it all neat and tidy, slay โจvirtual void randomize ()โ assigns each element to a random number between -1 and 1. chaos mode activated ๐ฅvoid assign (double val)โ assigns all elements of this toval. every single one gets the same value.void assign (const double *v)โ assigns elementitov[i]for alli. copy-paste from an array, basically.void assign (SCVector *v)โ makes this have the same elements asv. and bestie, the dimensions must match, okay? no funny business ๐ซvirtual void assign_val (double val)โ this is overridden to implement the assign functions. so it's the behind-the-scenes queen.virtual void assign_p (const double *v)โ like assign but with a pointer. same energy.virtual void assign_v (SCVector *v)โ assign from another vector. the classic.virtual void convert (double *v) constโ assignsv[i]to elementifor alli. the reverse of assign, kind of.virtual void convert (SCVector *)โ converts anSCVectorof a different specialization to this specialization and possibly accumulates the data. it's giving "blend in with the crowd" ๐ซถvirtual void convert_accumulate (SCVector *)โ same but with accumulation. add it up, bestie.virtual void scale (double val)โ multiplies each element byval. glow up for numbers ๐RefSCDimension dim () constโ returns theRefSCDimensioncorresponding to this vector. the shape, the size, the dimension honey.virtual void set_element (int i, double val)=0โ set elementitoval. pure virtual, so you HAVE to implement it in your subclass. no skipping ๐virtual void accumulate_element (int, double)=0โ addvalto elementi. also pure virtual. also mandatory.virtual double get_element (int i) const =0โ return the value of elementi. you guessed it, pure virtual.void accumulate_product (SymmSCMatrix *m, SCVector *v)โ sum the result ofmtimesvinto this. math but make it cute ๐งฎvoid accumulate_product (SCMatrix *m, SCVector *v)โ same thing but with a regularSCMatrix. got options.virtual void accumulate_product_sv (SymmSCMatrix *m, SCVector *v)โ the symm version.svstands for symm-vector, iykyk.virtual void accumulate_product_rv (SCMatrix *m, SCVector *v)=0โ the regular matrix version, pure virtual. implement it or perish.virtual void accumulate (const SCVector *v)=0โ sumvinto this. pure virtual, bestie.virtual void accumulate (const SCMatrix *m)=0โ summinto this. one ofm's dimensions must be 1. important detail! don't forget.virtual double scalar_product (SCVector *)=0โ return the dot product. the classic vector move.virtual void element_op (const Ref< SCElementOp > &)=0โ perform the element operationopon each element of this. element-wise, periodt.virtual void element_op (const Ref< SCElementOp2 > &, SCVector *)=0โ binary element op. two vectors enter, one leaves.virtual void element_op (const Ref< SCElementOp3 > &, SCVector *, SCVector *)=0โ ternary element op. it's a whole party.void print (std::ostream &o=ExEnv::out0()) constโ print out the vector. show it off to the world ๐จ๏ธvoid print (const char *title=0, std::ostream &out=ExEnv::out0(), int=10) constโ print with a title and output stream and an int (probably precision). the deluxe version.virtual void vprint (const char *title=0, std::ostream &out=ExEnv::out0(), int=10) const =0โ the virtual print. pure virtual so subclasses can do their own thing.Ref< MessageGrp > messagegrp () constโ returns the message group used by the matrix kit. for all your parallel communication needs ๐กvirtual Ref< SCMatrixSubblockIter > local_blocks (SCMatrixSubblockIter::Access)=0โ returns iterators for the local (rapidly accessible) blocks used in this vector. only one iterator is allowed if it hasAccumorWriteaccess. multipleReaditerators are permitted. read the fine print, bestie ๐virtual Ref< SCMatrixSubblockIter > all_blocks (SCMatrixSubblockIter::Access)=0โ returns iterators for all the blocks used in this vector. the whole collection.
๐ Protected Attributes ๐
RefSCDimension dโ the dimension, protected. it's lowkey but important.Ref< SCMatrixKit > kit_โ the matrix kit, protected. the behind-the-scenes enabler.
๐ Additional Inherited Members ๐
there are additional inherited members from sc::DescribedClass, but they're not listed here. just know they exist and they're part of the family.
๐ Detailed Description ๐
okay so the SCVector class is the abstract base class for double valued vectors. periodt. that's the whole description. it's the foundation, the blueprint, the mother of all double vectors in MPQC. if you want a vector of doubles that does math and stuff, this is where it all begins ๐
๐ฅ Member Function Documentation ๐ฅ
void sc::SCVector::assign (SCVector * v) [inline]
so this inline function makes this have the same elements as v. but bestie, the dimensions must match. if they don't, it's a no-go. no cap, check your dims before you assign ๐จ
virtual Ref<SCMatrixSubblockIter> sc::SCVector::local_blocks (SCMatrixSubblockIter::Access) [pure virtual]
returns iterators for the local (rapidly accessible) blocks used in this vector. and here's the tea: only one iterator is allowed for a matrix if it has Accum or Write access. multiple Read iterators are permitted. so if you're reading, go wild, but if you're writing or accumulating, one at a time, bestie. don't be messy ๐
this is implemented in sc::BlockedSCVector, sc::ReplSCVector, sc::LocalSCVector, and sc::DistSCVector. so those are the ones that actually do the work.
๐ Author ๐
generated automatically by Doxygen for MPQC from the source code. so you know it's official, bestie. Doxygen is the real MVP for making these docs โจ
this page was brought to you by version 2.3.1, dated Sun Oct 4 2020 โ periodt, it's iconic, it's legendary, it's giving documentation royalty ๐๐๐
๐ฆ where this page comes from
- ubuntu jammy: libsc-doc 2.3.1-21
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms