qxLib
Public Member Functions | List of all members
qx::triangular_vector< T > Class Template Reference

Triangular vector class. More...

#include <triangular_vector.h>

Public Member Functions

 triangular_vector (size_type nSideSize)
 triangular_vector object constructor More...
 
 triangular_vector (size_type nSideSize, const_reference data)
 triangular_vector object constructor More...
 
void assign (triangular_vector &&other) noexcept
 Assigns new contents to the vector, moving from other vector. More...
 
void assign (const triangular_vector &other)
 Assigns new contents to the vector, copying from other vector. More...
 
void assign (size_type nSideSize, const_reference data)
 Assigns new contents to the vector, creating new vector with size size and filling value. More...
 
bool reserve (size_type nSideSize)
 Reserve memory for vector. More...
 
bool resize (size_type nSideSize)
 Resize triangular vector without filling with new value. More...
 
bool resize (size_type nSideSize, const_reference data)
 Resize triangular vector with filling with new value. More...
 
void fill (const_reference data)
 Fill vector with value. More...
 
const_reference get (size_type nRow, size_type nCol) const noexcept
 Get value on position. More...
 
void set (size_type nRow, size_type nCol, const_reference data) noexcept
 Set value on position. More...
 
size_type size_side () const noexcept
 Get matrix side size. More...
 
size_type capacity () const noexcept
 Get capacity. More...
 
void free ()
 Clear vector and free memory.
 

Detailed Description

template<class T>
class qx::triangular_vector< T >

Triangular vector class.

Only elements with nRow >= nCols are stored data storage example: x 0 0 0 vec[r][c] = r >= c => vec[r][c] x x 0 0 r < c => vec[c][r] x x x 0 x x x x

Template Parameters
T- value type
Author
Khrapov
Date
23.02.2020

Definition at line 35 of file triangular_vector.h.

Constructor & Destructor Documentation

◆ triangular_vector() [1/2]

template<class T >
qx::triangular_vector< T >::triangular_vector ( size_type  nSideSize)
inline

triangular_vector object constructor

Parameters
nSideSize- matrix side size

Definition at line 26 of file triangular_vector.inl.

◆ triangular_vector() [2/2]

template<class T >
qx::triangular_vector< T >::triangular_vector ( size_type  nSideSize,
const_reference  data 
)
inline

triangular_vector object constructor

Parameters
nSideSize- matrix side size
data- data to fill

Definition at line 32 of file triangular_vector.inl.

Member Function Documentation

◆ assign() [1/3]

template<class T >
void qx::triangular_vector< T >::assign ( const triangular_vector< T > &  other)
inline

Assigns new contents to the vector, copying from other vector.

Parameters
other- other triangular_vector

Definition at line 69 of file triangular_vector.inl.

◆ assign() [2/3]

template<class T >
void qx::triangular_vector< T >::assign ( size_type  nSideSize,
const_reference  data 
)
inline

Assigns new contents to the vector, creating new vector with size size and filling value.

Parameters
nSideSize- matrix side size
data- data to fill

Definition at line 76 of file triangular_vector.inl.

◆ assign() [3/3]

template<class T >
void qx::triangular_vector< T >::assign ( triangular_vector< T > &&  other)
inlinenoexcept

Assigns new contents to the vector, moving from other vector.

Parameters
other- triangular_vector rvalue ref

Definition at line 60 of file triangular_vector.inl.

◆ capacity()

template<class T >
triangular_vector< T >::size_type qx::triangular_vector< T >::capacity ( void  ) const
inlinenoexcept

Get capacity.

Return values
-capacity

Definition at line 161 of file triangular_vector.inl.

◆ fill()

template<class T >
void qx::triangular_vector< T >::fill ( const_reference  data)
inline

Fill vector with value.

Parameters
data- value to fill

Definition at line 135 of file triangular_vector.inl.

◆ get()

template<class T >
triangular_vector< T >::const_reference qx::triangular_vector< T >::get ( size_type  nRow,
size_type  nCol 
) const
inlinenoexcept

Get value on position.

Parameters
nRow- row num
nCol- column num
Return values
-vector value

Definition at line 142 of file triangular_vector.inl.

◆ reserve()

template<class T >
bool qx::triangular_vector< T >::reserve ( size_type  nSideSize)
inline

Reserve memory for vector.

Parameters
nSideSize- new matrix side size
Return values
-true if reserved

Definition at line 82 of file triangular_vector.inl.

◆ resize() [1/2]

template<class T >
bool qx::triangular_vector< T >::resize ( size_type  nSideSize)
inline

Resize triangular vector without filling with new value.

Parameters
nSideSize- new matrix side size
Return values
-true if resized

Definition at line 103 of file triangular_vector.inl.

◆ resize() [2/2]

template<class T >
bool qx::triangular_vector< T >::resize ( size_type  nSideSize,
const_reference  data 
)
inline

Resize triangular vector with filling with new value.

Parameters
nSideSize- new matrix side size
data- data to fill
Return values
-true if resized

Definition at line 124 of file triangular_vector.inl.

◆ set()

template<class T >
void qx::triangular_vector< T >::set ( size_type  nRow,
size_type  nCol,
const_reference  data 
)
inlinenoexcept

Set value on position.

Parameters
nRow- row num
nCol- column num
data- value to set

Definition at line 149 of file triangular_vector.inl.

◆ size_side()

template<class T >
triangular_vector< T >::size_type qx::triangular_vector< T >::size_side ( void  ) const
inlinenoexcept

Get matrix side size.

Return values
-matrix side size

Definition at line 155 of file triangular_vector.inl.


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