|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
This class allows storing lists of integers accessible in constant time. More...
#include <Static_Int_Lists.h>
Public Types | |
| using | int_t = _SIZE_ |
| using | ArrOfInt_t = ArrOfInt_T<_SIZE_> |
| using | ArrsOfInt_t = ArrsOfInt_T<_SIZE_> |
Public Member Functions | |
| void | set_list_sizes (const ArrOfInt_t &sizes) |
| Destroys existing lists and creates new ones. | |
| void | reset () |
| Destroys all lists. | |
| 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. | |
| 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_list_size(i). | |
| 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). | |
| int_t | get_list_size (int_t i_liste) const |
| Returns the number of elements in list i. | |
| int_t | get_nb_lists () const |
| Returns the number of stored lists. | |
| const ArrOfInt_t & | get_index () const |
| const ArrOfInt_t & | get_data () const |
| void | set_data (const ArrOfInt_t &data) |
| Replaces the values stored in all lists with those from the data array. | |
| void | set_index_data (const ArrOfInt_t &index, const ArrOfInt_t &data) |
| Replaces index and data arrays. | |
| void | trier_liste (int_t i) |
| Sorts the values of the i-th list in ascending order. | |
| void | set (const ArrsOfInt_t &src) |
| Sortie & | printOn (Sortie &os) const |
| Entree & | readOn (Entree &is) |
| Sortie & | ecrire (Sortie &os) const |
This class allows storing lists of integers accessible in constant time.
The size of the lists cannot change without losing the content (these are static lists). Example: Static_Int_List l; ArrOfInt tailles(3); tailles[0] = 2; tailles[1] = 3; tailles[2] = 0; // Reserve memory for three lists of size 2, 3 and 0: l.set_list_sizes(tailles); // Assign a value to the second element of the first list: l.set_value(0,1,765); // Print the value Cout << l(0,1);
Definition at line 38 of file Static_Int_Lists.h.
| using Static_Int_Lists_32_64< _SIZE_ >::ArrOfInt_t = ArrOfInt_T<_SIZE_> |
Definition at line 42 of file Static_Int_Lists.h.
| using Static_Int_Lists_32_64< _SIZE_ >::ArrsOfInt_t = ArrsOfInt_T<_SIZE_> |
Definition at line 43 of file Static_Int_Lists.h.
| using Static_Int_Lists_32_64< _SIZE_ >::int_t = _SIZE_ |
Definition at line 41 of file Static_Int_Lists.h.
| void Static_Int_Lists_32_64< _SIZE_ >::copy_list_to_array | ( | int_t | i, |
| ArrOfInt_t & | array ) const |
Copies the i-th list into the provided array. The array must be resizable.
| i | index of the list to copy |
| array | destination array to fill |
Definition at line 124 of file Static_Int_Lists.cpp.
| Sortie & Static_Int_Lists_32_64< _SIZE_ >::ecrire | ( | Sortie & | os | ) | const |
Definition at line 154 of file Static_Int_Lists.cpp.
|
inline |
Definition at line 55 of file Static_Int_Lists.h.
|
inline |
Definition at line 54 of file Static_Int_Lists.h.
|
inline |
Returns the number of elements in list i.
Definition at line 102 of file Static_Int_Lists.h.
|
inline |
Returns the number of stored lists.
Definition at line 111 of file Static_Int_Lists.h.
|
inline |
Returns the j-th element of the i-th list with 0 <= i < get_nb_lists() and 0 <= j < get_list_size(i).
Definition at line 90 of file Static_Int_Lists.h.
| Sortie & Static_Int_Lists_32_64< _SIZE_ >::printOn | ( | Sortie & | os | ) | const |
Definition at line 133 of file Static_Int_Lists.cpp.
| Entree & Static_Int_Lists_32_64< _SIZE_ >::readOn | ( | Entree & | is | ) |
Definition at line 143 of file Static_Int_Lists.cpp.
| void Static_Int_Lists_32_64< _SIZE_ >::reset | ( | ) |
Destroys all lists.
Definition at line 21 of file Static_Int_Lists.cpp.
| void Static_Int_Lists_32_64< _SIZE_ >::set | ( | const ArrsOfInt_t & | src | ) |
Definition at line 178 of file Static_Int_Lists.cpp.
| void Static_Int_Lists_32_64< _SIZE_ >::set_data | ( | const ArrOfInt_t & | data | ) |
Replaces the values stored in all lists with those from the data array.
data must have a size equal to the sum of the sizes of all lists.
Definition at line 58 of file Static_Int_Lists.cpp.
| void Static_Int_Lists_32_64< _SIZE_ >::set_index_data | ( | const ArrOfInt_t & | index, |
| const ArrOfInt_t & | data ) |
Replaces index and data arrays.
| index | the new index array |
| data | the new data array |
Definition at line 89 of file Static_Int_Lists.cpp.
| void Static_Int_Lists_32_64< _SIZE_ >::set_list_sizes | ( | const ArrOfInt_t & | sizes | ) |
Destroys existing lists and creates new ones.
Creates as many lists as there are elements in the sizes array. The i-th list has a size of sizes[i]. The sizes values must be non-negative.
Definition at line 35 of file Static_Int_Lists.cpp.
|
inline |
Assigns "valeur" to the j-th element of the i-th list with 0 <= i < get_nb_lists() and 0 <= j < get_list_size(i).
Definition at line 79 of file Static_Int_Lists.h.
| void Static_Int_Lists_32_64< _SIZE_ >::trier_liste | ( | int_t | num_liste | ) |
Sorts the values of the i-th list in ascending order.
If num_liste < 0, all lists are sorted.
| num_liste | index of the list to sort, or -1 to sort all lists |
Definition at line 103 of file Static_Int_Lists.cpp.