MSpin-JCoupling  2.1
Public Member Functions | List of all members
magnes::D1Array< X > Class Template Reference

monodimensional dynamically allocated array More...

#include <mathtools.h>

Public Member Functions

 D1Array ()
 
 D1Array (size_t i)
 
 D1Array (size_t i, const X &x)
 
 D1Array (const D1Array &x)
 
void Initialize (size_t i)
 
void Initialize (size_t i, const X &x)
 
 ~D1Array ()
 
void Clear ()
 
X & operator() (size_t i)
 
const X & operator() (size_t i) const
 
 operator X* ()
 
 operator const X * () const
 
D1Arrayoperator= (const D1Array &x)
 
void operator*= (const X &x)
 
void operator/= (const X &x)
 
size_t size () const
 

Detailed Description

template<class X>
class magnes::D1Array< X >

monodimensional dynamically allocated array

abstraction of memory-contiguous dyanamically allocated monodimensional arrays

Constructor & Destructor Documentation

§ D1Array() [1/4]

template<class X>
magnes::D1Array< X >::D1Array ( )
inline

Build empty array

§ D1Array() [2/4]

template<class X>
magnes::D1Array< X >::D1Array ( size_t  i)
inlineexplicit

Build an array of size i and undefined values

§ D1Array() [3/4]

template<class X>
magnes::D1Array< X >::D1Array ( size_t  i,
const X &  x 
)

Build an array of size i, with an x value for all elements

§ D1Array() [4/4]

template<class X>
magnes::D1Array< X >::D1Array ( const D1Array< X > &  x)

copy constructor

§ ~D1Array()

template<class X>
magnes::D1Array< X >::~D1Array ( )
inline

destructor all date are deleted from the heap

Member Function Documentation

§ Initialize() [1/2]

template<class X>
void magnes::D1Array< X >::Initialize ( size_t  i)
inline

resize an existing array to size i, all values are undefined and data are lost

§ Initialize() [2/2]

template<class X>
void magnes::D1Array< X >::Initialize ( size_t  i,
const X &  x 
)

resize an existing array to size i, all values are set to x and previous data are deleted

§ operator const X *()

template<class X>
magnes::D1Array< X >::operator const X * ( ) const
inline

casting operator to const X*, allow easy pass to math libraries

§ operator X*()

template<class X>
magnes::D1Array< X >::operator X* ( )
inline

casting operator to X*, allow easy pass to math libraries

§ operator()() [1/2]

template<class X >
X & magnes::D1Array< X >::operator() ( size_t  i)
Returns
a reference to element i

§ operator()() [2/2]

template<class X >
const X & magnes::D1Array< X >::operator() ( size_t  i) const
Returns
a const reference to element i

§ operator*=()

template<class X>
void magnes::D1Array< X >::operator*= ( const X &  x)

multiply by scalar x

§ operator/=()

template<class X>
void magnes::D1Array< X >::operator/= ( const X &  x)

divide by scalar x

§ operator=()

template<class X >
D1Array< X > & magnes::D1Array< X >::operator= ( const D1Array< X > &  x)

asignment operator

§ size()

template<class X>
size_t magnes::D1Array< X >::size ( ) const
inline

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