Linear Algebra  master
Accessible implementations of linear algebra algorithms
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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: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, double s)
Scalar division.
Definition: Matrix.cpp:984

Definition at line 984 of file Matrix.cpp.

◆ operator/=()

void operator/= ( Matrix A,
double  s 
)

Definition at line 992 of file Matrix.cpp.

◆ operator/() [2/8]

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

Definition at line 996 of file Matrix.cpp.

◆ operator/() [3/8]

Vector operator/ ( const Vector a,
double  s 
)

Definition at line 1000 of file Matrix.cpp.

◆ operator/() [4/8]

RowVector operator/ ( const RowVector a,
double  s 
)

Definition at line 1003 of file Matrix.cpp.

◆ operator/() [5/8]

SquareMatrix operator/ ( const SquareMatrix a,
double  s 
)

Definition at line 1006 of file Matrix.cpp.

◆ operator/() [6/8]

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

Definition at line 1009 of file Matrix.cpp.

◆ operator/() [7/8]

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

Definition at line 1013 of file Matrix.cpp.

◆ operator/() [8/8]

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

Definition at line 1017 of file Matrix.cpp.