ARTS 2.5.11 (git: 6827797f)
array.h File Reference

This file contains the definition of Array. More...

#include <array>
#include <climits>
#include <iomanip>
#include <iostream>
#include <vector>
#include "matpack_concepts.h"

Go to the source code of this file.

Classes

class  Array< base >
 This can be used to make arrays out of anything. More...
 
class  CmpArrayOfNumeric
 Helper comparison class to sort an array or vector based on an ArrayOfNumeric. More...
 

Typedefs

using ArrayOfIndex = Array< Index >
 An array of Index.
 
using ArrayOfArrayOfIndex = Array< ArrayOfIndex >
 
using ArrayOfNumeric = Array< Numeric >
 An array of Numeric.
 

Functions

template<class base >
base max (const Array< base > &x)
 Max function.
 
template<class base >
base min (const Array< base > &x)
 Min function.
 
template<class base >
Index find_first (const Array< base > &x, const base &w)
 Find first occurance.
 
template<class base >
void find_all (ArrayOfIndex &pos, const Array< base > &x, const base &w)
 Find all occurances.
 
template<class base >
Index TotalNumberOfElements (const Array< Array< base > > &aa)
 Determine total number of elements in an ArrayOfArray.
 
template<class base >
Index FlattenedIndex (const Array< Array< base > > &aa, Index outer, Index inner=0)
 Determine the index of an element in a flattened version of the array.
 
template<typename T , typename... Ts>
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify (const T &first, const Ts &... the_rest)
 Make a std::array of a list of variables (must be 1-long at least)
 
template<typename T >
std::string stringify (const Array< T > &list, const char *const sep=" ", const char *const beg="")
 

Detailed Description

This file contains the definition of Array.

Author
Stefan Buehler
Date
2001-09-05

Definition in file array.h.

Typedef Documentation

◆ ArrayOfArrayOfIndex

Definition at line 121 of file array.h.

◆ ArrayOfIndex

using ArrayOfIndex = Array<Index>

An array of Index.

Definition at line 119 of file array.h.

◆ ArrayOfNumeric

using ArrayOfNumeric = Array<Numeric>

An array of Numeric.

Definition at line 124 of file array.h.

Function Documentation

◆ find_all()

template<class base >
void find_all ( ArrayOfIndex pos,
const Array< base > &  x,
const base &  w 
)

Find all occurances.

This calculates an array of indices of all occurances of w in array x.

An empty output array means that no occurance was found.

Return values
posArray with positions of w in the array.
Parameters
xThe array to search.
wThe value to look for.
Author
Stefan Buehler
Date
2002-11-28

Definition at line 195 of file array.h.

References Array< base >::nelem(), and w.

Referenced by chk_contains().

◆ find_first()

template<class base >
Index find_first ( const Array< base > &  x,
const base &  w 
)

Find first occurance.

This returns the index of the first occurance of w in array x.

A return value of -1 indicates that no matching element was found.

Returns
The index of the thing we looked for.
Parameters
xThe array to search.
wThe value to look for.
Author
Stefan Buehler
Date
2002-11-28

Definition at line 173 of file array.h.

References Array< base >::nelem(), and w.

Referenced by get_pointers_for_scat_species(), iySurfaceFlatReflectivity(), iySurfaceFlatRefractiveIndex(), iySurfaceLambertian(), particle_bulkprop_fieldPerturb(), particle_bulkprop_fieldPerturbAtmGrids(), pnd_fieldCalcFromParticleBulkProps(), SurfaceBlackbody(), SurfaceFastem(), SurfaceFlatScalarReflectivity(), SurfaceTessem(), and x2artsAtmAndSurf().

◆ FlattenedIndex()

template<class base >
Index FlattenedIndex ( const Array< Array< base > > &  aa,
Index  outer,
Index  inner = 0 
)

Determine the index of an element in a flattened version of the array.

Definition at line 235 of file array.h.

References ARTS_ASSERT.

Referenced by ScatSpeciesMerge().

◆ max()

template<class base >
base max ( const Array< base > &  x)
inline

Max function.

Definition at line 128 of file array.h.

References max().

Referenced by abs_linesCompact(), AtmFieldsExpand1D(), atmgeom_checkedCalc(), check_retrieval_grids(), chk_atm_field(), chk_interpolation_grids(), chk_interpolation_grids_loose_no_data_check(), cloudbox_checkedCalc(), cloudboxSetAutomatically(), cloudboxSetFullAtm(), complex_n_ice_matzler06(), complex_n_water_liebe93(), complex_refr_indexIceMatzler06(), defocusing_general(), defocusing_general_sub(), diameter_maxFromDiameter_volume_equ(), diy_from_pos_to_rgrids(), do_gridcell_2d_byltest(), do_gridcell_3d_byltest(), expand_md_data_raw_to_md_data(), FastemStandAlone(), find_cloudlimits(), find_new_grid_in_old_grid(), geompath_from_r1_to_r2(), get_disortsurf_props(), get_ppath_cloudvars(), integration_bin_by_vecmult(), InterpSurfaceFieldToPosition(), iyApplyUnit(), iySurfaceLambertian(), iySurfaceLambertianDirect(), jacobianAddSurfaceQuantity(), max(), MCGeneral(), MCRadar(), nlte_fieldForSingleSpeciesNonOverlappingLines(), NumericFromVector(), opt_prop_Bulk(), opt_prop_ScatSpecBulk(), particle_bulkpropRadarOnionPeeling(), pha_mat_Bulk(), pha_mat_ScatSpecBulk(), plevel_crossing_2d(), pnd_fieldCalcFromParticleBulkProps(), pndFromPsd(), polynomial_basis_func(), ppath_init_structure(), r_crossing_3d(), RandomNumberGenerator< Generator >::seed(), sensor_checkedCalc(), sensor_responseMixerBackendPrecalcWeights(), specular_losCalc(), specular_losCalcNoTopography(), surfaceFlatRvRh(), surfaceFlatScalarReflectivity(), surfaceLambertianSimple(), surfaceTelsem(), surfaceTessem(), wigner_limits(), WMRFSelectChannels(), yApplyUnit(), yCalcAppend(), and yRadar().

◆ min()

◆ stdarrayify()

template<typename T , typename... Ts>
constexpr std::array< T, 1+sizeof...(Ts)> stdarrayify ( const T &  first,
const Ts &...  the_rest 
)
constexpr

Make a std::array of a list of variables (must be 1-long at least)

Definition at line 255 of file array.h.

Referenced by lm_hitran_2017::qt_co2(), and lm_hitran_2017::read().

◆ stringify()

template<typename T >
std::string stringify ( const Array< T > &  list,
const char *const  sep = " ",
const char *const  beg = "" 
)

Definition at line 261 of file array.h.

◆ TotalNumberOfElements()