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

Represents a mutable MatrixRange. More...

#include <MatrixRange.h>

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

Public Types

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

Public Member Functions

 MatrixRange ()
 Default constructs a size 0x0 range.
 
 MatrixRange (Number *in_begin, int in_I, int in_J, int in_LD)
 Constructs from components.
 
 MatrixRange (Number *in_begin, int in_I, int in_J)
 Constructs onto contiguous underlying storage of size I*J.
 
void write (OutputStream &out) const
 Writes to OutputStream. Layout compatible with Matrix's InputStream constructor.
 
std::pair< int, int > size () const
 Size inspector.
 
uint64_t n_words () const
 Storage requirements.
 
CMatrixRange< Number > add_const () const
 Adds "const" (C) qualifier, explicit conversion to CMatrixRange<Number>
 
 operator CMatrixRange< Number > () const
 Implicit conversion operator to CMatrixRange<Number>
 
MatrixRange< Number > window (int i0, int i1, int j0, int j1) const
 Returns this(i0:i1,j0:j1)
 
Array2< MatrixRange< Number > > windows (const intCRange &i, const intCRange &j) const
 Tile rows and columns using given sizes.
 
Number & operator() (int i, int j) const
 Random accessor.
 
Number & at (int i, int j) const
 Bounds checked random accessor.
 
MatrixRange< Number > row (int i) const
 Returns this(i,:)
 
MatrixRange< Number > rows (int i0, int i1) const
 Returns this(i0:i1,:)
 
MatrixRange< Number > top (int i) const
 Returns the i topmost rows, this(0:i,:)
 
MatrixRange< Number > cut_top (int i) const
 Cuts the i topmost rows, returns this(i:I,:)
 
Pair split_top (int i) const
 Splits by rows, returns [this->top(i), this->cut_top(i)].
 
MatrixRange< Number > bottom (int i) const
 Returns the i bottommost rows, this(I-i:I,:)
 
MatrixRange< Number > cut_bottom (int i) const
 Cuts the i bottommost rows, returns this(0:I-i,:)
 
Pair split_bottom (int i) const
 Splits by rows, returns [this->cut_bottom(i), this->bottom(i)].
 
Array1< MatrixRange< Number > > rows (const intCRange &i) const
 Returns {this.rows(0:i0,:), this.rows(i0:i0+i1,:), ...}, tiling by rows.
 
MatrixRange< Number > column (int j) const
 Returns this(:,j)
 
MatrixRange< Number > columns (int j0, int j1) const
 Returns this(:,j0:j1)
 
MatrixRange< Number > left (int j) const
 Returns the j leftmost columns, this(:,0:j)
 
MatrixRange< Number > cut_left (int j) const
 Cuts the j leftmost columns, returns this(:,j:J)
 
Pair split_left (int j) const
 Splits by columns, returns [this->left(j), this->cut_left(j)].
 
MatrixRange< Number > right (int j) const
 Returns the j rightmost columns, this(:,J-j:J)
 
MatrixRange< Number > cut_right (int j) const
 Cuts the j rightmost columns, returns this(:,0:J-j)
 
Pair split_right (int j) const
 Splits by columns, returns [this->cut_right(j), this->right(j)].
 
Array1< MatrixRange< Number > > columns (const intCRange &j) const
 Tile columns using given sizes. Returns {this.columns(:,0:j0), this.columns(:,j0:j0+i1), ...}.
 
VectorRange< Number > vector (int j) const
 Returns the j'th column as a VectorRange.
 
void swap (const MatrixRange< Number > &that) const
 Swaps the contents of *this Range with another Range of same size.
 
template<class Functor >
void transform (const Functor &f) const
 Overwrites every A(i,j) in this MatrixRange with f(A(i,j)).
 
template<class Functor >
void transform_triangle (const Functor &f, char uplo) const
 Overwrites every A(i,j) in the 'U'pper or 'L'ower triangle of this MatrixRange with f(A(i,j)).
 
template<class Functor >
void transform_diagonal (const Functor &f) const
 Overwrites every A(n,n) on the diagonal of this MatrixRange with f(A(n,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 CMatrixRange< Number > &that) const
 Assigns the values in *this with the values in that.
 
void assign (const CMatrixRange< Number > &that, char op) const
 Assigns the values in *this with the values in that.
 
void assign (const Expression< 2, Number > &that) const
 Assigns the values in *this with the values in that.
 
void operator+= (const CMatrixRange< Number > &that) const
 Adds this += that.
 
void operator+= (const Expression< 2, Number > &that) const
 Adds this += that.
 
void operator-= (const CMatrixRange< Number > &that) const
 Subtracts this -= that.
 
void operator-= (const Expression< 2, Number > &that) const
 Subtracts this -= that.
 

Public Attributes

Number * begin
 ---------— Data members, all public ----------------—
 
int I
 ---------— Data members, all public ----------------—
 
int J
 ---------— Data members, all public ----------------—
 
int LD
 ---------— Data members, all public ----------------—
 

Detailed Description

template<class Number>
class myra::MatrixRange< Number >

Represents a mutable MatrixRange.


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