dejavu
Fast probabilistic symmetry detection.
Loading...
Searching...
No Matches
dejavu::ds::workspace Class Reference

Fixed-size integer array, 0-initialized. More...

#include <ds.h>

Public Member Functions

 workspace ()=default
 
 workspace (int size)
 
 workspace (const workspace &other)
 
workspaceoperator= (const workspace &other)
 
workspaceoperator= (workspace &&other)
 
void swap (workspace &other)
 
void copy (const workspace &other)
 
void allocate (int size)
 
void reset ()
 
void resize (const int size)
 
 ~workspace ()
 
dej_nodiscard int * get_array () const
 
int & operator[] (int index) const
 

Detailed Description

Fixed-size integer array, 0-initialized.

An array of fixed size, with some further convenience functions.

Definition at line 326 of file ds.h.

Constructor & Destructor Documentation

◆ workspace() [1/3]

dejavu::ds::workspace::workspace ( )
default

Default constructor, does not allocate any memory.

◆ workspace() [2/3]

dejavu::ds::workspace::workspace ( int  size)
inlineexplicit

Constructor that allocates the internal array with size size. The allocated memory is not initialized.

Parameters
sizeSize to allocate.

Definition at line 356 of file ds.h.

◆ workspace() [3/3]

dejavu::ds::workspace::workspace ( const workspace other)
inline

Definition at line 360 of file ds.h.

◆ ~workspace()

dejavu::ds::workspace::~workspace ( )
inline

Deallocates the internal array.

Definition at line 430 of file ds.h.

Member Function Documentation

◆ allocate()

void dejavu::ds::workspace::allocate ( int  size)
inline

Allocates the internal array with size size. The allocated memory is not initialized. Initializes the internal position cur_pos of the array at 0.

Parameters
sizeSize to allocate.

Definition at line 396 of file ds.h.

◆ copy()

void dejavu::ds::workspace::copy ( const workspace other)
inline

Definition at line 384 of file ds.h.

◆ get_array()

dej_nodiscard int * dejavu::ds::workspace::get_array ( ) const
inline
Returns
A pointer to the internal memory.

Definition at line 437 of file ds.h.

◆ operator=() [1/2]

workspace & dejavu::ds::workspace::operator= ( const workspace other)
inline

Definition at line 364 of file ds.h.

◆ operator=() [2/2]

workspace & dejavu::ds::workspace::operator= ( workspace &&  other)
inline

Definition at line 370 of file ds.h.

◆ operator[]()

int & dejavu::ds::workspace::operator[] ( int  index) const
inline

Access element index in the internal array arr.

Parameters
indexIndex of the internal array.
Returns
The element arr[index].

Definition at line 447 of file ds.h.

◆ reset()

void dejavu::ds::workspace::reset ( )
inline

Sets the entire array to 0.

Definition at line 403 of file ds.h.

◆ resize()

void dejavu::ds::workspace::resize ( const int  size)
inline

Resizes the internal array to size. Copies the contents of the old array into the new one. If the new size is larger than the old one, the new space is only allocated and not initialized.

Parameters
sizeNew size to allocate the array to.

Definition at line 413 of file ds.h.

◆ swap()

void dejavu::ds::workspace::swap ( workspace other)
inline

Definition at line 375 of file ds.h.


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