|
MyraMath
|
Represents a mutable intRange. More...
#include <intRange.h>
Public Types | |
| typedef std::pair< intRange, intRange > | Pair |
Public Member Functions | |
| intRange () | |
| Default constructs a size 0 range. | |
| intRange (int *in_begin, int in_N) | |
| Constructs from components. | |
| intRange (std::vector< int > &v) | |
| Constructs range over existing std::vector. | |
| void | write (OutputStream &out) const |
| Writes to OutputStream. Layout compatible with std::vector<int>'s InputStream reader. | |
| int | size () const |
| Size inspector. | |
| int | n_words () const |
| Storage requirements. | |
| intCRange | add_const () const |
| Adds "const" (C) qualifier, explicit conversion to intCRange. | |
| operator intCRange () const | |
| Implicit conversion operator to intCRange. | |
| intRange | window (int n0, int n1) const |
| Returns this(n0:n1) | |
| Array1< intRange > | windows (const intCRange &n) const |
| Returns multiple windows using given sizes. | |
| int & | operator() (int n) const |
| Random accessor. | |
| int & | operator[] (int n) const |
| int & | at (int n) const |
| Bounds checked random accessor. | |
| intRange | first (int n) const |
| Returns the first n entries, this(0:n) | |
| intRange | cut_first (int n) const |
| Cuts the first n entries, returns this(n:N) | |
| Pair | split_first (int n) const |
| Splits this range, returns [this->first(n), this->cut_first(n)]. | |
| intRange | last (int n) const |
| Returns the last n entries, this(N-n:N) | |
| intRange | cut_last (int n) const |
| Cuts the last n entires, returns this (0:N-n) | |
| Pair | split_last (int n) const |
| Splits this range, returns [this->cut_last(n), this->last(n)]. | |
| std::vector< int > | make_vector () const |
| Deep copy into a std::vector. | |
| template<class Functor > | |
| void | transform (const Functor &f) const |
| Overwrites every x(n) in this intRange with f(x(n)). | |
| void | assign (const intCRange &that) const |
| Assigns the values in *this with the values in that. | |
| void | zero () const |
| Assigns zero to every entry. | |
Public Attributes | |
| int * | begin |
| ---------— Data members, all public ----------------— | |
| int | N |
| ---------— Data members, all public ----------------— | |
Represents a mutable intRange.
1.8.13