|
Epetra Package Browser (Single Doxygen Collection)
Development
|
Go to the documentation of this file.
53 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
62 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES // FIXME
190 for (i=0; i<NumMyRows; i++) {
193 for (j=0; j<NumIndices; j++) {
194 int ColumnIndex = Indices[j];
195 ColProfiles[ColumnIndex]++;
198 RowIDs[ColumnIndex] = i;
203 ColHasRowWithSingleton[j]++;
237 if (ColHasRowWithSingleton.
MaxValue()>1) {
247 for (j=0; j<NumMyCols; j++) {
250 if (ColProfiles[j]==1) {
252 if (rowMapColors[i]!=1) {
253 RowHasColWithSingleton[i]++;
261 for (jj=0; jj<NumIndices; jj++) NewColProfiles[Indices[jj]]--;
266 else if (ColHasRowWithSingleton[j]==1 && rowMapColors[i]!=1) {
270 if (RowHasColWithSingleton.MaxValue()>1) {
277 ColHasRowWithSingleton));
279 for (i=0; i<NumMyRows; i++)
if (rowMapColors[i]==2) rowMapColors[i] = 1;
362 int ColSingletonCounter = 0;
363 for (i=0; i<NumMyRows; i++) {
380 double pivot = Values[0];
382 int indX = Indices[0];
383 for (j=0; j<NumVectors; j++)
390 for (j=0; j<NumEntries; j++) {
391 if (Indices[j]==targetCol) {
392 double pivot = Values[j];
396 ColSingletonCounter++;
480 int ColSingletonCounter = 0;
481 for (i=0; i<NumMyRows; i++) {
497 double pivot = Values[0];
499 int indX = Indices[0];
500 for (j=0; j<NumVectors; j++)
507 double pivot = Values[j];
510 ColSingletonCounter++;
565 Epetra_Map ContiguousTargetMap(-1, TargetNumMyElements, IndexBase,Comm);
568 Epetra_Map ContiguousSourceMap(-1, SourceNumMyElements, IndexBase, Comm);
573 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
578 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
584 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
587 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesInt but no int API";
590 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
593 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesLongLong but no long long API";
596 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: Unknown global index type";
599 Epetra_Export Exporter(ContiguousSourceMap, ContiguousTargetMap);
603 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
605 TargetIndices->
Export(*SourceIndices, Exporter,
Insert);
607 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesInt but no int API";
610 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
612 TargetIndices_LL->
Export(*SourceIndices_LL, Exporter,
Insert);
614 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesLongLong but no long long API";
618 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: Unknown global index type";
624 #ifndef EPETRA_NO_32BIT_GLOBAL_INDICES
625 RedistributeMap =
new Epetra_Map(-1, TargetNumMyElements, TargetIndices->
Values(), IndexBase, Comm);
627 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesInt but no int API";
630 #ifndef EPETRA_NO_64BIT_GLOBAL_INDICES
631 RedistributeMap =
new Epetra_Map((
long long) -1, TargetNumMyElements, TargetIndices_LL->
Values(), IndexBase, Comm);
633 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: GlobalIndicesLongLong but no long long API";
636 throw "Epetra_CrsSingletonFilter::ConstructRedistributeExporter: Unknown global index type";
639 RedistributeExporter =
new Epetra_Export(*SourceMap, *RedistributeMap);
671 for (jj=0; jj<NumVectors; jj++)
672 (*
tempExportX_)[jj][j]= ((*FullRHS)[jj][i] - (*tempB_)[jj][i])/pivot;
717 double * & Values,
int * & Indices) {
732 double * & Values,
int * & GlobalIndices) {
764 int NumMyColSingletonstmp = 0;
765 for (j=0; j<NumMyCols; j++) {
767 if ( ColProfiles[j]==1 && rowMapColors[i]!=1) {
770 NumMyColSingletonstmp++;
774 else if (NewColProfiles[j]==0 && ColHasRowWithSingleton[j]!=1 && rowMapColors[i]==0) {
786 #endif // EPETRA_NO_32BIT_GLOBAL_INDICES
static void Sort(bool SortAscending, int NumKeys, T *Keys, int NumDoubleCompanions, double **DoubleCompanions, int NumIntCompanions, int **IntCompanions, int NumLongLongCompanions, long long **LongLongCompanions)
Epetra_Util Sort Routine (Shell sort)
const Epetra_Comm & Comm() const
Access function for Epetra_Comm communicator.
long long NumGlobalRows64() const
int NumMyElements() const
Number of elements on the calling processor.
bool GlobalIndicesInt() const
Returns true if map create with int NumGlobalElements.
virtual long long NumGlobalRows64() const =0
Epetra_RowMatrix * GetMatrix() const
Get a pointer to the matrix A.
Epetra_Map * GenerateMap(int Color) const
Generates an Epetra_Map of the GIDs associated with the specified color.
int PutScalar(double ScalarConstant)
Initialize all values in a multi-vector with constant value.
virtual int ReplaceGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Replace specified existing values with this list of entries for a given global row of the matrix.
#define EPETRA_CHK_ERR(a)
const Epetra_BlockMap & Map() const
Returns the address of the Epetra_BlockMap for this multi-vector.
int MaxValue()
Find maximum value.
virtual int NumMyCols() const =0
Returns the number of matrix columns owned by the calling processor.
Epetra_IntVector: A class for constructing and using dense integer vectors on a parallel computer.
Epetra_Comm: The Epetra Communication Abstract Base Class.
bool GlobalIndicesLongLong() const
Returns true if map create with long long NumGlobalElements.
virtual int InsertGlobalValues(int GlobalRow, int NumEntries, const double *Values, const int *Indices)
Insert a list of elements in a given global row of the matrix.
virtual const Epetra_Map & RowMatrixRowMap() const =0
Returns the Epetra_Map object associated with the rows of this matrix.
Epetra_CrsMatrix: A class for constructing and using real-valued double-precision sparse compressed r...
virtual int NumMyRows() const =0
Returns the number of matrix rows owned by the calling processor.
int Export(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Exports an Epetra_DistObject using the Epetra_Import object.
int Size(int Length_in)
Set length of a Epetra_SerialDenseVector object; init values to zero.
long long * Values() const
Returns a pointer to an array containing the values of this vector.
Epetra_RowMatrix: A pure virtual class for using real-valued double-precision row matrices.
virtual long long NumGlobalNonzeros64() const =0
int ExtractMyRowView(int MyRow, int &NumEntries, double *&Values, int *&Indices) const
Returns a view of the specified local row values via pointers to internal data.
int PutValue(int Value)
Set all elements of the vector to Value.
Epetra_Util: The Epetra Util Wrapper Class.
Epetra_LinearProblem: The Epetra Linear Problem Class.
int MyGlobalElements(int *MyGlobalElementList) const
Puts list of global elements on this processor into the user-provided array.
bool SameAs(const Epetra_BlockMap &Map) const
Returns true if this and Map are identical maps.
virtual int SumAll(double *PartialSums, double *GlobalSums, int Count) const =0
Epetra_Comm Global Sum function.
virtual const Epetra_Import * RowMatrixImporter() const =0
Returns the Epetra_Import object that contains the import operations for distributed operations.
Epetra_LongLongVector: A class for constructing and using dense integer vectors on a parallel compute...
int * Values() const
Returns a pointer to an array containing the values of this vector.
virtual int MaxNumEntries() const =0
Returns the maximum of NumMyRowEntries() over all rows.
Epetra_MultiVector: A class for constructing and using dense multi-vectors, vectors and matrices in p...
long long NumGlobalElements64() const
Epetra_MultiVector * GetLHS() const
Get a pointer to the left-hand-side X.
Epetra_MapColoring: A class for coloring Epetra_Map and Epetra_BlockMap objects.
Epetra_MultiVector * GetRHS() const
Get a pointer to the right-hand-side B.
int IndexBase() const
Index base for this map.
int Import(const Epetra_SrcDistObject &A, const Epetra_Import &Importer, Epetra_CombineMode CombineMode, const Epetra_OffsetIndex *Indexor=0)
Imports an Epetra_DistObject using the Epetra_Import object.
long long * MyGlobalElements64() const
long long GID64(int LID) const
Epetra_Export: This class builds an export object for efficient exporting of off-processor elements.
Epetra_Map: A class for partitioning vectors and matrices.
double * Values() const
Returns pointer to the values in vector.
Epetra_Import: This class builds an import object for efficient importing of off-processor elements.
int NumVectors() const
Returns the number of vectors in the multi-vector.
long long NumGlobalNonzeros64() const
int Update(double ScalarA, const Epetra_MultiVector &A, double ScalarThis)
Update multi-vector values with scaled values of A, this = ScalarThis*this + ScalarA*A.