Révision 1761
| tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 1761) | ||
|---|---|---|
| 148 | 148 |
*/ |
| 149 | 149 |
protected File userdir = null; |
| 150 | 150 |
|
| 151 |
|
|
| 152 |
|
|
| 151 | 153 |
/** |
| 152 |
* Appendto eval log.
|
|
| 154 |
* protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 153 | 155 |
* |
| 156 |
* @throws RWorkspaceException the r workspace exception |
|
| 157 |
*/ |
|
| 158 |
public RWorkspace(File userDir) throws RWorkspaceException {
|
|
| 159 |
this.userdir = userDir; |
|
| 160 |
this.setLog(isLoggingEvalCommandLines()); |
|
| 161 |
} |
|
| 162 |
|
|
| 163 |
|
|
| 164 |
// FIXME: SJ: became useless |
|
| 165 |
// /** |
|
| 166 |
// * protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 167 |
// * |
|
| 168 |
// * @param pathToRExecutable the path to r executable |
|
| 169 |
// * @throws RWorkspaceException the r workspace exception |
|
| 170 |
// */ |
|
| 171 |
// protected RWorkspace(String pathToRExecutable, int port, boolean debug) throws RWorkspaceException {
|
|
| 172 |
// if (initRserve(pathToRExecutable, port, debug, "","")) {
|
|
| 173 |
// connect(); |
|
| 174 |
// init(); |
|
| 175 |
// } |
|
| 176 |
// } |
|
| 177 |
|
|
| 178 |
|
|
| 179 |
// FIXME: SJ: became useless |
|
| 180 |
// /** |
|
| 181 |
// * protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 182 |
// * |
|
| 183 |
// * @param pathToRExecutable the path to r executable |
|
| 184 |
// * @param host the host |
|
| 185 |
// * @param port the port |
|
| 186 |
// * @throws RWorkspaceException the r workspace exception |
|
| 187 |
// */ |
|
| 188 |
// protected RWorkspace(String pathToRExecutable, String host, int port, boolean debug) |
|
| 189 |
// throws RWorkspaceException {
|
|
| 190 |
// if (initRserve(pathToRExecutable, port, debug, "", "")) {
|
|
| 191 |
// connect(host, port); |
|
| 192 |
// init(); |
|
| 193 |
// } |
|
| 194 |
// } |
|
| 195 |
|
|
| 196 |
|
|
| 197 |
|
|
| 198 |
/** |
|
| 199 |
* Append to eval log. |
|
| 200 |
* |
|
| 154 | 201 |
* @param cmd the cmd |
| 155 | 202 |
*/ |
| 156 | 203 |
public static void appendtoEvalLog(String cmd) |
| ... | ... | |
| 288 | 335 |
} |
| 289 | 336 |
} |
| 290 | 337 |
|
| 291 |
/** |
|
| 292 |
* Default initialisation of RWorkspace with default parameters : |
|
| 293 |
* address = 127.0.0.1 |
|
| 294 |
* port = 6311 |
|
| 295 |
* debug = false. |
|
| 296 |
* |
|
| 297 |
* @param pathToRExecutalbe the path to r executable |
|
| 298 |
* @throws RWorkspaceException the r workspace exception |
|
| 299 |
*/ |
|
| 300 |
public static final void initializeRWorkspace(String pathToRExecutalbe) |
|
| 301 |
throws RWorkspaceException {
|
|
| 302 |
initializeRWorkspace(pathToRExecutalbe, "127.0.0.1", 6311); //$NON-NLS-1$ |
|
| 303 |
} |
|
| 338 |
|
|
| 339 |
|
|
| 340 |
// FIXME: SJ: became useless |
|
| 341 |
// /** |
|
| 342 |
// * Default initialisation of RWorkspace with default parameters : |
|
| 343 |
// * address = 127.0.0.1 |
|
| 344 |
// * port = 6311 |
|
| 345 |
// * debug = false. |
|
| 346 |
// * |
|
| 347 |
// * @param pathToRExecutalbe the path to r executable |
|
| 348 |
// * @throws RWorkspaceException the r workspace exception |
|
| 349 |
// */ |
|
| 350 |
// public static final void initializeRWorkspace(String pathToRExecutalbe) throws RWorkspaceException {
|
|
| 351 |
// initializeRWorkspace(pathToRExecutalbe, "127.0.0.1", 6311); //$NON-NLS-1$ |
|
| 352 |
// } |
|
| 304 | 353 |
|
| 305 |
/** |
|
| 306 |
* Initialize r workspace. |
|
| 307 |
* debug = false |
|
| 308 |
* |
|
| 309 |
* @param pathToRExecutalbe the path to r executable |
|
| 310 |
* @param host the host |
|
| 311 |
* @param port the port |
|
| 312 |
* @throws RWorkspaceException the r workspace exception |
|
| 313 |
*/ |
|
| 314 |
public static final void initializeRWorkspace(String pathToRExecutalbe, |
|
| 315 |
String host, int port) throws RWorkspaceException {
|
|
| 316 |
workspace = new RWorkspace(pathToRExecutalbe, host, port, isDebugMode()); |
|
| 317 |
} |
|
| 354 |
// FIXME: SJ: became useless |
|
| 355 |
// /** |
|
| 356 |
// * Initialize r workspace. |
|
| 357 |
// * debug = false |
|
| 358 |
// * |
|
| 359 |
// * @param pathToRExecutalbe the path to r executable |
|
| 360 |
// * @param host the host |
|
| 361 |
// * @param port the port |
|
| 362 |
// * @throws RWorkspaceException the r workspace exception |
|
| 363 |
// */ |
|
| 364 |
// public static final void initializeRWorkspace(String pathToRExecutalbe, |
|
| 365 |
// String host, int port) throws RWorkspaceException {
|
|
| 366 |
// workspace = new RWorkspace(pathToRExecutalbe, host, port, isDebugMode()); |
|
| 367 |
// } |
|
| 318 | 368 |
|
| 319 | 369 |
// -------------------------------------- |
| 320 | 370 |
/** |
| ... | ... | |
| 574 | 624 |
} |
| 575 | 625 |
} |
| 576 | 626 |
|
| 577 |
/** |
|
| 578 |
* protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 579 |
* |
|
| 580 |
* @throws RWorkspaceException the r workspace exception |
|
| 581 |
*/ |
|
| 582 |
public RWorkspace(File userDir) throws RWorkspaceException {
|
|
| 583 |
this.userdir = userDir; |
|
| 584 |
setLog(isLoggingEvalCommandLines()); |
|
| 585 |
} |
|
| 586 | 627 |
|
| 587 |
// -------------------------------------- |
|
| 588 | 628 |
|
| 589 |
// /** |
|
| 590 |
// * protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 591 |
// * |
|
| 592 |
// * @param pathToRExecutable the path to r executable |
|
| 593 |
// * @throws RWorkspaceException the r workspace exception |
|
| 594 |
// */ |
|
| 595 |
// protected RWorkspace(String pathToRExecutable, int port, boolean debug) throws RWorkspaceException {
|
|
| 596 |
// if (initRserve(pathToRExecutable, port, debug, "","")) {
|
|
| 597 |
// connect(); |
|
| 598 |
// init(); |
|
| 599 |
// } |
|
| 600 |
// } |
|
| 601 |
|
|
| 602 | 629 |
/** |
| 603 |
* protected on purpose. See {@link #getRWorkspaceInstance()}.
|
|
| 604 |
* |
|
| 605 |
* @param pathToRExecutable the path to r executable |
|
| 606 |
* @param host the host |
|
| 607 |
* @param port the port |
|
| 608 |
* @throws RWorkspaceException the r workspace exception |
|
| 609 |
*/ |
|
| 610 |
protected RWorkspace(String pathToRExecutable, String host, int port, boolean debug) |
|
| 611 |
throws RWorkspaceException {
|
|
| 612 |
if (initRserve(pathToRExecutable, port, debug, "", "")) {
|
|
| 613 |
connect(host, port); |
|
| 614 |
init(); |
|
| 615 |
} |
|
| 616 |
} |
|
| 617 |
|
|
| 618 |
/** |
|
| 619 | 630 |
* Add a matrix into the workspace and link it to a name. The inner arrays |
| 620 | 631 |
* of the <code>matrix</code> parameters are the <strong>row</strong> of the |
| 621 | 632 |
* resulting R matrix. |
Formats disponibles : Unified diff