HMM
Toolbox for hidden Markov models
shuttleFuns.cpp File Reference

helper functions for converting data types for HMM models More...

#include <hmm.h>

Functions

std::vector< double > array2vec (double ary[], int len)
 converts C array (of doubles) to std::vector of doubles More...
 
std::vector< int > array2vec (int ary[], int len)
 converts C array (of ints) to std::vector of ints More...
 
void vec2array (std::vector< double > vIn, double *ary)
 converts std::vector of doubles to array using std::copy More...
 
void modDub (double *pDub)
 modifies the value at a pointer location, for debuggin More...
 
void modDubVec (double *pDub, int lenDub)
 modifies the values across vector at a pointer location, for debuggin More...
 

Detailed Description

helper functions for converting data types for HMM models

helper functions for converting data types for HMM models

Author
Adam Willats
Date
2/27/19.

Function Documentation

◆ array2vec() [1/2]

std::vector<double> array2vec ( double  ary[],
int  len 
)

converts C array (of doubles) to std::vector of doubles

Parameters
aryC array in
lenlength of vector
Returns
std::vector converted from input

◆ array2vec() [2/2]

std::vector<int> array2vec ( int  ary[],
int  len 
)

converts C array (of ints) to std::vector of ints

Parameters
aryC array in
lenength of vector
Returns
std::vector converted from input

◆ modDub()

void modDub ( double *  pDub)

modifies the value at a pointer location, for debuggin

Parameters
pDubpointer to double
Warning
for debug only

◆ modDubVec()

void modDubVec ( double *  pDub,
int  lenDub 
)

modifies the values across vector at a pointer location, for debuggin

Parameters
pDubpointer to start of vector of doubles
lenDublength of vector of doubles
Warning
for debug only

◆ vec2array()

void vec2array ( std::vector< double >  vIn,
double *  ary 
)

converts std::vector of doubles to array using std::copy

Parameters
vInstd::vector in
arypointer to location where array should be copied