Epetra_Util Class Reference

Epetra_Util: The Epetra Util Wrapper Class. More...

#include <Epetra_Util.h>

List of all members.

Public Member Functions

 Epetra_Util ()
 Epetra_Util Constructor.
 Epetra_Util (const Epetra_Util &Util)
 Epetra_Util Copy Constructor.
virtual ~Epetra_Util ()
 Epetra_Util Destructor.
void Sort (bool SortAscending, int NumKeys, int *Keys, int NumDoubleCompanions, double **DoubleCompanions, int NumIntCompanions, int **IntCompanions) const
 Epetra_Util Sort Routine (Shell sort).
Random number utilities
unsigned int RandomInt ()
 Returns a random integer on the interval (0, 2^31-1).
double RandomDouble ()
 Returns a random double on the interval (-1.0,1.0).
unsigned int Seed () const
 Get seed from Random function.
int SetSeed (unsigned int Seed)
 Set seed for Random function.

Static Public Member Functions

double Chop (const double &Value)
 Epetra_Util Chop method. Return zero if input Value is less than ChopValue.

Static Public Attributes

const double chopVal_


Detailed Description

Epetra_Util: The Epetra Util Wrapper Class.

The Epetra_Util class is a collection of useful functions that cut across a broad set of other classes. Specifically, sorting is provided by this class. A random number generator is also provided.

Epetra_Util is a serial interface only. This is appropriate since the standard utilities are only specified for serial execution (or shared memory parallel).

The random number generator is a multiplicative linear congruential generator, with multiplier 16807 and modulus 2^31 - 1. It is based on the algorithm described in "Random Number Generators: Good Ones Are Hard To Find", S. K. Park and K. W. Miller, Communications of the ACM, vol. 31, no. 10, pp. 1192-1201.


Constructor & Destructor Documentation

Epetra_Util::Epetra_Util  )  [inline]
 

Epetra_Util Constructor.

Builds an instance of a serial Util object.

Epetra_Util::Epetra_Util const Epetra_Util Util  )  [inline]
 

Epetra_Util Copy Constructor.

Makes an exact copy of an existing Epetra_Util instance.


Member Function Documentation

unsigned int Epetra_Util::Seed  )  const
 

Get seed from Random function.

Returns:
Current random number seed.

int Epetra_Util::SetSeed unsigned int  Seed  ) 
 

Set seed for Random function.

Parameters:
In Seed - An integer on the interval [0, INT_MAX).
Returns:
Integer error code, set to 0 if successful.

void Epetra_Util::Sort bool  SortAscending,
int  NumKeys,
int *  Keys,
int  NumDoubleCompanions,
double **  DoubleCompanions,
int  NumIntCompanions,
int **  IntCompanions
const
 

Epetra_Util Sort Routine (Shell sort).

This function sorts a list of integer values in ascending or descending order. Additionally it sorts any number of companion lists of doubles or ints. A shell sort is used, which is fast if indices are already sorted.

Parameters:
In SortAscending - Sort keys in ascending order if true, otherwise sort in descending order..
In NumKeys - Number of integer values to be sorted.
In/Out Keys - List of integers to be sorted.
In NumDoubleCompanions - Number of lists of double precision numbers to be sorted with the key. If set to zero, DoubleCompanions is ignored and can be set to zero.
In DoubleCompanions - DoubleCompanions[i] is a pointer to the ith list of doubles to be sorted with key.
In NumIntCompanions - Number of lists of integers to be sorted with the key. If set to zero, IntCompanions is ignored and can be set to zero.
In IntCompanions - IntCompanions[i] is a pointer to the ith list of integers to be sorted with key.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:42:07 2008 for Epetra by doxygen 1.3.9.1