ARTS 2.5.0 (git: 9ee3ac6c)
array.h File Reference

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

#include <climits>
#include <iomanip>
#include <iostream>
#include <array>
#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

typedef Array< IndexArrayOfIndex
 An array of Index. More...
 
typedef Array< ArrayOfIndexArrayOfArrayOfIndex
 
typedef Array< NumericArrayOfNumeric
 An array of Numeric. More...
 
typedef Array< VectorArrayOfVector
 An array of vectors. More...
 
typedef Array< ArrayOfVectorArrayOfArrayOfVector
 
typedef Array< MatrixArrayOfMatrix
 An array of matrices. More...
 
typedef Array< ArrayOfMatrixArrayOfArrayOfMatrix
 
typedef Array< SparseArrayOfSparse
 An array of sparse matrices. More...
 
typedef Array< Tensor3ArrayOfTensor3
 An array of Tensor3. More...
 
typedef Array< ArrayOfTensor3ArrayOfArrayOfTensor3
 
typedef Array< Tensor4ArrayOfTensor4
 An array of Tensor4. More...
 
typedef Array< ArrayOfTensor4ArrayOfArrayOfTensor4
 
typedef Array< Tensor5ArrayOfTensor5
 An array of Tensor5. More...
 
typedef Array< ArrayOfTensor5ArrayOfArrayOfTensor5
 
typedef Array< Tensor6ArrayOfTensor6
 An array of Tensor6. More...
 
typedef Array< ArrayOfTensor6ArrayOfArrayOfTensor6
 
typedef Array< Tensor7ArrayOfTensor7
 An array of Tensor7. More...
 
typedef Array< ArrayOfTensor7ArrayOfArrayOfTensor7
 

Functions

template<class base >
std::ostream & operator<< (std::ostream &os, const Array< base > &v)
 Output operator. More...
 
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...
 

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 44 of file array.h.

◆ ArrayOfArrayOfMatrix

Definition at line 67 of file array.h.

◆ ArrayOfArrayOfTensor3

Definition at line 75 of file array.h.

◆ ArrayOfArrayOfTensor4

Definition at line 80 of file array.h.

◆ ArrayOfArrayOfTensor5

Definition at line 85 of file array.h.

◆ ArrayOfArrayOfTensor6

Definition at line 90 of file array.h.

◆ ArrayOfArrayOfTensor7

Definition at line 95 of file array.h.

◆ ArrayOfArrayOfVector

Definition at line 62 of file array.h.

◆ ArrayOfIndex

An array of Index.

Definition at line 42 of file array.h.

◆ ArrayOfMatrix

An array of matrices.

Definition at line 65 of file array.h.

◆ ArrayOfNumeric

An array of Numeric.

Definition at line 47 of file array.h.

◆ ArrayOfSparse

An array of sparse matrices.

Definition at line 70 of file array.h.

◆ ArrayOfTensor3

An array of Tensor3.

Definition at line 73 of file array.h.

◆ ArrayOfTensor4

An array of Tensor4.

Definition at line 78 of file array.h.

◆ ArrayOfTensor5

An array of Tensor5.

Definition at line 83 of file array.h.

◆ ArrayOfTensor6

An array of Tensor6.

Definition at line 88 of file array.h.

◆ ArrayOfTensor7

An array of Tensor7.

Definition at line 93 of file array.h.

◆ ArrayOfVector

An array of vectors.

Definition at line 60 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 314 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 292 of file array.h.

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

Referenced by get_pointers_for_scat_species(), particle_bulkprop_fieldPerturb(), particle_bulkprop_fieldPerturbAtmGrids(), pnd_fieldCalcFromParticleBulkProps(), SurfaceBlackbody(), SurfaceFastem(), SurfaceFlatScalarReflectivity(), and SurfaceTessem().

◆ 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 354 of file array.h.

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

Referenced by ScatSpeciesMerge().

◆ max()

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

Max function.

Definition at line 247 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 263 of file array.h.

References min().

Referenced by min().

◆ operator<<()

template<class base >
std::ostream & operator<< ( std::ostream &  os,
const Array< base > &  v 
)
inline

Output operator.

Definition at line 229 of file array.h.

References Zeeman::end(), and v.

◆ 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 374 of file array.h.

Referenced by lm_hitran_2017::qt_co2(), lm_hitran_2017::read(), EnergyLevelMap::validIndexForType(), and MCAntenna::validType().

◆ TotalNumberOfElements()