FIMS  v0.8.0
Loading...
Searching...
No Matches
RealVector Class Reference

An Rcpp interface class that defines the RealVector class. More...

#include <rcpp_interface_base.hpp>

Public Member Functions

 RealVector ()
 The constructor.
 
 RealVector (const RealVector &other)
 The constructor.
 
 RealVector (size_t size)
 The constructor.
 
 RealVector (Rcpp::NumericVector x, size_t size)
 The constructor for initializing a real vector.
 
 RealVector (const fims::Vector< double > &v)
 The constructor for initializing a real vector.
 
virtual ~RealVector ()
 Destroy the real Vector object.
 
RealVectoroperator= (const Rcpp::NumericVector &v)
 
virtual uint32_t get_id ()
 Gets the ID of the RealVector object.
 
void fromRVector (const Rcpp::NumericVector &orig)
 
Rcpp::NumericVector toRVector ()
 
doubleoperator[] (size_t pos)
 The accessor where the first index starts is zero.
 
SEXP at (R_xlen_t pos)
 The accessor where the first index starts at one. This function is for calling accessing from R.
 
doubleget (size_t pos)
 An internal accessor for calling a position of a RealVector from R.
 
void set (size_t pos, const double &p)
 An internal setter for setting a position of a RealVector from R.
 
size_t size ()
 Returns the size of a RealVector.
 
void resize (size_t size)
 Resizes a RealVector to the desired length.
 
void fill (double value)
 Sets the value of all elements in the RealVector to the provided value.
 
void show ()
 The printing methods for a RealVector.
 

Public Attributes

std::shared_ptr< std::vector< double > > storage_m
 real storage.
 
uint32_t id_m
 The local ID of the RealVector object.
 

Static Public Attributes

static uint32_t id_g = 0
 The static ID of the RealVector object.
 

Detailed Description

An Rcpp interface class that defines the RealVector class.

An Rcpp interface class that defines the interface between R and C++ for a real vector type. Underlying values are held in a shared pointer and are carried over to any copies of this vector.

Constructor & Destructor Documentation

◆ RealVector() [1/2]

RealVector::RealVector ( Rcpp::NumericVector  x,
size_t  size 
)
inline

The constructor for initializing a real vector.

Parameters
xA numeric vector.
sizeThe number of elements to copy over.

◆ RealVector() [2/2]

RealVector::RealVector ( const fims::Vector< double > &  v)
inline

The constructor for initializing a real vector.

Parameters
vA vector of doubles.

Member Function Documentation

◆ at()

SEXP RealVector::at ( R_xlen_t  pos)
inline

The accessor where the first index starts at one. This function is for calling accessing from R.

Parameters
posThe position of the ParameterVector that you want returned.

◆ fill()

void RealVector::fill ( double  value)
inline

Sets the value of all elements in the RealVector to the provided value.

Parameters
valueA double specifying the value to set all elements to within the RealVector.

◆ fromRVector()

void RealVector::fromRVector ( const Rcpp::NumericVector &  orig)
inline
Parameters
orig

◆ get()

double & RealVector::get ( size_t  pos)
inline

An internal accessor for calling a position of a RealVector from R.

Parameters
posAn integer specifying the position of the RealVector you want returned. The first position is one and the last position is the same as the size of the RealVector.

◆ operator=()

RealVector & RealVector::operator= ( const Rcpp::NumericVector &  v)
inline
Parameters
v
Returns
RealVector&

◆ operator[]()

double & RealVector::operator[] ( size_t  pos)
inline

The accessor where the first index starts is zero.

Parameters
posThe position of the RealVector that you want returned.

◆ resize()

void RealVector::resize ( size_t  size)
inline

Resizes a RealVector to the desired length.

Parameters
sizeAn integer specifying the desired length for the RealVector to be resized to.

◆ set()

void RealVector::set ( size_t  pos,
const double p 
)
inline

An internal setter for setting a position of a RealVector from R.

Parameters
posAn integer specifying the position of the RealVector you want to set. The first position is one and the last position is the same as the size of the RealVector.
pA numeric value specifying the value to set position pos to in the RealVector.

◆ toRVector()

Rcpp::NumericVector RealVector::toRVector ( )
inline
Returns
Rcpp::NumericVector

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