sc::SCVectorSimpleBlock(3)

πŸ“¦
version 2.3.1 Β· 5 versions
, in ubuntu jammy

πŸ’… 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 a StateIn. it's the "come back to life" CTOR, iykyk.
  • void save_data_state(StateOut &) β€” save the base classes (with save_data_state) and the members, in the exact same order that the StateIn CTOR 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 istart
  • int iend
  • double * 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