comm_matrix_t Class Reference

Communication matrix. More...

#include <network.hh>

List of all members.

Public Member Functions

 comm_matrix_t (int rows, int col, error_vector_t &arg0=gerr)
 A contructor, creates matrix with rows rows and col columns.
int getcolcount (void)
 Function that returns number of columns in the matrix.
int getrowcount (void)
 Function that returns number of rows in the matrix.
int & operator() (int row, int col)
 Operator that retrieves elements of the matrix.
 ~comm_matrix_t ()
 A destructor, frees space allocated for the matrix.

Protected Attributes

error_vector_terrvec

Friends

pcomm_matrix_t operator* (const pcomm_matrix_t &m, int a)
 Operator that multiplies matrix m by integer a, analogous to operator*().
pcomm_matrix_t operator* (int a, const pcomm_matrix_t &m)
 Operator that multiplies matrix m by integer a.
pcomm_matrix_t operator+ (const pcomm_matrix_t &m1, const pcomm_matrix_t &m2)
 Operator that adds matrix m1 to matrix m2.
pcomm_matrix_t operator- (const pcomm_matrix_t &m1, const pcomm_matrix_t &m2)
 Operator that subtracts matrix m2 from matrix m1 (element-wise).
pcomm_matrix_t operator- (const pcomm_matrix_t &m)
 Operator that inverts all elements in the matrix ("puts minus" in front of every element).


Detailed Description

Communication matrix.

Matrix returned by methods of network_t is usually of size cl_size * cl_size, where cl_size if the number of computers in the cluster, which can be retrieved by network_t::get_cluster_size() method. In i-th row and j-th column of the matrix is an integer that stores information about data sent by workstation with id i to workstation with id j.


Constructor & Destructor Documentation

comm_matrix_t ( int  rows,
int  col,
error_vector_t arg0 = gerr 
)

A contructor, creates matrix with rows rows and col columns.

Parameters:
rows - number of rows of the matrix to be created
col - number of columns of the matrix to be created
arg0 - object used for error reporting
Use this constructor to create matrix with rows rows and col columns. If you don't want errors to be handled in a default way, pass your own error handling object of type error_vector_t.


Member Function Documentation

int getcolcount ( void   )  [inline]

Function that returns number of columns in the matrix.

Returns:
number of columns in the matrix
Use this function to get the number of columns in the matrix.

int getrowcount ( void   )  [inline]

Function that returns number of rows in the matrix.

Returns:
number of rows in the matrix
Use this function to get the number of rows in the matrix.

int & operator() ( int  row,
int  col 
)

Operator that retrieves elements of the matrix.

Parameters:
row - specifies the row of the element to be retrieved
col - specifies the column of the element to be retrieved
Returns:
value of the retrieved element
Use this operator to retrieve element at position (i, j) in the matrix by passing i as the first parameter and j as the second parameter.


Friends And Related Function Documentation

pcomm_matrix_t operator* ( int  a,
const pcomm_matrix_t m 
) [friend]

Operator that multiplies matrix m by integer a.

Parameters:
a - integer that is to be multiplied with all elements of the matrix passed as second parameter
m - pointer to matrix whose elements are to be multiplied by the integer passed as first parameter
Returns:
pointer to matrix whose elements are elements of m multiplied by a
Use this operator to multiply all elements of matrix by an integer.

pcomm_matrix_t operator+ ( const pcomm_matrix_t m1,
const pcomm_matrix_t m2 
) [friend]

Operator that adds matrix m1 to matrix m2.

Parameters:
m1 - pointer to matrix, first addend
m2 - pointer to matrix, second addend
Returns:
pointer to sum matrix of m1 and m2
Use this operator to add two matrices.

pcomm_matrix_t operator- ( const pcomm_matrix_t m1,
const pcomm_matrix_t m2 
) [friend]

Operator that subtracts matrix m2 from matrix m1 (element-wise).

Parameters:
m1 - pointer to matrix, minuend
m2 - pointer to matrix, subtrahend
Returns:
pointer to difference matrix between m1 and m2
Use this operator to subtract two matrices.

pcomm_matrix_t operator- ( const pcomm_matrix_t m  )  [friend]

Operator that inverts all elements in the matrix ("puts minus" in front of every element).

Parameters:
m - pointer to matrix whose elements are to be inverted
Returns:
pointer to matrix with inverted elements
Use this operator to get matrix with all elements inverted.


The documentation for this class was generated from the following files:

Reference Manual for Library, 2006 developed in ParaDiSe laboratory, Faculty of Informatics, Masaryk University