Version 1.2 (June 2013)
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
utils.ComplexArray Class Reference

Class for storing an 1- to 3-dimensional array of complex numbers as an 1D array of alternating real and imaginary parts in double precision. More...

Public Member Functions

 ComplexArray (int n)
 Constructor to generate a 1D array of complex numbers. More...
 
 ComplexArray (int n, int m)
 Constructor to generate a 2D array of complex numbers. More...
 
 ComplexArray (int n, int m, int L)
 Constructor to generate a 3D array of complex numbers. More...
 
int getDimension ()
 Return the dimension of this complex array. More...
 
int getTotalLength ()
 Return the total length of this complex array. More...
 
int[] getOriginalSize ()
 Return the array that shows the size of the original array before storing using this method. More...
 
double[] getWholeArray ()
 Return the complex array. More...
 
void setWholeArray (double[] inputArray)
 Set the array to values of a array of doubles. More...
 
void setWholeArray (ComplexArray input)
 Set the array to values to those of another AltComplex. More...
 
void setRealAt (double realPart, int i, int j, int k)
 Set value at given coordinates. More...
 
void setRealAt (double realPart, int i, int j)
 Set value at given coordinates. More...
 
void setRealAt (double realPart, int i)
 Set value at given coordinates. More...
 
void setImagAt (double imagPart, int i, int j, int k)
 Set the 'imaginary' part of the array to a value. More...
 
void setImagAt (double imagPart, int i, int j)
 Set the 'imaginary' part of the array to a value. More...
 
void setImagAt (double imagPart, int i)
 Set the 'imaginary' part of the array to a value. More...
 
void setComplexAt (Complex c, int i, int j, int k)
 Set the 'imaginary' part of the array to a Complex number. More...
 
void setComplexAt (Complex c, int i, int j)
 Set the 'imaginary' part of the array to a Complex number. More...
 
void setComplexAt (Complex c, int i)
 Set the 'imaginary' part of the array to a Complex number. More...
 
double getRealAt (int i, int j, int k)
 Get value at specified coordinates. More...
 
double getRealAt (int i, int j)
 Get value at specified coordinates. More...
 
double getRealAt (int i)
 Get value at specified coordinates. More...
 
double getImagAt (int i, int j, int k)
 Get imaginary value part of this object at specified coordinates. More...
 
double getImagAt (int i, int j)
 Get imaginary value part of this object at specified coordinates. More...
 
double getImagAt (int i)
 Get imaginary value part of this object at specified coordinates. More...
 
Complex getComplexAt (int i, int j, int k)
 Get the complex number stored at a given position in the array. More...
 
Complex getComplexAt (int i, int j)
 Get the complex number stored at a given position in the array. More...
 
Complex getComplexAt (int i)
 Get the complex number stored at a given position in the array. More...
 
void add (double realNumber, int i, int j, int k)
 Add a double to the data in a given position in the array. More...
 
void sub (double realNumber, int i, int j, int k)
 Subtract a double to the data in a given position in the array. More...
 
void mul (double realNumber, int i, int j, int k)
 Multiply a double to the data in a given position in the array. More...
 
void div (double realNumber, int i, int j, int k)
 Divide a double to the data in a given position in the array. More...
 
void add (double realNumber, int i, int j)
 Add a double to the data in a given position in the array. More...
 
void sub (double realNumber, int i, int j)
 Subtract a double to the data in a given position in the array. More...
 
void mul (double realNumber, int i, int j)
 Multiply a double to the data in a given position in the array. More...
 
void div (double realNumber, int i, int j)
 Divide a double to the data in a given position in the array. More...
 
void add (double realNumber, int i)
 Add a double to the data in a given position in the array. More...
 
void sub (double realNumber, int i)
 Subtract a double to the data in a given position in the array. More...
 
void mul (double realNumber, int i)
 Multiply a double to the data in a given position in the array. More...
 
void div (double realNumber, int i)
 Divide a double to the data in a given position in the array. More...
 
void add (Complex c, int i, int j, int k)
 Add a complex number to the data in a given position in the array. More...
 
void sub (Complex c, int i, int j, int k)
 Subtract a complex number from the data in a given position in the array. More...
 
void mul (Complex c, int i, int j, int k)
 Multiply a complex number to the data in a given position in the array. More...
 
void div (Complex c, int i, int j, int k)
 Divide a complex number to the data in a given position in the array. More...
 
void add (Complex c, int i, int j)
 Add a complex number to the data in a given position in the array. More...
 
void add (Complex c, int i)
 Add a complex number to the data in a given position in the array. More...
 
void sub (Complex c, int i, int j)
 Subtract a complex number from the data in a given position in the array. More...
 
void sub (Complex c, int i)
 Subtract a complex number from the data in a given position in the array. More...
 
void mul (Complex c, int i, int j)
 Multiply a complex number to the data in a given position in the array. More...
 
void mul (Complex c, int i)
 Multiply a complex number to the data in a given position in the array. More...
 
void div (Complex c, int i, int j)
 Divide a complex number to the data in a given position in the array. More...
 
void div (Complex c, int i)
 Divide a complex number to the data in a given position in the array. More...
 

Protected Attributes

double[] altArray
 
int _dim
 
int _l
 
int _m
 
int _n
 
int[] _originalSize = {_n, _m, _l}
 
int _ntot
 

Detailed Description

Class for storing an 1- to 3-dimensional array of complex numbers as an 1D array of alternating real and imaginary parts in double precision.

Class for storing an 1- to 3-dimensional array of complex numbers as an 1D array of alternating real and imaginary parts in double precision. This data structure optimizes efficiency of fast fourier transformation (fft) by the "Numerical Recipes" algorithm. Includes basic math operations (addition, subtraction, multiplication, division)

Author
Andreas D�tsch (andre.nosp@m.as.d.nosp@m.oetsc.nosp@m.h@he.nosp@m.lmhol.nosp@m.tz-h.nosp@m.zi.de), Helmholtz Centre for Infection Research (Germany)

Constructor & Destructor Documentation

utils.ComplexArray.ComplexArray ( int  n)

Constructor to generate a 1D array of complex numbers.

Constructor to generate a 1D array of complex numbers

Parameters
nThe number of entries that will be included in this array
utils.ComplexArray.ComplexArray ( int  n,
int  m 
)

Constructor to generate a 2D array of complex numbers.

Constructor to generate a 2D array of complex numbers

Parameters
nThe number of entries in the n direction that will be included in this array
mThe number of entries in the m direction that will be included in this array
utils.ComplexArray.ComplexArray ( int  n,
int  m,
int  L 
)

Constructor to generate a 3D array of complex numbers.

Constructor to generate a 3D array of complex numbers

Parameters
nThe number of entries in the n direction that will be included in this array
mThe number of entries in the m direction that will be included in this array
LThe number of entries in the L direction that will be included in this array

Member Function Documentation

void utils.ComplexArray.add ( double  realNumber,
int  i,
int  j,
int  k 
)

Add a double to the data in a given position in the array.

Add a double to the data in a given position in the array

Parameters
realNumberValue to add
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.add ( double  realNumber,
int  i,
int  j 
)

Add a double to the data in a given position in the array.

Add a double to the data in a given position in the array

Parameters
realNumberValue to add
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.add ( double  realNumber,
int  i 
)

Add a double to the data in a given position in the array.

Add a double to the data in a given position in the array

Parameters
realNumberValue to add
iArray coordinate i
void utils.ComplexArray.add ( Complex  c,
int  i,
int  j,
int  k 
)

Add a complex number to the data in a given position in the array.

Add a complex number to the data in a given position in the array

Parameters
cValue to add
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.add ( Complex  c,
int  i,
int  j 
)

Add a complex number to the data in a given position in the array.

Add a complex number to the data in a given position in the array

Parameters
cValue to add
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.add ( Complex  c,
int  i 
)

Add a complex number to the data in a given position in the array.

Add a complex number to the data in a given position in the array

Parameters
cValue to add
iArray coordinate i
void utils.ComplexArray.div ( double  realNumber,
int  i,
int  j,
int  k 
)

Divide a double to the data in a given position in the array.

Divide a double to the data in a given position in the array

Parameters
realNumberValue to divide by
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.div ( double  realNumber,
int  i,
int  j 
)

Divide a double to the data in a given position in the array.

Divide a double to the data in a given position in the array

Parameters
realNumberValue to divide by
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.div ( double  realNumber,
int  i 
)

Divide a double to the data in a given position in the array.

Divide a double to the data in a given position in the array

Parameters
realNumberValue to divide by
iArray coordinate i
void utils.ComplexArray.div ( Complex  c,
int  i,
int  j,
int  k 
)

Divide a complex number to the data in a given position in the array.

Divide a complex number to the data in a given position in the array

Parameters
cValue to divide by
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.div ( Complex  c,
int  i,
int  j 
)

Divide a complex number to the data in a given position in the array.

Divide a complex number to the data in a given position in the array

Parameters
cValue to divide
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.div ( Complex  c,
int  i 
)

Divide a complex number to the data in a given position in the array.

Divide a complex number to the data in a given position in the array

Parameters
cValue to divide by
iArray coordinate i
Complex utils.ComplexArray.getComplexAt ( int  i,
int  j,
int  k 
)

Get the complex number stored at a given position in the array.

Get the complex number stored at a given position in the array

Parameters
iArray coordinate i
jArray coordinate j
kArray coordinate k
Returns
Complex number at that position
Complex utils.ComplexArray.getComplexAt ( int  i,
int  j 
)

Get the complex number stored at a given position in the array.

Get the complex number stored at a given position in the array

Parameters
iArray coordinate i
jArray coordinate j
Returns
Complex number at that position
Complex utils.ComplexArray.getComplexAt ( int  i)

Get the complex number stored at a given position in the array.

Get the complex number stored at a given position in the array

Parameters
iArray coordinate i
Returns
Complex number at that position
int utils.ComplexArray.getDimension ( )

Return the dimension of this complex array.

Return the dimension of this complex array

Returns
Dimension of this array
double utils.ComplexArray.getImagAt ( int  i,
int  j,
int  k 
)

Get imaginary value part of this object at specified coordinates.

Get imaginary value part of this object at specified coordinates

Parameters
iArray coordinate i
jArray coordinate j
kArray coordinate k
Returns
Value at that coordinate
double utils.ComplexArray.getImagAt ( int  i,
int  j 
)

Get imaginary value part of this object at specified coordinates.

Get imaginary value part of this object at specified coordinates

Parameters
iArray coordinate i
jArray coordinate j
Returns
Value at that coordinate
double utils.ComplexArray.getImagAt ( int  i)

Get imaginary value part of this object at specified coordinates.

Get imaginary value part of this object at specified coordinates

Parameters
iArray coordinate i
Returns
Value at that coordinate
int [] utils.ComplexArray.getOriginalSize ( )

Return the array that shows the size of the original array before storing using this method.

Return the array that shows the size of the original array before storing using this method

Returns
Array showing the original nxmxl size of the array
double utils.ComplexArray.getRealAt ( int  i,
int  j,
int  k 
)

Get value at specified coordinates.

Get value at specified coordinates

Parameters
iArray coordinate i
jArray coordinate j
kArray coordinate k
Returns
Value at that coordinate
double utils.ComplexArray.getRealAt ( int  i,
int  j 
)

Get value at specified coordinates.

Get value at specified coordinates

Parameters
iArray coordinate i
jArray coordinate j
Returns
Value at that coordinate
double utils.ComplexArray.getRealAt ( int  i)

Get value at specified coordinates.

Get value at specified coordinates

Parameters
iArray coordinate i
Returns
Value at that coordinate
int utils.ComplexArray.getTotalLength ( )

Return the total length of this complex array.

Return the total length of this complex array

Returns
Total length of this array
double [] utils.ComplexArray.getWholeArray ( )

Return the complex array.

Return the complex array

Returns
Complex array (of doubles)
void utils.ComplexArray.mul ( double  realNumber,
int  i,
int  j,
int  k 
)

Multiply a double to the data in a given position in the array.

Multiply a double to the data in a given position in the array

Parameters
realNumberValue to multiply
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.mul ( double  realNumber,
int  i,
int  j 
)

Multiply a double to the data in a given position in the array.

Multiply a double to the data in a given position in the array

Parameters
realNumberValue to multiply
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.mul ( double  realNumber,
int  i 
)

Multiply a double to the data in a given position in the array.

Multiply a double to the data in a given position in the array

Parameters
realNumberValue to multiply
iArray coordinate i
void utils.ComplexArray.mul ( Complex  c,
int  i,
int  j,
int  k 
)

Multiply a complex number to the data in a given position in the array.

Multiply a complex number to the data in a given position in the array

Parameters
cValue to add
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.mul ( Complex  c,
int  i,
int  j 
)

Multiply a complex number to the data in a given position in the array.

Multiply a complex number to the data in a given position in the array

Parameters
cValue to multiply
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.mul ( Complex  c,
int  i 
)

Multiply a complex number to the data in a given position in the array.

Multiply a complex number to the data in a given position in the array

Parameters
cValue to multiply
iArray coordinate i
void utils.ComplexArray.setComplexAt ( Complex  c,
int  i,
int  j,
int  k 
)

Set the 'imaginary' part of the array to a Complex number.

Set the 'imaginary' part of the array to a Complex number

Parameters
cComplex number to set this part of the array to
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.setComplexAt ( Complex  c,
int  i,
int  j 
)

Set the 'imaginary' part of the array to a Complex number.

Set the 'imaginary' part of the array to a Complex number

Parameters
cComplex number to set this part of the array to
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.setComplexAt ( Complex  c,
int  i 
)

Set the 'imaginary' part of the array to a Complex number.

Set the 'imaginary' part of the array to a Complex number

Parameters
cComplex number to set this part of the array to
iArray coordinate i
void utils.ComplexArray.setImagAt ( double  imagPart,
int  i,
int  j,
int  k 
)

Set the 'imaginary' part of the array to a value.

Set the 'imaginary' part of the array to a value

Parameters
imagPartValue to set this part of the array to
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.setImagAt ( double  imagPart,
int  i,
int  j 
)

Set the 'imaginary' part of the array to a value.

Set the 'imaginary' part of the array to a value

Parameters
imagPartValue to set this part of the array to
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.setImagAt ( double  imagPart,
int  i 
)

Set the 'imaginary' part of the array to a value.

Set the 'imaginary' part of the array to a value

Parameters
imagPartValue to set this part of the array to
iArray coordinate i
void utils.ComplexArray.setRealAt ( double  realPart,
int  i,
int  j,
int  k 
)

Set value at given coordinates.

Set value at given coordinates

Parameters
realPartThe value to set the array coordinate to
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.setRealAt ( double  realPart,
int  i,
int  j 
)

Set value at given coordinates.

Set value at given coordinates

Parameters
realPartThe value to set the array coordinate to
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.setRealAt ( double  realPart,
int  i 
)

Set value at given coordinates.

Set value at given coordinates

Parameters
realPartThe value to set the array coordinate to
iArray coordinate i
void utils.ComplexArray.setWholeArray ( double[]  inputArray)

Set the array to values of a array of doubles.

Set the array to values of a array of doubles

Parameters
inputArrayArray of values to set this complex array to
void utils.ComplexArray.setWholeArray ( ComplexArray  input)

Set the array to values to those of another AltComplex.

Set the array to values to those of another AltComplex

Parameters
inputComplex array of values whose values should be cloned into this array
void utils.ComplexArray.sub ( double  realNumber,
int  i,
int  j,
int  k 
)

Subtract a double to the data in a given position in the array.

Subtract a double to the data in a given position in the array

Parameters
realNumberValue to subtract
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.sub ( double  realNumber,
int  i,
int  j 
)

Subtract a double to the data in a given position in the array.

Subtract a double to the data in a given position in the array

Parameters
realNumberValue to subtract
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.sub ( double  realNumber,
int  i 
)

Subtract a double to the data in a given position in the array.

Subtract a double to the data in a given position in the array

Parameters
realNumberValue to subtract
iArray coordinate i
void utils.ComplexArray.sub ( Complex  c,
int  i,
int  j,
int  k 
)

Subtract a complex number from the data in a given position in the array.

Subtract a complex number from the data in a given position in the array

Parameters
cValue to add
iArray coordinate i
jArray coordinate j
kArray coordinate k
void utils.ComplexArray.sub ( Complex  c,
int  i,
int  j 
)

Subtract a complex number from the data in a given position in the array.

Subtract a complex number from the data in a given position in the array

Parameters
cValue to subtract
iArray coordinate i
jArray coordinate j
void utils.ComplexArray.sub ( Complex  c,
int  i 
)

Subtract a complex number from the data in a given position in the array.

Subtract a complex number from the data in a given position in the array

Parameters
cValue to subtract
iArray coordinate i

Member Data Documentation

int utils.ComplexArray._dim
protected

Dimension of the source array

int utils.ComplexArray._l
protected

Number of voxels in the l direction

int utils.ComplexArray._m
protected

Number of voxels in the m direction

int utils.ComplexArray._n
protected

Number of voxels in the n direction

int utils.ComplexArray._ntot
protected

Length of the main array

int [] utils.ComplexArray._originalSize = {_n, _m, _l}
protected

Integer array storing the original size of the array (nxmxl)

double [] utils.ComplexArray.altArray
protected

The main array


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