Changing the size of an Array
[Operations for Arrays (Please notice the detailed description!)]


Functions

void ArrayBase::resize (unsigned i, bool copy=false)
 Resizes an array to an one-dimensional array of size "i".
void ArrayBase::resize (unsigned i, unsigned j, bool copy=false)
 Resizes an array to a two-dimensional array of size i x j.
void ArrayBase::resize (unsigned i, unsigned j, unsigned k, bool copy=false)
 Resizes an array to a three-dimensional array of size i x j x k.
void ArrayBase::resize (const std::vector< unsigned > &i, bool copy=false)
 Resizes an array to an array with dimensions defined in vector "i".
void ArrayBase::resize (const ArrayBase &v, bool copy=false)
 Resizes an array to the dimensions of array "v".
void ArrayTable::resize (unsigned d0, unsigned d1, unsigned d2, int dummy=0)
 Modifies the size of a 3-dimensional array.
void ArrayTable::resize (unsigned d0, unsigned d1, int dummy=0)
 Modifies the size of a 2-dimensional array.
void ArrayTable::resize (unsigned d0, int dummy=0)
 Modifies the size of a 1-dimensional array.

Function Documentation

template<class T >
void ArrayTable< T >::resize ( unsigned  d0,
int  dummy = 0 
) [inline, inherited]

Modifies the size of a 1-dimensional array.

This method changes the size of an existing array. The previous content is destroyed.

Parameters:
d0 New size in the first dimension, i.e. size of first argument of the array
dummy Has no effect, is only introduced due to consistency with class Array
Returns:
none
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 252 of file ArrayTable.h.

References ArrayTable< T >::A, ArrayTable< T >::P1, ArrayTable< T >::P2, and ArrayBase::resize().

template<class T >
void ArrayTable< T >::resize ( unsigned  d0,
unsigned  d1,
int  dummy = 0 
) [inline, inherited]

Modifies the size of a 2-dimensional array.

This method changes the size of an existing array. The previous content is destroyed.

Parameters:
d0 New size in the first dimension, i.e. size of first argument of the array.
d1 New size in the second dimension, i.e. size of second argument of the array.
dummy Has no effect, is only introduced due to consistency with class Array.
Returns:
none
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 219 of file ArrayTable.h.

References ArrayTable< T >::A, ArrayTable< T >::P1, ArrayTable< T >::P2, and ArrayBase::resize().

template<class T >
void ArrayTable< T >::resize ( unsigned  d0,
unsigned  d1,
unsigned  d2,
int  dummy = 0 
) [inline, inherited]

Modifies the size of a 3-dimensional array.

This method changes the size of an existing array. The previous content is destroyed.

Parameters:
d0 New size in the first dimension, i.e. size of first argument of the array.
d1 New size in the second dimension, i.e. size of second argument of the array.
d2 New size in the third dimension, i.e. size of third argument of the array.
dummy Has no effect, is only introduced due to consistency with class Array.
Returns:
None.
Author:
M. Toussaint
Date:
2000
Changes
none
Status
stable

Definition at line 181 of file ArrayTable.h.

References ArrayTable< T >::A, ArrayTable< T >::P1, ArrayTable< T >::P2, and ArrayBase::resize().

Referenced by ArrayTable< T >::ArrayTable(), and ArrayTable< T >::operator=().

void ArrayBase::resize ( const ArrayBase v,
bool  copy = false 
) [inline, inherited]

Resizes an array to the dimensions of array "v".

The new dimensions of the current array are adopted from the dimensions of array v.
When the copy flag is set, existing elements are copied (if possible), otherwise all existing elements are discarded.

Parameters:
v the array which dimensions are taken as new dimensions of the current array.
copy if set to "true", then existing elements of the current array are copied, otherwise they are discarded.
Returns:
none
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates, that you've tried to resize a static array reference and the new size is not equal to the old size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
resize_i(unsigned*, unsigned, bool)

Definition at line 485 of file Array.h.

References ArrayBase::d, ArrayBase::nd, and ArrayBase::resize_i().

void ArrayBase::resize ( const std::vector< unsigned > &  i,
bool  copy = false 
) [inline, inherited]

Resizes an array to an array with dimensions defined in vector "i".

When the copy flag is set, then existing elements are copied (if possible), otherwise all existing elements are discarded.

Parameters:
i the vector with the sizes of the different dimensions of the array.
copy if set to "true", then existing elements are copied, otherwise they are discarded.
Returns:
none
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates, that you've tried to resize a static array reference and the new size is not equal to the old size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
resize_i(unsigned*, unsigned, bool)

Definition at line 440 of file Array.h.

References ArrayBase::resize_i().

void ArrayBase::resize ( unsigned  i,
unsigned  j,
unsigned  k,
bool  copy = false 
) [inline, inherited]

Resizes an array to a three-dimensional array of size i x j x k.

When the copy flag is set, then existing elements are copied (if possible), otherwise all existing elements are discarded.

Parameters:
i the size of the array in dimension one.
j the size of the array in dimension two.
k the size of the array in dimension three.
copy if set to "true", then existing elements are copied, otherwise they are discarded.
Returns:
none
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates, that you've tried to resize a static array reference and the new size is not equal to the old size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
resize_i(unsigned*, unsigned, bool)

Definition at line 399 of file Array.h.

References ArrayBase::resize_i().

void ArrayBase::resize ( unsigned  i,
unsigned  j,
bool  copy = false 
) [inline, inherited]

Resizes an array to a two-dimensional array of size i x j.

When the copy flag is set, then existing elements are copied (if possible), otherwise all existing elements are discarded.

Parameters:
i the size of the array in dimension one.
j the size of the array in dimension two.
copy if set to "true", then existing elements are copied, otherwise they are discarded.
Returns:
none
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates, that you've tried to resize a static array reference and the new size is not equal to the old size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
resize_i(unsigned*, unsigned, bool)

Definition at line 358 of file Array.h.

References ArrayBase::resize_i().

void ArrayBase::resize ( unsigned  i,
bool  copy = false 
) [inline, inherited]

Resizes an array to an one-dimensional array of size "i".

When the copy flag is set, then existing elements are copied (if possible), otherwise all existing elements are discarded.

Parameters:
i the new size of the one-dimensional array.
copy if set to "true", then existing elements are copied, otherwise they are discarded.
Returns:
none
Exceptions:
SharkException the type of the exception will be "size mismatch" and indicates, that you've tried to resize a static array reference and the new size is not equal to the old size
Author:
M. Kreutz
Date:
1995-01-01
Changes
none
Status
stable
See also:
resize_i(unsigned*, unsigned, bool)

Definition at line 320 of file Array.h.

References ArrayBase::resize_i().

Referenced by Array< T * >::append_elem(), Array< T * >::append_elems(), Array< T * >::append_rows(), innerProduct(), Array< T * >::operator=(), outerProduct(), Array< T * >::pos2idx(), readArray(), ArrayTable< T >::resize(), sort(), and sort2DBy1st().