Linear Algebra  arduino
Accessible implementations of linear algebra algorithms
Functions

Detailed Description

Matrix and vector negation.

+ Collaboration diagram for Negation:

Functions

Matrix operator- (const Matrix &A)
 Matrix negation. More...
 
Matrix && operator- (Matrix &&A)
 
Vector && operator- (Vector &&a)
 
RowVector && operator- (RowVector &&a)
 
SquareMatrix && operator- (SquareMatrix &&a)
 
Vector operator- (const Vector &a)
 
RowVector operator- (const RowVector &a)
 
SquareMatrix operator- (const SquareMatrix &a)
 

Function Documentation

◆ operator-() [1/8]

Matrix operator- ( const Matrix A)

Matrix negation.

Implementation

Matrix operator-(const Matrix &A) {
Matrix result(A.rows(), A.cols());
std::transform(A.begin(), A.end(), result.begin(), std::negate<double>());
return result;
}
General matrix class.
Definition: Matrix.hpp:34
storage_t::iterator end()
Get the iterator to the element past the end of the matrix.
Definition: Matrix.hpp:220
size_t rows() const
Get the number of rows of the matrix.
Definition: Matrix.hpp:81
size_t cols() const
Get the number of columns of the matrix.
Definition: Matrix.hpp:83
storage_t::iterator begin()
Get the iterator to the first element of the matrix.
Definition: Matrix.hpp:213
Matrix operator-(const Matrix &A, const Matrix &B)
Matrix subtraction.
Definition: Matrix.cpp:810

Definition at line 903 of file Matrix.cpp.

◆ operator-() [2/8]

Matrix&& operator- ( Matrix &&  A)

Definition at line 910 of file Matrix.cpp.

◆ operator-() [3/8]

Vector&& operator- ( Vector &&  a)

Definition at line 914 of file Matrix.cpp.

◆ operator-() [4/8]

RowVector&& operator- ( RowVector &&  a)

Definition at line 918 of file Matrix.cpp.

◆ operator-() [5/8]

SquareMatrix&& operator- ( SquareMatrix &&  a)

Definition at line 922 of file Matrix.cpp.

◆ operator-() [6/8]

Vector operator- ( const Vector a)

Definition at line 926 of file Matrix.cpp.

◆ operator-() [7/8]

RowVector operator- ( const RowVector a)

Definition at line 929 of file Matrix.cpp.

◆ operator-() [8/8]

SquareMatrix operator- ( const SquareMatrix a)

Definition at line 932 of file Matrix.cpp.