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

SMatrix Class Reference

#include <SMatrix.h>

List of all members.

Public Member Functions

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

Friends

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


Constructor & Destructor Documentation

SMatrix::SMatrix  )  [inline]
 

Creates an array.

Definition at line 222 of file SMatrix.h.

SMatrix::SMatrix 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 232 of file SMatrix.h.

References allocate().

SMatrix::SMatrix const SMatrix rhs  )  [inline]
 

Creates an array and sets it equal to another array.

Parameters:
rhs array to set this array equal to.

Definition at line 241 of file SMatrix.h.

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

SMatrix::~SMatrix  )  [inline]
 

Destroy's the array and cleans up the memory.

Definition at line 257 of file SMatrix.h.

References deallocate().


Member Function Documentation

void SMatrix::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 138 of file SMatrix.h.

References deallocate().

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

float* SMatrix::array  )  [inline]
 

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

Definition at line 109 of file SMatrix.h.

Referenced by sgemm(), sgemm_n_t(), sgemm_t_n(), sgemm_t_t(), sgemv(), sgemv_t(), SLU_decomp(), SLU_invert(), SLU_solve(), and SSYEV().

SVector SMatrix::col int  icol  )  [inline]
 

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

Definition at line 484 of file SMatrix.h.

References F77_FUNC, and SVector::pArray.

float* SMatrix::col_pointer int  icol  )  [inline]
 

Return a pointer to the coloumn icol

Definition at line 467 of file SMatrix.h.

void SMatrix::col_scale int  icol,
float  C
[inline]
 

Rescale a column

Definition at line 398 of file SMatrix.h.

References F77_FUNC.

float SMatrix::coldot int  icol,
float *  vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 422 of file SMatrix.h.

References F77_FUNC.

float SMatrix::coldot int  icol,
const SVector vector
[inline]
 

Dot product between the i-th col and a vector

Definition at line 383 of file SMatrix.h.

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

void SMatrix::deallocate  )  [inline]
 

Deallocates memory for the array.

Definition at line 159 of file SMatrix.h.

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

int SMatrix::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 89 of file SMatrix.h.

Referenced by sgemm(), sgemm_n_t(), sgemm_t_n(), sgemm_t_t(), sgemv(), sgemv_t(), SLU_decomp(), SLU_det(), SLU_invert(), SLU_solve(), and SSYEV().

int SMatrix::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 96 of file SMatrix.h.

Referenced by sgemm(), sgemm_n_t(), sgemm_t_n(), sgemm_t_t(), sgemv(), sgemv_t(), SLU_invert(), and SSYEV().

void SMatrix::operator *= float  C  )  [inline]
 

Sets this array equal to itself times a scalar value.

Definition at line 200 of file SMatrix.h.

References F77_FUNC.

float& SMatrix::operator() int  i,
int  j
[inline]
 

Accesses element (i,j) of the array.

Definition at line 596 of file SMatrix.h.

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

Returns the sum of two matrices.

Definition at line 541 of file SMatrix.h.

References F77_FUNC, n_1, n_2, and pArray.

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

Returns the difference of two Matrices.

Definition at line 569 of file SMatrix.h.

References F77_FUNC, n_1, n_2, and pArray.

void SMatrix::operator/= const float  C  )  [inline]
 

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

Definition at line 210 of file SMatrix.h.

References F77_FUNC.

void SMatrix::operator= const float  C  )  [inline]
 

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

Definition at line 191 of file SMatrix.h.

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

Sets two arrays equal.

Definition at line 176 of file SMatrix.h.

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

SVector SMatrix::row int  irow  )  [inline]
 

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

Definition at line 447 of file SMatrix.h.

References F77_FUNC, and SVector::pArray.

float* SMatrix::row_pointer int  irow  )  [inline]
 

Return a pointer to the row irow

Definition at line 432 of file SMatrix.h.

void SMatrix::row_scale int  irow,
float  C
[inline]
 

Rescale a row

Definition at line 350 of file SMatrix.h.

References F77_FUNC.

float SMatrix::rowdot int  irow,
float *  vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 414 of file SMatrix.h.

References F77_FUNC.

float SMatrix::rowdot int  irow,
const SVector vector
[inline]
 

Dot product between the i-th row and a vector

Definition at line 368 of file SMatrix.h.

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

void SMatrix::setcol int  icol,
float *  vector
[inline]
 

Copy an 1D array into the i-th coloumn

Definition at line 335 of file SMatrix.h.

References F77_FUNC.

void SMatrix::setcol int  icol,
const SVector vector
[inline]
 

Copy an 1D array into the i-th coloumn

Definition at line 320 of file SMatrix.h.

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

void SMatrix::setrow int  irow,
float *  vector,
int  lda
[inline]
 

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

Definition at line 312 of file SMatrix.h.

References F77_FUNC.

void SMatrix::setrow int  irow,
float *  vector
[inline]
 

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

Definition at line 304 of file SMatrix.h.

References F77_FUNC.

void SMatrix::setrow int  irow,
SVector vector
[inline]
 

Copy an 1D array into the i-th row

Definition at line 289 of file SMatrix.h.

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

int SMatrix::size  )  [inline]
 

Gets the total number of elements in the array.

Returns:
total number of elements in the array.

Definition at line 103 of file SMatrix.h.

float SMatrix::SumAll  )  [inline]
 

Sum all elements of the matrix

Definition at line 262 of file SMatrix.h.

float SMatrix::SumCol const int  icol  )  [inline]
 

Sum all elements of a Col the matrix

Definition at line 519 of file SMatrix.h.

float SMatrix::SumRow const int  irow  )  [inline]
 

Sum all elements of a Row the matrix

Definition at line 501 of file SMatrix.h.

float SMatrix::Trace  )  [inline]
 

Return the SMatrix Trace

Definition at line 272 of file SMatrix.h.

void SMatrix::transpose  )  [inline]
 

Transpose the 2D matrix

Definition at line 115 of file SMatrix.h.


Friends And Related Function Documentation

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

Prints the array to a stream.

Definition at line 614 of file SMatrix.h.

friend class TMatrix [friend]
 

Definition at line 46 of file SMatrix.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