ReFRACtor
FullPhysics::ArrayWithUnit< T, D > Class Template Reference

We frequently have a array of numbers with units associated with them. More...

#include <array_with_unit.h>

+ Inheritance diagram for FullPhysics::ArrayWithUnit< T, D >:
+ Collaboration diagram for FullPhysics::ArrayWithUnit< T, D >:

Public Member Functions

 ArrayWithUnit ()
 
 ArrayWithUnit (const ArrayWithUnit< T, D > &V)
 
 ArrayWithUnit (const blitz::Array< T, D > &Value, const Unit &Value_units)
 
 ArrayWithUnit (const blitz::Array< T, D > &Value, const std::string &Value_units_name)
 
int cols () const
 
ArrayWithUnit< T, D > convert (const Unit &R) const
 Convert to the given units. More...
 
ArrayWithUnit< T, D > convert_wave (const Unit &R) const
 We often need to handle conversion from wavenumber to/from wavelength. More...
 
int depth () const
 
DoubleWithUnit operator() (int i1) const
 
DoubleWithUnit operator() (int i1, int i2) const
 
DoubleWithUnit operator() (int i1, int i2, int i3) const
 
DoubleWithUnit operator() (int i1, int i2, int i3, int i4) const
 
template<class I >
ArrayWithUnit< T, D > operator() (I i1) const
 
template<class I >
ArrayWithUnit< T, D > operator() (I i1, I i2) const
 
template<class I >
ArrayWithUnit< T, D > operator() (I i1, I i2, I i3) const
 
template<class I >
ArrayWithUnit< T, D > operator() (I i1, I i2, I i3, I i4) const
 
template<class I , class J >
ArrayWithUnit< T, D-1 > operator() (I i1, J i2) const
 
template<class I , class J >
ArrayWithUnit< T, D-1 > operator() (J i1, I i2, I i3) const
 
template<class I , class J >
ArrayWithUnit< T, D-1 > operator() (I i1, J i2, I i3) const
 
template<class I , class J >
ArrayWithUnit< T, D-1 > operator() (I i1, I i2, J i3) const
 
template<class I , class J >
ArrayWithUnit< T, D-2 > operator() (I i1, J i2, J i3) const
 
template<class I , class J >
ArrayWithUnit< T, D-2 > operator() (J i1, I i2, J i3) const
 
template<class I , class J >
ArrayWithUnit< T, D-2 > operator() (J i1, J i2, I i3) const
 
ArrayWithUnit< T, D > & operator*= (const ArrayWithUnit< T, D > &V)
 Basic math operators for class. More...
 
ArrayWithUnit< T, D > & operator+= (const ArrayWithUnit< T, D > &V)
 
ArrayWithUnit< T, D > & operator-= (const ArrayWithUnit< T, D > &V)
 
ArrayWithUnit< T, D > & operator/= (const ArrayWithUnit< T, D > &V)
 
ArrayWithUnit< T, D > & operator= (const ArrayWithUnit< T, D > &V)
 Assignment operator so internals are correctly set. More...
 
void print (std::ostream &Os) const
 
std::string print_to_string () const
 Print to string. More...
 
int rows () const
 

Public Attributes

Unit units
 
blitz::Array< T, D > value
 

Detailed Description

template<class T, int D>
class FullPhysics::ArrayWithUnit< T, D >

We frequently have a array of numbers with units associated with them.

This is a simple structure that just keeps these two things together.

Definition at line 15 of file array_with_unit.h.

Constructor & Destructor Documentation

◆ ArrayWithUnit() [1/4]

template<class T, int D>
FullPhysics::ArrayWithUnit< T, D >::ArrayWithUnit ( )
inline

Definition at line 18 of file array_with_unit.h.

◆ ArrayWithUnit() [2/4]

template<class T, int D>
FullPhysics::ArrayWithUnit< T, D >::ArrayWithUnit ( const ArrayWithUnit< T, D > &  V)
inline

Definition at line 19 of file array_with_unit.h.

◆ ArrayWithUnit() [3/4]

template<class T, int D>
FullPhysics::ArrayWithUnit< T, D >::ArrayWithUnit ( const blitz::Array< T, D > &  Value,
const Unit Value_units 
)
inline

Definition at line 21 of file array_with_unit.h.

◆ ArrayWithUnit() [4/4]

template<class T, int D>
FullPhysics::ArrayWithUnit< T, D >::ArrayWithUnit ( const blitz::Array< T, D > &  Value,
const std::string &  Value_units_name 
)
inline

Definition at line 23 of file array_with_unit.h.

Member Function Documentation

◆ cols()

template<class T, int D>
int FullPhysics::ArrayWithUnit< T, D >::cols ( ) const
inline

Definition at line 129 of file array_with_unit.h.

◆ convert()

template<class T, int D>
ArrayWithUnit<T, D> FullPhysics::ArrayWithUnit< T, D >::convert ( const Unit R) const
inline

Convert to the given units.

Definition at line 101 of file array_with_unit.h.

◆ convert_wave()

template<class T, int D>
ArrayWithUnit<T,D> FullPhysics::ArrayWithUnit< T, D >::convert_wave ( const Unit R) const
inline

We often need to handle conversion from wavenumber to/from wavelength.

This is either a normal conversion of the units before and after match in the power of length (so cm^-1 to m^-1), or do an inversion. Since we do this often enough, it is worth having a function that handles this logic.

Definition at line 117 of file array_with_unit.h.

◆ depth()

template<class T, int D>
int FullPhysics::ArrayWithUnit< T, D >::depth ( ) const
inline

Definition at line 130 of file array_with_unit.h.

◆ operator()() [1/15]

template<class T, int D>
DoubleWithUnit FullPhysics::ArrayWithUnit< T, D >::operator() ( int  i1) const
inline

Definition at line 47 of file array_with_unit.h.

◆ operator()() [2/15]

template<class T, int D>
DoubleWithUnit FullPhysics::ArrayWithUnit< T, D >::operator() ( int  i1,
int  i2 
) const
inline

Definition at line 49 of file array_with_unit.h.

◆ operator()() [3/15]

template<class T, int D>
DoubleWithUnit FullPhysics::ArrayWithUnit< T, D >::operator() ( int  i1,
int  i2,
int  i3 
) const
inline

Definition at line 51 of file array_with_unit.h.

◆ operator()() [4/15]

template<class T, int D>
DoubleWithUnit FullPhysics::ArrayWithUnit< T, D >::operator() ( int  i1,
int  i2,
int  i3,
int  i4 
) const
inline

Definition at line 53 of file array_with_unit.h.

◆ operator()() [5/15]

template<class T, int D>
template<class I >
ArrayWithUnit<T, D> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1) const
inline

Definition at line 60 of file array_with_unit.h.

◆ operator()() [6/15]

template<class T, int D>
template<class I >
ArrayWithUnit<T, D> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2 
) const
inline

Definition at line 64 of file array_with_unit.h.

◆ operator()() [7/15]

template<class T, int D>
template<class I >
ArrayWithUnit<T, D> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 67 of file array_with_unit.h.

◆ operator()() [8/15]

template<class T, int D>
template<class I >
ArrayWithUnit<T, D> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3,
i4 
) const
inline

Definition at line 70 of file array_with_unit.h.

◆ operator()() [9/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-1> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2 
) const
inline

Definition at line 74 of file array_with_unit.h.

◆ operator()() [10/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-1> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 78 of file array_with_unit.h.

◆ operator()() [11/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-1> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 81 of file array_with_unit.h.

◆ operator()() [12/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-1> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 84 of file array_with_unit.h.

◆ operator()() [13/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-2> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 88 of file array_with_unit.h.

◆ operator()() [14/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-2> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 91 of file array_with_unit.h.

◆ operator()() [15/15]

template<class T, int D>
template<class I , class J >
ArrayWithUnit<T, D-2> FullPhysics::ArrayWithUnit< T, D >::operator() ( i1,
i2,
i3 
) const
inline

Definition at line 94 of file array_with_unit.h.

◆ operator*=()

template<class T, int D>
ArrayWithUnit<T, D>& FullPhysics::ArrayWithUnit< T, D >::operator*= ( const ArrayWithUnit< T, D > &  V)
inline

Basic math operators for class.

Definition at line 38 of file array_with_unit.h.

◆ operator+=()

template<class T, int D>
ArrayWithUnit<T, D>& FullPhysics::ArrayWithUnit< T, D >::operator+= ( const ArrayWithUnit< T, D > &  V)
inline

Definition at line 42 of file array_with_unit.h.

◆ operator-=()

template<class T, int D>
ArrayWithUnit<T, D>& FullPhysics::ArrayWithUnit< T, D >::operator-= ( const ArrayWithUnit< T, D > &  V)
inline

Definition at line 44 of file array_with_unit.h.

◆ operator/=()

template<class T, int D>
ArrayWithUnit<T, D>& FullPhysics::ArrayWithUnit< T, D >::operator/= ( const ArrayWithUnit< T, D > &  V)
inline

Definition at line 40 of file array_with_unit.h.

◆ operator=()

template<class T, int D>
ArrayWithUnit<T, D>& FullPhysics::ArrayWithUnit< T, D >::operator= ( const ArrayWithUnit< T, D > &  V)
inline

Assignment operator so internals are correctly set.

Definition at line 32 of file array_with_unit.h.

◆ print()

template<class T, int D>
void FullPhysics::ArrayWithUnit< T, D >::print ( std::ostream &  Os) const
inline

Definition at line 132 of file array_with_unit.h.

◆ print_to_string()

std::string FullPhysics::Printable< ArrayWithUnit< T, D > >::print_to_string ( ) const
inlineinherited

Print to string.

This is primarily useful for SWIG wrappers to this class, e.g. a to_s method in ruby.

Definition at line 31 of file printable.h.

◆ rows()

template<class T, int D>
int FullPhysics::ArrayWithUnit< T, D >::rows ( ) const
inline

Definition at line 128 of file array_with_unit.h.

Member Data Documentation

◆ units

template<class T, int D>
Unit FullPhysics::ArrayWithUnit< T, D >::units

Definition at line 27 of file array_with_unit.h.

◆ value

template<class T, int D>
blitz::Array<T, D> FullPhysics::ArrayWithUnit< T, D >::value

Definition at line 26 of file array_with_unit.h.


The documentation for this class was generated from the following file:

Copyright © 2017, California Institute of Technology.
ALL RIGHTS RESERVED.
U.S. Government Sponsorship acknowledged.
Generated Fri Aug 24 2018 15:44:12