BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
LLData.h File Reference

Defines class LLData. More...

Include dependency graph for LLData.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  LLData< T >
 Template class to store data of any type in multi-dimensional space (low-level). More...
 

Macros

#define BORNAGAIN_DEVICE_DATA_LLDATA_H
 

Functions

template<class T >
bool HaveSameDimensions (const LLData< T > &left, const LLData< T > &right)
 
template<class T >
LLData< T > operator* (const LLData< T > &left, const LLData< T > &right)
 
template<class T >
LLData< T > operator+ (const LLData< T > &left, const LLData< T > &right)
 
template<class T >
LLData< T > operator- (const LLData< T > &left, const LLData< T > &right)
 
template<class T >
LLData< T > operator/ (const LLData< T > &left, const LLData< T > &right)
 

Detailed Description

Defines class LLData.

Homepage:\n http://www.bornagainproject.org
License:\n GNU General Public License v3 or higher (see COPYING)
Authors
Scientific Computing Group at MLZ (see CITATION, AUTHORS)

Definition in file LLData.h.

Macro Definition Documentation

◆ BORNAGAIN_DEVICE_DATA_LLDATA_H

#define BORNAGAIN_DEVICE_DATA_LLDATA_H

Definition at line 21 of file LLData.h.

Function Documentation

◆ HaveSameDimensions()

template<class T >
bool HaveSameDimensions ( const LLData< T > &  left,
const LLData< T > &  right 
)

Definition at line 299 of file LLData.h.

300 {
301  if (left.rank() != right.rank())
302  return false;
303  const int* ldims = left.dimensions();
304  const int* rdims = right.dimensions();
305  for (size_t i = 0; i < left.rank(); ++i) {
306  if (ldims[i] != rdims[i])
307  return false;
308  }
309  return true;
310 }
size_t rank() const
Definition: LLData.h:59
const int * dimensions() const
Definition: LLData.h:60

References LLData< T >::dimensions(), and LLData< T >::rank().

Referenced by LLData< T >::operator*=(), LLData< T >::operator+=(), LLData< T >::operator-=(), and LLData< T >::operator/=().

Here is the call graph for this function:

◆ operator*()

template<class T >
LLData< T > operator* ( const LLData< T > &  left,
const LLData< T > &  right 
)

Definition at line 285 of file LLData.h.

286 {
287  LLData<T>* p_result = new LLData<T>(left);
288  (*p_result) *= right;
289  return *p_result;
290 }
Template class to store data of any type in multi-dimensional space (low-level).
Definition: LLData.h:31

◆ operator+()

template<class T >
LLData< T > operator+ ( const LLData< T > &  left,
const LLData< T > &  right 
)

Definition at line 271 of file LLData.h.

272 {
273  LLData<T>* p_result = new LLData<T>(left);
274  (*p_result) += right;
275  return *p_result;
276 }

◆ operator-()

template<class T >
LLData< T > operator- ( const LLData< T > &  left,
const LLData< T > &  right 
)

Definition at line 278 of file LLData.h.

279 {
280  LLData<T>* p_result = new LLData<T>(left);
281  (*p_result) -= right;
282  return *p_result;
283 }

◆ operator/()

template<class T >
LLData< T > operator/ ( const LLData< T > &  left,
const LLData< T > &  right 
)

Definition at line 292 of file LLData.h.

293 {
294  LLData<T>* p_result = new LLData<T>(left);
295  *p_result /= right;
296  return *p_result;
297 }