sc::SCVectorSimpleBlock(3)
π sc::SCVectorSimpleBlock β from the MPQC manual, bestie
okay so this page is literally the glow-up guide to sc::SCVectorSimpleBlock, and it lives in the MPQC manual section 3, so you already know it's giving library-API energy. no cap, it's a whole little vibe. let's go β¨
πΈ NAME πΈ
sc::SCVectorSimpleBlock β the class that describes a piece of a vector. yes, a piece. like a slice, a chunk, a lil' segment of the bigger vector. it's giving "I'm just a block but I'm doing my best" π
β¨ SYNOPSIS β¨
#include <block.h>
Inherits sc::SCMatrixBlock. so it's part of the family, got the inheritance chain going, we love a nepo baby with actual skills π
π«Ά Public Member Functions
SCVectorSimpleBlock(int istart, int iend)β constructor, takes a start index and an end index. boom, block.SCVectorSimpleBlock(StateIn &)β the other constructor, this one restores from aStateIn. it's the "come back to life" CTOR, iykyk.void save_data_state(StateOut &)β save the base classes (withsave_data_state) and the members, in the exact same order that theStateInCTOR initializes them. order matters, bestie, don't play with it.SCMatrixBlock *deepcopy() constβ returns a copy of this. a whole clone. main character duplicating herself πvoid process(SCElementOp *)void process(SCElementOp2 *, SCMatrixBlock *)void process(SCElementOp3 *, SCMatrixBlock *, SCMatrixBlock *)β yep, three overloads, one for each flavor of element op. they said "we have options."double *dat()β returns a pointer to the block's data and the number of elements in the block. two-for-one, iconic.int ndat() constβ the number-of-elements half of that deal, on its own.
π§ Public Attributes
int istartint ienddouble * data
like, that's it. three public fields, just out in the open, no secrets, no gatekeeping π
π¦ Additional Inherited Members
(those live up in the parent class, sc::SCMatrixBlock, not our problem to relist here, but she's got them fr fr)
π Detailed Description π
The SCVectorSimpleBlock describes a piece of a vector. yes we said that already but the docs said it again so I said it again. consistency!! π
the following bit of code illustrates the data layout β this is the actual code from the page, copy it exactly, do not @ me:
fill(double *vector, SCVectorSimpleBlock &b) {
int i,offset=0;
for (i=b.istart; i<b.iend; i++,offset++) {
vector[i] = b.data[offset];
}
}
so like, offset starts at 0, i starts at b.istart, she walks i up to (but not including!) b.iend, and every step she copies b.data[offset] into vector[i]. offsets on one side, real indices on the other. the iend is exclusive β that's the whole vibe, careful with your fences π§
π Member Function Documentation π
β double* sc::SCVectorSimpleBlock::dat() [virtual]
return a pointer to the block's data and the number of elements in the block. π«Ά
β οΈ okay so heads up: some blocks cannot provide this information, and a runtime error will be generated if these members are called on those. not every block has the range, and that's on her. also, these routines are only used internally in the matrix library β so this is backstage stuff, not for the general public. π
Reimplemented from sc::SCMatrixBlock.
β SCMatrixBlock* sc::SCVectorSimpleBlock::deepcopy() const [virtual]
return of copy of this. (their words, not mine β they mean a copy π)
β οΈ a runtime error will be generated for blocks that cannot do a deepcopy. so like, don't assume every block can clone herself. and again: these routines are only used internally in the matrix library. internal use only bestie, no touching π«
Reimplemented from sc::SCMatrixBlock.
β void sc::SCVectorSimpleBlock::save_data_state(StateOut &) [virtual]
save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR initializes them. order. matters. periodt.
also, this must be implemented by the derived class if the class has data β so if you're subclassing and you've got data, you have to write this yourself, no skipping, it's giving responsibilities π₯
Reimplemented from sc::SCMatrixBlock.
π Author π
Generated automatically by Doxygen for MPQC from the source code. so nobody actually wrote this prose, a robot did, and honestly? she ate. π β¨
π and that's the whole page!! every flag, every function, every warning, all present and accounted for, nothing dropped, we do not lose information in this house π«Ά
okay love u, bye!! and remember: this was Version 2.3.1, dated Sun Oct 4 2020, page sc::SCVectorSimpleBlock(3) β go forth and index your vectors correctly πππ
π¦ 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