Ocean
Ocean::Lookup2< T, TScalar > Class Template Reference

This class implements a 2D lookup object allowing to separate a two dimensional lookup area into individual bins. More...

Inheritance diagram for Ocean::Lookup2< T, TScalar >:

Public Types

typedef T Type
 Definition of the lookup data type. More...
 

Public Member Functions

const T * data () const
 Returns a pointer to the constant bin data (row aligned). More...
 
T * data ()
 Returns a pointer to the bin data (row aligned). More...
 
size_t sizeX () const
 Returns the horizontal dimension of this lookup object. More...
 
size_t sizeY () const
 Returns the vertical dimension of this lookup object. More...
 
size_t binsX () const
 Returns the number of horizontal bins of this lookup object. More...
 
size_t binsY () const
 Returns the number of vertical bins of this lookup object. More...
 
bool isEmpty () const
 Returns whether this lookup object does not hold any lookup bin. More...
 
 operator bool () const
 Returns whether this lookup object holds at least one lookup bin. More...
 
bool operator== (const Lookup2< T, TScalar > &lookup) const
 Returns whether two lookup objects are identical. More...
 
bool operator!= (const Lookup2< T, TScalar > &lookup) const
 Returns whether two lookup objects are not identical. More...
 

Protected Types

typedef std::vector< T > Values
 Definition of a vector holding lookup values. More...
 

Protected Member Functions

 Lookup2 ()=default
 Creates a new empty lookup object. More...
 
 Lookup2 (const Lookup2< T, TScalar > &lookup)
 Copy constructor. More...
 
 Lookup2 (Lookup2< T, TScalar > &&lookup) noexcept
 Move constructor. More...
 
Lookup2< T, TScalar > & operator= (const Lookup2< T, TScalar > &lookup)
 Assign operator. More...
 
Lookup2< T, TScalar > & operator= (Lookup2< T, TScalar > &&lookup) noexcept
 Move operator. More...
 

Protected Attributes

size_t sizeX_ = 0
 Horizontal dimension of this lookup object. More...
 
size_t sizeY_ = 0
 Vertical dimension of this lookup object. More...
 
size_t binsX_ = 0
 Number of horizontal bins. More...
 
size_t binsY_ = 0
 Number of vertical bins. More...
 
TScalar invSizeX_ = 0
 Inverse horizontal dimension of this lookup object. More...
 
TScalar invSizeY_ = 0
 Inverse vertical dimension of this lookup object. More...
 
TScalar invBinsX_ = 0
 Inverse number of horizontal bins. More...
 
TScalar invBinsY_ = 0
 Inverse number of vertical bins. More...
 
Values values_
 The values of the lookup bins. More...
 

Detailed Description

template<typename T, typename TScalar = Scalar>
class Ocean::Lookup2< T, TScalar >

This class implements a 2D lookup object allowing to separate a two dimensional lookup area into individual bins.

The entire lookup area covers an integer two-dimensional space starting at the origin.
Lookup values are generated by interpolating lookup values between neighboring bins.

Template Parameters
TThe data type of the stored lookup values
TScalarThe data type of the scalar values, either 'float' or 'double'

Member Typedef Documentation

◆ Type

template<typename T , typename TScalar = Scalar>
typedef T Ocean::Lookup2< T, TScalar >::Type

Definition of the lookup data type.

◆ Values

template<typename T , typename TScalar = Scalar>
typedef std::vector<T> Ocean::Lookup2< T, TScalar >::Values
protected

Definition of a vector holding lookup values.

Constructor & Destructor Documentation

◆ Lookup2() [1/3]

template<typename T , typename TScalar = Scalar>
Ocean::Lookup2< T, TScalar >::Lookup2 ( )
protecteddefault

Creates a new empty lookup object.

◆ Lookup2() [2/3]

template<typename T , typename TScalar >
Ocean::Lookup2< T, TScalar >::Lookup2 ( const Lookup2< T, TScalar > &  lookup)
inlineprotected

Copy constructor.

Parameters
lookupThe lookup object to be moved

◆ Lookup2() [3/3]

template<typename T , typename TScalar >
Ocean::Lookup2< T, TScalar >::Lookup2 ( Lookup2< T, TScalar > &&  lookup)
inlineprotectednoexcept

Move constructor.

Parameters
lookupThe lookup object to be moved

Member Function Documentation

◆ binsX()

template<typename T , typename TScalar >
size_t Ocean::Lookup2< T, TScalar >::binsX
inline

Returns the number of horizontal bins of this lookup object.

Returns
Number of horizontal bins

◆ binsY()

template<typename T , typename TScalar >
size_t Ocean::Lookup2< T, TScalar >::binsY
inline

Returns the number of vertical bins of this lookup object.

Returns
Number of vertical bins

◆ data() [1/2]

template<typename T , typename TScalar >
T * Ocean::Lookup2< T, TScalar >::data
inline

Returns a pointer to the bin data (row aligned).

Returns
Bin data

◆ data() [2/2]

template<typename T , typename TScalar >
const T * Ocean::Lookup2< T, TScalar >::data
inline

Returns a pointer to the constant bin data (row aligned).

Returns
Bin data

◆ isEmpty()

template<typename T , typename TScalar >
bool Ocean::Lookup2< T, TScalar >::isEmpty
inline

Returns whether this lookup object does not hold any lookup bin.

Returns
True, if so

◆ operator bool()

template<typename T , typename TScalar >
Ocean::Lookup2< T, TScalar >::operator bool
inlineexplicit

Returns whether this lookup object holds at least one lookup bin.

Returns
True, if so

◆ operator!=()

template<typename T , typename TScalar >
bool Ocean::Lookup2< T, TScalar >::operator!= ( const Lookup2< T, TScalar > &  lookup) const
inline

Returns whether two lookup objects are not identical.

Parameters
lookupSecond lookup object
Returns
True, if so

◆ operator=() [1/2]

template<typename T , typename TScalar >
Lookup2< T, TScalar > & Ocean::Lookup2< T, TScalar >::operator= ( const Lookup2< T, TScalar > &  lookup)
protected

Assign operator.

Parameters
lookupThe lookup object that will be moved
Returns
Reference to this object

◆ operator=() [2/2]

template<typename T , typename TScalar >
Lookup2< T, TScalar > & Ocean::Lookup2< T, TScalar >::operator= ( Lookup2< T, TScalar > &&  lookup)
protectednoexcept

Move operator.

Parameters
lookupThe lookup object that will be moved
Returns
Reference to this object

◆ operator==()

template<typename T , typename TScalar >
bool Ocean::Lookup2< T, TScalar >::operator== ( const Lookup2< T, TScalar > &  lookup) const

Returns whether two lookup objects are identical.

Parameters
lookupSecond lookup object
Returns
True, if so

◆ sizeX()

template<typename T , typename TScalar >
size_t Ocean::Lookup2< T, TScalar >::sizeX
inline

Returns the horizontal dimension of this lookup object.

Returns
Horizontal dimension

◆ sizeY()

template<typename T , typename TScalar >
size_t Ocean::Lookup2< T, TScalar >::sizeY
inline

Returns the vertical dimension of this lookup object.

Returns
Vertical dimension

Field Documentation

◆ binsX_

template<typename T , typename TScalar = Scalar>
size_t Ocean::Lookup2< T, TScalar >::binsX_ = 0
protected

Number of horizontal bins.

◆ binsY_

template<typename T , typename TScalar = Scalar>
size_t Ocean::Lookup2< T, TScalar >::binsY_ = 0
protected

Number of vertical bins.

◆ invBinsX_

template<typename T , typename TScalar = Scalar>
TScalar Ocean::Lookup2< T, TScalar >::invBinsX_ = 0
protected

Inverse number of horizontal bins.

◆ invBinsY_

template<typename T , typename TScalar = Scalar>
TScalar Ocean::Lookup2< T, TScalar >::invBinsY_ = 0
protected

Inverse number of vertical bins.

◆ invSizeX_

template<typename T , typename TScalar = Scalar>
TScalar Ocean::Lookup2< T, TScalar >::invSizeX_ = 0
protected

Inverse horizontal dimension of this lookup object.

◆ invSizeY_

template<typename T , typename TScalar = Scalar>
TScalar Ocean::Lookup2< T, TScalar >::invSizeY_ = 0
protected

Inverse vertical dimension of this lookup object.

◆ sizeX_

template<typename T , typename TScalar = Scalar>
size_t Ocean::Lookup2< T, TScalar >::sizeX_ = 0
protected

Horizontal dimension of this lookup object.

◆ sizeY_

template<typename T , typename TScalar = Scalar>
size_t Ocean::Lookup2< T, TScalar >::sizeY_ = 0
protected

Vertical dimension of this lookup object.

◆ values_

template<typename T , typename TScalar = Scalar>
Values Ocean::Lookup2< T, TScalar >::values_
protected

The values of the lookup bins.


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