Utils Class Reference

Collection of general purpose functions. More...

List of all members.

Static Public Member Functions

static T[] copy< T > (T[] src, T[] dst)
 Copies the contents of an array.
static double dist (Complex[] a, Complex[] b)
 Computes the Euclidean distance between two vectors.
static int Log2 (int n)
 Calculates the minimal number of bits necessary to store numbers $\{0,\ldots,n-1\}$.
static int Exp2 (int n)
 Computes $2^n$.
static bool IsPowerOf2 (int n)
 Checks that the number is a power of 2.
static void PrintArray< T > (T[] t, params string[] name)
 Pretty-prints the contents of an array.


Detailed Description

Collection of general purpose functions.

Definition at line 9 of file Utils.cs.


Member Function Documentation

static T [] copy< T > ( T[]  src,
T[]  dst 
) [static]

Copies the contents of an array.

Parameters:
src the source array.
dst the target array.
Returns:
dst. This method assumes that both src and dst are not null. The arrays do not have to be of the same length. If the src array is shorter than dst, then the remining elements of dst are unchanged. If src is not longer than dst, then the remaining elements of src are not copied.

static double dist ( Complex[]  a,
Complex[]  b 
) [static]

Computes the Euclidean distance between two vectors.

The input vectors do not have to be of equal length. The distance is calculated on the length of the shorter vector.

Definition at line 39 of file Utils.cs.

static int Exp2 ( int  n  )  [static]

Computes $2^n$.

Definition at line 77 of file Utils.cs.

static bool IsPowerOf2 ( int  n  )  [static]

Checks that the number is a power of 2.

Definition at line 85 of file Utils.cs.

static int Log2 ( int  n  )  [static]

Calculates the minimal number of bits necessary to store numbers $\{0,\ldots,n-1\}$.

It returns $ \log_2(n) + 1$ if $n$ is a power of 2 and $\lceil \log_2(n)\rceil$ otherwise. For n <= 0, the method returs 0.

Definition at line 58 of file Utils.cs.

static void PrintArray< T > ( T[]  t,
params string[]  name 
) [static]

Pretty-prints the contents of an array.

Parameters:
t an array whose content is to be printed.
name an optional name for the array.


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

Generated on Thu Jun 4 22:47:06 2009 for FFT by  doxygen 1.5.8