MyraMath
|
Represents a mutable DiagonalMatrixRange. More...
#include <DiagonalMatrixRange.h>
Public Types | |
typedef std::pair< DiagonalMatrixRange< Number >, DiagonalMatrixRange< Number > > | Pair |
Public Member Functions | |
DiagonalMatrixRange () | |
Default constructs a size 0 range. | |
DiagonalMatrixRange (Number *in_begin, int in_N) | |
Constructs from components. | |
void | write (OutputStream &out) const |
Writes to OutputStream. Layout compatible with DiagonalMatrix's InputStream constructor. | |
int | size () const |
Size inspector. | |
int | n_words () const |
Storage requirements. | |
const CDiagonalMatrixRange< Number > | add_const () const |
Adds "const" (C) qualifier, explicit conversion to CDiagonalMatrixRange<Number> | |
operator const CDiagonalMatrixRange< Number > () const | |
Implicit conversion operator to CDiagonalMatrixRange<Number> | |
const DiagonalMatrixRange< Number > | window (int n0, int n1) const |
Returns this(n0:n1) | |
const VectorRange< Number > | vector () const |
Constructs a VectorRange over *this. | |
Number & | operator() (int n) const |
Random accessor. | |
Number & | at (int n) const |
Bounds checked random accessor. | |
const DiagonalMatrixRange< Number > | first (int n) const |
Returns the first n entries, this(0:n) | |
const DiagonalMatrixRange< Number > | cut_first (int n) const |
Cuts the first n entries, returns this(n:N) | |
const Pair | split_first (int n) const |
Splits this range, returns [this->first(n), this->cut_first(n)]. | |
const DiagonalMatrixRange< Number > | last (int n) const |
Returns the last n entries, this(N-n:N) | |
const DiagonalMatrixRange< Number > | cut_last (int n) const |
Cuts the last n entries, returns this (0:N-n) | |
const 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 D(n) in this DiagonalMatrixRange with f(D(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. | |
Matrix< Number > | make_Matrix () const |
Accumulates *this onto a Matrix<Number> | |
void | make_Matrix (const MatrixRange< Number > &A) const |
Accumulates *this onto a Matrix<Number> | |
Vector< Number > | make_Vector () const |
Accumulates *this onto a Vector<Number>. | |
void | make_Vector (const VectorRange< Number > &A) const |
Accumulates *this onto a Vector<Number>. | |
void | assign (const CDiagonalMatrixRange< 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 CDiagonalMatrixRange< Number > &that) const |
Adds this += that. | |
void | operator+= (const Expression< 1, Number > &that) const |
Adds this += that. | |
void | operator-= (const CDiagonalMatrixRange< 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 ----------------— | |
Represents a mutable DiagonalMatrixRange.