Matrix Library. v1.6.4

Dependents:   Matrix_class Wizardsneverdie TwoTank mbed_multiplex_matrix ... more

Embed: (wiki syntax)

« Back to documentation index

Operators.cpp File Reference

Operators.cpp File Reference

Source Code for the Operator of Matrix Class. More...

Go to the source code of this file.

Functions

bool operator== (const Matrix &leftM, const Matrix &rightM)
 Comapre element by element.
bool operator!= (const Matrix &leftM, const Matrix &rightM)
 Calls for '==' operator.
Matrixoperator+= (Matrix &leftM, const Matrix &rightM)
 Matrices must be same size.
Matrixoperator-= (Matrix &leftM, const Matrix &rightM)
 Matrices must be same size.
Matrixoperator*= (Matrix &leftM, const Matrix &rightM)
Matrixoperator*= (Matrix &leftM, float number)
const Matrix operator+= (Matrix &leftM, float number)
const Matrix operator-= (Matrix &leftM, float number)
const Matrix operator+ (const Matrix &leftM, const Matrix &rightM)
const Matrix operator+ (const Matrix &leftM, float number)
const Matrix operator+ (float number, const Matrix &leftM)
const Matrix operator- (const Matrix &leftM, const Matrix &rightM)
const Matrix operator- (const Matrix &leftM, float number)
const Matrix operator- (float number, const Matrix &leftM)
const Matrix operator* (const Matrix &leftM, const Matrix &rightM)
const Matrix operator* (const Matrix &leftM, float number)
const Matrix operator* (float number, const Matrix &leftM)
Matrixoperator<< (Matrix &leftM, float number)

Detailed Description

Source Code for the Operator of Matrix Class.

Author:
Ernesto Palacios

Created on September 2011.

Develop Under GPL v3.0 License http://www.gnu.org/licenses/gpl-3.0.html

Definition in file Operators.cpp.


Function Documentation

bool operator!= ( const Matrix leftM,
const Matrix rightM 
)

Calls for '==' operator.

Overload opeartor for the compare Matrices.

Parameters:
rightM
Returns:
Boolean 'true' if different

Definition at line 95 of file Operators.cpp.

const Matrix operator* ( const Matrix leftM,
float  number 
)
Returns:
A new object with the result.

Definition at line 284 of file Operators.cpp.

const Matrix operator* ( float  number,
const Matrix leftM 
)
Returns:

Definition at line 295 of file Operators.cpp.

const Matrix operator* ( const Matrix leftM,
const Matrix rightM 
)
Returns:

Definition at line 262 of file Operators.cpp.

Matrix& operator*= ( Matrix leftM,
const Matrix rightM 
)
Parameters:
rightM
Returns:

Definition at line 135 of file Operators.cpp.

Matrix& operator*= ( Matrix leftM,
float  number 
)
Parameters:
number
Returns:

Definition at line 153 of file Operators.cpp.

const Matrix operator+ ( const Matrix leftM,
const Matrix rightM 
)

If diferent dimensions -> ERROR.

Returns:
A new object Matrix with the result.

Definition at line 186 of file Operators.cpp.

const Matrix operator+ ( const Matrix leftM,
float  number 
)

Mimic MATLAB operation.

Returns:
A new matrix object with the result.

Definition at line 207 of file Operators.cpp.

const Matrix operator+ ( float  number,
const Matrix leftM 
)
Returns:
A new Matrix object with the result.

Definition at line 219 of file Operators.cpp.

Matrix& operator+= ( Matrix leftM,
const Matrix rightM 
)

Matrices must be same size.

Overload Copmpound assignment.

Element by element adition.

Definition at line 103 of file Operators.cpp.

const Matrix operator+= ( Matrix leftM,
float  number 
)

Because the '=' operator checks for self Assign, no extra operations are needed.

Returns:
Same Matrix to self Assign.

Definition at line 168 of file Operators.cpp.

const Matrix operator- ( const Matrix leftM,
float  number 
)
Returns:
A new matrix object with the result.

Definition at line 244 of file Operators.cpp.

const Matrix operator- ( const Matrix leftM,
const Matrix rightM 
)

If different dimensions -> ERROR.

Returns:
A new object Matrix with the result.

Definition at line 225 of file Operators.cpp.

const Matrix operator- ( float  number,
const Matrix leftM 
)
Returns:
A new matrix object with the result.

Definition at line 256 of file Operators.cpp.

Matrix& operator-= ( Matrix leftM,
const Matrix rightM 
)

Matrices must be same size.

Overload Compund decrease.

Element by element Substraction

Definition at line 119 of file Operators.cpp.

const Matrix operator-= ( Matrix leftM,
float  number 
)
Returns:
Same matrix to self Assign.

Definition at line 177 of file Operators.cpp.

Matrix& operator<< ( Matrix leftM,
float  number 
)

This does NOT work on an only declared Matrix such as: Matrix obj; obj << 5; //Error

Returns:

Definition at line 301 of file Operators.cpp.

bool operator== ( const Matrix leftM,
const Matrix rightM 
)

Comapre element by element.

Overload opeartor for the compare Matrices.

Parameters:
rightM
Returns:
Boolean 'false' if different.

Definition at line 77 of file Operators.cpp.