reconciliation_lib 0.1
Library for data reconciliation algorithms
Loading...
Searching...
No Matches
dvrlib::vector_view Class Reference

Non-owning view into a contiguous slice of a vector or matrix row/column. More...

#include <gsl_wrapper.h>

Public Member Functions

 vector_view (const vector_view &src)
 Copy constructor (shallow — both views reference the same data).
 
int size () const
 Return the number of elements.
 
double get (int i) const
 Return element i.
 
void set (int i, double val)
 Set element i to val (modifies the underlying data).
 
const gsl_vectorgsl_internal () const
 Return a read-only pointer to the underlying gsl_vector.
 
vector_viewoperator= (const vector &src)
 Copy values from src into the viewed memory.
 
vector_viewoperator= (const vector_view &src)
 Copy values from another view into the viewed memory.
 
 operator vector () const
 Create an independent vector copy of this view.
 

Private Member Functions

 vector_view (const gsl_vector_view &vv)
 

Private Attributes

gsl_vector_view vv
 

Friends

class vector
 
class matrix
 

Detailed Description

Non-owning view into a contiguous slice of a vector or matrix row/column.

Wraps a gsl_vector_view. The referenced data is owned by the original vector or matrix — the view must not outlive it. Assigning to a view modifies the underlying data in place. Use operator vector() to obtain an independent copy.

Constructor & Destructor Documentation

◆ vector_view() [1/2]

dvrlib::vector_view::vector_view ( const gsl_vector_view vv)
private

◆ vector_view() [2/2]

dvrlib::vector_view::vector_view ( const vector_view src)

Copy constructor (shallow — both views reference the same data).

Member Function Documentation

◆ get()

double dvrlib::vector_view::get ( int  i) const

Return element i.

◆ gsl_internal()

const gsl_vector * dvrlib::vector_view::gsl_internal ( ) const

Return a read-only pointer to the underlying gsl_vector.

◆ operator vector()

Create an independent vector copy of this view.

◆ operator=() [1/2]

Copy values from src into the viewed memory.

◆ operator=() [2/2]

Copy values from another view into the viewed memory.

◆ set()

void dvrlib::vector_view::set ( int  i,
double  val 
)

Set element i to val (modifies the underlying data).

◆ size()

int dvrlib::vector_view::size ( ) const

Return the number of elements.

Friends And Related Symbol Documentation

◆ matrix

◆ vector

Member Data Documentation

◆ vv

gsl_vector_view dvrlib::vector_view::vv
private

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