OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
lib-array.h File Reference

Underlying data structures. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  GSlice_iter< T >
 
class  GSlice_iter< T >
 
class  CGSlice_iter< T >
 
class  CGSlice_iter< T >
 
class  Array2D< T >
 
class  Array2D_cmplx< T >
 
class  Array3D< T >
 
class  Array3D_cmplx< T >
 
class  Array4D< T >
 
class  Array4D_cmplx< T >
 

Functions

template<class T >
bool operator== (const GSlice_iter< T > &, const GSlice_iter< T > &)
 
template<class T >
bool operator!= (const GSlice_iter< T > &, const GSlice_iter< T > &)
 
template<class T >
bool operator< (const GSlice_iter< T > &, const GSlice_iter< T > &)
 
template<class T >
bool operator== (const CGSlice_iter< T > &, const CGSlice_iter< T > &)
 
template<class T >
bool operator!= (const CGSlice_iter< T > &, const CGSlice_iter< T > &)
 
template<class T >
bool operator< (const CGSlice_iter< T > &, const CGSlice_iter< T > &)
 

Detailed Description

Underlying data structures.

Author
PICKSC
Date
September 1, 2016

This header file contains the definitions for multidimensional (2D to 4D) array types. These types define the following: –> Fortan-style access to the underlying valarray (_,_,_)

–> "=, *=, +=, -="

–> Slices of the array given a range of indices in a specific dimension

–> Multiplication with a valarray.

–> Central difference

–> Subsets of the given array

Notice that these array-containers are closer to Fortran-style arrays than to standard Matrix types, particularly because they are not intended to facilitate standard Matrix algebra. No error-checking is included.

The following classes are defined:

  1. template<class T> class GSlice_iter: an iterator for the elements of a regular array type.
  2. template<class T> class CGSlice_iter : same as above for constant values

3.a.template<class t>=""> class Array2D : a 2D container with basic access and algebra

3.b.template<class t>=""> class Array2D_cmplx : a 2D container of complex with basic access and algebra

4.a.template<class t>=""> class Array3D : a 3D container

4.b.template<class t>=""> class Array3D_cmplx : a 3D container of complex with basic access and algebra

5.a.template<class t>=""> class Array4D : a 4D container

5.b.template<class t>=""> class Array4D_cmplx : a 4D container of complex with basic access and algebra

Definition in file lib-array.h.

Function Documentation

◆ operator!=() [1/2]

template<class T >
bool operator!= ( const GSlice_iter< T > &  p,
const GSlice_iter< T > &  q 
)

Definition at line 146 of file lib-array.h.

146  {
147  return !(p==q);
148 }

◆ operator!=() [2/2]

template<class T >
bool operator!= ( const CGSlice_iter< T > &  p,
const CGSlice_iter< T > &  q 
)

Definition at line 248 of file lib-array.h.

248  {
249  return !(p==q);
250 }

◆ operator<() [1/2]

template<class T >
bool operator< ( const GSlice_iter< T > &  p,
const GSlice_iter< T > &  q 
)

Definition at line 151 of file lib-array.h.

151  {
152  size_t count(0);
153  if (p.curr<q.curr && p.gs.start() == q.gs.start())
154  while ( (p.gs.stride()[count] == p.gs.stride()[count])
155  && (p.gs.size()[count] == p.gs.size()[count] ))
156  if (count++ == q.gs.size().size()-1) return true;
157  return false;
158 }
size_t curr
Definition: lib-array.h:80
gslice gs
Definition: lib-array.h:79

◆ operator<() [2/2]

template<class T >
bool operator< ( const CGSlice_iter< T > &  p,
const CGSlice_iter< T > &  q 
)

Definition at line 253 of file lib-array.h.

253  {
254  size_t count(0);
255  if (p.curr<q.curr && p.gs.start() == q.gs.start())
256  while ( (p.gs.stride()[count] == p.gs.stride()[count])
257  && (p.gs.size()[count] == p.gs.size()[count] ))
258  if (count++ == q.gs.size().size()-1) return true;
259  return false;
260 }
size_t curr
Definition: lib-array.h:182
gslice gs
Definition: lib-array.h:181

◆ operator==() [1/2]

template<class T >
bool operator== ( const GSlice_iter< T > &  p,
const GSlice_iter< T > &  q 
)

Definition at line 136 of file lib-array.h.

References GSlice_iter< T >::curr, and GSlice_iter< T >::gs.

136  {
137  size_t count(0);
138  if (p.curr==q.curr && p.gs.start() == q.gs.start())
139  while ( (p.gs.stride()[count] == p.gs.stride()[count])
140  && (p.gs.size()[count] == p.gs.size()[count] ))
141  if (count++ == q.gs.size().size()-1) return true;
142  return false;
143 }
size_t curr
Definition: lib-array.h:80
gslice gs
Definition: lib-array.h:79

◆ operator==() [2/2]

template<class T >
bool operator== ( const CGSlice_iter< T > &  p,
const CGSlice_iter< T > &  q 
)

Definition at line 238 of file lib-array.h.

References CGSlice_iter< T >::curr, and CGSlice_iter< T >::gs.

238  {
239  size_t count(0);
240  if (p.curr==q.curr && p.gs.start() == q.gs.start())
241  while ( (p.gs.stride()[count] == p.gs.stride()[count])
242  && (p.gs.size()[count] == p.gs.size()[count] ))
243  if (count++ == q.gs.size().size()-1) return true;
244  return false;
245 }
size_t curr
Definition: lib-array.h:182
gslice gs
Definition: lib-array.h:181