43 #include "Epetra_Comm.h"
44 #include "Epetra_Map.h"
45 #include "Epetra_Vector.h"
46 #include "Epetra_IntVector.h"
47 #include "Epetra_SerialDenseVector.h"
48 #include "Epetra_IntSerialDenseVector.h"
49 #include "Epetra_Import.h"
50 #include "Epetra_RowMatrix.h"
51 #include "Epetra_CrsMatrix.h"
53 using namespace Matlab;
74 for (
int i=0; i<numRows; i++) allGids[i] = map.
GID(i);
77 int numChunks = numProc;
83 int numImportGids = 0;
85 importGidList.
Size(stripSize+1);
86 for (
int i=0; i<numChunks; i++) {
87 if (comm.
MyPID()==0) {
88 curStripSize = stripSize;
89 if (i<remainder) curStripSize++;
90 for (
int j=0; j<curStripSize; j++) importGidList[j] = j + curStart;
91 curStart += curStripSize;
99 if (importGids.Import(allGids, gidImporter,
Insert))
return(-1);
111 if (importA.Import(A, importer,
Insert))
return(-1);
121 int* matlabAcolumnIndicesPtr = mxGetJc(matlabA);
139 if (comm.
MyPID()!=0) {
145 double* matlabAvaluesPtr = mxGetPr(matlabA);
146 int* matlabAcolumnIndicesPtr = mxGetJc(matlabA);
147 int* matlabArowIndicesPtr = mxGetIr(matlabA);
150 matlabAvaluesPtr += valueCount;
151 matlabArowIndicesPtr += valueCount;
157 for (
int i=0; i<numRows; i++) {
159 int I = rowMap.
GID(i);
162 values.Values(), indices.Values()))
return(-1);
163 matlabAcolumnIndicesPtr[I - minAllGID] = valueCount;
164 double* serialValuesPtr = values.Values();
165 for (
int j=0; j<numEntries; j++) {
166 int J = colMap.
GID(indices[j]);
167 *matlabAvaluesPtr = *serialValuesPtr++;
168 *matlabArowIndicesPtr = J;
171 matlabArowIndicesPtr++;
195 comm.
MinAll(&ierr, &ierrGlobal, 1);
virtual const Epetra_Map & RowMatrixRowMap() const =0
virtual int MinAll(double *PartialMins, double *GlobalMins, int Count) const =0
virtual int MyPID() const =0
int FillComplete(bool OptimizeDataStorage=true)
virtual int NumMyCols() const =0
int NumMyElements() const
virtual int MaxNumEntries() const =0
int CopyRowMatrix(mxArray *matlabA, const Epetra_RowMatrix &A)
virtual int NumMyRows() const =0
int DoCopyRowMatrix(mxArray *matlabA, int &valueCount, const Epetra_RowMatrix &A)
const Epetra_Comm & Comm() const
virtual int NumProc() const =0
virtual int ExtractMyRowCopy(int MyRow, int Length, int &NumEntries, double *Values, int *Indices) const =0
virtual const Epetra_Map & RowMatrixColMap() const =0
virtual int NumGlobalRows() const =0