74 GNdarray(
const int& nx,
const int& ny);
75 GNdarray(
const int& nx,
const int& ny,
const int& nz);
82 double&
operator()(
const int& ix,
const int& iy);
83 double&
operator()(
const int& ix,
const int& iy,
const int& iz);
86 const double&
operator()(
const int& ix,
const int& iy)
const;
87 const double&
operator()(
const int& ix,
const int& iy,
const int& iz)
const;
88 const double&
operator()(
const std::vector<int>& i)
const;
109 int size(
void)
const;
110 const std::vector<int>&
shape(
void)
const;
111 const std::vector<int>&
strides(
void)
const;
112 void shape(
const std::vector<int>& shape);
113 int index(
const std::vector<int>& i)
const;
114 std::vector<int>
index(
const int& index)
const;
115 double&
at(
const int& ix);
116 double&
at(
const int& ix,
const int& iy);
117 double&
at(
const int& ix,
const int& iy,
const int& iz);
118 double&
at(
const std::vector<int>& i);
119 const double&
at(
const int& ix)
const;
120 const double&
at(
const int& ix,
const int& iy)
const;
121 const double&
at(
const int& ix,
const int& iy,
const int& iz)
const;
122 const double&
at(
const std::vector<int>& i)
const;
123 const double*
data(
void)
const;
296 return int(
m_data.size());
337 return const_cast<double &
>(
static_cast<const GNdarray &
>(*this).
at(ix));
351 return const_cast<double &
>(
static_cast<const GNdarray &
>(*this).
at(ix,iy));
366 return const_cast<double &
>(
static_cast<const GNdarray &
>(*this).
at(ix,iy,iz));
379 return const_cast<double &
>(
static_cast<const GNdarray &
>(*this).
at(i));
GArf operator/(const GArf &arf, const double &scale)
Auxiliary Response File vision operator friend.
friend GNdarray sqrt(const GNdarray &array)
Computes square root of array elements.
const std::vector< int > & strides(void) const
Return strides of array.
bool operator!=(const GNdarray &array) const
Non-equality operator.
void clear(void)
Clear array.
friend GNdarray sign(const GNdarray &array)
Computes sign of array elements.
void free_members(void)
Delete class members.
friend double sum(const GNdarray &array)
Computes array sum.
GNdarray * clone(void) const
Clone array.
friend GNdarray asinh(const GNdarray &array)
Computes asinh of array elements.
Definition of interface for all GammaLib classes.
friend GNdarray sinh(const GNdarray &array)
Computes sinh of array elements.
const std::vector< int > & shape(void) const
Return shape of array.
friend GNdarray acos(const GNdarray &array)
Computes arccos of array elements.
friend GNdarray exp(const GNdarray &array)
Computes exponential of array elements.
std::vector< int > m_shape
Array dimensions.
friend GNdarray log(const GNdarray &array)
Computes natural logarithm of array elements.
GArf operator+(const GArf &a, const GArf &b)
Auxiliary Response File addition operator friend.
void copy_members(const GNdarray &array)
Copy class members.
friend GNdarray asin(const GNdarray &array)
Computes arcsin of array elements.
double & at(const int &ix)
1-dimensional array element access with range checking
GNdarray & operator-=(const GNdarray &array)
Unary subtraction operator.
std::vector< double > m_data
Array data.
GNdarray & operator/=(const GNdarray &array)
Unary division operator.
GNdarray & operator=(const GNdarray &array)
Assignment operator.
void require_same_shape(const std::string &method, const GNdarray &array) const
Throw exception if array shapes differ.
friend GNdarray atanh(const GNdarray &array)
Computes atanh of array elements.
friend GNdarray cos(const GNdarray &array)
Computes cosine of array elements.
Interface class for all GammaLib classes.
friend GNdarray abs(const GNdarray &array)
Computes absolute of array elements.
const double * data(void) const
Data access method (const version)
std::string print(const GChatter &chatter=NORMAL) const
Print array information.
bool operator==(const GNdarray &array) const
Equality operator.
int size(void) const
Return number of elements in array.
GArf operator*(const GArf &arf, const double &scale)
Auxiliary Response File scaling operator friend.
GNdarray(void)
Void constructor.
friend GNdarray log10(const GNdarray &array)
Computes base10 logarithm of array elements.
friend GNdarray tanh(const GNdarray &array)
Computes tanh of array elements.
N-dimensional array class.
std::string classname(void) const
Return class name.
friend GNdarray tan(const GNdarray &array)
Computes tangens of array elements.
GNdarray & operator*=(const GNdarray &array)
Unary multiplication operator.
friend GNdarray atan(const GNdarray &array)
Computes arctan of array elements.
friend double max(const GNdarray &array)
Computes maximum array element.
friend double min(const GNdarray &array)
Computes minimum array element.
int index(const std::vector< int > &i) const
Compute array element index.
friend GNdarray sin(const GNdarray &array)
Computes sine of array elements.
bool has_same_shape(const GNdarray &array) const
Check if array has the same shape.
friend GNdarray acosh(const GNdarray &array)
Computes acosh of array elements.
void init_members(void)
Initialise class members.
friend GNdarray pow(const GNdarray &array, const double &power)
Computes tanh of array elements.
GNdarray & operator+=(const GNdarray &array)
Unary addition operator.
GArf operator-(const GArf &a, const GArf &b)
Auxiliary Response File subtraction operator friend.
virtual ~GNdarray(void)
Destructor.
int dim(void) const
Return dimension of array.
double & operator()(const int &ix)
1-dimensional array element access operator
GNdarray operator-(void) const
Unary minus operator.
std::vector< int > m_strides
Steps in each dimension when traversing array.
friend GNdarray cosh(const GNdarray &array)
Computes cosh of array elements.