numerics 0.1.0
Loading...
Searching...
No Matches
vector.hpp File Reference

Dense vector storage and operations. More...

#include "core/parallel/cuda_ops.hpp"
#include "core/policy.hpp"
#include "core/types.hpp"
#include <algorithm>
#include <memory>
#include <type_traits>

Go to the source code of this file.

Classes

class  num::BasicVector< T >
 Dense owning vector. More...
 
struct  num::Vec2View
 Non-owning view of a flat vector as \((x_i,y_i)\) pairs. More...
 
struct  num::Vec2ConstView
 

Namespaces

namespace  num
 

Typedefs

using num::Vector = BasicVector< real >
 Real-valued dense vector with full backend dispatch (CPU + GPU)
 
using num::CVector = BasicVector< cplx >
 Complex-valued dense vector (sequential; no GPU)
 

Functions

void num::scale (Vector &v, real alpha, Backend b=default_backend)
 Compute \(v \leftarrow \alpha v\).
 
void num::add (const Vector &x, const Vector &y, Vector &z, Backend b=default_backend)
 Compute \(z=x+y\).
 
void num::axpy (real alpha, const Vector &x, Vector &y, Backend b=default_backend)
 Compute \(y \leftarrow y+\alpha x\).
 
real num::dot (const Vector &x, const Vector &y, Backend b=default_backend)
 Compute \(x^T y\).
 
real num::norm (const Vector &x, Backend b=default_backend)
 Compute \(\|x\|_2\).
 
void num::scale (CVector &v, cplx alpha)
 v *= alpha
 
void num::axpy (cplx alpha, const CVector &x, CVector &y)
 y += alpha * x
 
cplx num::dot (const CVector &x, const CVector &y)
 Conjugate inner product <x, y> = Sigma conj(x_i) * y_i.
 
real num::norm (const CVector &x)
 Euclidean norm sqrt(Sigma |v_i|^2)
 

Detailed Description

Dense vector storage and operations.

Definition in file vector.hpp.