VEC

This class is used to store 1D arrays. More…

#include "VEC.h"

Inherited by VEC_CPU< TYPE >

Public Functions

Name
VEC< TYPE > & operator=(VEC< TYPE > const & x)
Copy operator.
iExt size() const
Returns the length of the object.
TYPE * data()
Returns a pointer to the data of the object.
const TYPE * data() const
TYPE * begin() const
Returns a pointer to the beginning of the data stored.
TYPE * end() const
Returns a pointer to the end of the data stored.
virtual ~VEC() =0
Deletes the object.
virtual void resize(const iExt new_length) =0
Resizes current storage preserving already stored elements.
virtual void swap(VEC< TYPE > & V) =0
Swaps two vector instances.
virtual void assign(const iExt new_length, const TYPE & value) =0
Assign a given value.
virtual void overlap(const iExt new_length, TYPE *restrict pt_data_in) =0
Overlaps current VEC_CPU instance with the data pointed by pt_data_in. The length of the array is assigned by the user and is responsibility of the user to ensure consistency.
virtual void assign_nullptr() =0
Assign null pointer.
virtual void copy(VEC< TYPE > const & x) =0

Protected Functions

Name
int GetBasicType()
Retrieve type index if basic type otherwise return -1.

Protected Attributes

Name
iExt length
Number of entries.
TYPE * pt_data
Entries stored in the container.

Detailed Description

template <typename TYPE >
class VEC;

This class is used to store 1D arrays.

class VEC.

Public Functions Documentation

function operator=

VEC< TYPE > & operator=(
    VEC< TYPE > const & x
)

Copy operator.

function size

iExt size() const

Returns the length of the object.

function data

TYPE * data()

Returns a pointer to the data of the object.

function data

const TYPE * data() const

function begin

TYPE * begin() const

Returns a pointer to the beginning of the data stored.

function end

TYPE * end() const

Returns a pointer to the end of the data stored.

function ~VEC

virtual ~VEC() =0

Deletes the object.

function resize

virtual void resize(
    const iExt new_length
) =0

Resizes current storage preserving already stored elements.

Reimplemented by: VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize, VEC_CPU::resize

function swap

virtual void swap(
    VEC< TYPE > & V
) =0

Swaps two vector instances.

Reimplemented by: VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap, VEC_CPU::swap

function assign

virtual void assign(
    const iExt new_length,
    const TYPE & value
) =0

Assign a given value.

Reimplemented by: VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign, VEC_CPU::assign

function overlap

virtual void overlap(
    const iExt new_length,
    TYPE *__restrict__ pt_data_in
) =0

Overlaps current VEC_CPU instance with the data pointed by pt_data_in. The length of the array is assigned by the user and is responsibility of the user to ensure consistency.

Reimplemented by: VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap, VEC_CPU::overlap

function assign_nullptr

virtual void assign_nullptr() =0

Assign null pointer.

Reimplemented by: VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr, VEC_CPU::assign_nullptr

function copy

virtual void copy(
    VEC< TYPE > const & x
) =0

Reimplemented by: VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy, VEC_CPU::copy

@ brief Copy.

Protected Functions Documentation

function GetBasicType

int GetBasicType()

Retrieve type index if basic type otherwise return -1.

Protected Attributes Documentation

variable length

iExt length = 0;

Number of entries.

variable pt_data

TYPE * pt_data = nullptr;

Entries stored in the container.


Updated on 19 November 2024 at 10:20:48 CET