47 #if defined(Epetra_SHOW_DEPRECATED_WARNINGS)
49 #warning "The Epetra package is deprecated"
108 unsigned int RandomInt();
111 double RandomDouble();
117 unsigned int Seed()
const;
126 int SetSeed(
unsigned int Seed_in);
155 static void EPETRA_LIB_DLL_EXPORT Sort(
bool SortAscending,
int NumKeys, T * Keys,
156 int NumDoubleCompanions,
double ** DoubleCompanions,
157 int NumIntCompanions,
int ** IntCompanions,
158 int NumLongLongCompanions,
long long ** LongLongCompanions);
160 static void Sort(
bool SortAscending,
int NumKeys,
int * Keys,
161 int NumDoubleCompanions,
double ** DoubleCompanions,
162 int NumIntCompanions,
int ** IntCompanions,
163 int NumLongLongCompanions,
long long ** LongLongCompanions);
165 static void Sort(
bool SortAscending,
int NumKeys,
long long * Keys,
166 int NumDoubleCompanions,
double ** DoubleCompanions,
167 int NumIntCompanions,
int ** IntCompanions,
168 int NumLongLongCompanions,
long long ** LongLongCompanions);
170 static void Sort(
bool SortAscending,
int NumKeys,
int * Keys,
171 int NumDoubleCompanions,
double ** DoubleCompanions,
172 int NumIntCompanions,
int ** IntCompanions);
174 static void Sort(
bool SortAscending,
int NumKeys,
double * Keys,
175 int NumDoubleCompanions,
double ** DoubleCompanions,
176 int NumIntCompanions,
int ** IntCompanions,
177 int NumLongLongCompanions,
long long ** LongLongCompanions);
195 bool high_rank_proc_owns_shared=
false);
203 bool high_rank_proc_owns_shared=
false);
205 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
212 bool high_rank_proc_owns_shared=
false);
219 static int SortCrsEntries(
int NumRows,
const int *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
224 static int SortCrsEntries(
int NumRows,
const size_t *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
229 static int SortAndMergeCrsEntries(
int NumRows,
int *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
234 static int SortAndMergeCrsEntries(
int NumRows,
size_t *CRS_rowptr,
int *CRS_colind,
double *CRS_vals);
244 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
245 static int GetPidGidPairs(
const Epetra_Import & Importer,std::vector< std::pair<int,int> > & gpids,
bool use_minus_one_for_local);
247 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
248 static int GetPidGidPairs(
const Epetra_Import & Importer,std::vector< std::pair<int,long long> > & gpids,
bool use_minus_one_for_local);
255 static int GetPids(
const Epetra_Import & Importer, std::vector<int> &pids,
bool use_minus_one_for_local);
260 static int GetRemotePIDs(
const Epetra_Import & Importer, std::vector<int> &RemotePIDs);
264 static double Chop(
const double & Value);
308 const long long* list,
340 const long long* aux_list,
350 int& allocatedLength,
351 int insertOffset,
int numPositions,
352 int allocChunkSize=32)
354 if (insertOffset < 0 || insertOffset > usedLength ||
355 usedLength > allocatedLength) {
359 if (((
unsigned int)usedLength+(
unsigned int)numPositions) < (
unsigned int)allocatedLength) {
360 for(
int i=usedLength-1; i>=insertOffset; --i) {
361 array[i+numPositions] = array[i];
363 usedLength += numPositions;
367 allocatedLength += allocChunkSize;
370 while(allocatedLength < usedLength+numPositions) {
371 allocatedLength += allocChunkSize;
374 T* newlist =
new T[allocatedLength];
376 for(
int i=0; i<insertOffset; ++i) {
377 newlist[i] = array[i];
380 for(
int i=insertOffset; i<usedLength; ++i) {
381 newlist[i+numPositions] = array[i];
384 usedLength += numPositions;
408 int& allocatedLength,
409 int allocChunkSize=32)
411 int code = Epetra_Util_insert_empty_positions<T>(list, usedLength,
412 allocatedLength, offset, 1,
481 int & M,
int & N,
int & nz,
int * & ptr,
482 int * & ind,
double * & val,
int & Nrhs,
483 double * & rhs,
int & ldrhs,
484 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.