cawlign 0.0.1
Codon-aware pairwise sequence alignment
Loading...
Searching...
No Matches
VectorFP Class Reference

A simple vector class for floating point numbers that allows for dynamic resizing. More...

#include <stringBuffer.h>

Public Member Functions

 VectorFP (void)
 Construct a new VectorFP object.
 ~VectorFP (void)
 Destroy the VectorFP object.
void appendValue (const cawlign_fp)
 Append a value to the vector.
void appendValues (const cawlign_fp *, long)
 Append multiple values to the vector.
void storeValue (const cawlign_fp, const unsigned long)
 Store a value at a specific index.
cawlign_fp value (const long idx)
 Get a value at a specific index.
unsigned long length (void) const
 Get the length of the vector.
const cawlign_fp * values (void)
 Get the underlying C array.
cawlign_fp * rvalues (void)
 Get the underlying C array.

Static Public Attributes

static long vDefaultLength = 16
static long vDefaultBoost = 16

Detailed Description

A simple vector class for floating point numbers that allows for dynamic resizing.

Constructor & Destructor Documentation

◆ VectorFP()

VectorFP::VectorFP ( void )

Construct a new VectorFP object.

Initializes an empty vector of floating-point values with a default initial capacity.

◆ ~VectorFP()

VectorFP::~VectorFP ( void )

Destroy the VectorFP object.

Frees the memory allocated for the floating-point vector data.

Member Function Documentation

◆ appendValue()

void VectorFP::appendValue ( const cawlign_fp l)

Append a value to the vector.

Parameters
valueThe value to append.

Appends a floating-point value to the VectorFP.

Adds a floating-point value to the end of the vector, growing the vector if needed.

Parameters
lThe floating-point value to append.

◆ appendValues()

void VectorFP::appendValues ( const cawlign_fp * l,
long N )

Append multiple values to the vector.

Parameters
valuesThe values to append.
countThe number of values to append.

Appends multiple floating-point values to the VectorFP.

Parameters
lThe array of floating-point values to append.
NThe number of values to append.

◆ length()

unsigned long VectorFP::length ( void ) const
inline

Get the length of the vector.

Returns
unsigned long The length of the vector.

◆ rvalues()

cawlign_fp * VectorFP::rvalues ( void )
inline

Get the underlying C array.

Returns
cawlign_fp* A pointer to the underlying C array.

◆ storeValue()

void VectorFP::storeValue ( const cawlign_fp v,
const unsigned long l )

Store a value at a specific index.

Parameters
valueThe value to store.
indexThe index to store the value at.

Stores a floating-point value at a specific index in the VectorFP.

If the index is beyond the current capacity, the vector grows to accommodate the value.

Parameters
vThe floating-point value to store.
lThe index at which to store the value.

◆ value()

cawlign_fp VectorFP::value ( const long idx)
inline

Get a value at a specific index.

Parameters
idxThe index to get the value from.
Returns
cawlign_fp The value at the index.

◆ values()

const cawlign_fp * VectorFP::values ( void )
inline

Get the underlying C array.

Returns
const cawlign_fp* A pointer to the underlying C array.

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