Index

C++ Code Documentation

template <class A> math::Matrix

File: BASE/math/Matrix.H

Template matrix container class.

public:
  • Matrix();
    void constructor
  • Matrix( Matrix<A> const & );
    copy constructor
  • ~Matrix();
    destructor
  • Matrix<A> &operator=( Matrix<A> const & );
    assignment operator
  • A *operator[]( uint );
    Reference to entry.
  • A const *operator[]( uint ) const;
    Reference to entry.
  • bool isnan() const;
  • void clear();
    Set all entries of *this to A(0).
  • void clear(uint n);
    allocate to n-by-n; Set all entries of *this to A(0).
  • void zero();
    Set all entries of *this to A(0).
  • void zero(uint n);
    Set all entries of *this to A(0).
  • void set( A const & );
    Set all entries of *this to a.
  • void set( A const &, uint n );
    allocate to n-by-n; Set all entries of *this to a.
  • void identity();
    *this := identity matrix
  • void identity(uint n);
    allocate to n-by-n; *this := identity matrix
  • void getrow( Vector<A> &, uint ) const;
    copy nth row of *this into a
  • void getcol( Vector<A> &, uint ) const;
    copy nth column of *this into a
  • void putrow( Vector<A> const &, uint );
    copy a into nth row of *this
  • void putcol( Vector<A> const &, uint );
    copy a into nth column of *this
  • void neg();
    negation: *this := - *this
  • void neg( Matrix<A> const & );
    negation *this := -a
  • void add( Matrix<A> const &, Matrix<A> const &b );
    *this := a + b
  • void add( Matrix<A> const &a );
    *this += a
  • void operator+=( Matrix<A> const &a );
    *this += a
  • void sub( Matrix<A> const &, Matrix<A> const & );
    *this := a - b
  • void sub( Matrix<A> const &a );
    *this -= a
  • void operator-=( Matrix<A> const &a );
    *this -= a
  • void operator*=( A const & );
    *this *= a
  • void operator*=( Matrix<A> const & );
    *this *= a
  • void mul( A const &, Matrix<A> const &b );
    scalar multiplication: *this := a * b
  • void mul( Matrix<A> const &, A const &b );
    scalar multiplication: *this := a * b
  • void mul( A const &b );
    scalar multiplication: *this *= a
  • void mul( Vector<A> &v ) const;
    vector multiplication v := (*this) * v
  • void mulleft( Vector<A> &v ) const;
    vector multiplication v := (*this) * v
  • void mul( Matrix<A> const &, Matrix<A> const &b );
    matrix multiplication: *this := a * b
  • void mul( Matrix<A> const &a );
    matrix multiplication: *this *= a
  • void mulleft( Matrix<A> const &a );
    matrix multiplication: *this *= a
  • void operator/=( A const & );
    *this /= a
  • void div( Matrix<A> const &, A const &b );
    *this := a / b
  • A trace() const;
    return trace( *this )
  • void transpose();
    *this := transpose( *this )
  • void transpose( Matrix<A> const & );
    *this := transpose( a )
  • friend std::ostream & operator<< NULL_TMPL_ARGS ( std::ostream &o, Matrix<A> const & );
    write a to stream o
  • void linear_solve( Vector<A> &b ) throw( base::Exception );
    solves the linear system A.X=B. A: n-by-n matrix of A's (already allocated) (input and output) n: size of a (input) B: right-hand-side and and solution (input and output) A is replaced by its LU-decomposition
  • void inv() throw( base::Exception );
    computes the inverse of a matrix. A_inv: inverse of A (already allocated) (output) A: n-by-n matrix of A's (already allocated) (input) n: size of a (input)
  • void inv( Matrix<A> const & ) throw( base::Exception );
  • A det() const throw( base::Exception );
  • void LU_decomposition(Vector<uint> &indx, int &d) throw( base::Exception );
    replaces a by LU-decomposition. With pivoting. a: n-by-n matrix of A's (already allocated) (input and output) n: size of a (input) indx: row permutation index (already allocated) (output) d: +1 or -1 according as permuation is even/odd (output) a and a_inv must be distinct
  • void LU_back_substitution( Vector<uint> const &indx, Vector<A> &b ) throw( base::Exception );
    LU_back_substitution. a: n-by-n matrix of A's in LU form (input) n: size of a (input) indx: row permutation index (already allocated) (input) b: right-hand-side (array of n A's) (input and output)
  • A *data();
  • A const *data() const;
  • uint dim() const;
  • void allocate( uint len );
protected:
  • uint _len;
  • A *_data;
  • A &el(uint i, uint j);
  • A const &el(uint i, uint j) const;
  • uint ind( uint i, uint j) const;
private:


template <class A> math::Matrix GANG