Linear Algebra  arduino
Accessible implementations of linear algebra algorithms
Functions

Detailed Description

Multiplication by a scalar.

+ Collaboration diagram for Scalar multiplication:

Functions

Matrix operator* (const Matrix &A, double s)
 Scalar multiplication. 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)
 
Matrix operator* (double s, const Matrix &A)
 
Matrix && operator* (double s, Matrix &&A)
 
Vector operator* (double s, const Vector &a)
 
RowVector operator* (double s, const RowVector &a)
 
SquareMatrix operator* (double s, const SquareMatrix &a)
 
Vector && operator* (double s, Vector &&a)
 
RowVector && operator* (double s, RowVector &&a)
 
SquareMatrix && operator* (double s, SquareMatrix &&a)
 

Function Documentation

◆ operator*() [1/16]

Matrix operator* ( const Matrix A,
double  s 
)

Scalar multiplication.

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, const Matrix &B)
Matrix multiplication.
Definition: Matrix.cpp:622

Definition at line 945 of file Matrix.cpp.

◆ operator*=()

void operator*= ( Matrix A,
double  s 
)

Definition at line 953 of file Matrix.cpp.

◆ operator*() [2/16]

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

Definition at line 957 of file Matrix.cpp.

◆ operator*() [3/16]

Vector operator* ( const Vector a,
double  s 
)

Definition at line 961 of file Matrix.cpp.

◆ operator*() [4/16]

RowVector operator* ( const RowVector a,
double  s 
)

Definition at line 964 of file Matrix.cpp.

◆ operator*() [5/16]

SquareMatrix operator* ( const SquareMatrix a,
double  s 
)

Definition at line 967 of file Matrix.cpp.

◆ operator*() [6/16]

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

Definition at line 970 of file Matrix.cpp.

◆ operator*() [7/16]

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

Definition at line 974 of file Matrix.cpp.

◆ operator*() [8/16]

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

Definition at line 978 of file Matrix.cpp.

◆ operator*() [9/16]

Matrix operator* ( double  s,
const Matrix A 
)

Definition at line 983 of file Matrix.cpp.

◆ operator*() [10/16]

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

Definition at line 984 of file Matrix.cpp.

◆ operator*() [11/16]

Vector operator* ( double  s,
const Vector a 
)

Definition at line 985 of file Matrix.cpp.

◆ operator*() [12/16]

RowVector operator* ( double  s,
const RowVector a 
)

Definition at line 986 of file Matrix.cpp.

◆ operator*() [13/16]

SquareMatrix operator* ( double  s,
const SquareMatrix a 
)

Definition at line 987 of file Matrix.cpp.

◆ operator*() [14/16]

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

Definition at line 988 of file Matrix.cpp.

◆ operator*() [15/16]

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

Definition at line 989 of file Matrix.cpp.

◆ operator*() [16/16]

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

Definition at line 990 of file Matrix.cpp.