|
EllAlgo 1.6.13
|
A simple vector class for conjugate gradient calculations. More...
#include <conjugate_gradient.hpp>
Public Member Functions | |
| Vector0 (size_t size) | |
| Construct a new Vector0 object with given size. | |
| Vector0 (const std::vector< double > &v) | |
| Construct a new Vector0 from a std::vector. | |
| double & | operator[] (size_t i) |
| Access element at index i. | |
| const double & | operator[] (size_t i) const |
| Access element at index i (const version) | |
| size_t | size () const |
| Get the size of the vector. | |
| Vector0 & | operator+= (const Vector0 &rhs) |
| Add another vector to this vector. | |
| Vector0 & | operator-= (const Vector0 &rhs) |
| Subtract another vector from this vector. | |
| Vector0 & | operator*= (double scalar) |
| Multiply this vector by a scalar. | |
| double | dot (const Vector0 &other) const |
| Compute the dot product with another vector. | |
| double | norm () const |
| Compute the L2 norm of the vector. | |
A simple vector class for conjugate gradient calculations.
This class provides basic vector operations needed for the conjugate gradient method, including addition, subtraction, scalar multiplication, dot product, and norm calculation.
|
inline |
Construct a new Vector0 object with given size.
| [in] | size | The size of the vector |
Construct a new Vector0 from a std::vector.
| [in] | v | The std::vector to copy from |
Compute the dot product with another vector.
| [in] | other | The other vector |
|
inline |
Compute the L2 norm of the vector.
Multiply this vector by a scalar.
| [in] | scalar | The scalar value to multiply |
Add another vector to this vector.
| [in] | rhs | The vector to add |
Subtract another vector from this vector.
| [in] | rhs | The vector to subtract |
Access element at index i.
| [in] | i | Index of the element |
Access element at index i (const version)
| [in] | i | Index of the element |
|
inline |
Get the size of the vector.