100 unsigned int RandomInt();
103 double RandomDouble();
109 unsigned int Seed()
const;
118 int SetSeed(
unsigned int Seed_in);
147 static void Sort(
bool SortAscending,
int NumKeys, T * Keys,
148 int NumDoubleCompanions,
double ** DoubleCompanions,
149 int NumIntCompanions,
int ** IntCompanions,
150 int NumLongLongCompanions,
long long ** LongLongCompanions);
152 static void Sort(
bool SortAscending,
int NumKeys,
int * Keys,
153 int NumDoubleCompanions,
double ** DoubleCompanions,
154 int NumIntCompanions,
int ** IntCompanions,
155 int NumLongLongCompanions,
long long ** LongLongCompanions);
157 static void Sort(
bool SortAscending,
int NumKeys,
long long * Keys,
158 int NumDoubleCompanions,
double ** DoubleCompanions,
159 int NumIntCompanions,
int ** IntCompanions,
160 int NumLongLongCompanions,
long long ** LongLongCompanions);
162 static void Sort(
bool SortAscending,
int NumKeys,
int * Keys,
163 int NumDoubleCompanions,
double ** DoubleCompanions,
164 int NumIntCompanions,
int ** IntCompanions);
166 static void Sort(
bool SortAscending,
int NumKeys,
double * Keys,
167 int NumDoubleCompanions,
double ** DoubleCompanions,
168 int NumIntCompanions,
int ** IntCompanions,
169 int NumLongLongCompanions,
long long ** LongLongCompanions);
187 bool high_rank_proc_owns_shared=
false);
195 bool high_rank_proc_owns_shared=
false);
197 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
204 bool high_rank_proc_owns_shared=
false);
211 static int SortCrsEntries(
int NumRows,
const int *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
216 static int SortCrsEntries(
int NumRows,
const size_t *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
221 static int SortAndMergeCrsEntries(
int NumRows,
int *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
226 static int SortAndMergeCrsEntries(
int NumRows,
size_t *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
236 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
237 static int GetPidGidPairs(
const Epetra_Import & Importer,std::vector< std::pair<int,int> > & gpids,
bool use_minus_one_for_local);
239 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
240 static int GetPidGidPairs(
const Epetra_Import & Importer,std::vector< std::pair<int,long long> > & gpids,
bool use_minus_one_for_local);
247 static int GetPids(
const Epetra_Import & Importer, std::vector<int> &pids,
bool use_minus_one_for_local);
252 static int GetRemotePIDs(
const Epetra_Import & Importer, std::vector<int> &RemotePIDs);
256 static double Chop(
const double & Value);
300 const long long* list,
332 const long long* aux_list,
342 int& allocatedLength,
343 int insertOffset,
int numPositions,
344 int allocChunkSize=32)
346 if (insertOffset < 0 || insertOffset > usedLength ||
347 usedLength > allocatedLength) {
351 if (((
unsigned int)usedLength+(
unsigned int)numPositions) < (
unsigned int)allocatedLength) {
352 for(
int i=usedLength-1; i>=insertOffset; --i) {
353 array[i+numPositions] = array[i];
355 usedLength += numPositions;
359 allocatedLength += allocChunkSize;
362 while(allocatedLength < usedLength+numPositions) {
363 allocatedLength += allocChunkSize;
366 T* newlist =
new T[allocatedLength];
368 for(
int i=0; i<insertOffset; ++i) {
369 newlist[i] = array[i];
372 for(
int i=insertOffset; i<usedLength; ++i) {
373 newlist[i+numPositions] = array[i];
376 usedLength += numPositions;
400 int& allocatedLength,
401 int allocChunkSize=32)
403 int code = Epetra_Util_insert_empty_positions<T>(list, usedLength,
404 allocatedLength, offset, 1,
472 int & M,
int & N,
int & nz,
int * & ptr,
473 int * & ind,
double * & val,
int & Nrhs,
474 double * & rhs,
int & ldrhs,
475 double * & lhs,
int & ldlhs);
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
Epetra_Map: A class for partitioning vectors and matrices.
static const double chopVal_
T * Epetra_Util_data_ptr(std::vector< T > &vec)
Function that returns either a pointer to the first entry in the vector or, if the vector is empty...
Epetra_Util()
Epetra_Util Constructor.
virtual ~Epetra_Util()
Epetra_Util Destructor.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements...
Epetra_Util: The Epetra Util Wrapper Class.
Epetra_BlockMap: A class for partitioning block element vectors and matrices.
int Epetra_Util_binary_search_aux(T item, const int *list, const T *aux_list, int len, int &insertPoint)
Utility function to perform a binary-search on a list of data.
int Epetra_Util_binary_search(T item, const T *list, int len, int &insertPoint)
Utility function to perform a binary-search on a list of data.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
int Epetra_Util_insert_empty_positions(T *&array, int &usedLength, int &allocatedLength, int insertOffset, int numPositions, int allocChunkSize=32)
int Epetra_Util_insert(T item, int offset, T *&list, int &usedLength, int &allocatedLength, int allocChunkSize=32)
Function to insert an item in a list, at a specified offset.
int Epetra_Util_ExtractHbData(Epetra_CrsMatrix *A, Epetra_MultiVector *LHS, Epetra_MultiVector *RHS, int &M, int &N, int &nz, int *&ptr, int *&ind, double *&val, int &Nrhs, double *&rhs, int &ldrhs, double *&lhs, int &ldlhs)
Harwell-Boeing data extraction routine.