00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef MATLAB_ENGINE_H
00030 #define MATLAB_ENGINE_H
00031 #include <Epetra_ConfigDefs.h>
00032
00033 #ifdef EPETRA_MPI
00034 #include "Epetra_MpiComm.h"
00035 #else
00036 #include "Epetra_SerialComm.h"
00037 #endif
00038 #include "Epetra_Comm.h"
00039
00040
00041 #include "engine.h"
00042 #include "mex.h"
00043 #undef printf // matlab has its own printf that we don't want to use
00044
00045 class Epetra_MultiVector;
00046 class Epetra_RowMatrix;
00047 class Epetra_CrsGraph;
00048 class Epetra_SerialDenseMatrix;
00049 class Epetra_BlockMap;
00050 class Epetra_IntSerialDenseMatrix;
00051 class Epetra_CrsMatrix;
00052
00053 namespace EpetraExt {
00054
00056
00102 class EpetraExt_MatlabEngine {
00103
00104 public:
00105
00107
00109
00115 EpetraExt_MatlabEngine(const Epetra_Comm& Comm);
00116
00118 ~EpetraExt_MatlabEngine();
00120
00122
00124
00138 int EvalString (char* command, char* outputBuffer = NULL, int outputBufferSize = -1);
00139
00141
00143
00145
00155 int PutMultiVector(const Epetra_MultiVector& A, const char* variableName);
00156
00158
00173 int PutRowMatrix(const Epetra_RowMatrix& A, const char* variableName, bool transA);
00174
00176 int PutCrsGraph(const Epetra_CrsGraph& A, const char* variableName, bool transA);
00177
00179
00194 int PutSerialDenseMatrix(const Epetra_SerialDenseMatrix& A, const char* variableName, int proc=0);
00195
00197
00212 int PutIntSerialDenseMatrix(const Epetra_IntSerialDenseMatrix& A, const char* variableName, int proc=0);
00213
00215
00230 int PutBlockMap(const Epetra_BlockMap& blockMap, const char* variableName, bool transA);
00231
00233
00252 int PutIntoMatlab(const char* variableName, mxArray* matlabA);
00253
00255
00257
00259
00270 int GetMultiVector(const char* variableName, Epetra_MultiVector& A);
00271
00273
00287 int GetSerialDenseMatrix(const char* variableName, Epetra_SerialDenseMatrix& A, int proc=0);
00288
00290
00304 int GetIntSerialDenseMatrix(const char* variableName, Epetra_IntSerialDenseMatrix& A, int proc=0);
00305
00307
00326 int GetCrsMatrix(const char* variableName, Epetra_CrsMatrix& A, bool getTrans);
00327
00329
00331
00333
00353 int GetmxArrayDimensions(mxArray* matlabA, bool& isSparse, int& numRows, int& numCols, int& numNonZeros);
00354
00356
00369 int GetmxArray(const char* variableName, mxArray** matlabA);
00370
00372
00373 private:
00374
00375 Engine* Engine_ ;
00376
00377 const Epetra_Comm& Comm_ ;
00378
00379 };
00380 }
00381
00382 #endif