Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Ref Template Class Reference

Ref is a reference to a value stored in a class Matrix. More...

#include <matrix.h>

List of all members.

Public Methods

conversion operators
A class for column oriented, sparse storage of a Matrix derived from base class Matrix<double>.

 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)


Detailed Description

template<class Tp> template class Ref

Ref is a reference to a value stored in a class Matrix.

Author(s):
rokrau
Date:
2000/11/21 17:03:07

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.


Member Function Documentation

template<classTp>
Ref<Tp>::operator Tp ( ) const [inline]
 

template<classTp>
Ref<Tp>::operator Tp * ( ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator= ( const Tp v ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator= ( const Ref< Tp > R ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator++ ( ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator-- ( ) const [inline]
 

template<classTp>
void Ref<Tp>::operator+= ( Tp v ) const [inline]
 

template<classTp>
void Ref<Tp>::operator-= ( Tp v ) const [inline]
 

template<classTp>
void Ref<Tp>::operator *= ( Tp v ) const [inline]
 

template<classTp>
void Ref<Tp>::operator/= ( Tp v ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator+ ( const Tp v ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator- ( const Tp v ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator * ( const Tp v ) const [inline]
 

template<classTp>
Tp Ref<Tp>::operator/ ( const Tp v ) const [inline]
 


Friends And Related Function Documentation

template<classTp>
class MatrixC [friend]
 

template<classTp>
class MatrixSP [friend]
 

template<classTp>
istream& operator>> ( istream & s,
Ref< Tp >& r ) [friend]
 

template<classTp>
ostream& operator>> ( ostream & s,
Ref< Tp >& r ) [friend]
 


The documentation for this class was generated from the following file:
Generated at Wed Nov 22 08:38:29 2000 for LinAl - a simple and efficient Matrix library - by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000