BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
LLData.h File Reference
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 >
 

Functions

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)
 
template<class T >
bool HaveSameDimensions (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.

Function Documentation

◆ operator+()

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

Definition at line 268 of file LLData.h.

269 {
270  LLData<T>* p_result = new LLData<T>(left);
271  (*p_result) += right;
272  return *p_result;
273 }
Template class to store data of any type in multi-dimensional space (low-level).
Definition: LLData.h:28

◆ operator-()

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

Definition at line 275 of file LLData.h.

276 {
277  LLData<T>* p_result = new LLData<T>(left);
278  (*p_result) -= right;
279  return *p_result;
280 }

◆ operator*()

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

Definition at line 282 of file LLData.h.

283 {
284  LLData<T>* p_result = new LLData<T>(left);
285  (*p_result) *= right;
286  return *p_result;
287 }

◆ operator/()

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

Definition at line 289 of file LLData.h.

290 {
291  LLData<T>* p_result = new LLData<T>(left);
292  *p_result /= right;
293  return *p_result;
294 }

◆ HaveSameDimensions()

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

Definition at line 296 of file LLData.h.

297 {
298  if (left.getRank() != right.getRank())
299  return false;
300  const int* ldims = left.getDimensions();
301  const int* rdims = right.getDimensions();
302  for (size_t i = 0; i < left.getRank(); ++i) {
303  if (ldims[i] != rdims[i])
304  return false;
305  }
306  return true;
307 }
size_t getRank() const
Definition: LLData.h:56
const int * getDimensions() const
Definition: LLData.h:57

References LLData< T >::getDimensions(), and LLData< T >::getRank().

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

Here is the call graph for this function: