VecMat.h File Reference

Object oriented encapsulation of vectors and matrices. More...

#include <Array/Array.h>
#include <Array/ArrayOp.h>

Go to the source code of this file.

Classes

class  Vector
 one-dimensional array of double used for vector computations More...
class  Matrix
 two-dimensional array of double used for matrix computations More...

Functions

bool operator== (const Vector &v1, const Vector &v2)
bool operator!= (const Vector &v1, const Vector &v2)
bool operator== (const Matrix &m1, const Matrix &m2)
bool operator!= (const Matrix &m1, const Matrix &m2)
Vector operator+ (const Vector &v1, const Vector &v2)
Vector operator- (const Vector &v1, const Vector &v2)
Vectoroperator+= (Vector &v1, const Vector &v2)
Vectoroperator-= (Vector &v1, const Vector &v2)
Matrix operator+ (const Matrix &m1, const Matrix &m2)
Matrix operator- (const Matrix &m1, const Matrix &m2)
Matrixoperator+= (Matrix &m1, const Matrix &m2)
Matrixoperator-= (Matrix &m1, const Matrix &m2)
Vector operator* (double s, const Vector &v)
Matrix operator* (double s, const Matrix &m)
Vectoroperator*= (Vector &v, double s)
Matrixoperator*= (Matrix &m, double s)
Vector operator* (const Matrix &m, const Vector &v)
Vector operator* (const Vector &v, const Matrix &m)
Matrix operator* (const Matrix &m1, const Matrix &m2)
Matrixoperator*= (Matrix &m1, const Matrix &m2)
double operator* (const Vector &v1, const Vector &v2)
Matrix operator% (const Vector &v1, const Vector &v2)
Matrix powerseries (const Matrix &m, const double *coeff, int ncoeff, double acc=1e-14)
Matrix exp (const Matrix &m)


Detailed Description

Object oriented encapsulation of vectors and matrices.

The aim of the classes Vector and Matrix, instead of the usage of Array<double>, is two-fold. First, these classes encapsulate a large part of the LinAlg functionality and thus make the library object-orientated. Second, these classes enable us to write vector and matrix multiplications in a clean and natural operator notation.
Author:
T. Glasmachers
Date:
2008
Copyright (c) 2008:
Institut für Neuroinformatik
Ruhr-Universität Bochum
D-44780 Bochum, Germany
Phone: +49-234-32-25558
Fax: +49-234-32-14209
eMail: Shark-admin@neuroinformatik.ruhr-uni-bochum.de
www: http://www.neuroinformatik.ruhr-uni-bochum.de

This file is part of Shark. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this library; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

Definition in file VecMat.h.


Function Documentation

Matrix exp ( const Matrix m  ) 

Definition at line 570 of file VecMat.cpp.

References powerseries().

bool operator!= ( const Matrix m1,
const Matrix m2 
)

Definition at line 347 of file VecMat.cpp.

bool operator!= ( const Vector v1,
const Vector v2 
)

Definition at line 337 of file VecMat.cpp.

Matrix operator% ( const Vector v1,
const Vector v2 
)

Definition at line 528 of file VecMat.cpp.

double operator* ( const Vector v1,
const Vector v2 
)

Definition at line 518 of file VecMat.cpp.

Matrix operator* ( const Matrix m1,
const Matrix m2 
)

Definition at line 490 of file VecMat.cpp.

Vector operator* ( const Vector v,
const Matrix m 
)

Definition at line 475 of file VecMat.cpp.

Vector operator* ( const Matrix m,
const Vector v 
)

Definition at line 460 of file VecMat.cpp.

Matrix operator* ( double  s,
const Matrix m 
)

Definition at line 433 of file VecMat.cpp.

Vector operator* ( double  s,
const Vector v 
)

Definition at line 425 of file VecMat.cpp.

Matrix& operator*= ( Matrix m1,
const Matrix m2 
)

Definition at line 509 of file VecMat.cpp.

Matrix& operator*= ( Matrix m,
double  s 
)

Definition at line 449 of file VecMat.cpp.

Vector& operator*= ( Vector v,
double  s 
)

Definition at line 442 of file VecMat.cpp.

Matrix operator+ ( const Matrix m1,
const Matrix m2 
)

Definition at line 387 of file VecMat.cpp.

Vector operator+ ( const Vector v1,
const Vector v2 
)

Definition at line 353 of file VecMat.cpp.

Matrix& operator+= ( Matrix m1,
const Matrix m2 
)

Definition at line 401 of file VecMat.cpp.

Vector& operator+= ( Vector v1,
const Vector v2 
)

Definition at line 367 of file VecMat.cpp.

Matrix operator- ( const Matrix m1,
const Matrix m2 
)

Definition at line 394 of file VecMat.cpp.

Vector operator- ( const Vector v1,
const Vector v2 
)

Definition at line 360 of file VecMat.cpp.

Matrix& operator-= ( Matrix m1,
const Matrix m2 
)

Definition at line 412 of file VecMat.cpp.

Vector& operator-= ( Vector v1,
const Vector v2 
)

Definition at line 377 of file VecMat.cpp.

bool operator== ( const Matrix m1,
const Matrix m2 
)

Definition at line 342 of file VecMat.cpp.

bool operator== ( const Vector v1,
const Vector v2 
)

Definition at line 332 of file VecMat.cpp.

Matrix powerseries ( const Matrix m,
const double *  coeff,
int  ncoeff,
double  acc = 1e-14 
)

Definition at line 539 of file VecMat.cpp.

References Matrix::isSquare(), and Matrix::unitmatrix().

Referenced by exp().