Linear Algebra  arduino
Accessible implementations of linear algebra algorithms
Functions

Detailed Description

Division by a scalar.

+ Collaboration diagram for Scalar division:

Functions

Matrix operator/ (const Matrix &A, double s)
 Scalar division. More...
 
void operator/= (Matrix &A, double s)
 
Matrix && operator/ (Matrix &&A, double s)
 
Vector operator/ (const Vector &a, double s)
 
RowVector operator/ (const RowVector &a, double s)
 
SquareMatrix operator/ (const SquareMatrix &a, double s)
 
Vector && operator/ (Vector &&a, double s)
 
RowVector && operator/ (RowVector &&a, double s)
 
SquareMatrix && operator/ (SquareMatrix &&a, double s)
 

Function Documentation

◆ operator/() [1/8]

Matrix operator/ ( const Matrix A,
double  s 
)

Scalar division.

Implementation

Matrix operator/(const Matrix &A, double s) {
Matrix C(A.rows(), A.cols());
std::transform(A.begin(), A.end(), C.begin(),
[s](double a) { return a / s; });
return C;
}
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, double s)
Scalar division.
Definition: Matrix.cpp:1003

Definition at line 1003 of file Matrix.cpp.

◆ operator/=()

void operator/= ( Matrix A,
double  s 
)

Definition at line 1011 of file Matrix.cpp.

◆ operator/() [2/8]

Matrix&& operator/ ( Matrix &&  A,
double  s 
)

Definition at line 1015 of file Matrix.cpp.

◆ operator/() [3/8]

Vector operator/ ( const Vector a,
double  s 
)

Definition at line 1019 of file Matrix.cpp.

◆ operator/() [4/8]

RowVector operator/ ( const RowVector a,
double  s 
)

Definition at line 1022 of file Matrix.cpp.

◆ operator/() [5/8]

SquareMatrix operator/ ( const SquareMatrix a,
double  s 
)

Definition at line 1025 of file Matrix.cpp.

◆ operator/() [6/8]

Vector&& operator/ ( Vector &&  a,
double  s 
)

Definition at line 1028 of file Matrix.cpp.

◆ operator/() [7/8]

RowVector&& operator/ ( RowVector &&  a,
double  s 
)

Definition at line 1032 of file Matrix.cpp.

◆ operator/() [8/8]

SquareMatrix&& operator/ ( SquareMatrix &&  a,
double  s 
)

Definition at line 1036 of file Matrix.cpp.