std::gslice(3cxx)

🌸 NAME 🌸

std::gslice β€” a class that defines a multi-dimensional subset of an array. Welcome to the std::gslice(3cxx) page, bestie; this is libstdc++’s manual entry and we’re gonna get you comfy with it. πŸ’…

✨ SYNOPSIS ✨

okay so first, grab the header:

#include <valarray>

πŸ’– Public Member Functions πŸ’–

  • gslice () β€” Construct an empty slice. ✨
  • gslice (const gslice &) β€” Copy constructor. 🫢
  • gslice (size_t __o, const valarray< size_t > &__l, const valarray< size_t > &__s) β€” Construct a slice. πŸŽ€
  • ~gslice () β€” Destructor. πŸ’€
  • gslice & operator= (const gslice &) β€” Assignment operator. πŸ’…
  • valarray< size_t > size () const β€” Return array of sizes of slice dimensions. 🌈
  • size_t start () const β€” Return array offset of first slice element. ⭐
  • valarray< size_t > stride () const β€” Return array of array strides for each dimension. πŸ¦‹

🫢 Friends 🫢

  • template<typename _Tp > class valarray β€” that’s the friend in the building, no cap. πŸ’œ

🌈 Detailed Description 🌈

okay so std::gslice is a class that defines a multi-dimensional subset of an array. The slice class represents a multi-dimensional subset of an array, and it’s specified by three parameter sets: start offset, size array, and stride array. 🫢

The start offset is the index of the first element of the array that’s part of the subset. The size and stride array describe each dimension of the slice. Size is the number of elements in that dimension, and stride is the distance in the array between successive elements in that dimension. Each dimension’s size and stride is taken to begin at an array element described by the previous dimension. The size array and stride array must be the same size β€” that’s a hard requirement, bestie. πŸ’€

For example, if you have:

offset==3, stride[0]==11, size[1]==3, stride[1]==3

then:

slice[0,0]==array[3], slice[0,1]==array[6], slice[0,2]==array[9], slice[1,0]==array[14], slice[1,1]==array[17], slice[1,2]==array[20].

πŸ‘‘ Author πŸ‘‘

Generated automatically by Doxygen for libstdc++ from the source code. πŸ€–βœ¨


that’s the whole vibe check, bestie πŸŽ€ the footer credits libstdc++ as the source and repeats the std::gslice(3cxx) manual name; there’s no date listed in this footer, so no birthday info, just source/manual-name energy. πŸ’œ

πŸ“¦ where this page comes from