Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Standard C++ Library Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

gslice

Module:  Standard C++ Library   Library:  Numerics


Does not inherit

Local Index

Members

Summary

A numeric array class used to represent a generalized slice from an array

Synopsis

#include <valarray>

namespace std {
 class gslice;
}

Description

gslice represents a generalized slice from an array. A generalized slice contains a starting index, a set of lengths, and a set of strides. The number of lengths and strides must be equal. Together the lengths and strides allow a slice from a multiple dimension array (with the dimension equal to the number of strides) to be represented on a one-dimensional valarray. The gslice maps a set of n indices (ij), where n is equal to the number of strides, to a single index k.

When applied to a valarray using the gslice subscript operator (see valarray), a gslice produces a gslice_array. The gslice_array class creates a view into the original valarray that is tailored to match parameters of the gslice. The elements in a gslice_array are references to the elements in the original array.

Interface

Constructors

gslice();
gslice(size_t start, const valarray<size_t>& length,
       const valarray<size_t>& stride);
gslice(const gslice&)

Accessors

size_t start() const;
valarray<size_t> size() const;
valarray<size_t> stride() const;

Example

See Also

valarray, slice_array, slice, gslice_array, mask_array, indirect_array

Standards Conformance

ISO/IEC 14882:1998 -- International Standard for Information Systems -- Programming Language C++, Section 26.3.6



Previous fileTop of DocumentContentsIndex pageNext file

Copyright (c) 1994-2006 Rogue Wave Software, a Quovadx Division.
Licensed under the Apache License, Version 2.0.
Contact Rogue Wave about documentation or support issues. You can also seek help from other developers through the Apache stdcxx community (see below).

For more information on the Rogue Wave Standard C++ Library under open source, see Section 1.2 of the user's guide.