ARTS 2.5.4 (git: 4c0d3b4d)
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

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

◆ ArrayOfArrayOfMatrix

Definition at line 68 of file array.h.

◆ ArrayOfArrayOfTensor3

Definition at line 76 of file array.h.

◆ ArrayOfArrayOfTensor4

Definition at line 81 of file array.h.

◆ ArrayOfArrayOfTensor5

Definition at line 86 of file array.h.

◆ ArrayOfArrayOfTensor6

Definition at line 91 of file array.h.

◆ ArrayOfArrayOfTensor7

Definition at line 96 of file array.h.

◆ ArrayOfArrayOfVector

Definition at line 63 of file array.h.

◆ ArrayOfIndex

An array of Index.

Definition at line 43 of file array.h.

◆ ArrayOfMatrix

An array of matrices.

Definition at line 66 of file array.h.

◆ ArrayOfNumeric

An array of Numeric.

Definition at line 48 of file array.h.

◆ ArrayOfSparse

An array of sparse matrices.

Definition at line 71 of file array.h.

◆ ArrayOfTensor3

An array of Tensor3.

Definition at line 74 of file array.h.

◆ ArrayOfTensor4

An array of Tensor4.

Definition at line 79 of file array.h.

◆ ArrayOfTensor5

An array of Tensor5.

Definition at line 84 of file array.h.

◆ ArrayOfTensor6

An array of Tensor6.

Definition at line 89 of file array.h.

◆ ArrayOfTensor7

An array of Tensor7.

Definition at line 94 of file array.h.

◆ ArrayOfVector

An array of vectors.

Definition at line 61 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 316 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 294 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 356 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 249 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 265 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 231 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 376 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 382 of file array.h.

◆ TotalNumberOfElements()