15#ifndef Static_Int_Lists_included
16#define Static_Int_Lists_included
18#include <TRUSTTabs_forward.h>
19#include <TRUSTArray.h>
37template <
typename _SIZE_>
78template <
typename _SIZE_>
81 const int_t index = index_[i] + j;
82 assert(index < index_[i+1]);
83 valeurs_[index] = valeur;
89template <
typename _SIZE_>
92 const int_t index = index_[i] + j;
93 assert(index < index_[i+1]);
94 const int_t val = valeurs_[index];
101template <
typename _SIZE_>
104 return index_[i+1] - index_[i];
110template <
typename _SIZE_>
113 return index_.size_array() - 1;
Class defining operators and methods for all reading operation in an input flow (file,...
Base class for output streams.
This class allows storing lists of integers accessible in constant time.
void set(const ArrsOfInt_t &src)
Sortie & ecrire(Sortie &os) const
void copy_list_to_array(int_t i_liste, ArrOfInt_t &array) const
Copies the i-th list into the provided array. The array must be resizable.
const ArrOfInt_t & get_index() const
void set_value(int_t i_liste, int_t i_element, int_t valeur)
Assigns "valeur" to the j-th element of the i-th list with 0 <= i < get_nb_lists() and 0 <= j < get_l...
void set_index_data(const ArrOfInt_t &index, const ArrOfInt_t &data)
Replaces index and data arrays.
ArrsOfInt_T< _SIZE_ > ArrsOfInt_t
void reset()
Destroys all lists.
int_t get_list_size(int_t i_liste) const
Returns the number of elements in list i.
void trier_liste(int_t i)
Sorts the values of the i-th list in ascending order.
void set_list_sizes(const ArrOfInt_t &sizes)
Destroys existing lists and creates new ones.
int_t get_nb_lists() const
Returns the number of stored lists.
Entree & readOn(Entree &is)
ArrOfInt_T< _SIZE_ > ArrOfInt_t
Sortie & printOn(Sortie &os) const
void set_data(const ArrOfInt_t &data)
Replaces the values stored in all lists with those from the data array.
const ArrOfInt_t & get_data() const
int_t operator()(int_t i_liste, int_t i_element) const
Returns the j-th element of the i-th list with 0 <= i < get_nb_lists() and 0 <= j < get_list_size(i).