Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

NRMat< T > Class Template Reference

#include <nrutil_mtl.h>

List of all members.

Public Member Functions

 NRMat ()
 NRMat (int n, int m)
 NRMat (const T &a, int n, int m)
 NRMat (const T *a, int n, int m)
 NRMat (Matrix &rhs)
 NRMat (const NRMat &rhs)
NRMatoperator= (const NRMat &rhs)
Matrix::OneD operator[] (const int i) const
int nrows () const
int ncols () const
 operator Matrix () const
 ~NRMat ()
 NRMat ()
 NRMat (int n, int m)
 NRMat (const T &a, int n, int m)
 NRMat (const T *a, int n, int m)
 NRMat (const NRMat &rhs)
NRMatoperator= (const NRMat &rhs)
NRMatoperator= (const T &a)
T * operator[] (const int i)
const T * operator[] (const int i) const
int nrows () const
int ncols () const
 ~NRMat ()
 NRMat ()
 NRMat (int n, int m)
 NRMat (const T &a, int n, int m)
 NRMat (const T *a, int n, int m)
 NRMat (TNT::Matrix< T > &rhs)
 NRMat (const NRMat &rhs)
NRMatoperator= (const NRMat &rhs)
NRMatoperator= (const T &rhs)
T * operator[] (const int i) const
int nrows () const
int ncols () const
 operator TNT::Matrix () const
 ~NRMat ()
 NRMat ()
 NRMat (int n, int m)
 NRMat (const T &a, int n, int m)
 NRMat (const T *a, int n, int m)
 NRMat (const NRMat &rhs)
NRMatoperator= (const NRMat &rhs)
NRMatoperator= (const T &a)
T * operator[] (const int i)
const T * operator[] (const int i) const
int nrows () const
int ncols () const
 ~NRMat ()

Protected Attributes

Matrix mymat
Matrixmyref

Private Types

typedef matrix< T, rectangle<
>, dense<>, row_major >::type 
Matrix

Private Attributes

int nn
int mm
T ** v
TNT::Matrix< T > mymat
TNT::Matrix< T > & myref
T ** v

template<class T>
class NRMat< T >


Member Typedef Documentation

template<class T>
typedef matrix< T, rectangle<>, dense<>, row_major>::type NRMat< T >::Matrix [private]
 

Definition at line 127 of file nrutil_mtl.h.


Constructor & Destructor Documentation

template<class T>
NRMat< T >::NRMat  )  [inline]
 

Reimplemented in NRMat< bool >.

Definition at line 132 of file nrutil_mtl.h.

00132 : mymat(), myref(mymat) {}

template<class T>
NRMat< T >::NRMat int  n,
int  m
[inline]
 

Reimplemented in NRMat< bool >.

Definition at line 133 of file nrutil_mtl.h.

00133 : mymat(n,m), myref(mymat) {}

template<class T>
NRMat< T >::NRMat const T &  a,
int  n,
int  m
[inline]
 

Definition at line 134 of file nrutil_mtl.h.

00134                                         : mymat(n,m), myref(mymat) {
00135                 for (int i=0; i< n; i++)
00136                         for (int j=0; j<m; j++)
00137                                 mymat[i][j] = a;}

template<class T>
NRMat< T >::NRMat const T *  a,
int  n,
int  m
[inline]
 

Definition at line 138 of file nrutil_mtl.h.

00138                                         : mymat(n,m), myref(mymat) {
00139                 for (int i=0; i< n; i++)
00140                         for (int j=0; j<m; j++)
00141                                 mymat[i][j] = *a++;}

template<class T>
NRMat< T >::NRMat Matrix rhs  )  [inline]
 

template<class T>
NRMat< T >::NRMat const NRMat< T > &  rhs  )  [inline]
 

Definition at line 143 of file nrutil_mtl.h.

00143                                 :
00144                 mymat(rhs.myref.nrows(),rhs.myref.ncols()), myref(mymat)
00145                 {copy(rhs.myref,myref);}

template<class T>
NRMat< T >::~NRMat  )  [inline]
 

Definition at line 159 of file nrutil_mtl.h.

00159 {}

template<class T>
NRMat< T >::NRMat  ) 
 

Reimplemented in NRMat< bool >.

template<class T>
NRMat< T >::NRMat int  n,
int  m
 

Reimplemented in NRMat< bool >.

template<class T>
NRMat< T >::NRMat const T &  a,
int  n,
int  m
 

template<class T>
NRMat< T >::NRMat const T *  a,
int  n,
int  m
 

template<class T>
NRMat< T >::NRMat const NRMat< T > &  rhs  ) 
 

template<class T>
NRMat< T >::~NRMat  ) 
 

template<class T>
NRMat< T >::NRMat  )  [inline]
 

Reimplemented in NRMat< bool >.

Definition at line 108 of file nrutil_tnt.h.

00108 : mymat(), myref(mymat) {}

template<class T>
NRMat< T >::NRMat int  n,
int  m
[inline]
 

Reimplemented in NRMat< bool >.

Definition at line 109 of file nrutil_tnt.h.

00109 : mymat(n,m), myref(mymat) {}

template<class T>
NRMat< T >::NRMat const T &  a,
int  n,
int  m
[inline]
 

Definition at line 110 of file nrutil_tnt.h.

00110 : mymat(n,m,a), myref(mymat) {}

template<class T>
NRMat< T >::NRMat const T *  a,
int  n,
int  m
[inline]
 

Definition at line 112 of file nrutil_tnt.h.

00112 : mymat(n,m,a), myref(mymat) {}

template<class T>
NRMat< T >::NRMat TNT::Matrix< T > &  rhs  )  [inline]
 

template<class T>
NRMat< T >::NRMat const NRMat< T > &  rhs  )  [inline]
 

Definition at line 116 of file nrutil_tnt.h.

00116 : mymat(rhs.myref), myref(mymat) {}

template<class T>
NRMat< T >::~NRMat  )  [inline]
 

Definition at line 129 of file nrutil_tnt.h.

00129 {}

template<class T>
NRMat< T >::NRMat  ) 
 

Reimplemented in NRMat< bool >.

template<class T>
NRMat< T >::NRMat int  n,
int  m
 

Reimplemented in NRMat< bool >.

template<class T>
NRMat< T >::NRMat const T &  a,
int  n,
int  m
 

template<class T>
NRMat< T >::NRMat const T *  a,
int  n,
int  m
 

template<class T>
NRMat< T >::NRMat const NRMat< T > &  rhs  ) 
 

template<class T>
NRMat< T >::~NRMat  ) 
 


Member Function Documentation

template<class T>
int NRMat< T >::ncols  )  const [inline]
 

template<class T>
int NRMat< T >::ncols  )  const [inline]
 

Definition at line 126 of file nrutil_tnt.h.

00126 {return myref.num_cols();}

template<class T>
int NRMat< T >::ncols  )  const [inline]
 

template<class T>
int NRMat< T >::ncols  )  const [inline]
 

Definition at line 157 of file nrutil_mtl.h.

Referenced by NR::gaussj(), and NRMat< int >::operator=().

00157 {return myref.ncols();}

template<class T>
int NRMat< T >::nrows  )  const [inline]
 

template<class T>
int NRMat< T >::nrows  )  const [inline]
 

Definition at line 125 of file nrutil_tnt.h.

00125 {return myref.num_rows();}

template<class T>
int NRMat< T >::nrows  )  const [inline]
 

template<class T>
int NRMat< T >::nrows  )  const [inline]
 

Definition at line 156 of file nrutil_mtl.h.

Referenced by NR::gaussj(), and NRMat< int >::operator=().

00156 {return myref.nrows();}

template<class T>
NRMat< T >::operator Matrix  )  const [inline]
 

Definition at line 158 of file nrutil_mtl.h.

00158 {return myref;}

template<class T>
NRMat< T >::operator TNT::Matrix  )  const [inline]
 

Definition at line 127 of file nrutil_tnt.h.

00127 {return myref;}

template<class T>
NRMat& NRMat< T >::operator= const T &  a  ) 
 

template<class T>
NRMat& NRMat< T >::operator= const NRMat< T > &  rhs  ) 
 

template<class T>
NRMat& NRMat< T >::operator= const T &  rhs  )  [inline]
 

Definition at line 120 of file nrutil_tnt.h.

00120 { mymat=rhs; return *this;}

template<class T>
NRMat& NRMat< T >::operator= const NRMat< T > &  rhs  )  [inline]
 

Definition at line 118 of file nrutil_tnt.h.

00118 { myref=rhs.myref; return *this;}

template<class T>
NRMat< T > & NRMat< T >::operator= const T &  a  ) 
 

Definition at line 254 of file nrutil_nr.h.

References NRMat< T >::v.

00255 {
00256   for (int i=0; i< nn; i++)
00257     for (int j=0; j<mm; j++)
00258       v[i][j] = a;
00259   return *this;
00260 }

template<class T>
NRMat& NRMat< T >::operator= const NRMat< T > &  rhs  ) 
 

template<class T>
NRMat< T > & NRMat< T >::operator= const NRMat< T > &  rhs  )  [inline]
 

Definition at line 146 of file nrutil_mtl.h.

00146                                                   {
00147                 if (myref.nrows() != rhs.myref.nrows() && myref.ncols() !=
00148                         rhs.myref.ncols()) {
00149                                 cerr << "assignment with incompatible matrix sizes\n";
00150                                 abort();
00151                 }
00152                 copy(rhs.myref,myref); return *this;
00153         }

template<class T>
const T* NRMat< T >::operator[] const int  i  )  const [inline]
 

template<class T>
T* NRMat< T >::operator[] const int  i  )  [inline]
 

template<class T>
T* NRMat< T >::operator[] const int  i  )  const [inline]
 

Definition at line 122 of file nrutil_tnt.h.

00122 {return myref[i];}

template<class T>
const T* NRMat< T >::operator[] const int  i  )  const [inline]
 

template<class T>
T * NRMat< T >::operator[] const int  i  )  [inline]
 

Definition at line 263 of file nrutil_nr.h.

References NRMat< T >::v.

00263                                                               : pointer to row i
00264 {
00265   return v[i];
00266 }

template<class T>
const T * NRMat< T >::operator[] const int  i  )  const [inline]
 

Definition at line 154 of file nrutil_mtl.h.

00154 {return myref[i];}


Member Data Documentation

template<class T>
int NRMat< T >::mm [private]
 

Definition at line 67 of file nrutil_val.h.

template<class T>
TNT::Matrix<T> NRMat< T >::mymat [private]
 

Definition at line 105 of file nrutil_tnt.h.

template<class T>
Matrix NRMat< T >::mymat [protected]
 

Definition at line 129 of file nrutil_mtl.h.

template<class T>
TNT::Matrix<T>& NRMat< T >::myref [private]
 

Definition at line 106 of file nrutil_tnt.h.

template<class T>
Matrix& NRMat< T >::myref [protected]
 

Definition at line 130 of file nrutil_mtl.h.

Referenced by NRMat< int >::NRMat(), and NRMat< int >::operator=().

template<class T>
int NRMat< T >::nn [private]
 

Definition at line 66 of file nrutil_val.h.

template<class T>
T** NRMat< T >::v [private]
 

Definition at line 68 of file nrutil_val.h.

template<class T>
T** NRMat< T >::v [private]
 

Definition at line 163 of file nrutil_nr.h.

Referenced by NRMat< T >::operator=(), and NRMat< T >::operator[]().


The documentation for this class was generated from the following files:
Generated on Thu Nov 1 11:59:43 2007 for loon by  doxygen 1.3.9.1