ARTS 2.5.4 (git: 31ce4f0e)
array.h File Reference

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

#include <array>
#include <climits>
#include <iomanip>
#include <iostream>
#include <vector>
#include "matpack.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. More...
 
using ArrayOfArrayOfIndex = Array< ArrayOfIndex >
 
using ArrayOfNumeric = Array< Numeric >
 An array of Numeric. More...
 

Functions

template<class base >
base max (const Array< base > &x)
 Max function. More...
 
template<class base >
base min (const Array< base > &x)
 Min function. More...
 
template<class base >
Index find_first (const Array< base > &x, const base &w)
 Find first occurance. More...
 
template<class base >
void find_all (ArrayOfIndex &pos, const Array< base > &x, const base &w)
 Find all occurances. More...
 
template<class base >
Index TotalNumberOfElements (const Array< Array< base > > &aa)
 Determine total number of elements in an ArrayOfArray. More...
 
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. More...
 
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) More...
 
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 138 of file array.h.

◆ ArrayOfIndex

An array of Index.

Definition at line 136 of file array.h.

◆ ArrayOfNumeric

An array of Numeric.

Definition at line 141 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 212 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 190 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 252 of file array.h.

References ARTS_ASSERT, N, and Absorption::nelem().

Referenced by ScatSpeciesMerge().

◆ max()

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

Max function.

Definition at line 145 of file array.h.

References max().

Referenced by max().

◆ min()

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

Min function.

Definition at line 161 of file array.h.

References min().

Referenced by 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 272 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 278 of file array.h.

◆ TotalNumberOfElements()