LatNet Builder Manual  2.0.1-11
Software Package for Constructing Highly Uniform Point Sets
NTL::vector< T > Class Template Reference

A subclass of the NTL::Vec<T> class. More...

#include <ntlwrap.h>

Inherits Vec< T >, and Vec< T >.

Public Types

typedef long size_type
 
typedef std::int64_t size_type
 

Public Member Functions

 vector ()
 Constructor.
 
 vector (size_type size)
 
 vector (const Vec< T > &v)
 
void resize (size_type size)
 Set the vector lenght to size new objects are initialized using the default contructor for T a copy from NTL::Vec<T>::SetLength.
 
void clear ()
 release space and set to length 0 a copy from NTL::Vec<T>::kill
 
size_type size () const
 a copy from NTL::Vec<T>::length
 
size_type max_size () const
 a copy from NTL::Vec<T>::MaxLength
 
void push_back (const T &element)
 a copy from NTL::Vec<T>::append
 
back ()
 return the last element, this one is for STL compatibility
 
bool empty () const
 check if a vector is empty
 
const T & operator() (size_type i) const
 change the indexation reference for () operator to start from 0 in NTL::Vec<T> the () operator starts from 1 wich is not compatible with boost
 
T & operator() (size_type i)
 
 vector ()
 Empty constructor. More...
 
 vector (size_type size)
 Allocation constructor. More...
 
 vector (const Vec< T > &v)
 Copy constructor. More...
 
 ~vector ()
 Destructor. More...
 
void resize (size_type size)
 Set the vector lenght to size. More...
 
void clear ()
 Releases space and sets length to 0. More...
 
size_type size () const
 Returns the current lenght of the vector. More...
 
size_type max_size () const
 Returns the number of allocated and initialized elements in the vector. More...
 
bool empty () const
 Returns true if the vector has length 0 and false otherwise.
 
const T & operator() (size_type i) const
 Change in the indexation reference for () operator to start from 0. More...
 
T & operator() (size_type i)
 

Detailed Description

template<typename T>
class NTL::vector< T >

A subclass of the NTL::Vec<T> class.

It extends its parent with a few methods and overloads a few others with more compatible defaults.

Member Typedef Documentation

◆ size_type

template<typename T>
typedef std::int64_t NTL::vector< T >::size_type

Constructor & Destructor Documentation

◆ vector() [1/3]

template<typename T>
NTL::vector< T >::vector ( )
inline

Empty constructor.

Creates a vector of size 0.

◆ vector() [2/3]

template<typename T>
NTL::vector< T >::vector ( size_type  size)
inline

Allocation constructor.

Allocates the space needed by a vector of size size.

Parameters
sizeThe size of the vector

◆ vector() [3/3]

template<typename T>
NTL::vector< T >::vector ( const Vec< T > &  v)
inline

Copy constructor.

Makes a copy of v.

Parameters
vVector to be copied.

◆ ~vector()

template<typename T>
NTL::vector< T >::~vector ( )
inline

Destructor.

Frees memory of all T and destroys the vector.

Member Function Documentation

◆ clear()

template<typename T>
void NTL::vector< T >::clear ( )
inline

Releases space and sets length to 0.

This uses NTL::Vec<T>::kill().

◆ max_size()

template<typename T>
size_type NTL::vector< T >::max_size ( ) const
inline

Returns the number of allocated and initialized elements in the vector.

It is possible for the vector length to differ from this one if the max length has been preemptively expanded or if the vector has been shrinked because NTL does not free components until explicitly asked. This uses NTL::Vec<T>::MaxLength().

◆ operator()()

template<typename T>
const T& NTL::vector< T >::operator() ( size_type  i) const
inline

Change in the indexation reference for () operator to start from 0.

In NTL::Vec<T> the () operator starts from 1 which is not compatible with boost.

◆ resize()

template<typename T>
void NTL::vector< T >::resize ( size_type  size)
inline

Set the vector lenght to size.

New objects are initialized using the default contructor for T This uses NTL::Vec<T>::SetLength(size)

Parameters
sizeThe new size wanted

◆ size()

template<typename T>
size_type NTL::vector< T >::size ( ) const
inline

Returns the current lenght of the vector.

This uses NTL::Vec<T>::length().


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