#include <matrix.h>
Public Methods | |
conversion operators | |
operator Tp () const | |
operator Tp * () const | |
assignment operators | |
Tp | operator= (const Tp v) const |
Tp | operator= (const Ref<Tp> R) const |
algebraic operators | |
Tp | operator++ () const |
Tp | operator-- () const |
void | operator+= (Tp v) const |
void | operator-= (Tp v) const |
void | operator *= (Tp v) const |
void | operator/= (Tp v) const |
Tp | operator+ (const Tp v) const |
Tp | operator- (const Tp v) const |
Tp | operator * (const Tp v) const |
Tp | operator/ (const Tp v) const |
Friends | |
class | MatrixC< Tp > |
class | MatrixSP |
istream& | operator>> (istream& s, Ref<Tp>& r) |
ostream& | operator>> (ostream& s, Ref<Tp>& r) |
Ref is used to implement copy on write for operations on individual coefficients of the matrix. The basic idea behind this is, that Matrix operator() returns a Ref<T> object for which then an overloaded operator is called. The overloaded operator itself calls a Matrix method which ensures that a unique copy of the Matrix data is obtained before modification. Ref is not supposed to be public, therefore its constructor is private. It is impossible to create an instance of a Ref object from anywhere but a method of one of the Matrix classes. Unfortunately though Ref has to declare all classes derived from Matrix<Tp> as its friend.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|