ARTS  2.3.1285(git:92a29ea9-dirty)
m_array.cc File Reference

Stuff related to manipulating arrays. More...

#include "artstime.h"
#include "matpackVII.h"
#include "messages.h"
#include "sorting.h"

Go to the source code of this file.

Macros

#define TIME_SORT_MACRO(VAR)
 
#define FLATTEN_MACRO(VAR)
 

Functions

template<class T >
Array< T > TimeSortTemplate (const Array< T > &arr, const ArrayOfTime &time_stamps)
 
template<class T >
Array< T > FlattenArrayTemplate (const Array< Array< T >> &in)
 
void Flatten (Matrix &out, const ArrayOfVector &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 
void Flatten (Tensor3 &out, const ArrayOfMatrix &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 
void Flatten (Tensor4 &out, const ArrayOfTensor3 &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 
void Flatten (Tensor5 &out, const ArrayOfTensor4 &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 
void Flatten (Tensor6 &out, const ArrayOfTensor5 &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 
void Flatten (Tensor7 &out, const ArrayOfTensor6 &in, const Verbosity &)
 WORKSPACE METHOD: Flatten. More...
 

Detailed Description

Stuff related to manipulating arrays.

Author
Richard Larsson
Date
2020-04-24

Definition in file m_array.cc.

Macro Definition Documentation

◆ FLATTEN_MACRO

#define FLATTEN_MACRO (   VAR)
Value:
void Flatten(VAR & out, const Array< VAR > & in, const Verbosity&) \
void Flatten(Matrix &out, const ArrayOfVector &in, const Verbosity &)
WORKSPACE METHOD: Flatten.
Definition: m_array.cc:95
This can be used to make arrays out of anything.
Definition: array.h:40
Array< T > FlattenArrayTemplate(const Array< Array< T >> &in)
Definition: m_array.cc:64

Definition at line 86 of file m_array.cc.

◆ TIME_SORT_MACRO

#define TIME_SORT_MACRO (   VAR)
Value:
void time_stampsSort(VAR & out, const ArrayOfTime& time_stamps, const VAR & in, const Verbosity&) \
{out = TimeSortTemplate(in, time_stamps);}
void time_stampsSort(ArrayOfTime &out, const ArrayOfTime &time_stamps, const ArrayOfTime &in, const Verbosity &verbosity)
WORKSPACE METHOD: time_stampsSort.
Array< T > TimeSortTemplate(const Array< T > &arr, const ArrayOfTime &time_stamps)
Definition: m_array.cc:35
This can be used to make arrays out of anything.
Definition: array.h:40

Definition at line 54 of file m_array.cc.

Function Documentation

◆ Flatten() [1/6]

void Flatten ( Matrix out,
const ArrayOfVector in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 95 of file m_array.cc.

References i, joker, n, and Array< base >::nelem().

Referenced by Flatten_sg_ArrayOfTimeArrayOfArrayOfTime_g(), Flatten_sg_ArrayOfVectorArrayOfArrayOfVector_g(), Flatten_sg_MatrixArrayOfVector_g(), Flatten_sg_Tensor3ArrayOfMatrix_g(), Flatten_sg_Tensor4ArrayOfTensor3_g(), Flatten_sg_Tensor5ArrayOfTensor4_g(), Flatten_sg_Tensor6ArrayOfTensor5_g(), and Flatten_sg_Tensor7ArrayOfTensor6_g().

◆ Flatten() [2/6]

void Flatten ( Tensor3 out,
const ArrayOfMatrix in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 112 of file m_array.cc.

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

◆ Flatten() [3/6]

void Flatten ( Tensor4 out,
const ArrayOfTensor3 in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 133 of file m_array.cc.

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

◆ Flatten() [4/6]

void Flatten ( Tensor5 out,
const ArrayOfTensor4 in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 157 of file m_array.cc.

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

◆ Flatten() [5/6]

void Flatten ( Tensor6 out,
const ArrayOfTensor5 in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 184 of file m_array.cc.

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

◆ Flatten() [6/6]

void Flatten ( Tensor7 out,
const ArrayOfTensor6 in,
const Verbosity verbosity 
)

WORKSPACE METHOD: Flatten.

Flattens an ArrayOfArray<T> to Array<T> or an Array of matpack-types to a larger dimension matpack (if dimensions agree)

The intended transformation for arrays is (sub-arrays can have different sizes): <br> {{a, b, c}, {d, e}} -> {a, b, c, d, e}

The intended transformation for arrays to matpack types is (sub-types must have same size): <br> {{a, b, c}, {d, e, f}} -> {a, b, c, d, e, f}

Author
Richard Larsson
Parameters
[out]outSupergeneric output
[in]inGeneric Input

Definition at line 214 of file m_array.cc.

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

◆ FlattenArrayTemplate()

template<class T >
Array<T> FlattenArrayTemplate ( const Array< Array< T >> &  in)

Definition at line 64 of file m_array.cc.

References i, and n.

◆ TimeSortTemplate()

template<class T >
Array<T> TimeSortTemplate ( const Array< T > &  arr,
const ArrayOfTime time_stamps 
)

Definition at line 35 of file m_array.cc.

References get_sorted_indexes(), i, n, and Array< base >::nelem().