MatlabInterface.h
Go to the documentation of this file.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
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00046
#ifndef MATLAB_INTERFACE_INC
00047
#define MATLAB_INTERFACE_INC
00048
00049
00050
00051
#include <plearn/sys/Popen.h>
00052
#include <plearn/math/RowMapSparseMatrix.h>
00053
00054
namespace PLearn {
00055
using namespace std;
00056
00135 class MatlabInterface
00136 {
00137
00138
public:
00139
00142 static string path()
00143 {
00144
char* plearndir = getenv(
"PLEARNDIR");
00145
if(!plearndir)
00146
PLERROR(
"PLEARNDIR environment variable not defined");
00147
return string(plearndir)+
"/Contrib/matlab/";
00148 }
00149
00179
MatlabInterface(
string matlab_file_header,
string matlab_file =
"",
string id =
"",
00180
bool launch_in_background =
false,
bool erase_tmp_files =
true);
00181
00182
MatlabInterface(
vector<string> matlab_file_header,
string
00183 matlab_file =
"",
string id =
"",
00184
bool launch_in_background =
false,
bool erase_tmp_files =
true);
00185
00202
Popen*
launch();
00203
00210
bool launchAndWaitFor(
string matlab_end_answer);
00211
00213 Popen*
matlab;
00214
00216 string matlab_file;
00217
00220 string matlab_file_header;
00221
00222
00223
static void eigs_r11(
RowMapSparseMatrix<real>& A,
00224
Mat& evectors,
00225
int d,
00226
string which_eigenvalues,
00227
bool erase_tmp_files =
true);
00228
00229
static void eigs_r11(
RowMapSparseMatrix<real>& A,
00230
Vec& evalues,
00231
int d,
00232
string which_eigenvalues,
00233
bool erase_tmp_files =
true);
00234
00235
static void eigs_r11(
RowMapSparseMatrix<real>& A,
00236
Mat& evectors,
00237
Vec& evalues,
00238
int d,
00239
string which_eigenvalues,
00240
bool erase_tmp_files =
true);
00241
00242
protected:
00243
00245 string id;
00246
00248 bool launch_in_background;
00249
00250 bool erase_tmp_files;
00251
00252 };
00253
00273
void matlabR11eigs(
RowMapSparseMatrix<double>& A,
Mat eigen_vectors,
00274
Vec eigen_values,
string which_eigenvalues=
"LM");
00275
00276
00277 }
00278
00279
#endif
Generated on Tue Aug 17 15:58:09 2004 for PLearn by
1.3.7