LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::scramble< T > Class Template Reference

This class is used to scramble the elements of a given vector or matrix. More...

#include <ltiScramble.h>

Inheritance diagram for lti::scramble< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::scramble< T >:
Collaboration graph
[legend]

List of all members.

Classes

class  parameters
 the parameters for the class scramble (empty) More...

Public Member Functions

 scramble ()
 scramble (const scramble &other)
virtual ~scramble ()
virtual const char * getTypeName () const
bool apply (matrix< T > &srcdest) const
bool apply (vector< T > &srcdest) const
bool apply (const matrix< T > &src, matrix< T > &dest) const
bool apply (const vector< T > &src, vector< T > &dest) const
scramblecopy (const scramble &other)
virtual functorclone () const
const parametersgetParameters () const

Detailed Description

template<class T>
class lti::scramble< T >

This class is used to scramble the elements of a given vector or matrix.

To this end two random indices of the vector or matrix are chosen and their contents swapped. This operation is performed N times, with N the number of elements.


Constructor & Destructor Documentation

template<class T >
lti::scramble< T >::scramble (  ) 

default constructor

template<class T >
lti::scramble< T >::scramble ( const scramble< T > &  other  ) 

copy constructor

Parameters:
other the object to be copied
template<class T >
virtual lti::scramble< T >::~scramble (  )  [virtual]

destructor


Member Function Documentation

template<class T >
bool lti::scramble< T >::apply ( const vector< T > &  src,
vector< T > &  dest 
) const

Makes a scrambled copy from src to dest.

Parameters:
src vector<T> with the source data.
dest vector<T> where the result will be left.
Returns:
a reference to the dest.
template<class T >
bool lti::scramble< T >::apply ( const matrix< T > &  src,
matrix< T > &  dest 
) const

Makes a scrambled copy from src to dest.

Parameters:
src matrix<T> with the source data.
dest matrix<T> where the result will be left.
Returns:
true if operation was successfull
template<class T >
bool lti::scramble< T >::apply ( vector< T > &  srcdest  )  const

Scramble the elements of srcdest.

Parameters:
srcdest vector<T> with the source data. The result will be left here too.
Returns:
true if operation was successfull
template<class T >
bool lti::scramble< T >::apply ( matrix< T > &  srcdest  )  const

Scramble the elements of srcdest.

Parameters:
srcdest matrix<T> with the source data. The result will be left here too.
Returns:
true if operation was successfull
template<class T >
virtual functor* lti::scramble< T >::clone (  )  const [virtual]

returns a pointer to a clone of this functor.

Implements lti::functor.

template<class T >
scramble& lti::scramble< T >::copy ( const scramble< T > &  other  ) 

copy data of "other" functor.

Parameters:
other the functor to be copied
Returns:
a reference to this functor object

Reimplemented from lti::functor.

template<class T >
const parameters& lti::scramble< T >::getParameters (  )  const

returns used parameters

Reimplemented from lti::functor.

template<class T >
virtual const char* lti::scramble< T >::getTypeName (  )  const [virtual]

returns the name of this type ("scramble")

Reimplemented from lti::functor.


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

Generated on Sat Apr 10 15:28:40 2010 for LTI-Lib by Doxygen 1.6.1