|
TrioCFD 1.9.9_beta
TrioCFD documentation
|
Represents a an array of int/int64/double/... values. More...
#include <TRUSTArray.h>
Public Types | |
| using | Value_type_ = _TYPE_ |
| using | int_t = _SIZE_ |
| using | Iterator_ = typename tcb::span<_TYPE_>::iterator |
| using | Vector_ = std::vector<_TYPE_, TVAlloc<_TYPE_> > |
| using | Span_ = tcb::span<_TYPE_> |
Public Member Functions | |
| Iterator_ | begin () |
| Iterator_ | end () |
| const Iterator_ | begin () const |
| const Iterator_ | end () const |
| virtual | ~TRUSTArray () |
| TRUSTArray () | |
| TRUSTArray (_SIZE_ n) | |
| TRUSTArray (const TRUSTArray &A) | |
| void | resize (_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) |
| void | resize_array (_SIZE_ new_size, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) |
| void | ref_as_big (TRUSTArray< _TYPE_, trustIdType > &out) const |
| void | ref_as_small (TRUSTArray< _TYPE_, int > &out) const |
| void | from_tid_to_int (TRUSTArray< int, int > &out) const |
| void | set_mem_storage (const STORAGE storage) |
| STORAGE | get_mem_storage () const |
| std::shared_ptr< Vector_ > | get_mem () |
| TRUSTArray & | operator= (const TRUSTArray &) |
| _TYPE_ & | operator[] (_SIZE_ i) |
| const _TYPE_ & | operator[] (_SIZE_ i) const |
| _TYPE_ & | operator() (_SIZE_ i) |
| const _TYPE_ & | operator() (_SIZE_ i) const |
| _TYPE_ * | addr () |
| const _TYPE_ * | addr () const |
| _TYPE_ * | data () |
| const _TYPE_ * | data () const |
| _SIZE_ | size_array () const |
| int | ref_count () const |
| void | append_array (_TYPE_ valeur) |
| TRUSTArray & | operator= (_TYPE_ x) |
| TRUSTArray & | operator+= (const TRUSTArray &y) |
| TRUSTArray & | operator+= (const _TYPE_ dy) |
| TRUSTArray & | operator-= (const TRUSTArray &y) |
| TRUSTArray & | operator-= (const _TYPE_ dy) |
| TRUSTArray & | operator*= (const _TYPE_ dy) |
| TRUSTArray & | operator/= (const _TYPE_ dy) |
| TRUSTArray & | inject_array (const TRUSTArray &source, _SIZE_ nb_elements=-1, _SIZE_ first_element_dest=0, _SIZE_ first_element_source=0) |
| TRUSTArray & | copy_array (const TRUSTArray &a) |
| void | ordonne_array () |
| virtual void | ref_data (_TYPE_ *ptr, _SIZE_ size) |
| virtual void | reset () |
| virtual void | ref_array (TRUSTArray &, _SIZE_ start=0, _SIZE_ sz=-1) |
| virtual void | resize_tab (_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) |
| DataLocation | get_data_location () |
| DataLocation | get_data_location () const |
| void | set_data_location (DataLocation flag) |
| void | set_data_location (DataLocation flag) const |
| int | size_mem () |
| void | ensureDataOnHost () |
| void | ensureDataOnHost () const |
| bool | isDataOnDevice () const |
| bool | checkDataOnDevice () |
| bool | checkDataOnDevice () const |
| bool | checkDataOnDevice (const TRUSTArray &arr) |
| virtual Span_ | get_span () |
| virtual Span_ | get_span_tot () |
| virtual const Span_ | get_span () const |
| virtual const Span_ | get_span_tot () const |
| virtual _SIZE_ | dimension_tot (int) const |
| void | ref_as_big (TRUSTArray< trustIdType, trustIdType > &out) const |
| Conversion methods - from a small array (SIZE=int) of TID (TYPE=trustIdType), return a big one (SIZE=trustIdType). No data copied! This behaves somewhat like a ref_array. Used in LATA stuff notably. Not implemented for TYPE=double or float (because never needed). | |
| void | ref_as_small (TRUSTArray< float, int > &out) const |
| Conversion methods - from a big array (SIZE=trustIdType), return a small one (SIZE=int). Overflow is detected in debug if array is too big to be fit into SIZE=int. No data copied! This behaves somewhat like a ref_array. Used in LATA stuff and FT notably. | |
| void | ref_as_small (TRUSTArray< int, int > &out) const |
| void | from_tid_to_int (TRUSTArray< int, int > &out) const |
| Conversion from a BigArrOfTID to an ArrOfInt. Careful, it always does a copy! It is your responsibility to invoke it only when necessary (typically you should avoid this when trustIdType == int ...). | |
| Public Member Functions inherited from Objet_U | |
| ~Objet_U () override | |
| Destructor. Removes the object from the list of objects registered in "memory". | |
| int | numero () const |
| Returns the index of the object in Memoire::data. | |
| virtual int | est_egal_a (const Objet_U &) const |
| Returns 1 if x and *this are the same instance (same memory address). | |
| virtual const Nom & | le_nom () const |
| Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation. | |
| virtual void | nommer (const Nom &) |
| Assigns a name to the Objet_U. Virtual method to override. | |
| virtual int | reprendre (Entree &) |
| Restores an Objet_U from an input stream. Virtual method to override. | |
| virtual int | sauvegarder (Sortie &) const |
| Saves an Objet_U to an output stream. Virtual method to override. | |
| int | get_object_id () const |
| Returns the unique identifier of the object (object_id_). | |
| virtual const Type_info * | get_info () const |
| Returns type information for the Objet_U. | |
| const Nom & | que_suis_je () const |
| Returns the string identifying the class. | |
| const char * | le_type () const |
| Returns the type name of the Objet_U. | |
| virtual int | change_num (const int *const) |
| Changes the internal number of the Objet_U. | |
| virtual int | lire_motcle_non_standard (const Motcle &motlu, Entree &is) |
| Reads non-simple-type parameters of an Objet_U from an input stream. | |
| virtual int | associer_ (Objet_U &) |
| Associates the Objet_U with another Objet_U. Virtual method to override. | |
| const Interprete & | interprete () const |
| Interprete & | interprete () |
| Public Member Functions inherited from Process | |
| virtual | ~Process () |
Protected Member Functions | |
| unsigned | taille_memoire () const override |
| int | duplique () const override |
| Sortie & | printOn (Sortie &os) const override |
| Writes the object to an output stream. Virtual method to override. | |
| Entree & | readOn (Entree &is) override |
| Reads an Objet_U from an input stream. Virtual method to override. | |
| void | attach_array (const TRUSTArray &a, _SIZE_ start=0, _SIZE_ size=-1) |
| bool | detach_array () |
| void | resize_array_ (_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) |
| Protected Member Functions inherited from Objet_U | |
| Objet_U () | |
| Default constructor: assigns a unique identifier to the object (object_id_) and registers the object in "memory" by giving it a num_obj number. | |
| Objet_U (const Objet_U &) | |
| Copy constructor. | |
| const Objet_U & | operator= (const Objet_U &) |
| Assignment operator: does nothing (the number and identifier are preserved). | |
| virtual void | set_param (Param &) const |
Protected Attributes | |
| int | nb_dim_ = 1 |
Friends | |
| class | TRUSTArrayKokkos |
| template<typename _TYPE2_, typename _SIZE2_> | |
| class | TRUSTArray |
Additional Inherited Members | |
| Static Public Member Functions inherited from Objet_U | |
| static const Nom & | nom_du_cas () |
| Returns a constant reference to the case name. This method is static. | |
| static Nom & | get_set_nom_du_cas () |
| Returns a non-constant reference to the case name (to allow modification). This method is static. | |
| static const Type_info * | info () |
| Returns type information for the Objet_U (static version). | |
| static const Objet_U & | self_cast (const Objet_U &) |
| Method added for casting in Python. | |
| static Objet_U & | self_cast (Objet_U &) |
| Static Public Member Functions inherited from Process | |
| static int | me () |
| Returns the rank of the local processor in the current communication group. See Comm_Group::rank() and PE_Groups::current_group(). | |
| static int | nproc () |
| Returns the number of processors in the current group. See Comm_Group::nproc() and PE_Groups::current_group(). | |
| static bool | is_parallel () |
| static void | exit (int exit_code=-1) |
| Exit routine for TRUST within a Kokkos region. | |
| static double | mp_sum (double) |
| Computes the sum of x over all processors in the current group. | |
| static float | mp_sum (float) |
| static trustIdType | mp_sum (trustIdType) |
| Computes the sum of x over all processors in the current group. | |
| static double | mp_max (double) |
| static double | mp_min (double) |
| static int | mp_max (int) |
| Returns the maximum value of x across all processors in the current group. | |
| static int | mp_min (int) |
| Returns the minimum value of x across all processors in the current group. | |
| static double | mp_sum_as_double (int v) |
| static trustIdType | mppartial_sum (trustIdType i) |
| Computes the partial sum of x over processors 0 to me()-1 (returns 0 on processor 0). | |
| template<typename T> | |
| static void | mp_sum_for_each (T &arg1, T &arg2) |
| C++14 compatible mp_sum_for_each: combine multiple mp_sum calls into one collective operation Usage: mp_sum_for_each(a, b); mp_sum_for_each(a, b, c); mp_sum_for_each(a, b, c, d); mp_sum_for_each(a, b, c, d, e); All arguments must be of the same type (double or int) and are modified in place. Supports 2-5 parameters. | |
| template<typename T> | |
| static void | mp_sum_for_each (T &arg1, T &arg2, T &arg3) |
| template<typename T> | |
| static void | mp_sum_for_each (T &arg1, T &arg2, T &arg3, T &arg4) |
| template<typename T> | |
| static void | mp_sum_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5) |
| template<typename T> | |
| static void | mp_max_for_each (T &arg1, T &arg2) |
| C++14 compatible mp_max_for_each: combine multiple mp_max calls into one collective operation. | |
| template<typename T> | |
| static void | mp_max_for_each (T &arg1, T &arg2, T &arg3) |
| template<typename T> | |
| static void | mp_max_for_each (T &arg1, T &arg2, T &arg3, T &arg4) |
| template<typename T> | |
| static void | mp_max_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5) |
| template<typename T> | |
| static void | mp_min_for_each (T &arg1, T &arg2) |
| C++14 compatible mp_min_for_each: combine multiple mp_min calls into one collective operation. | |
| template<typename T> | |
| static void | mp_min_for_each (T &arg1, T &arg2, T &arg3) |
| template<typename T> | |
| static void | mp_min_for_each (T &arg1, T &arg2, T &arg3, T &arg4) |
| template<typename T> | |
| static void | mp_min_for_each (T &arg1, T &arg2, T &arg3, T &arg4, T &arg5) |
| template<typename _TYPE_> | |
| static void | mp_sum_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1) |
| template<typename _TYPE_> | |
| static void | mp_max_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1) |
| template<typename _TYPE_> | |
| static void | mp_min_for_each_item (TRUSTArray< _TYPE_ > &x, int n=-1) |
| static bool | mp_and (bool) |
| Computes the logical AND of b across all processors in the current group. | |
| static bool | mp_or (bool) |
| static int | check_int_overflow (trustIdType) |
| static int | je_suis_maitre () |
| Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise. | |
| static KOKKOS_INLINE_FUNCTION void | Kokkos_exit (const char *) |
| Exit routine for TRUST within a Kokkos region. | |
| static int | node_master () |
| Returns 1 if on the NUMA node master processor, 0 otherwise. | |
| static void | exit (const Nom &message, int exit_code=-1) |
| static bool | is_sequential () |
| static void | barrier () |
| Synchronizes all processors in the current group (waits until all processors have reached the barrier). | |
| static void | abort () |
| Abort routine for TRUST on a fatal error. | |
| static Sortie & | Journal (int message_level=0) |
| Returns a static Sortie object used as an event journal. | |
| static double | ram_processeur () |
| static void | imprimer_ram_totale (int all_process=0) |
| static bool | force_single_file (const int ranks, const Nom &filename) |
| Static Public Attributes inherited from Objet_U | |
| static double | precision_geom = 1e-10 |
| static constexpr bool | HAS_POINTER = false |
| static int | dimension =0 |
| static int | format_precision_geom =11 |
| static int | axi =0 |
| static int | bidim_axi =0 |
| static int | DEACTIVATE_SIGINT_CATCH =0 |
| static Type_info | info_obj |
| static bool | disable_TU =false |
| Flag to disable or not the writing of the .TU files. | |
| static bool | stat_per_proc_perf_log =false |
| Flag to enable the writing of the statistics detailed per processor in _csv.TU file. | |
| Static Public Attributes inherited from Process | |
| static int | exception_sur_exit =0 |
| static int | multiple_files =5120 |
Represents a an array of int/int64/double/... values.
The two main members are mem_ and span_:
We can have 3 states for the array:
Finally, in case of a "XXTrav" array, the memory allocation is special:
In the template parameters below, TYPE is the value type (what it contains), SIZE is the extent type (how many items).
Definition at line 80 of file TRUSTArray.h.
| using TRUSTArray< _TYPE_, _SIZE_ >::int_t = _SIZE_ |
Definition at line 99 of file TRUSTArray.h.
| using TRUSTArray< _TYPE_, _SIZE_ >::Iterator_ = typename tcb::span<_TYPE_>::iterator |
Definition at line 100 of file TRUSTArray.h.
| using TRUSTArray< _TYPE_, _SIZE_ >::Span_ = tcb::span<_TYPE_> |
Definition at line 102 of file TRUSTArray.h.
| using TRUSTArray< _TYPE_, _SIZE_ >::Value_type_ = _TYPE_ |
Definition at line 98 of file TRUSTArray.h.
| using TRUSTArray< _TYPE_, _SIZE_ >::Vector_ = std::vector<_TYPE_, TVAlloc<_TYPE_> > |
Definition at line 101 of file TRUSTArray.h.
|
inlinevirtual |
Destroy array, potentially making block available again if this was a Trav
Definition at line 27 of file TRUSTArray.tpp.
|
inline |
Definition at line 118 of file TRUSTArray.h.
|
inline |
Definition at line 120 of file TRUSTArray.h.
|
inline |
Copy ctor. Performs a deep copy.
It is forbidden to deep copy a ref_data.
Definition at line 136 of file TRUSTArray.h.
|
inline |
Returns a pointer on the first element of the array. nullptr will be returned if array is detached. Careful, address might change after a resize_array(), ref_data(), etc.
Definition at line 159 of file TRUSTArray.tpp.
|
inline |
Definition at line 166 of file TRUSTArray.tpp.
|
inline |
Add a slot at the end of the array and store it valeur -> similar to vector<>::push_back
Ajoute une case en fin de tableau et y stocke la "valeur" Precondition: Le tableau ne doit pas etre "ref_data", et il ne doit pas y avoir plus d'une reference a la zone de memoire pointee (meme precondition que resize_array()) Le tableau doit etre de type TRUSTArray (pas un type derive)
Definition at line 216 of file TRUSTArray.tpp.
|
inlineprotected |
Attach the array to (part of) an existing block of data stored in another array. The data is then shared between that other array and this.
If size < 0, we take the data from the specified start till the end of the block. Array must be detached first before invoking this method. It is forbidden to attach to a ref_data.
Definition at line 242 of file TRUSTArray.tpp.
|
inline |
Definition at line 111 of file TRUSTArray.h.
|
inline |
Definition at line 113 of file TRUSTArray.h.
|
inline |
Definition at line 72 of file TRUSTArray_device.tpp.
|
inline |
Definition at line 57 of file TRUSTArray_device.tpp.
|
inline |
Definition at line 87 of file TRUSTArray_device.tpp.
|
inline |
Definition at line 227 of file TRUSTArray.h.
|
inline |
Definition at line 173 of file TRUSTArray.tpp.
|
inline |
Definition at line 179 of file TRUSTArray.tpp.
|
inlineprotected |
Bring the current array in a detached state, i.e. both 'mem_' and 'span_' are cleared, whatever the current state.
Definition at line 277 of file TRUSTArray.tpp.
|
inlinevirtual |
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, and TRUSTTab< trustIdType, trustIdType >.
Definition at line 297 of file TRUSTArray.tpp.
|
inlineoverrideprotectedvirtual |
Implements Objet_U.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTTrav< _TYPE_ >, TRUSTTrav< double >, TRUSTTrav< float >, TRUSTTrav< int >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 85 of file TRUSTArray.h.
|
inline |
Definition at line 112 of file TRUSTArray.h.
|
inline |
Definition at line 114 of file TRUSTArray.h.
|
inline |
Definition at line 33 of file TRUSTArray_device.tpp.
|
inline |
Definition at line 24 of file TRUSTArray_device.tpp.
| void TRUSTArray< trustIdType, trustIdType >::from_tid_to_int | ( | TRUSTArray< int, int > & | out | ) | const |
Conversion from a BigArrOfTID to an ArrOfInt. Careful, it always does a copy! It is your responsibility to invoke it only when necessary (typically you should avoid this when trustIdType == int ...).
| out | the output ArrOfInt filled with the converted values |
Definition at line 302 of file TRUSTArray.cpp.
| void TRUSTArray< _TYPE_, _SIZE_ >::from_tid_to_int | ( | TRUSTArray< int, int > & | out | ) | const |
Definition at line 319 of file TRUSTArray.cpp.
|
inline |
Definition at line 245 of file TRUSTArray.h.
|
inline |
Definition at line 246 of file TRUSTArray.h.
|
inline |
Definition at line 173 of file TRUSTArray.h.
|
inline |
Definition at line 171 of file TRUSTArray.h.
|
inlinevirtual |
Reimplemented in TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 258 of file TRUSTArray.h.
|
inlinevirtual |
Reimplemented in TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 260 of file TRUSTArray.h.
|
inlinevirtual |
Reimplemented in TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 259 of file TRUSTArray.h.
|
inlinevirtual |
Reimplemented in TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 261 of file TRUSTArray.h.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::inject_array | ( | const TRUSTArray< _TYPE_, _SIZE_ > & | source, |
| _SIZE_ | nb_elements = -1, | ||
| _SIZE_ | first_element_dest = 0, | ||
| _SIZE_ | first_element_source = 0 ) |
Copies elements source[first_element_source + i] into elements (*this)[first_element_dest + i] for 0 <= i < nb_elements The other elements of (*this) are left unchanged.
| const | ArrOfDouble& m: the array to use, must be different from *this ! |
| _SIZE_ | nb_elements: number of elements to copy, nb_elements >= -1. If nb_elements==-1, the entire array m is copied. Default value: -1 |
| _SIZE_ | first_element_dest. Default value: 0 |
| _SIZE_ | first_element_source. Default value: 0 |
| Exits | with an error if the size of array m is larger than the size of array this. |
Definition at line 195 of file TRUSTArray.cpp.
|
inline |
Definition at line 47 of file TRUSTArray_device.tpp.
|
inline |
Definition at line 180 of file TRUSTArray.h.
|
inline |
Definition at line 181 of file TRUSTArray.h.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator*= | ( | const _TYPE_ | dy | ) |
Multiplies all entries by dy
muliplie toutes les cases par dy
Definition at line 457 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator+= | ( | const _TYPE_ | dy | ) |
Adds the same value to all entries of the array
Adds the same value to every element of the array
Definition at line 389 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator+= | ( | const TRUSTArray< _TYPE_, _SIZE_ > & | y | ) |
Element-wise addition over all entries: the size of y must be at least equal to the size of *this
Element-wise addition over all elements of the array: the size of y must be at least equal to the size of this
Definition at line 358 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator-= | ( | const _TYPE_ | dy | ) |
Subtracts the same value from all entries
soustrait la meme valeur a toutes les cases
Definition at line 448 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator-= | ( | const TRUSTArray< _TYPE_, _SIZE_ > & | y | ) |
Element-wise subtraction over all entries: array must have the same size as *this
Element-wise subtraction over all elements of the array: array must be the same size as *this
Definition at line 417 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator/= | ( | const _TYPE_ | dy | ) |
Divides all entries by dy (not for TRUSTArray<int>)
divise toutes les cases par dy (pas pour TRUSTArray<int>)
Definition at line 485 of file TRUSTArray.cpp.
| TRUSTArray< _TYPE_, _SIZE_ > & TRUSTArray< _TYPE_, _SIZE_ >::operator= | ( | _TYPE_ | x | ) |
Assign 'x' to all slots in the array
Fills the array with the value x passed as parameter (x is assigned to every element of the array)
Definition at line 330 of file TRUSTArray.cpp.
|
inline |
Copy the data from another array, potentially resizing. The storage type is not copied.
Definition at line 115 of file TRUSTArray.tpp.
|
inline |
operateur [] retourne le ieme element du tableau Parametre: SIZE i Signification: indice dans l'intervalle 0 <= i < size_array() Exception: assert si i n'est pas dans l'intervalle
Definition at line 133 of file TRUSTArray.tpp.
|
inline |
Definition at line 143 of file TRUSTArray.tpp.
|
inline |
Tri des valeurs du tableau dans l'ordre croissant.
Definition at line 228 of file TRUSTArray.tpp.
|
overrideprotectedvirtual |
Writes the object to an output stream. Virtual method to override.
| s | Output stream. |
Reimplemented from Objet_U.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTTrav< _TYPE_ >, TRUSTTrav< double >, TRUSTTrav< float >, TRUSTTrav< int >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 29 of file TRUSTArray.cpp.
|
overrideprotectedvirtual |
Reads an Objet_U from an input stream. Virtual method to override.
| s | Input stream. |
Reimplemented from Objet_U.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTTrav< _TYPE_ >, TRUSTTrav< double >, TRUSTTrav< float >, TRUSTTrav< int >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 45 of file TRUSTArray.cpp.
|
inlinevirtual |
Make the current array point to the data of another existing array. Ownership of the data is hence shared.
The current array is first detached (see detach_array()), and then attached to the provided data (see attach_array()) Wanring: virtual -> in derived classes this method initializes structures to create a sequential array.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTVect< _TYPE_, _SIZE_ >, and TRUSTVect< _TYPE_, int >.
Definition at line 103 of file TRUSTArray.tpp.
| void TRUSTArray< _TYPE_, _SIZE_ >::ref_as_big | ( | TRUSTArray< _TYPE_, trustIdType > & | out | ) | const |
Definition at line 261 of file TRUSTArray.cpp.
| void TRUSTArray< trustIdType, int >::ref_as_big | ( | TRUSTArray< trustIdType, trustIdType > & | out | ) | const |
Conversion methods - from a small array (SIZE=int) of TID (TYPE=trustIdType), return a big one (SIZE=trustIdType). No data copied! This behaves somewhat like a ref_array. Used in LATA stuff notably. Not implemented for TYPE=double or float (because never needed).
| out | the output big array that will reference the same data |
Definition at line 255 of file TRUSTArray.cpp.
| void TRUSTArray< _TYPE_, _SIZE_ >::ref_as_small | ( | TRUSTArray< _TYPE_, int > & | out | ) | const |
Definition at line 290 of file TRUSTArray.cpp.
| void TRUSTArray< float, trustIdType >::ref_as_small | ( | TRUSTArray< float, int > & | out | ) | const |
Conversion methods - from a big array (SIZE=trustIdType), return a small one (SIZE=int). Overflow is detected in debug if array is too big to be fit into SIZE=int. No data copied! This behaves somewhat like a ref_array. Used in LATA stuff and FT notably.
| out | the output small array that will reference the same data |
Definition at line 274 of file TRUSTArray.cpp.
| void TRUSTArray< int, trustIdType >::ref_as_small | ( | TRUSTArray< int, int > & | out | ) | const |
Definition at line 282 of file TRUSTArray.cpp.
|
inline |
Returns the number of owners of the data, i.e. the number of Arrays pointing to the same underlying data
Returns the number of shared owners of the data underlying the array. If -1 detached array. This is simply the ref count of the shared pointer 'mem_'
Definition at line 196 of file TRUSTArray.tpp.
|
inlinevirtual |
Constructs an array pointing to existing data !!! Use ref_data with caution
Make the array point to the memory zone indicated by data_. The array is detached from its current underlying data ('mem_' is released).
Warning: virtual method. In derived classes this method initializes the structures to create a sequential array. To create a ref on a parallel array, see DoubleVect::ref()
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 86 of file TRUSTArray.tpp.
|
inlinevirtual |
Resets the array to the state obtained by the default constructor (frees memory but keeps the current memory allocation mode)
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 240 of file TRUSTArray.h.
|
inline |
Definition at line 156 of file TRUSTArray.h.
|
inline |
Change the size of the array.
This updates the underlying std::vector size.
Conditions:
Definition at line 43 of file TRUSTArray.tpp.
|
protected |
Protected method for resize. Used by derived classes. Same as resize_array() with less checks.
This is also where we deal with the STORAGE::TEMP_STORAGE capability, i.e. the Trav arrays. There memory is taken from a shared pool (TRUSTTravPool). This kind of array should never be used in 64bits, since Trav are meaningful when inside the timestepping (so the 32bit world after the Scatter isntruction).
Definition at line 79 of file TRUSTArray.cpp.
|
inlinevirtual |
Methode virtuelle (dans Array_base) identique a resize_array(), permet de traiter de facon generique les ArrOf, Vect et Tab. Si l'objet est de type TRUSTArray, appel a resize_array(n)
Prerequis: le tableau doit etre "resizable" (voir resize_array()). S'il est d'un type derive (Vect ou Tab), il ne doit pas avoir de descripteur parallele si la taille est effectivement modifiee.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 62 of file TRUSTArray.tpp.
|
inline |
Definition at line 247 of file TRUSTArray.h.
|
inline |
Definition at line 248 of file TRUSTArray.h.
|
inline |
Memory allocation type - TEMP arrays (i.e. Trav) have a different allocation mechanism - see TRUSTTravPool.h)
Definition at line 73 of file TRUSTArray.tpp.
|
inline |
Return the size of the span on the data (not the full underlying allocated size)
Returns the size of the array.
Definition at line 187 of file TRUSTArray.tpp.
|
inline |
Definition at line 249 of file TRUSTArray.h.
|
inlineoverrideprotectedvirtual |
Implements Objet_U.
Reimplemented in TRUSTTab< _TYPE_, _SIZE_ >, TRUSTTab< _SIZE_, _SIZE_ >, TRUSTTab< _TYPE_ >, TRUSTTab< _TYPE_, int >, TRUSTTab< _TYPE_, trustIdType >, TRUSTTab< double, _SIZE_ >, TRUSTTab< double, int >, TRUSTTab< double, trustIdType >, TRUSTTab< float, int >, TRUSTTab< float, trustIdType >, TRUSTTab< int, int >, TRUSTTab< int, trustIdType >, TRUSTTab< trustIdType, int >, TRUSTTab< trustIdType, trustIdType >, TRUSTTrav< _TYPE_ >, TRUSTTrav< double >, TRUSTTrav< float >, TRUSTTrav< int >, TRUSTVect< _TYPE_, _SIZE_ >, TRUSTVect< _SIZE_, _SIZE_ >, TRUSTVect< _TYPE_, int >, TRUSTVect< _TYPE_, trustIdType >, TRUSTVect< double, _SIZE_ >, TRUSTVect< double, int >, TRUSTVect< double, trustIdType >, TRUSTVect< float, _SIZE_ >, TRUSTVect< float, int >, TRUSTVect< int, _SIZE_ >, TRUSTVect< int, _TYPE_ >, TRUSTVect< int, int >, TRUSTVect< int, trustIdType >, TRUSTVect< trustIdType, int >, and TRUSTVect< trustIdType, trustIdType >.
Definition at line 83 of file TRUSTArray.h.
|
friend |
Definition at line 108 of file TRUSTArray.h.
|
friend |
Definition at line 105 of file TRUSTArray.h.
|
protected |
Definition at line 95 of file TRUSTArray.h.