MyraMath
Public Types | Public Member Functions | List of all members
myra::VectorRange< Number > Class Template Reference

Represents a mutable VectorRange. More...

#include <VectorRange.h>

Collaboration diagram for myra::VectorRange< Number >:
[legend]

Public Types

typedef std::pair< VectorRange< Number >, VectorRange< Number > > Pair
 

Public Member Functions

 VectorRange ()
 Default constructs a size 0 range.
 
 VectorRange (Number *in_begin, int in_N)
 Constructs from components.
 
void write (OutputStream &out) const
 Writes to OutputStream. Layout compatible with Vector's InputStream constructor.
 
int size () const
 Size inspector.
 
int n_words () const
 Storage requirements.
 
CVectorRange< Number > add_const () const
 Adds "const" (C) qualifier, explicit conversion to CVectorRange<Number>
 
 operator CVectorRange< Number > () const
 Implicit conversion operator to CVectorRange<Number>
 
VectorRange< Number > window (int n0, int n1) const
 Returns this(n0:n1)
 
Array1< VectorRange< Number > > windows (const intCRange &n) const
 Returns multiple windows using given sizes.
 
MatrixRange< Number > column () const
 Constructs an Nx1 column-shaped MatrixRange from *this.
 
MatrixRange< Number > row () const
 Constructs a 1xN row-shaped MatrixRange from *this.
 
Number & operator() (int n) const
 Random accessor.
 
Number & operator[] (int n) const
 
Number & at (int n) const
 Bounds checked random accessor.
 
VectorRange< Number > first (int n) const
 Returns the first n entries, this(0:n)
 
VectorRange< Number > 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)].
 
VectorRange< Number > last (int n) const
 Returns the last n entries, this(N-n:N)
 
VectorRange< Number > 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)].
 
template<class Functor >
void transform (const Functor &f) const
 Overwrites every x(n) in this VectorRange with f(x(n)).
 
void operator*= (Number alpha) const
 Scales this *= alpha.
 
void operator/= (Number alpha) const
 Scales this /= alpha.
 
void zero () const
 Assigns zero to every entry.
 
void assign (const CVectorRange< Number > &that) const
 Assigns the values in *this with the values in that.
 
void assign (const Expression< 1, Number > &that) const
 Assigns the values in *this with the values in that.
 
void operator+= (const CVectorRange< Number > &that) const
 Adds this += that.
 
void operator+= (const Expression< 1, Number > &that) const
 Adds this += that.
 
void operator-= (const CVectorRange< Number > &that) const
 Subtracts this -= that.
 
void operator-= (const Expression< 1, Number > &that) const
 Subtracts this -= that.
 

Public Attributes

Number * begin
 ---------— Data members, all public ----------------—
 
int N
 ---------— Data members, all public ----------------—
 

Detailed Description

template<class Number>
class myra::VectorRange< Number >

Represents a mutable VectorRange.


The documentation for this class was generated from the following files: