eckit::linalg::Vector class

Vector for Linear Algebra operations

Constructors, destructors, conversion operators

Vector()
Default constructor (empty vector)
Vector(Size length)
Construct vector of given size (allocates memory, not initialised)
Vector(const Scalar array[], Size length)
Construct vector from existing data (does NOT take ownership)
Vector(Stream&)
Constructor from Stream.
Vector(const Vector&)
Copy constructor.
~Vector()

Public functions

auto operator=(const Vector&) -> Vector&
void swap(Vector&)
Swap this vector for another.
void resize(Size length)
Resize vector to given size (invalidates data)
void setZero()
Set data to zero.
void fill(Scalar)
Fill vector with given scalar.
void encode(Stream&) const
Serialise to a Stream.
auto size() const -> Size
auto rows() const -> Size
auto cols() const -> Size
auto operator[](Size i) -> Scalar&
auto operator[](Size i) const -> const Scalar&
auto data() -> Scalar*
auto data() const -> const Scalar*
auto begin() -> Scalar*
auto begin() const -> const Scalar*
auto end() -> Scalar*
auto end() const -> const Scalar*

Function documentation

Size eckit::linalg::Vector::size() const

Returns size (rows * cols)

Size eckit::linalg::Vector::rows() const

Returns number of rows (i.e. size)

Size eckit::linalg::Vector::cols() const

Returns number of columns (always 1)

Scalar* eckit::linalg::Vector::data()

Returns modifiable view of the data

const Scalar* eckit::linalg::Vector::data() const

Returns read-only view of the data

Scalar* eckit::linalg::Vector::begin()

Returns iterator to beginning of the data

const Scalar* eckit::linalg::Vector::begin() const

Returns const iterator to beginning of the data

Scalar* eckit::linalg::Vector::end()

Returns iterator to end of the data

const Scalar* eckit::linalg::Vector::end() const

Returns const iterator to end of the data