Computational Physics - Department of Physics

(Axel Boer) #1

6.7 A vector and matrix class 201


**/
T*getPtr();

/**
*@return A pointer to an array with information on the length of each dimension.
**/
int*getPtrSize();

/************************************************************/
/* OPERATORS */
/************************************************************/
//! Assignment operator
Array<T>&operator=(constArray<T>& array);
//! Sum operator
Array<T>operator+(constArray<T>& array);
//! Substraction operator
Array<T>operator-(constArray<T>& array)const;/// w=u-v;

//! Multiplication operator
//Array<T> operator*(const Array<T>& array);

//! Assigment by addition operator
Array<T>&operator+=(constArray<T>& w);

//! Assignment by substraction operator
Array<T>&operator-=(constArray<T>& w);

//! Assignment by scalar product operator
Array<T>&operator*=(doublescalar);
//! Assignment by division operator
Array<T>&operator/=(doublescalar);
//! Index operators
constT&operator()(inti)const;
constT&operator()(inti,intj)const;
constT&operator()(inti,intj,intk)const;
constT&operator()(inti,intj,intk,intl)const;
constT&operator()(inti,intj,intk,intl,intm)const;
constT&operator()(inti,intj,intk,intl,intm,intn)const;
T&operator()(inti);
T&operator()(inti,intj);
T&operator()(inti,intj,intk);
T&operator()(inti,intj,intk,intl);
T&operator()(inti,intj,intk,intl,intm);
T&operator()(inti,intj,intk,intl,intm,intn);
Free download pdf