Main Page | Namespace List | Class List | File List | Class Members | File Members

ZMatrix Class Reference

#include <ZMatrix.h>

List of all members.

Public Member Functions

int dim1 ()
int dim2 ()
int size ()
complex< double > * array ()
void transpose ()
void allocate (int i, int j)
void deallocate ()
void operator= (const ZMatrix &rhs)
void operator= (const complex< double > C)
void operator= (const double C)
void operator *= (complex< double > C)
void operator/= (const complex< double > C)
 ZMatrix ()
 ZMatrix (int i, int j)
 ZMatrix (const ZMatrix &rhs)
 ~ZMatrix ()
complex< double > SumAll ()
complex< double > Trace ()
void setrow (int irow, ZVector &vector)
void setcol (int icol, const ZVector &vector)
void row_scale (int irow, complex< double > C)
complex< double > rowdotu (int irow, const ZVector &vector)
complex< double > rowdotc (int irow, const ZVector &vector)
complex< double > coldotu (int icol, const ZVector &vector)
complex< double > coldotc (int icol, const ZVector &vector)
void col_scale (int icol, complex< double > C)
complex< double > * row_pointer (int irow)
ZVector row (int irow)
complex< double > * col_pointer (int icol)
ZVector col (int icol)
complex< double > SumRow (const int irow)
complex< double > SumCol (const int icol)
ZMatrix operator+ (const ZMatrix &rhs)
ZMatrix operator- (const ZMatrix &rhs)
complex< double > & operator() (int i, int j)

Friends

ostream & operator<< (ostream &strm, const ZMatrix &rhs)


Detailed Description

A 2-dimensional template for making arrays. All of the memory allocation and deallocation details are dealt with by the class. Fortran allocation

Definition at line 43 of file ZMatrix.h.


Constructor & Destructor Documentation

ZMatrix::ZMatrix  )  [inline]
 

Creates an array.

Definition at line 229 of file ZMatrix.h.

ZMatrix::ZMatrix int  i,
int  j
[inline]
 

Creates an array and allocates memory.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.

Definition at line 239 of file ZMatrix.h.

References allocate().

ZMatrix::ZMatrix const ZMatrix rhs  )  [inline]
 

Creates an array and sets it equal to another array.

Parameters:
rhs array to set this array equal to.

Definition at line 248 of file ZMatrix.h.

References allocate(), F77_FUNC, n_1, n_2, and pArray.

ZMatrix::~ZMatrix  )  [inline]
 

Destroy's the array and cleans up the memory.

Definition at line 264 of file ZMatrix.h.

References deallocate().


Member Function Documentation

void ZMatrix::allocate int  i,
int  j
[inline]
 

Allocates memory for the array.

Parameters:
i size of the array's first dimension.
j size of the array's second dimension.

Definition at line 136 of file ZMatrix.h.

References deallocate().

Referenced by operator=(), and ZMatrix().

complex<double>* ZMatrix::array  )  [inline]
 

Gets a pointer to a col the array elements. The ordering of this array is NOT specified.

Definition at line 107 of file ZMatrix.h.

Referenced by zgemm(), zgemm_c_c(), zgemm_c_n(), zgemm_c_t(), zgemm_n_c(), zgemm_n_t(), zgemm_t_c(), zgemm_t_n(), zgemm_t_t(), zgemv(), zgemv_c(), and zgemv_t().

ZVector ZMatrix::col int  icol  )  [inline]
 

Get a copy 1D array of the i-th coloumn

Definition at line 528 of file ZMatrix.h.

complex<double>* ZMatrix::col_pointer int  icol  )  [inline]
 

Return a pointer to the coloumn icol

Definition at line 511 of file ZMatrix.h.

void ZMatrix::col_scale int  icol,
complex< double >  C
[inline]
 

Rescale a column

Definition at line 440 of file ZMatrix.h.

complex<double> ZMatrix::coldotc int  icol,
const ZVector vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 425 of file ZMatrix.h.

complex<double> ZMatrix::coldotu int  icol,
const ZVector vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 409 of file ZMatrix.h.

void ZMatrix::deallocate  )  [inline]
 

Deallocates memory for the array.

Definition at line 156 of file ZMatrix.h.

Referenced by allocate(), and ~ZMatrix().

int ZMatrix::dim1  )  [inline]
 

Gets the number of elements in the array's first dimension.

Returns:
number of elements in the array's first dimension.

Definition at line 87 of file ZMatrix.h.

Referenced by zgemm(), zgemm_c_c(), zgemm_c_n(), zgemm_c_t(), zgemm_n_c(), zgemm_n_t(), zgemm_t_c(), zgemm_t_n(), zgemm_t_t(), zgemv(), zgemv_c(), and zgemv_t().

int ZMatrix::dim2  )  [inline]
 

Gets the number of elements in the array's second dimension.

Returns:
number of elements in the array's second dimension.

Definition at line 94 of file ZMatrix.h.

Referenced by zgemm(), zgemm_c_c(), zgemm_c_n(), zgemm_c_t(), zgemm_n_c(), zgemm_n_t(), zgemm_t_c(), zgemm_t_n(), zgemm_t_t(), zgemv(), zgemv_c(), and zgemv_t().

void ZMatrix::operator *= complex< double >  C  )  [inline]
 

Scale all elements for C

Definition at line 207 of file ZMatrix.h.

References F77_FUNC.

complex<double>& ZMatrix::operator() int  i,
int  j
[inline]
 

Accesses element (i,j) of the array.

Definition at line 641 of file ZMatrix.h.

ZMatrix ZMatrix::operator+ const ZMatrix rhs  )  [inline]
 

Returns the sum of two matrices.

Definition at line 585 of file ZMatrix.h.

ZMatrix ZMatrix::operator- const ZMatrix rhs  )  [inline]
 

Returns the difference of two Matrices.

Definition at line 613 of file ZMatrix.h.

void ZMatrix::operator/= const complex< double >  C  )  [inline]
 

Sets this array equal to itself divided by a scalar value.

Definition at line 217 of file ZMatrix.h.

References dcmplx(), and F77_FUNC.

void ZMatrix::operator= const double  C  )  [inline]
 

Sets all of the elements in an array equal to the real value.

Definition at line 197 of file ZMatrix.h.

References dcmplx().

void ZMatrix::operator= const complex< double >  C  )  [inline]
 

Sets all of the elements in an array equal to the complex value.

Definition at line 188 of file ZMatrix.h.

void ZMatrix::operator= const ZMatrix rhs  )  [inline]
 

Sets two matrix equal.

Definition at line 173 of file ZMatrix.h.

References allocate(), F77_FUNC, n_1, n_2, and pArray.

ZVector ZMatrix::row int  irow  )  [inline]
 

Get a copy 1D array of the i-th row

Definition at line 491 of file ZMatrix.h.

Referenced by main().

complex<double>* ZMatrix::row_pointer int  irow  )  [inline]
 

complex<double> coldot(int icol, complex<double> *vector) { return F77_FUNC(ddot,DDOT)(&n_1,pArray+icol*n_1,&one,vector,&one); }

/** Return a pointer to the row irow

Definition at line 476 of file ZMatrix.h.

void ZMatrix::row_scale int  irow,
complex< double >  C
[inline]
 

void setcol(int icol,complex<double> *vector) { ifdef DEBUG if(icol>=n_2) { cerr << " ERROR! dimension array copying coloumn! " << endl; exit(1); } endif F77_FUNC(dcopy,DCOPY)(&n_1,vector,&one,pArray+icol*n_1,&one); }

/** Rescale a row

Definition at line 360 of file ZMatrix.h.

Referenced by main().

complex<double> ZMatrix::rowdotc int  irow,
const ZVector vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 393 of file ZMatrix.h.

complex<double> ZMatrix::rowdotu int  irow,
const ZVector vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 378 of file ZMatrix.h.

Referenced by main().

void ZMatrix::setcol int  icol,
const ZVector vector
[inline]
 

void setrow(int irow,complex<double> *vector,int lda) { F77_FUNC(dcopy,DCOPY)(&n_2,vector,&lda,pArray+irow,&n_1); }

/** Copy an 1D array into the i-th coloumn

Definition at line 329 of file ZMatrix.h.

Referenced by main().

void ZMatrix::setrow int  irow,
ZVector vector
[inline]
 

Copy an 1D array into the i-th row

Definition at line 296 of file ZMatrix.h.

References F77_FUNC, ZVector::n_1, and ZVector::pArray.

Referenced by main().

int ZMatrix::size  )  [inline]
 

Gets the total number of elements in the array.

Returns:
total number of elements in the array.

Definition at line 101 of file ZMatrix.h.

complex<double> ZMatrix::SumAll  )  [inline]
 

Sum all elements of the matrix

Definition at line 269 of file ZMatrix.h.

Referenced by main().

complex<double> ZMatrix::SumCol const int  icol  )  [inline]
 

Sum all elements of a Col the matrix

Definition at line 563 of file ZMatrix.h.

complex<double> ZMatrix::SumRow const int  irow  )  [inline]
 

Sum all elements of a Row the matrix

Definition at line 545 of file ZMatrix.h.

Referenced by main().

complex<double> ZMatrix::Trace  )  [inline]
 

Return the ZMatrix Trace

Definition at line 279 of file ZMatrix.h.

Referenced by main().

void ZMatrix::transpose  )  [inline]
 

Transpose the 2D matrix

Definition at line 113 of file ZMatrix.h.


Friends And Related Function Documentation

ostream& operator<< ostream &  strm,
const ZMatrix rhs
[friend]
 

Prints the array to a stream.

Definition at line 659 of file ZMatrix.h.


The documentation for this class was generated from the following file:
Generated on Wed Aug 16 19:03:50 2006 for MyLapack by  doxygen 1.4.4