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

monodimensional array More...

#include <mathtools.h>

Public Member Functions

 D2Array ()
 
 D2Array (size_t i, size_t j)
 
 D2Array (size_t i, size_t j, const X &x)
 
 D2Array (const D2Array &x)
 
D2Arrayoperator= (const D2Array &x)
 
void operator+= (const D2Array &x)
 
void operator-= (const D2Array &x)
 
void operator*= (const X &x)
 
void operator/= (const X &x)
 
void Initialize (size_t i, size_t j)
 
bool Empty () const
 
void Initialize (size_t i, size_t j, const X &x)
 
 ~D2Array ()
 
void Clear ()
 
X & operator() (size_t i, size_t j)
 
const X & operator() (size_t i, size_t j) const
 
 operator X* ()
 
 operator const X * () const
 
size_t NRows () const
 
size_t NColumns () const
 
void SwapRows (size_t i, size_t j)
 
void SwapColumns (size_t i, size_t j)
 
D2Array< X > RemoveRow (size_t row)
 
D2Array< X > RemoveColumn (size_t column)
 
D1Array< X > GetRow (size_t row) const
 
D1Array< X > GetColumn (size_t column) const
 
D2Array< X > SymmetricPart () const
 
D2Array< X > AntiSymmetricPart () const
 
void Transpose ()
 
Trace () const
 

Detailed Description

template<class X>
class magnes::D2Array< X >

monodimensional array

abstraction of memory-contiguous bidimensional arrays

Constructor & Destructor Documentation

§ D2Array() [1/4]

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

Build an empty N-dimensional array

§ D2Array() [2/4]

template<class X>
magnes::D2Array< X >::D2Array ( size_t  i,
size_t  j 
)
inlineexplicit

Build an array with i rows and j columns

§ D2Array() [3/4]

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

Build an array with i rows and j columns*, with values x

§ D2Array() [4/4]

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

§ ~D2Array()

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

destructor, erase all elements from the heap

Member Function Documentation

§ AntiSymmetricPart()

template<class X >
D2Array< X > magnes::D2Array< X >::AntiSymmetricPart ( ) const

return the antisymmetric component of a square matrix

References magnes::D2Array< X >::NColumns(), and magnes::D2Array< X >::NRows().

§ Empty()

template<class X>
bool magnes::D2Array< X >::Empty ( ) const
inline

return true if array is empty

§ GetColumn()

template<class X >
D1Array< X > magnes::D2Array< X >::GetColumn ( size_t  column) const

Get a column as a new monodimensional array

§ GetRow()

template<class X >
D1Array< X > magnes::D2Array< X >::GetRow ( size_t  row) const

Get a row as a new monodimensional array

§ Initialize() [1/2]

template<class X>
void magnes::D2Array< X >::Initialize ( size_t  i,
size_t  j 
)
inline

resize an existing array to i rows and j columns, erase all previous data

§ Initialize() [2/2]

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

resize an existing array to i rows and j columns, erase all previous data and set all values to x

§ NColumns()

template<class X>
size_t magnes::D2Array< X >::NColumns ( ) const
inline

§ NRows()

template<class X>
size_t magnes::D2Array< X >::NRows ( ) const
inline

§ operator const X *()

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

casting operator to X

§ operator X*()

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

casting operator to X

§ operator()() [1/2]

template<class X >
X & magnes::D2Array< X >::operator() ( size_t  i,
size_t  j 
)
Returns
reference to element at (i,j) position

§ operator()() [2/2]

template<class X >
const X & magnes::D2Array< X >::operator() ( size_t  i,
size_t  j 
) const
Returns
const reference to element at (i,j) position

§ operator*=()

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

multiply by scalar x

References magnes::D2Array< X >::NColumns(), and magnes::D2Array< X >::NRows().

§ operator+=()

template<class X >
void magnes::D2Array< X >::operator+= ( const D2Array< X > &  x)

sum operator

§ operator-=()

template<class X >
void magnes::D2Array< X >::operator-= ( const D2Array< X > &  x)

difference operator

§ operator/=()

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

§ operator=()

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

§ RemoveColumn()

template<class X >
D2Array< X > magnes::D2Array< X >::RemoveColumn ( size_t  column)

remove a column

§ RemoveRow()

template<class X >
D2Array< X > magnes::D2Array< X >::RemoveRow ( size_t  row)

remove a row

§ SwapColumns()

template<class X >
void magnes::D2Array< X >::SwapColumns ( size_t  i,
size_t  j 
)

swap tow columns

§ SwapRows()

template<class X >
void magnes::D2Array< X >::SwapRows ( size_t  i,
size_t  j 
)

swap two rows

§ SymmetricPart()

template<class X >
D2Array< X > magnes::D2Array< X >::SymmetricPart ( ) const

return the symmetric component of a square matrix

References magnes::D2Array< X >::NColumns(), and magnes::D2Array< X >::NRows().

§ Trace()

template<class X >
X magnes::D2Array< X >::Trace ( ) const

§ Transpose()

template<class X >
void magnes::D2Array< X >::Transpose ( )

transpose the matrix

References magnes::D2Array< X >::NColumns(), and magnes::D2Array< X >::NRows().


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