Extracting Array elements
[Operations for Arrays (Please notice the detailed description!)]

Functions

T & Array::operator() ()
 Returns the first and only element of the current array.
const T & Array::operator() () const
 Returns the first and only element of the current array as constant.
T & Array::operator() (unsigned i)
 Returns the i-th element of the one-dimensional array.
const T & Array::operator() (unsigned i) const
 Returns the i-th element of the one-dimensional array as constant.
T & Array::operator() (unsigned i, unsigned j)
 Returns the element at position "i" of dimension one and position "j" at dimension two of the two-dimensional array.
const T & Array::operator() (unsigned i, unsigned j) const
 Returns the element at position "i" of dimension one and position "j" at dimension two of the two-dimensional array as constant.
T & Array::operator() (unsigned i, unsigned j, unsigned k)
 Returns the element at position "i" of dimension one, position "j" at dimension two and position "k" of dimension three of the three-dimensional array.
const T & Array::operator() (unsigned i, unsigned j, unsigned k) const
 Returns the element at position "i" of dimension one, position "j" at dimension two and position "k" of dimension three of the three-dimensional array as constant.
T & Array::operator() (const std::vector< unsigned > &i)
 Returns the element identified by the dimension-positions in vector "i" from the current array.
const T & Array::operator() (const std::vector< unsigned > &i) const
 Returns the element identified by the dimension-positions in vector "i" from the current array as constant.
T & Array::elem (unsigned i)
 Returns the i-th element of the arrays element vector Array::e.
const T & Array::elem (unsigned i) const
 Returns the i-th element of the arrays element vector Array::e as constant.
Array< T > Array::subarr (unsigned from, unsigned to) const
 Returns a subarray from position "from" to position "to" of the current array.
Array< unsigned > Array::pos2idx (unsigned p)
 Given an absolute position "p" in the element vector Array::e, the positions relative to the single dimensions of the array are returned.
Array< T > Array::row (unsigned i) const
 Returns the row number "i" of the current array.
Array< T > Array::rows (const Array< unsigned > &idx) const
 Returns the array rows with the numbers defined in array "idx" from the current non-empty array.
Array< T > Array::rows (unsigned i) const
 Returns the array row number "i" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j) const
 Returns the array rows with the numbers "i" and "j" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k) const
 Returns the array rows with the numbers "i", "j" and "k" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k, unsigned l) const
 Returns the array rows with the numbers "i", "j", "k" and "l" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m) const
 Returns the array rows with the numbers "i", "j", "k", "l" and "m" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n) const
 Returns the array rows with the numbers "i", "j", "k", "l", "m" and "n" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n, unsigned o) const
 Returns the array rows with the numbers "i", "j", "k", "l", "m", "n" and "o" from the current non-empty array.
Array< T > Array::rows (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n, unsigned o, unsigned p) const
 Returns the array rows with the numbers "i", "j", "k", "l", "m", "n", "o" and "p" from the current non-empty array.
Array< T > Array::col (unsigned i) const
 Returns the column number "i" of the current array.
Array< T > Array::cols (const Array< unsigned > &idx) const
 Returns the array columns with the numbers defined in array "idx" from the current non-empty array.
Array< T > Array::cols (unsigned i) const
 Returns the array column number "i" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j) const
 Returns the array columns with the numbers "i" and "j" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k) const
 Returns the array columns with the numbers "i", "j" and "k" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k, unsigned l) const
 Returns the array columns with the numbers "i", "j", "k" and "l" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m) const
 Returns the array columns with the numbers "i", "j", "k", "l" and "m" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n) const
 Returns the array columns with the numbers "i", "j", "k", "l", "m" and "n" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n, unsigned o) const
 Returns the array columns with the numbers "i", "j", "k", "l", "m", "n" and "o" from the current non-empty array.
Array< T > Array::cols (unsigned i, unsigned j, unsigned k, unsigned l, unsigned m, unsigned n, unsigned o, unsigned p) const
 Returns the array columns with the numbers "i", "j", "k", "l", "m", "n", "o" and "p" from the current non-empty array.
template<class T >
minElement (const Array< T > &v)
 Returns the minimum value stored in array "v".
template<class T >
minElement (const Array< T > &v, unsigned &ind, unsigned start=0, unsigned end=0)
 Returns the minimum value stored in array "v" between the positions "start" and "end" - 1.
template<class T >
maxElement (const Array< T > &v)
 Returns the maximum value stored in array "v".
template<class T >
maxElement (const Array< T > &v, unsigned &ind, unsigned start=0, unsigned end=0)
 Returns the maximum value stored in array "v" between the positions "start" and "end" - 1.
template<class T >
void minmaxElement (const Array< T > &v, T &minVal, T &maxVal)
 Determines the minimum and maximum values stored in array "v".
T & ArrayTable::operator() (unsigned i)
 Allows access to single entries of a 1-dimensional array.
T & ArrayTable::operator() (unsigned i, unsigned j)
 Allows access to single entries of a 2-dimensional array.
T & ArrayTable::operator() (unsigned i, unsigned j, unsigned k)
 Allows access to single entries of a 3-dimensional array.
ArrayReference< T > Array::operator[] (unsigned i)
 Returns a reference to subarray "i" of the current array.
const ArrayReference< T > Array::operator[] (unsigned i) const
 Returns a constant reference to subarray "i" of the current array.

Function Documentation

template<class T>
Array< T > Array< T >::col ( unsigned  i  )  const [inline, inherited]

Returns the column number "i" of the current array.

Column here always refers to the last dimension of the array.

Parameters:
i the number of the column that will be returned, must be less than the size of the last dimension
Returns:
the column number i
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i exceeds the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 3396 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n,
unsigned  o,
unsigned  p 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j", "k", "l", "m", "n", "o" and "p" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
l number of the 4-th column that will be returned, must be less than the size of the last dimension
m number of the 5-th column that will be returned, must be less than the size of the last dimension
n number of the 6-th column that will be returned, must be less than the size of the last dimension
o number of the 7-th column that will be returned, must be less than the size of the last dimension
p number of the 8-th column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j, k, l, m, n, o and p
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i, j, k, l, m, n, o or p exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3869 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n,
unsigned  o 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j", "k", "l", "m", "n" and "o" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
l number of the 4-th column that will be returned, must be less than the size of the last dimension
m number of the 5-th column that will be returned, must be less than the size of the last dimension
n number of the 6-th column that will be returned, must be less than the size of the last dimension
o number of the 7-th column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j, k, l, m, n and o
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i, j, k, l, m, n or o exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3806 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j", "k", "l", "m" and "n" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
l number of the 4-th column that will be returned, must be less than the size of the last dimension
m number of the 5-th column that will be returned, must be less than the size of the last dimension
n number of the 6-th column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j, k, l, m and n
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i, j, k, l, m or n exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3747 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j", "k", "l" and "m" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
l number of the 4-th column that will be returned, must be less than the size of the last dimension
m number of the 5-th column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j, k, l and m
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i, j, k, l or m exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3691 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j", "k" and "l" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
l number of the 4-th column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j, k and l
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i, j, k or l exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3638 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j,
unsigned  k 
) const [inline, inherited]

Returns the array columns with the numbers "i", "j" and "k" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
k number of the third column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i, j and k
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i or j or k exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3591 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i,
unsigned  j 
) const [inline, inherited]

Returns the array columns with the numbers "i" and "j" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the first column that will be returned, must be less than the size of the last dimension
j number of the second column that will be returned, must be less than the size of the last dimension
Returns:
an array containing columns no. i and j
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i or j exceed the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3547 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( unsigned  i  )  const [inline, inherited]

Returns the array column number "i" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
i number of the column that will be returned, must be less than the size of the last dimension
Returns:
an array containing column no. i
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if i exceeds the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
cols(const Array< unsigned >&)

Definition at line 3506 of file Array.h.

template<class T>
Array< T > Array< T >::cols ( const Array< unsigned > &  idx  )  const [inline, inherited]

Returns the array columns with the numbers defined in array "idx" from the current non-empty array.

Column here always refers to the last dimension of the array.

Parameters:
idx one-dimensional or empty array with the numbers of the columns that will be returned
Returns:
an array containing all the chosen columns
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions or "range check error" if at least one element of idx exceeds the size of the last dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 3444 of file Array.h.

template<class T>
const T& Array< T >::elem ( unsigned  i  )  const [inline, inherited]

Returns the i-th element of the arrays element vector Array::e as constant.

Parameters:
i position of the element in the element vector
Returns:
the i-th element of the element vector
Exceptions:
SharkException the type of the exception will be "range check error" and indicates, that the value of i exceeds the total number of array elements
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1808 of file Array.h.

template<class T>
T& Array< T >::elem ( unsigned  i  )  [inline, inherited]

Returns the i-th element of the arrays element vector Array::e.

Parameters:
i position of the element in the element vector
Returns:
the i-th element of the element vector
Exceptions:
SharkException the type of the exception will be "range check error" and indicates, that the value of i exceeds the total number of array elements
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1778 of file Array.h.

Referenced by Array< T * >::append_cols(), Array< T * >::append_rows(), clip(), Array< T * >::col(), Array< T * >::cols(), innerProduct(), maxElement(), minElement(), minmaxElement(), operator>>(), outerProduct(), prettyprint(), product(), readArray(), Array< T * >::remove_col(), Array< T * >::remove_row(), Array< T * >::rows(), scalarProduct(), sort(), sort2DBy1st(), sqrDistance(), Array< T * >::subarr(), sum(), sumOfAbs(), sumOfSqr(), and writeArray().

template<class T >
T maxElement ( const Array< T > &  v,
unsigned &  ind,
unsigned  start = 0,
unsigned  end = 0 
) [inline]

Returns the maximum value stored in array "v" between the positions "start" and "end" - 1.

The positions of the values apply to the positions of the values in the element vector Array::e.
Besides returning the maximum value, the index (i.e. position in the element vector) of the maximum value is stored.

Parameters:
v the array of which the maximum value will be returned
ind index of the determined maximum value in the element vector
start the first position in the element vector where the method will search for the maximum value, the default value is "0"
end the first position in the element vector where the method will not search for the maximum value any more. If end is set to "0" (the default value), then the number of elements of the element vector is taken for end. end must be greater or equal than start, otherwise it will be set to the value of start
Returns:
the maximum value of v in the interval [start, end[
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that v contains no elements or that start or end exceed the number of elements in v
Author:
M. Kreutz
Date:
1995
Changes
2002-03-13, ra: Last RANGE CHECK set into comments, because otherwise you can not use the default value "0" for "end" (and its replacement by the number of elements of "v") if "start" is set to a value >= 1. To avoid errors, the value of "end" will be now set to "start", if its less than the start value
Status
stable

Definition at line 1198 of file ArrayOp.h.

References Array< T >::elem(), and ArrayBase::nelem().

template<class T >
T maxElement ( const Array< T > &  v  )  [inline]

Returns the maximum value stored in array "v".

Parameters:
v the array of which the maximum value will be returned
Returns:
the maximum value of v
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that v contains no elements
Author:
M. Kreutz
Date:
1995
Changes
none
Status
stable

Definition at line 1139 of file ArrayOp.h.

References Array< T >::elem(), and ArrayBase::nelem().

template<class T >
T minElement ( const Array< T > &  v,
unsigned &  ind,
unsigned  start = 0,
unsigned  end = 0 
) [inline]

Returns the minimum value stored in array "v" between the positions "start" and "end" - 1.

The positions of the values apply to the positions of the values in the element vector Array::e.
Besides returning the minimum value, the index (i.e. position in the element vector) of the minimum value is stored.

Parameters:
v the array of which the minimum value will be returned
ind index of the determined minimum value in the element vector
start the first position in the element vector where the method will search for the minimum value, the default value is "0"
end the first position in the element vector where the method will not search for the minimum value any more. If end is set to "0" (the default value), then the number of elements of the element vector is taken for end. end must be greater than or equal to start, otherwise it will be set to the value of start
Returns:
the minimum value of v in the interval [start, end[
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that v contains no elements or that start or end exceed the number of elements in v
Author:
M. Kreutz
Date:
1995
Changes
2002-03-13, ra: Last RANGE CHECK set into comments, because otherwise you can not use the default value "0" for "end" (and its replacement by the number of elements of "v") if "start" is set to a value >= 1. To avoid errors, the value of "end" will be now set to "start", if its less than the start value
Status
stable

Definition at line 1093 of file ArrayOp.h.

References Array< T >::elem(), and ArrayBase::nelem().

template<class T >
T minElement ( const Array< T > &  v  )  [inline]

Returns the minimum value stored in array "v".

Parameters:
v the array of which the minimum value will be returned
Returns:
the minimum value of v
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that v contains no elements
Author:
M. Kreutz
Date:
1995
Changes
none
Status
stable

Definition at line 1034 of file ArrayOp.h.

References Array< T >::elem(), and ArrayBase::nelem().

template<class T >
void minmaxElement ( const Array< T > &  v,
T &  minVal,
T &  maxVal 
) [inline]

Determines the minimum and maximum values stored in array "v".

Parameters:
v the array of which the minimum and maximum values will be determined
minVal the minimum value of the array
maxVal the maximum value of the array
Returns:
none
Author:
M. Kreutz
Date:
1995
Changes
none
Status
stable

Definition at line 1244 of file ArrayOp.h.

References Array< T >::elem(), and ArrayBase::nelem().

template<class T>
T& ArrayTable< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  k 
) [inline, inherited]

Allows access to single entries of a 3-dimensional array.

This method provides the functionality to allow access to single elements of an 3-dimensional array. The values of the parameters must fit to the sizes of the array chosen by means of resize.

Parameters:
i Index of the first dimension.
j Index of the second dimension.
k Index of the third dimension.
Returns:
Element with the indices $i$, $j$, and $k$.
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that i exceeds the array's first dimension or j exceeds the array's second dimension or k exceeds the array's third dimension
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 502 of file ArrayTable.h.

References ArrayTable< T >::P2.

template<class T>
T& ArrayTable< T >::operator() ( unsigned  i,
unsigned  j 
) [inline, inherited]

Allows access to single entries of a 2-dimensional array.

This method provides the functionality to allow access to single elements of an 2-dimensional array. The values of the parameters must fit to the sizes of the array chosen by means of resize

Parameters:
i Index of the first dimension.
j Index of the second dimension.
Returns:
Entry of $j$-th element of the $i$-th row of the array.
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that i exceeds the array's first dimension or j exceeds the array's second dimension
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 467 of file ArrayTable.h.

References ArrayTable< T >::P1.

template<class T>
T& ArrayTable< T >::operator() ( unsigned  i  )  [inline, inherited]

Allows access to single entries of a 1-dimensional array.

This method provides the functionality to allow access to single elements of an 1-dimensional array. The value of the parameter must fit to the size of the array chosen by means of resize

Parameters:
i Index of the element.
Returns:
Entry of $i$-th element of the array.
Exceptions:
check_exception the type of the exception will be "range check error" and indicates that i exceeds the array's first dimension
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 434 of file ArrayTable.h.

References ArrayTable< T >::A.

template<class T>
const T& Array< T >::operator() ( const std::vector< unsigned > &  i  )  const [inline, inherited]

Returns the element identified by the dimension-positions in vector "i" from the current array as constant.

Parameters:
i the positions of the wished array element related to the different dimensions
Returns:
The array element with the indices stored in i
Exceptions:
SharkException if the type of the exception is "size mismatch", then i contains more index values, than the current array has dimensions. If the type is "range check error", then at least one of the index values in i exceeds the size of the corresponding array dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1617 of file Array.h.

template<class T>
T& Array< T >::operator() ( const std::vector< unsigned > &  i  )  [inline, inherited]

Returns the element identified by the dimension-positions in vector "i" from the current array.

Parameters:
i the positions of the wished array element related to the different dimensions
Returns:
The array element with the indices stored in i
Exceptions:
SharkException if the type of the exception is "size mismatch", then i contains more index values, than the current array has dimensions. If the type is "range check error", then at least one of the index values in i exceeds the size of the corresponding array dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1572 of file Array.h.

template<class T>
const T& Array< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  k 
) const [inline, inherited]

Returns the element at position "i" of dimension one, position "j" at dimension two and position "k" of dimension three of the three-dimensional array as constant.

Parameters:
i position in dimension 1 of the element that will be returned.
j position in dimension 2 of the element that will be returned.
k position in dimension 3 of the element that will be returned.
Returns:
The i-th, j-th, k-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not 3-dimensional. If the type is "range check error", then the value of i exceeds the size of the first dimension and/or the value of j exceeds the size of the second dimension and/or the value of k exceeds the size of the third dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1537 of file Array.h.

template<class T>
T& Array< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  k 
) [inline, inherited]

Returns the element at position "i" of dimension one, position "j" at dimension two and position "k" of dimension three of the three-dimensional array.

Parameters:
i position in dimension 1 of the element that will be returned.
j position in dimension 2 of the element that will be returned.
k position in dimension 3 of the element that will be returned.
Returns:
The i-th, j-th, k-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not 3-dimensional. If the type is "range check error", then the value of i exceeds the size of the first dimension and/or the value of j exceeds the size of the second dimension and/or the value of k exceeds the size of the third dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1500 of file Array.h.

template<class T>
const T& Array< T >::operator() ( unsigned  i,
unsigned  j 
) const [inline, inherited]

Returns the element at position "i" of dimension one and position "j" at dimension two of the two-dimensional array as constant.

Parameters:
i row-position of the element that will be returned.
j column-position of the element that will be returned.
Returns:
The i-th, j-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not 2-dimensional. If the type is "range check error", then the value of i exceeds the size of the first dimension and/or the value of j exceeds the size of the second dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1464 of file Array.h.

template<class T>
T& Array< T >::operator() ( unsigned  i,
unsigned  j 
) [inline, inherited]

Returns the element at position "i" of dimension one and position "j" at dimension two of the two-dimensional array.

Parameters:
i row-position of the element that will be returned.
j column-position of the element that will be returned.
Returns:
The i-th, j-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not 2-dimensional. If the type is "range check error", then the value of i exceeds the size of the first dimension and/or the value of j exceeds the size of the second dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1430 of file Array.h.

template<class T>
const T& Array< T >::operator() ( unsigned  i  )  const [inline, inherited]

Returns the i-th element of the one-dimensional array as constant.

Parameters:
i position of the element that will be returned.
Returns:
The i-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not one-dimensional. If the type is "range check error", then the value of i exceeds the array size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1397 of file Array.h.

template<class T>
T& Array< T >::operator() ( unsigned  i  )  [inline, inherited]

Returns the i-th element of the one-dimensional array.

Parameters:
i position of the element that will be returned.
Returns:
The i-th array element
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array is not one-dimensional. If the type is "range check error", then the value of i exceeds the array size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1367 of file Array.h.

template<class T>
const T& Array< T >::operator() (  )  const [inline, inherited]

Returns the first and only element of the current array as constant.

The dimension of the array must be zero and the number of elements must be "1".

Returns:
The first element of the array.
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array has one or more dimensions, if the type is "range check error", then the array contains more or less than one element
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1338 of file Array.h.

template<class T>
T& Array< T >::operator() (  )  [inline, inherited]

Returns the first and only element of the current array.

The dimension of the array must be zero and the number of elements must be "1".

Returns:
The first element of the array.
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array has one or more dimensions, if the type is "range check error", then the array contains more or less than one element
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 1306 of file Array.h.

template<class T >
const ArrayReference< T > Array< T >::operator[] ( unsigned  i  )  const [inline, inherited]

Returns a constant reference to subarray "i" of the current array.

A subarray is identified here by a position in the first dimension. The subarray will then include the element at this position and all elements of the subdimensions, starting from the mentioned position.

Parameters:
i index of the subarray that will be returned
Returns:
constant reference to the subarray with index i
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array has no dimensions. If the type is "range check error", then the value of i exceeds the size of the array's first dimension
Example
Given the array $A$ with content

$ \left(\begin{array}{ll} 1. & 2.\\ 3. & 4.\\ 5. & 6.\\ 7. & 8. \end{array}\right) $

then $A[ 2 ]$ will return the subarray $(5. \mbox{\ \ } 6.)$.

Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 5102 of file Array.h.

References ArrayBase::d, Array< T >::e, and ArrayBase::ne.

template<class T >
ArrayReference< T > Array< T >::operator[] ( unsigned  i  )  [inline, inherited]

Returns a reference to subarray "i" of the current array.

A subarray is identified here by a position in the first dimension. The subarray will then include the element at this position and all elements of the subdimensions, starting from the mentioned position.

Parameters:
i index of the subarray that will be returned
Returns:
reference to the subarray with index i
Exceptions:
SharkException if the type of the exception is "size mismatch", then the array has no dimensions. If the type is "range check error", then the value of i exceeds the size of the array's first dimension.
Example
Given the array $A$ with content

$ \left(\begin{array}{ll} 1. & 2.\\ 3. & 4.\\ 5. & 6.\\ 7. & 8. \end{array}\right) $

then $A[ 2 ]$ will return the subarray $(5. \mbox{\ \ } 6.)$.

Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 5053 of file Array.h.

References ArrayBase::d, Array< T >::e, and ArrayBase::ne.

template<class T>
Array< unsigned > Array< T >::pos2idx ( unsigned  p  )  [inline, inherited]

Given an absolute position "p" in the element vector Array::e, the positions relative to the single dimensions of the array are returned.

Parameters:
p the absolute position
Returns:
an array with the positions due to the single dimensions of the current Array object
Exceptions:
SharkException the type of the exception will be "range check error" and indicates that p exceeds the number of elements of the current array
Example
Guess you have an $5 \times 4$ array, i.e. an array with a total number of 20 elements. You want to extract the element at the absolute position 13 of the element vector (containing elements with indices 0 to 19).
Transformed to the array as seen by the user, you will get the relative positions $(3,1)$, because $3 \ast 4 + 1 = 13$.
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 2796 of file Array.h.

template<class T>
Array< T > Array< T >::row ( unsigned  i  )  const [inline, inherited]

Returns the row number "i" of the current array.

Row here always refers to the first dimension of the array.

Parameters:
i the number of the row that will be returned, must be less than the size of dimension one.
Returns:
the row number i
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions and "range check error" if i exceeds the size of the array's first dimension
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 2884 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n,
unsigned  o,
unsigned  p 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j", "k", "l", "m", "n", "o" and "p" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
l number of the 4-th row that will be returned, must be less than the size of dimension one.
m number of the 5-th row that will be returned, must be less than the size of dimension one.
n number of the 6-th row that will be returned, must be less than the size of dimension one.
o number of the 7-th row that will be returned, must be less than the size of dimension one.
p number of the 8-th row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j, k, l, m, n, o and p
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i, j, k, l, m, n, p or p exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3350 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n,
unsigned  o 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j", "k", "l", "m", "n" and "o" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
l number of the 4-th row that will be returned, must be less than the size of dimension one.
m number of the 5-th row that will be returned, must be less than the size of dimension one.
n number of the 6-th row that will be returned, must be less than the size of dimension one.
o number of the 7-th row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j, k, l, m, n and o
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i, j, k, l, m, n or p exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3286 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m,
unsigned  n 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j", "k", "l", "m" and "n" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
l number of the 4-th row that will be returned, must be less than the size of dimension one.
m number of the 5-th row that will be returned, must be less than the size of dimension one.
n number of the 6-th row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j, k, l, m and n
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i, j, k, l, m or n exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3226 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l,
unsigned  m 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j", "k", "l" and "m" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
l number of the 4-th row that will be returned, must be less than the size of dimension one.
m number of the 5-th row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j, k, l and m
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i, j, k, l or m exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3169 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k,
unsigned  l 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j", "k" and "l" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
l number of the 4-th row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j, k and l
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i, j, k or l exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3115 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j,
unsigned  k 
) const [inline, inherited]

Returns the array rows with the numbers "i", "j" and "k" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
k number of the third row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i, j and k
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i or j or k exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3066 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i,
unsigned  j 
) const [inline, inherited]

Returns the array rows with the numbers "i" and "j" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the first row that will be returned, must be less than the size of dimension one.
j number of the second row that will be returned, must be less than the size of dimension one.
Returns:
an array containing rows no. i and j
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i or j exceed the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 3020 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( unsigned  i  )  const [inline, inherited]

Returns the array row number "i" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
i number of the row that will be returned, must be less than the size of dimension one.
Returns:
an array containing row no. i
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if i exceeds the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
rows(const Array< unsigned >&)

Definition at line 2977 of file Array.h.

template<class T>
Array< T > Array< T >::rows ( const Array< unsigned > &  idx  )  const [inline, inherited]

Returns the array rows with the numbers defined in array "idx" from the current non-empty array.

Row here always refers to the first dimension of the array.

Parameters:
idx one-dimensional or empty array with the numbers of the rows that will be returned
Returns:
an array containing all the chosen rows
Exceptions:
SharkException the type of the exception will be "size mismatch" and if the current array has no dimensions or idx is more than one-dimensional and "range check error" if at least one of the values in idx exceeds the size of the first dimension of the current array
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 2918 of file Array.h.

template<class T>
Array< T > Array< T >::subarr ( unsigned  from,
unsigned  to 
) const [inline, inherited]

Returns a subarray from position "from" to position "to" of the current array.

If the first dimension of the current array $A$ is $d1$ and $from \leq to < d1$, then an array containing the subarrays $A[ \mbox{from} ] \dots A[ \mbox{to} ]$ is returned.

Parameters:
from the first position of the subarray, must be less than the size of the first dimension
to the last position of the subarray, must be less than the size of the first dimension
Returns:
the subarray
Exceptions:
SharkException the type of the exception will be "size mismatch" if the current array has no dimensions and "range check error" if from is greater than to or at least one of the both values exceeds the size of the first dimension of the current array
Example

Given the following $4 \times 2$ array

$ \left(\begin{array}{ll} 1. & 2.\\ 3. & 4.\\ 5. & 6.\\ 7. & 8. \end{array}\right) $

and $\mbox{from} = 1 < 4$ and $\mbox{to} = 2 < 4$, the subarray

$ \left(\begin{array}{ll} 3. & 4.\\ 5. & 6.\\ \end{array}\right) $

is returned.

Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable

Definition at line 2735 of file Array.h.