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

DMatrix Class Reference

#include <DMatrix.h>

List of all members.

Public Member Functions

int dim1 ()
int dim2 ()
int size ()
double * array ()
void transpose ()
void allocate (int i, int j)
void deallocate ()
void operator= (const DMatrix &rhs)
void operator= (const double C)
void operator *= (double C)
void operator/= (const double C)
 DMatrix ()
 DMatrix (int i, int j)
 DMatrix (const DMatrix &rhs)
 ~DMatrix ()
double SumAll ()
double Trace ()
void setrow (int irow, DVector &vector)
void setrow (int irow, double *vector)
void setrow (int irow, double *vector, int lda)
void setcol (int icol, const DVector &vector)
void setcol (int icol, double *vector)
void row_scale (int irow, double C)
double rowdot (int irow, const DVector &vector)
double coldot (int icol, const DVector &vector)
void col_scale (int icol, double C)
double rowdot (int irow, double *vector)
double coldot (int icol, double *vector)
double * row_pointer (int irow)
DVector row (int irow)
double * col_pointer (int icol)
DVector col (int icol)
double SumRow (const int irow)
double SumCol (const int icol)
DMatrix operator+ (const DMatrix &rhs)
DMatrix operator- (const DMatrix &rhs)
double & operator() (int i, int j)

Friends

ostream & operator<< (ostream &strm, const DMatrix &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 DMatrix.h.


Constructor & Destructor Documentation

DMatrix::DMatrix  )  [inline]
 

Creates an array.

Definition at line 220 of file DMatrix.h.

DMatrix::DMatrix 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 230 of file DMatrix.h.

References allocate().

DMatrix::DMatrix const DMatrix rhs  )  [inline]
 

Creates an array and sets it equal to another array.

Parameters:
rhs array to set this array equal to.

Definition at line 239 of file DMatrix.h.

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

DMatrix::~DMatrix  )  [inline]
 

Destroy's the array and cleans up the memory.

Definition at line 255 of file DMatrix.h.

References deallocate().


Member Function Documentation

void DMatrix::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 DMatrix.h.

References deallocate().

Referenced by DMatrix(), main(), and operator=().

double* DMatrix::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 DMatrix.h.

Referenced by dgemm(), dgemm_n_t(), dgemm_t_n(), dgemm_t_t(), dgemv(), dgemv_t(), DLU_decomp(), DLU_invert(), DLU_solve(), and DSYEV().

DVector DMatrix::col int  icol  )  [inline]
 

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

Definition at line 482 of file DMatrix.h.

References F77_FUNC, and DVector::pArray.

double* DMatrix::col_pointer int  icol  )  [inline]
 

Return a pointer to the coloumn icol

Definition at line 465 of file DMatrix.h.

void DMatrix::col_scale int  icol,
double  C
[inline]
 

Rescale a column

Definition at line 396 of file DMatrix.h.

References F77_FUNC.

double DMatrix::coldot int  icol,
double *  vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 420 of file DMatrix.h.

References F77_FUNC.

double DMatrix::coldot int  icol,
const DVector vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 381 of file DMatrix.h.

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

void DMatrix::deallocate  )  [inline]
 

Deallocates memory for the array.

Definition at line 157 of file DMatrix.h.

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

int DMatrix::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 DMatrix.h.

Referenced by dgemm(), dgemm_n_t(), dgemm_t_n(), dgemm_t_t(), dgemv(), dgemv_t(), DLU_decomp(), DLU_det(), DLU_invert(), DLU_solve(), and DSYEV().

int DMatrix::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 DMatrix.h.

Referenced by dgemm(), dgemm_n_t(), dgemm_t_n(), dgemm_t_t(), dgemv(), dgemv_t(), DLU_invert(), and DSYEV().

void DMatrix::operator *= double  C  )  [inline]
 

Sets this array equal to itself times a scalar value.

Definition at line 198 of file DMatrix.h.

References F77_FUNC.

double& DMatrix::operator() int  i,
int  j
[inline]
 

Accesses element (i,j) of the array.

Definition at line 594 of file DMatrix.h.

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

Returns the sum of two matrices.

Definition at line 539 of file DMatrix.h.

References F77_FUNC, n_1, n_2, and pArray.

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

Returns the difference of two Matrices.

Definition at line 567 of file DMatrix.h.

References F77_FUNC, n_1, n_2, and pArray.

void DMatrix::operator/= const double  C  )  [inline]
 

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

Definition at line 208 of file DMatrix.h.

References F77_FUNC.

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

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

Definition at line 189 of file DMatrix.h.

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

Sets two arrays equal.

Definition at line 174 of file DMatrix.h.

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

DVector DMatrix::row int  irow  )  [inline]
 

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

Definition at line 445 of file DMatrix.h.

References F77_FUNC, and DVector::pArray.

double* DMatrix::row_pointer int  irow  )  [inline]
 

Return a pointer to the row irow

Definition at line 430 of file DMatrix.h.

void DMatrix::row_scale int  irow,
double  C
[inline]
 

Rescale a row

Definition at line 348 of file DMatrix.h.

References F77_FUNC.

double DMatrix::rowdot int  irow,
double *  vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 412 of file DMatrix.h.

References F77_FUNC.

double DMatrix::rowdot int  irow,
const DVector vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 366 of file DMatrix.h.

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

void DMatrix::setcol int  icol,
double *  vector
[inline]
 

Copy an 1D array into the i-th coloumn

Definition at line 333 of file DMatrix.h.

References F77_FUNC.

void DMatrix::setcol int  icol,
const DVector vector
[inline]
 

Copy an 1D array into the i-th coloumn

Definition at line 318 of file DMatrix.h.

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

void DMatrix::setrow int  irow,
double *  vector,
int  lda
[inline]
 

Copy an 1D C double array into the i-th row with lda

Definition at line 310 of file DMatrix.h.

References F77_FUNC.

void DMatrix::setrow int  irow,
double *  vector
[inline]
 

Copy an 1D double array into the i-th row

Definition at line 302 of file DMatrix.h.

References F77_FUNC.

void DMatrix::setrow int  irow,
DVector vector
[inline]
 

Copy an 1D array into the i-th row

Definition at line 287 of file DMatrix.h.

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

int DMatrix::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 DMatrix.h.

double DMatrix::SumAll  )  [inline]
 

Sum all elements of the matrix

Definition at line 260 of file DMatrix.h.

double DMatrix::SumCol const int  icol  )  [inline]
 

Sum all elements of a Col the matrix

Definition at line 517 of file DMatrix.h.

double DMatrix::SumRow const int  irow  )  [inline]
 

Sum all elements of a Row the matrix

Definition at line 499 of file DMatrix.h.

double DMatrix::Trace  )  [inline]
 

Return the DMatrix Trace

Definition at line 270 of file DMatrix.h.

void DMatrix::transpose  )  [inline]
 

Transpose the 2D matrix

Definition at line 113 of file DMatrix.h.

Referenced by main().


Friends And Related Function Documentation

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

Prints the array to a stream.

Definition at line 612 of file DMatrix.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