linearAlgebraSolverLib
Loading...
Searching...
No Matches
linearAlgebraLib::Vector Class Reference

A vector class with overloaded operators to facilitate arithmetic vector operations. More...

#include <vector.hpp>

Public Types

Custom types used in this class
using VectorType = std::vector< double >
 

Public Member Functions

Constructors and destructors
LINEARALGEBRALIB_EXPORT Vector (const unsigned &size)
 
API interface that exposes behaviour to the caller
LINEARALGEBRALIB_EXPORT unsigned size () const
 
LINEARALGEBRALIB_EXPORT Vector transpose ()
 
LINEARALGEBRALIB_EXPORT double getL2Norm () const
 

Overloaded operators

LINEARALGEBRALIB_EXPORT const double & operator[] (unsigned index) const
 
LINEARALGEBRALIB_EXPORT double & operator[] (unsigned index)
 
LINEARALGEBRALIB_EXPORT Vector operator+ (const Vector &other)
 
LINEARALGEBRALIB_EXPORT Vector operator- (const Vector &other)
 
LINEARALGEBRALIB_EXPORT Vectoroperator* (const double &scaleFactor)
 
LINEARALGEBRALIB_EXPORT double operator* (const Vector &other)
 
LINEARALGEBRALIB_EXPORT friend Vector operator* (const double &scaleFactor, Vector vector)
 
LINEARALGEBRALIB_EXPORT friend std::ostream & operator<< (std::ostream &out, const Vector &vector)
 

Detailed Description

A vector class with overloaded operators to facilitate arithmetic vector operations.

This class wraps around a C++ std::vector and extends it with arithmetic operations (addition, subtraction, etc.). It can be accessed as a C++ std::vector<double> and exposes functionality to calculate the L2-norm of the vector. It can also be used together with the SparseMatrixCSR class to perform matrix-vector multiplication. Examples for how to perform basic operations can in the Creating a vector section of the documentation.


The documentation for this class was generated from the following files: