Main Page | Class Hierarchy | Class List | File List | Class Members | File Members | Related Pages

Matrix< T > Class Template Reference

#include <matrix.H>

Inheritance diagram for Matrix< T >:

Table< T > Tuple< T > List of all members.

Detailed Description

template<class T>
class Matrix< T >

The Matrix class: Table with arithmetic.

When arithmetic operations can be done with elements of type T, it is desirable to perform them with Tables.

The Matrix class is inherited from Table and provides just this. More precisely it is assumed that objects of type T have methods for *=, += and -=. So do objects of type Matrix<T>.

Definition at line 22 of file matrix.H.

Public Member Functions

 Matrix (long i, long j)
 Matrix (const Matrix< T > &that)
void make_identity (long n)
void get_data_from_matrix_list (const list< Matrix< T > > &L)
void swap_lines (long i, long j)
 swaps two lines
void add_line (long i, long j, T coeff)
 adds to line i the result of (line j)*coeff
void multiply_line (long i, T coeff)
 multiplies a line by a coeff
bool is_invertible () const
 checks if the matrix is invertible
Matrix< T > inverse () const
 returns the inverse of this
Matrix< T > & operator+= (const Matrix< T > &that)
 adds a matrix to this
Matrix< T > & operator-= (const Matrix< T > &that)
 takes a matrix from this
Matrix< T > & operator *= (const Matrix< T > &that)
 multiplies by a matrix
Matrix< T > & operator *= (const T &c)
Matrix< T > operator * (const T &c) const
Matrix< T > operator * (const Matrix< T > &that) const
 operator *
Matrix< T > operator+ (const Matrix< T > &that) const
 operator +

Friends

void matrixprod (const Matrix< T > &A, const Matrix< T > &B, Matrix< T > &ans)
 "external" matrix multiplication


Member Function Documentation

template<class T>
void Matrix< T >::add_line long  i,
long  j,
coeff
[inline]
 

adds to line i the result of (line j)*coeff

Definition at line 85 of file matrix.H.

Referenced by Matrix< Polynomial< K > >::inverse(), and Matrix< Polynomial< K > >::is_invertible().

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

returns the inverse of this

Definition at line 138 of file matrix.H.

Referenced by HomFinder::filter_GL().

template<class T>
bool Matrix< T >::is_invertible  )  const [inline]
 

checks if the matrix is invertible

Uses a copy of the matrix, so quite memory consuming. Optimized for speed however (does not quite compute the determinant entirely). T must be a field.

Definition at line 108 of file matrix.H.

Referenced by HomFinder::populate_GL().

template<class T>
void Matrix< T >::multiply_line long  i,
coeff
[inline]
 

multiplies a line by a coeff

Definition at line 93 of file matrix.H.

Referenced by Matrix< Polynomial< K > >::inverse().

template<class T>
Matrix<T> Matrix< T >::operator * const Matrix< T > &  that  )  const [inline]
 

operator *

do not use for anything other than toy examples ! very inefficient use of memory.

Definition at line 312 of file matrix.H.

template<class T>
Matrix<T>& Matrix< T >::operator *= const Matrix< T > &  that  )  [inline]
 

multiplies by a matrix

Definition at line 214 of file matrix.H.

template<class T>
Matrix<T> Matrix< T >::operator+ const Matrix< T > &  that  )  const [inline]
 

operator +

Definition at line 320 of file matrix.H.

template<class T>
Matrix<T>& Matrix< T >::operator+= const Matrix< T > &  that  )  [inline]
 

adds a matrix to this

Parameters:
that: another matrix of the same size. if the sizes don't match, the unmodified matrix is returned (ie *this).
Returns:
the matrix which now contains this + that.

Definition at line 183 of file matrix.H.

template<class T>
Matrix<T>& Matrix< T >::operator-= const Matrix< T > &  that  )  [inline]
 

takes a matrix from this

Parameters:
that: another matrix of the same size. if the sizes don't match, the unmodified matrix is returned (ie *this).
Returns:
the matrix which now contains this - that.

Definition at line 200 of file matrix.H.

template<class T>
void Matrix< T >::swap_lines long  i,
long  j
[inline]
 

swaps two lines

Definition at line 71 of file matrix.H.

Referenced by Matrix< Polynomial< K > >::inverse(), and Matrix< Polynomial< K > >::is_invertible().


Friends And Related Function Documentation

template<class T>
void matrixprod const Matrix< T > &  A,
const Matrix< T > &  B,
Matrix< T > &  ans
[friend]
 

"external" matrix multiplication

Parameters:
A,B: matrices to be multiplied,
ans: a matrix which will hold the result A*B. ans may be resized in the process.

Definition at line 282 of file matrix.H.

Referenced by Matrix< Polynomial< K > >::operator *(), and Matrix< Polynomial< K > >::operator *=().


The documentation for this class was generated from the following file:
Generated on Wed Jun 18 17:22:45 2008 for Pierre Guillot by  doxygen 1.3.9.1