version
0.0.1
Defines the C++ API for MsPASS
|
A vector compatible with dmatrix objects. More...
#include <dmatrix.h>
Public Member Functions | |
dvector () | |
dvector (size_t nrv) | |
dvector (const dvector &other) | |
dvector & | operator= (const dvector &other) |
double & | operator() (size_t rowindex) |
Public Member Functions inherited from mspass::utility::dmatrix | |
dmatrix () | |
dmatrix (const size_t nr, const size_t nc) | |
dmatrix (const dmatrix &other) | |
~dmatrix () | |
double | operator() (const size_t rowindex, const size_t colindex) const |
double & | operator() (size_t r, size_t c) |
dmatrix & | operator= (const dmatrix &other) |
dmatrix & | operator+= (const dmatrix &other) |
Add one matrix to another. More... | |
dmatrix & | operator-= (const dmatrix &other) |
Subtract one matrix to another. More... | |
dmatrix | operator+ (const dmatrix &other) const |
dmatrix | operator- (const dmatrix &other) const |
dmatrix | operator* (double s) const noexcept |
double * | get_address (size_t r, size_t c) const |
size_t | rows () const |
size_t | columns () const |
std::vector< size_t > | size () const |
Return a vector with 2 elements giving the size. More... | |
void | zero () |
Friends | |
dvector | operator* (const dmatrix &A, const dvector &x) |
Additional Inherited Members | |
Protected Attributes inherited from mspass::utility::dmatrix | |
std::vector< double > | ary |
size_t | length |
size_t | nrr |
size_t | ncc |
A vector compatible with dmatrix objects.
A vector is a special case of a matrix with one row or column. In this implementation, however, it always means a column vector. Hence, it is possible to multiply a vector x and a matrix A as Ax provided they are compatible sizes. This differs from matlab where row and columns vectors are sometimes used interchangably.
|
inline |
Default constructor creates an empty vector.
|
inline |
Create a (zero initialized) vector of length nrv.
mspass::utility::dvector::dvector | ( | const dvector & | other | ) |
double & mspass::utility::dvector::operator() | ( | size_t | rowindex | ) |
Matrix vector multiple operator.
This operator is used for constructs like y=Ax where x is a vector and A is a matrix. y is the returned vector.
A | - matrix on right in multiply |
x | - vector on left of multiply operation |
dmatrix_size_error | thrown if size of A and x do not match. |