Linear Algebra  master
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:25
storage_t::iterator end()
Get the iterator to the element past the end of the matrix.
Definition: Matrix.hpp:204
size_t rows() const
Get the number of rows of the matrix.
Definition: Matrix.hpp:69
size_t cols() const
Get the number of columns of the matrix.
Definition: Matrix.hpp:71
storage_t::iterator begin()
Get the iterator to the first element of the matrix.
Definition: Matrix.hpp:197
Matrix operator-(const Matrix &A, const Matrix &B)
Matrix subtraction.
Definition: Matrix.cpp:791

Definition at line 884 of file Matrix.cpp.

◆ operator-() [2/8]

Matrix&& operator- ( Matrix &&  A)

Definition at line 891 of file Matrix.cpp.

◆ operator-() [3/8]

Vector&& operator- ( Vector &&  a)

Definition at line 895 of file Matrix.cpp.

◆ operator-() [4/8]

RowVector&& operator- ( RowVector &&  a)

Definition at line 899 of file Matrix.cpp.

◆ operator-() [5/8]

SquareMatrix&& operator- ( SquareMatrix &&  a)

Definition at line 903 of file Matrix.cpp.

◆ operator-() [6/8]

Vector operator- ( const Vector a)

Definition at line 907 of file Matrix.cpp.

◆ operator-() [7/8]

RowVector operator- ( const RowVector a)

Definition at line 910 of file Matrix.cpp.

◆ operator-() [8/8]

SquareMatrix operator- ( const SquareMatrix a)

Definition at line 913 of file Matrix.cpp.