Révision 277
tmp/org.txm.statsengine.r.core/.classpath (revision 277) | ||
---|---|---|
3 | 3 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> |
4 | 4 |
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
5 | 5 |
<classpathentry kind="src" path="src"/> |
6 |
<classpathentry exported="true" kind="lib" path="lib/colt-1.2.0.jar"/> |
|
7 |
<classpathentry exported="true" kind="lib" path="lib/REngine.jar"/> |
|
8 |
<classpathentry exported="true" kind="lib" path="lib/RserveEngine.jar"/> |
|
9 | 6 |
<classpathentry kind="output" path="bin"/> |
10 | 7 |
</classpath> |
tmp/org.txm.statsengine.r.core/META-INF/MANIFEST.MF (revision 277) | ||
---|---|---|
3 | 3 |
Bundle-Name: R Statistics Engine Core |
4 | 4 |
Bundle-SymbolicName: org.txm.statsengine.r.core;singleton:=true |
5 | 5 |
Bundle-Version: 1.0.0.qualifier |
6 |
Require-Bundle: org.txm.core;bundle-version="0.7.0", |
|
7 |
org.eclipse.core.runtime, |
|
8 |
org.txm.utils;bundle-version="1.0.0" |
|
6 |
Require-Bundle: org.txm.libs.colt;bundle-version="1.0.0";visibility:=reexport, |
|
7 |
org.txm.libs.rserve;bundle-version="0.0.0";visibility:=reexport, |
|
8 |
org.txm.statsengine.core;bundle-version="1.0.0";visibility:=reexport, |
|
9 |
org.txm.core;bundle-version="0.7.0", |
|
10 |
org.eclipse.core.runtime |
|
9 | 11 |
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 |
10 | 12 |
Bundle-ActivationPolicy: lazy |
11 |
Export-Package: cern.clhep, |
|
12 |
cern.colt, |
|
13 |
cern.colt.bitvector, |
|
14 |
cern.colt.buffer, |
|
15 |
cern.colt.function, |
|
16 |
cern.colt.list, |
|
17 |
cern.colt.list.adapter, |
|
18 |
cern.colt.map, |
|
19 |
cern.colt.matrix, |
|
20 |
cern.colt.matrix.bench, |
|
21 |
cern.colt.matrix.doublealgo, |
|
22 |
cern.colt.matrix.impl, |
|
23 |
cern.colt.matrix.linalg, |
|
24 |
cern.colt.matrix.objectalgo, |
|
25 |
cern.jet.math, |
|
26 |
cern.jet.random, |
|
27 |
cern.jet.random.engine, |
|
28 |
cern.jet.random.sampling, |
|
29 |
cern.jet.stat, |
|
30 |
cern.jet.stat.quantile, |
|
31 |
corejava, |
|
32 |
hep.aida, |
|
33 |
hep.aida.bin, |
|
34 |
hep.aida.ref, |
|
35 |
org.rosuda.REngine, |
|
36 |
org.rosuda.REngine.Rserve, |
|
37 |
org.rosuda.REngine.Rserve.protocol, |
|
38 |
org.txm.statsengine.core, |
|
39 |
org.txm.statsengine.core.data, |
|
40 |
org.txm.statsengine.core.utils, |
|
41 |
org.txm.statsengine.r.core, |
|
13 |
Export-Package: org.txm.statsengine.r.core, |
|
42 | 14 |
org.txm.statsengine.r.core.data, |
15 |
org.txm.statsengine.r.core.exceptions, |
|
43 | 16 |
org.txm.statsengine.r.core.messages, |
44 | 17 |
org.txm.statsengine.r.core.preferences, |
45 | 18 |
org.txm.statsengine.r.core.rcolt |
46 |
Bundle-ClassPath: REngine.jar, |
|
47 |
RserveEngine.jar, |
|
48 |
., |
|
49 |
colt-1.2.0.jar |
|
19 |
Bundle-Vendor: Textometrie.org |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspaceException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core; |
|
29 |
|
|
30 |
import org.txm.statsengine.core.StatException; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* Super-class of all exception related to the R engine. |
|
35 |
* |
|
36 |
* @author sloiseau |
|
37 |
*/ |
|
38 |
public class RWorkspaceException extends StatException { |
|
39 |
|
|
40 |
/** The Constant serialVersionUID. */ |
|
41 |
private static final long serialVersionUID = 1630828823146927953L; |
|
42 |
|
|
43 |
/** |
|
44 |
* Instantiates a new r workspace exception. |
|
45 |
*/ |
|
46 |
public RWorkspaceException() { |
|
47 |
super(); |
|
48 |
// TODO Auto-generated constructor stub |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r workspace exception. |
|
53 |
* |
|
54 |
* @param arg0 the arg0 |
|
55 |
* @param arg1 the arg1 |
|
56 |
*/ |
|
57 |
public RWorkspaceException(String arg0, Throwable arg1) { |
|
58 |
super(arg0, arg1); |
|
59 |
// TODO Auto-generated constructor stub |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Instantiates a new r workspace exception. |
|
64 |
* |
|
65 |
* @param arg0 the arg0 |
|
66 |
*/ |
|
67 |
public RWorkspaceException(String arg0) { |
|
68 |
super(arg0); |
|
69 |
// TODO Auto-generated constructor stub |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* Instantiates a new r workspace exception. |
|
74 |
* |
|
75 |
* @param arg0 the arg0 |
|
76 |
*/ |
|
77 |
public RWorkspaceException(Throwable arg0) { |
|
78 |
super(arg0); |
|
79 |
// TODO Auto-generated constructor stub |
|
80 |
} |
|
81 |
|
|
82 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core; |
|
29 |
|
|
30 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* An exception indicating an error during the evaluation of an expression by |
|
35 |
* the R engine. |
|
36 |
* |
|
37 |
* @author sloiseau |
|
38 |
*/ |
|
39 |
public class RException extends RWorkspaceException { |
|
40 |
|
|
41 |
/** The Constant serialVersionUID. */ |
|
42 |
private static final long serialVersionUID = -3459835604570896478L; |
|
43 |
|
|
44 |
/** |
|
45 |
* Instantiates a new r exception. |
|
46 |
*/ |
|
47 |
public RException() { |
|
48 |
super(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r exception. |
|
53 |
* |
|
54 |
* @param msg the msg |
|
55 |
*/ |
|
56 |
public RException(String msg) { |
|
57 |
super(msg); |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Instantiates a new r exception. |
|
62 |
* |
|
63 |
* @param expr the expr |
|
64 |
* @param msg the msg |
|
65 |
*/ |
|
66 |
public RException(String expr, String msg) { |
|
67 |
super(RCoreMessages.RException_0 + msg + RCoreMessages.RException_1 + RCoreMessages.RException_2 + expr); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Instantiates a new r exception. |
|
72 |
* |
|
73 |
* @param arg0 the arg0 |
|
74 |
* @param arg1 the arg1 |
|
75 |
*/ |
|
76 |
public RException(String arg0, Throwable arg1) { |
|
77 |
super(arg0, arg1); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Instantiates a new r exception. |
|
82 |
* |
|
83 |
* @param arg0 the arg0 |
|
84 |
*/ |
|
85 |
public RException(Throwable arg0) { |
|
86 |
super(arg0); |
|
87 |
} |
|
88 |
|
|
89 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RServeException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core; |
|
29 |
|
|
30 |
// TODO: Auto-generated Javadoc |
|
31 |
/** |
|
32 |
* The Class RServeException. |
|
33 |
*/ |
|
34 |
public class RServeException extends RException { |
|
35 |
|
|
36 |
/** The Constant serialVersionUID. */ |
|
37 |
private static final long serialVersionUID = 1L; |
|
38 |
|
|
39 |
/** |
|
40 |
* Instantiates a new r serve exception. |
|
41 |
*/ |
|
42 |
public RServeException() { |
|
43 |
super(); |
|
44 |
// TODO Auto-generated constructor stub |
|
45 |
} |
|
46 |
|
|
47 |
/** |
|
48 |
* Instantiates a new r serve exception. |
|
49 |
* |
|
50 |
* @param arg0 the arg0 |
|
51 |
* @param arg1 the arg1 |
|
52 |
*/ |
|
53 |
public RServeException(String arg0, Throwable arg1) { |
|
54 |
super(arg0, arg1); |
|
55 |
// TODO Auto-generated constructor stub |
|
56 |
} |
|
57 |
|
|
58 |
/** |
|
59 |
* Instantiates a new r serve exception. |
|
60 |
* |
|
61 |
* @param arg0 the arg0 |
|
62 |
*/ |
|
63 |
public RServeException(String arg0) { |
|
64 |
super(arg0); |
|
65 |
// TODO Auto-generated constructor stub |
|
66 |
} |
|
67 |
|
|
68 |
/** |
|
69 |
* Instantiates a new r serve exception. |
|
70 |
* |
|
71 |
* @param arg0 the arg0 |
|
72 |
*/ |
|
73 |
public RServeException(Throwable arg0) { |
|
74 |
super(arg0); |
|
75 |
// TODO Auto-generated constructor stub |
|
76 |
} |
|
77 |
|
|
78 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RWorkspace.java (revision 277) | ||
---|---|---|
47 | 47 |
import org.rosuda.REngine.REngineException; |
48 | 48 |
import org.rosuda.REngine.Rserve.RConnection; |
49 | 49 |
import org.rosuda.REngine.Rserve.RserveException; |
50 |
import org.txm.core.messages.TXMCoreMessages; |
|
51 | 50 |
import org.txm.statsengine.core.StatException; |
52 | 51 |
import org.txm.statsengine.core.data.QuantitativeDataStructure; |
52 |
import org.txm.statsengine.core.messages.StatsEngineCoreMessages; |
|
53 | 53 |
import org.txm.statsengine.core.utils.VectorizeArray; |
54 |
import org.txm.statsengine.r.core.data.RObjectAlreadyExist; |
|
54 |
import org.txm.statsengine.r.core.exceptions.RException; |
|
55 |
import org.txm.statsengine.r.core.exceptions.RObjectAlreadyExist; |
|
56 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException; |
|
55 | 57 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
56 | 58 |
import org.txm.statsengine.r.core.rcolt.RColt; |
57 | 59 |
import org.txm.utils.OSDetector; |
58 | 60 |
import org.txm.utils.StreamHog; |
59 |
import org.txm.utils.SystemProxyDetector; |
|
60 | 61 |
import org.txm.utils.logger.Log; |
62 |
import org.txm.utils.network.SystemProxyDetector; |
|
61 | 63 |
|
62 | 64 |
import cern.colt.list.DoubleArrayList; |
63 | 65 |
import cern.colt.list.IntArrayList; |
... | ... | |
342 | 344 |
|
343 | 345 |
if (isRServerOk) { |
344 | 346 |
Log.finest("RSERVE_ACTIVATED"); //$NON-NLS-1$ |
345 |
System.out.println(TXMCoreMessages.CONNECTED_TO_STATS_MODULE);
|
|
347 |
System.out.println(RCoreMessages.CONNECTED_TO_STATS_MODULE);
|
|
346 | 348 |
RserveProcess = StartRserve.Rserveprocess; |
347 | 349 |
} |
348 | 350 |
return isRServerOk; |
... | ... | |
887 | 889 |
arguments_as_string[i] = "NULL"; //$NON-NLS-1$ |
888 | 890 |
} else { |
889 | 891 |
if (!containsVariable(arguments[i].getSymbol())) { |
890 |
throw new RWorkspaceException(TXMCoreMessages.REQUESTED_OBJECT |
|
891 |
+ arguments[i].getSymbol() |
|
892 |
+ TXMCoreMessages.NOT_FOUND_IN_R); |
|
892 |
throw new RWorkspaceException(NLS.bind(RCoreMessages.REQUESTED_OBJECT_NOT_FOUND_IN_R, arguments[i].getSymbol())); |
|
893 | 893 |
} |
894 | 894 |
arguments_as_string[i] = arguments[i].getSymbol(); |
895 | 895 |
} |
... | ... | |
1124 | 1124 |
public int[][] evalToInt2D(String exp) throws RWorkspaceException { |
1125 | 1125 |
int[][] res = null; |
1126 | 1126 |
try { |
1127 |
int[] dims = eval(TXMCoreMessages.MatrixImpl_2+exp+")").asIntegers(); //$NON-NLS-2$
|
|
1127 |
int[] dims = eval(StatsEngineCoreMessages.MatrixImpl_2+exp+")").asIntegers(); //$NON-NLS-2$
|
|
1128 | 1128 |
int ncol = dims[1]; |
1129 | 1129 |
int nrow = dims[0]; |
1130 | 1130 |
int[] tmp = eval("c("+exp+")").asIntegers(); //$NON-NLS-1$ //$NON-NLS-2$ |
... | ... | |
1172 | 1172 |
try { |
1173 | 1173 |
return list.asList().at(item_name); |
1174 | 1174 |
} catch (REXPMismatchException e) { |
1175 |
throw new RWorkspaceException(TXMCoreMessages.ERROR_EXTRACT_ITEM
|
|
1175 |
throw new RWorkspaceException(RCoreMessages.ERROR_EXTRACT_ITEM
|
|
1176 | 1176 |
+ e.getMessage()); |
1177 | 1177 |
} |
1178 | 1178 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/exceptions/RWorkspaceException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.exceptions; |
|
29 |
|
|
30 |
import org.txm.statsengine.core.StatException; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* Super-class of all exception related to the R engine. |
|
35 |
* |
|
36 |
* @author sloiseau |
|
37 |
*/ |
|
38 |
public class RWorkspaceException extends StatException { |
|
39 |
|
|
40 |
/** The Constant serialVersionUID. */ |
|
41 |
private static final long serialVersionUID = 1630828823146927953L; |
|
42 |
|
|
43 |
/** |
|
44 |
* Instantiates a new r workspace exception. |
|
45 |
*/ |
|
46 |
public RWorkspaceException() { |
|
47 |
super(); |
|
48 |
// TODO Auto-generated constructor stub |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r workspace exception. |
|
53 |
* |
|
54 |
* @param arg0 the arg0 |
|
55 |
* @param arg1 the arg1 |
|
56 |
*/ |
|
57 |
public RWorkspaceException(String arg0, Throwable arg1) { |
|
58 |
super(arg0, arg1); |
|
59 |
// TODO Auto-generated constructor stub |
|
60 |
} |
|
61 |
|
|
62 |
/** |
|
63 |
* Instantiates a new r workspace exception. |
|
64 |
* |
|
65 |
* @param arg0 the arg0 |
|
66 |
*/ |
|
67 |
public RWorkspaceException(String arg0) { |
|
68 |
super(arg0); |
|
69 |
// TODO Auto-generated constructor stub |
|
70 |
} |
|
71 |
|
|
72 |
/** |
|
73 |
* Instantiates a new r workspace exception. |
|
74 |
* |
|
75 |
* @param arg0 the arg0 |
|
76 |
*/ |
|
77 |
public RWorkspaceException(Throwable arg0) { |
|
78 |
super(arg0); |
|
79 |
// TODO Auto-generated constructor stub |
|
80 |
} |
|
81 |
|
|
82 |
} |
|
0 | 83 |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/exceptions/RException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.exceptions; |
|
29 |
|
|
30 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* An exception indicating an error during the evaluation of an expression by |
|
35 |
* the R engine. |
|
36 |
* |
|
37 |
* @author sloiseau |
|
38 |
*/ |
|
39 |
public class RException extends RWorkspaceException { |
|
40 |
|
|
41 |
/** The Constant serialVersionUID. */ |
|
42 |
private static final long serialVersionUID = -3459835604570896478L; |
|
43 |
|
|
44 |
/** |
|
45 |
* Instantiates a new r exception. |
|
46 |
*/ |
|
47 |
public RException() { |
|
48 |
super(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r exception. |
|
53 |
* |
|
54 |
* @param msg the msg |
|
55 |
*/ |
|
56 |
public RException(String msg) { |
|
57 |
super(msg); |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Instantiates a new r exception. |
|
62 |
* |
|
63 |
* @param expr the expr |
|
64 |
* @param msg the msg |
|
65 |
*/ |
|
66 |
public RException(String expr, String msg) { |
|
67 |
super(RCoreMessages.RException_0 + msg + RCoreMessages.RException_1 + RCoreMessages.RException_2 + expr); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Instantiates a new r exception. |
|
72 |
* |
|
73 |
* @param arg0 the arg0 |
|
74 |
* @param arg1 the arg1 |
|
75 |
*/ |
|
76 |
public RException(String arg0, Throwable arg1) { |
|
77 |
super(arg0, arg1); |
|
78 |
} |
|
79 |
|
|
80 |
/** |
|
81 |
* Instantiates a new r exception. |
|
82 |
* |
|
83 |
* @param arg0 the arg0 |
|
84 |
*/ |
|
85 |
public RException(Throwable arg0) { |
|
86 |
super(arg0); |
|
87 |
} |
|
88 |
|
|
89 |
} |
|
0 | 90 |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/exceptions/RObjectDoesNotExist.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.exceptions; |
|
29 |
|
|
30 |
|
|
31 |
// TODO: Auto-generated Javadoc |
|
32 |
/** |
|
33 |
* Exception thrown if a symbol without corresponding object in the R workspace |
|
34 |
* is used. |
|
35 |
* |
|
36 |
* @author sloiseau |
|
37 |
*/ |
|
38 |
public class RObjectDoesNotExist extends RWorkspaceException { |
|
39 |
|
|
40 |
/** The Constant serialVersionUID. */ |
|
41 |
private static final long serialVersionUID = -1344530765750521820L; |
|
42 |
|
|
43 |
/** |
|
44 |
* Instantiates a new r object does not exist. |
|
45 |
*/ |
|
46 |
public RObjectDoesNotExist() { |
|
47 |
super(); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* Instantiates a new r object does not exist. |
|
52 |
* |
|
53 |
* @param arg0 the arg0 |
|
54 |
* @param arg1 the arg1 |
|
55 |
*/ |
|
56 |
public RObjectDoesNotExist(String arg0, Throwable arg1) { |
|
57 |
super(arg0, arg1); |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Instantiates a new r object does not exist. |
|
62 |
* |
|
63 |
* @param arg0 the arg0 |
|
64 |
*/ |
|
65 |
public RObjectDoesNotExist(String arg0) { |
|
66 |
super(arg0); |
|
67 |
} |
|
68 |
|
|
69 |
/** |
|
70 |
* Instantiates a new r object does not exist. |
|
71 |
* |
|
72 |
* @param arg0 the arg0 |
|
73 |
*/ |
|
74 |
public RObjectDoesNotExist(Throwable arg0) { |
|
75 |
super(arg0); |
|
76 |
} |
|
77 |
|
|
78 |
} |
|
0 | 79 |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/exceptions/RServeException.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.exceptions; |
|
29 |
|
|
30 |
|
|
31 |
// TODO: Auto-generated Javadoc |
|
32 |
/** |
|
33 |
* The Class RServeException. |
|
34 |
*/ |
|
35 |
public class RServeException extends RException { |
|
36 |
|
|
37 |
/** The Constant serialVersionUID. */ |
|
38 |
private static final long serialVersionUID = 1L; |
|
39 |
|
|
40 |
/** |
|
41 |
* Instantiates a new r serve exception. |
|
42 |
*/ |
|
43 |
public RServeException() { |
|
44 |
super(); |
|
45 |
// TODO Auto-generated constructor stub |
|
46 |
} |
|
47 |
|
|
48 |
/** |
|
49 |
* Instantiates a new r serve exception. |
|
50 |
* |
|
51 |
* @param arg0 the arg0 |
|
52 |
* @param arg1 the arg1 |
|
53 |
*/ |
|
54 |
public RServeException(String arg0, Throwable arg1) { |
|
55 |
super(arg0, arg1); |
|
56 |
// TODO Auto-generated constructor stub |
|
57 |
} |
|
58 |
|
|
59 |
/** |
|
60 |
* Instantiates a new r serve exception. |
|
61 |
* |
|
62 |
* @param arg0 the arg0 |
|
63 |
*/ |
|
64 |
public RServeException(String arg0) { |
|
65 |
super(arg0); |
|
66 |
// TODO Auto-generated constructor stub |
|
67 |
} |
|
68 |
|
|
69 |
/** |
|
70 |
* Instantiates a new r serve exception. |
|
71 |
* |
|
72 |
* @param arg0 the arg0 |
|
73 |
*/ |
|
74 |
public RServeException(Throwable arg0) { |
|
75 |
super(arg0); |
|
76 |
// TODO Auto-generated constructor stub |
|
77 |
} |
|
78 |
|
|
79 |
} |
|
0 | 80 |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/exceptions/RObjectAlreadyExist.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.exceptions; |
|
29 |
|
|
30 |
|
|
31 |
// TODO: Auto-generated Javadoc |
|
32 |
/** |
|
33 |
* When one try to create an object with a symbol already existing in the |
|
34 |
* workspace. |
|
35 |
* |
|
36 |
* @author sloiseau |
|
37 |
*/ |
|
38 |
public class RObjectAlreadyExist extends RWorkspaceException { |
|
39 |
|
|
40 |
/** The Constant serialVersionUID. */ |
|
41 |
private static final long serialVersionUID = 3386015668080138287L; |
|
42 |
|
|
43 |
/** |
|
44 |
* Instantiates a new r object already exist. |
|
45 |
*/ |
|
46 |
public RObjectAlreadyExist() { |
|
47 |
super(); |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* Instantiates a new r object already exist. |
|
52 |
* |
|
53 |
* @param arg0 the arg0 |
|
54 |
* @param arg1 the arg1 |
|
55 |
*/ |
|
56 |
public RObjectAlreadyExist(String arg0, Throwable arg1) { |
|
57 |
super(arg0, arg1); |
|
58 |
} |
|
59 |
|
|
60 |
/** |
|
61 |
* Instantiates a new r object already exist. |
|
62 |
* |
|
63 |
* @param arg0 the arg0 |
|
64 |
*/ |
|
65 |
public RObjectAlreadyExist(String arg0) { |
|
66 |
super(arg0); |
|
67 |
} |
|
68 |
|
|
69 |
/** |
|
70 |
* Instantiates a new r object already exist. |
|
71 |
* |
|
72 |
* @param arg0 the arg0 |
|
73 |
*/ |
|
74 |
public RObjectAlreadyExist(Throwable arg0) { |
|
75 |
super(arg0); |
|
76 |
} |
|
77 |
|
|
78 |
} |
|
0 | 79 |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/preferences/RPreferences.java (revision 277) | ||
---|---|---|
4 | 4 |
import org.eclipse.core.runtime.preferences.DefaultScope; |
5 | 5 |
import org.osgi.framework.FrameworkUtil; |
6 | 6 |
import org.osgi.service.prefs.Preferences; |
7 |
import org.txm.utils.preferences.TXMPreferences;
|
|
7 |
import org.txm.core.preferences.TXMPreferences;
|
|
8 | 8 |
|
9 | 9 |
/** |
10 | 10 |
* Default preferences initializer. |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RserveWatcher.java (revision 277) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.statsengine.r.core; |
29 | 29 |
|
30 |
import org.txm.Toolbox;
|
|
31 |
import org.txm.Watcher; |
|
30 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
31 |
import org.txm.utils.Watcher;
|
|
32 | 32 |
|
33 | 33 |
// TODO: Auto-generated Javadoc |
34 | 34 |
/** |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RStatsEngine.java (revision 277) | ||
---|---|---|
2 | 2 |
|
3 | 3 |
import java.io.IOException; |
4 | 4 |
|
5 |
import org.txm.core.preferences.TXMPreferences; |
|
6 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException; |
|
5 | 7 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
6 | 8 |
import org.txm.statsengine.r.core.preferences.RPreferences; |
7 | 9 |
import org.txm.utils.OSDetector; |
8 | 10 |
import org.txm.utils.logger.Log; |
9 |
import org.txm.utils.preferences.TXMPreferences; |
|
10 | 11 |
|
11 | 12 |
/** |
12 | 13 |
* R statistics engine. Contains methods to start, stop, kill, etc. the R and RServe process. |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/RFileCommunication.java (revision 277) | ||
---|---|---|
32 | 32 |
import java.io.FileWriter; |
33 | 33 |
import java.io.IOException; |
34 | 34 |
|
35 |
import org.eclipse.core.runtime.Platform;
|
|
35 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
36 | 36 |
import org.txm.utils.OSDetector; |
37 | 37 |
|
38 | 38 |
|
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/RCoreMessages.java (revision 277) | ||
---|---|---|
1 | 1 |
package org.txm.statsengine.r.core.messages; |
2 | 2 |
|
3 | 3 |
import org.eclipse.osgi.util.NLS; |
4 |
import org.txm.core.messages.TXMCoreMessages;
|
|
4 |
import org.txm.utils.messages.Utf8NLS;
|
|
5 | 5 |
|
6 | 6 |
public class RCoreMessages extends NLS { |
7 | 7 |
|
... | ... | |
47 | 47 |
|
48 | 48 |
public static String RSERVE_PATH_NOT_SET_ERROR; |
49 | 49 |
public static String RSERVE_PATH_SET_ERROR; |
50 |
public static String CONNECTED_TO_STATS_MODULE; |
|
51 |
public static String CHAR_VECTOR_ADDED_TO_WORKSPACE; |
|
52 |
public static String CONNECTION_OK; |
|
53 |
public static String ERROR_EXTRACT_ITEM; |
|
54 |
public static String REQUESTED_OBJECT_NOT_FOUND_IN_R; |
|
50 | 55 |
|
51 | 56 |
|
52 | 57 |
// FIXME: unused keys |
... | ... | |
62 | 67 |
|
63 | 68 |
static { |
64 | 69 |
// initialize resource bundle |
65 |
TXMCoreMessages.initializeMessages(BUNDLE_NAME, RCoreMessages.class);
|
|
70 |
Utf8NLS.initializeMessages(BUNDLE_NAME, RCoreMessages.class);
|
|
66 | 71 |
} |
67 | 72 |
|
68 | 73 |
private RCoreMessages() { |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages.properties (revision 277) | ||
---|---|---|
46 | 46 |
StartRserve_3 = Rserve already running on port |
47 | 47 |
StartRserve_4 = try R path : 'R' |
48 | 48 |
StartRserve_6 = try R path : |
49 |
|
|
50 |
|
|
51 |
CHAR_VECTOR_ADDED_TO_WORKSPACE = Vector "{1}" ({0,number,integer} "character") has been transmited to the Statistics Engine. |
|
52 |
CONNECTED_TO_STATS_MODULE = connected. |
|
53 |
CONNECTION_OK = Connected to the Statistics Engine. |
|
54 |
|
|
55 |
ERROR_EXTRACT_ITEM = ** Error extracting list item: |
|
56 |
|
|
57 |
REQUESTED_OBJECT_NOT_FOUND_IN_R = The requested object ({0}) was not found in the R workspace. |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/messages/messages_fr.properties (revision 277) | ||
---|---|---|
46 | 46 |
StartRserve_3 = Rserve déja démarré sur le port |
47 | 47 |
StartRserve_4 = Essai du chemin de R : 'R' |
48 | 48 |
StartRserve_6 = Essai du chemin de R : |
49 |
|
|
50 |
|
|
51 |
CHAR_VECTOR_ADDED_TO_WORKSPACE = Le vecteur "{1}" ({0,number,integer} valeurs "character") a été transmis au Moteur Statistique. |
|
52 |
CONNECTED_TO_STATS_MODULE = connecté. |
|
53 |
CONNECTION_OK = Connexion au Moteur Statistique établie. |
|
54 |
ERROR_EXTRACT_ITEM = ** Erreur lors de l'extraction de la liste d'items : \ |
|
55 |
REQUESTED_OBJECT_NOT_FOUND_IN_R = L'objet demandé ({0}) n'a pas été trouvé dans l'espace de travail R. |
|
56 |
|
|
57 |
|
|
58 |
|
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/RObjectDoesNotExist.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.data; |
|
29 |
|
|
30 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* Exception thrown if a symbol without corresponding object in the R workspace |
|
35 |
* is used. |
|
36 |
* |
|
37 |
* @author sloiseau |
|
38 |
*/ |
|
39 |
public class RObjectDoesNotExist extends RWorkspaceException { |
|
40 |
|
|
41 |
/** The Constant serialVersionUID. */ |
|
42 |
private static final long serialVersionUID = -1344530765750521820L; |
|
43 |
|
|
44 |
/** |
|
45 |
* Instantiates a new r object does not exist. |
|
46 |
*/ |
|
47 |
public RObjectDoesNotExist() { |
|
48 |
super(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r object does not exist. |
|
53 |
* |
|
54 |
* @param arg0 the arg0 |
|
55 |
* @param arg1 the arg1 |
|
56 |
*/ |
|
57 |
public RObjectDoesNotExist(String arg0, Throwable arg1) { |
|
58 |
super(arg0, arg1); |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* Instantiates a new r object does not exist. |
|
63 |
* |
|
64 |
* @param arg0 the arg0 |
|
65 |
*/ |
|
66 |
public RObjectDoesNotExist(String arg0) { |
|
67 |
super(arg0); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Instantiates a new r object does not exist. |
|
72 |
* |
|
73 |
* @param arg0 the arg0 |
|
74 |
*/ |
|
75 |
public RObjectDoesNotExist(Throwable arg0) { |
|
76 |
super(arg0); |
|
77 |
} |
|
78 |
|
|
79 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/RObjectAlreadyExist.java (revision 277) | ||
---|---|---|
1 |
// Copyright © 2010-2013 ENS de Lyon. |
|
2 |
// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of |
|
3 |
// Lyon 2, University of Franche-Comté, University of Nice |
|
4 |
// Sophia Antipolis, University of Paris 3. |
|
5 |
// |
|
6 |
// The TXM platform is free software: you can redistribute it |
|
7 |
// and/or modify it under the terms of the GNU General Public |
|
8 |
// License as published by the Free Software Foundation, |
|
9 |
// either version 2 of the License, or (at your option) any |
|
10 |
// later version. |
|
11 |
// |
|
12 |
// The TXM platform is distributed in the hope that it will be |
|
13 |
// useful, but WITHOUT ANY WARRANTY; without even the implied |
|
14 |
// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
|
15 |
// PURPOSE. See the GNU General Public License for more |
|
16 |
// details. |
|
17 |
// |
|
18 |
// You should have received a copy of the GNU General |
|
19 |
// Public License along with the TXM platform. If not, see |
|
20 |
// http://www.gnu.org/licenses. |
|
21 |
// |
|
22 |
// |
|
23 |
// |
|
24 |
// $LastChangedDate: 2013-05-06 17:38:43 +0200 (Mon, 06 May 2013) $ |
|
25 |
// $LastChangedRevision: 2386 $ |
|
26 |
// $LastChangedBy: mdecorde $ |
|
27 |
// |
|
28 |
package org.txm.statsengine.r.core.data; |
|
29 |
|
|
30 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
31 |
|
|
32 |
// TODO: Auto-generated Javadoc |
|
33 |
/** |
|
34 |
* When one try to create an object with a symbol already existing in the |
|
35 |
* workspace. |
|
36 |
* |
|
37 |
* @author sloiseau |
|
38 |
*/ |
|
39 |
public class RObjectAlreadyExist extends RWorkspaceException { |
|
40 |
|
|
41 |
/** The Constant serialVersionUID. */ |
|
42 |
private static final long serialVersionUID = 3386015668080138287L; |
|
43 |
|
|
44 |
/** |
|
45 |
* Instantiates a new r object already exist. |
|
46 |
*/ |
|
47 |
public RObjectAlreadyExist() { |
|
48 |
super(); |
|
49 |
} |
|
50 |
|
|
51 |
/** |
|
52 |
* Instantiates a new r object already exist. |
|
53 |
* |
|
54 |
* @param arg0 the arg0 |
|
55 |
* @param arg1 the arg1 |
|
56 |
*/ |
|
57 |
public RObjectAlreadyExist(String arg0, Throwable arg1) { |
|
58 |
super(arg0, arg1); |
|
59 |
} |
|
60 |
|
|
61 |
/** |
|
62 |
* Instantiates a new r object already exist. |
|
63 |
* |
|
64 |
* @param arg0 the arg0 |
|
65 |
*/ |
|
66 |
public RObjectAlreadyExist(String arg0) { |
|
67 |
super(arg0); |
|
68 |
} |
|
69 |
|
|
70 |
/** |
|
71 |
* Instantiates a new r object already exist. |
|
72 |
* |
|
73 |
* @param arg0 the arg0 |
|
74 |
*/ |
|
75 |
public RObjectAlreadyExist(Throwable arg0) { |
|
76 |
super(arg0); |
|
77 |
} |
|
78 |
|
|
79 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/VectorImpl.java (revision 277) | ||
---|---|---|
34 | 34 |
import org.txm.statsengine.core.StatException; |
35 | 35 |
import org.txm.statsengine.core.data.Vector; |
36 | 36 |
import org.txm.statsengine.core.utils.ArrayIndex; |
37 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
37 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
38 | 38 |
|
39 | 39 |
// TODO: Auto-generated Javadoc |
40 | 40 |
/** |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/MatrixImpl.java (revision 277) | ||
---|---|---|
38 | 38 |
|
39 | 39 |
import org.rosuda.REngine.REXP; |
40 | 40 |
import org.rosuda.REngine.REXPMismatchException; |
41 |
import org.txm.core.messages.TXMCoreMessages; |
|
42 | 41 |
import org.txm.statsengine.core.StatException; |
43 | 42 |
import org.txm.statsengine.core.data.Matrix; |
44 | 43 |
import org.txm.statsengine.core.data.Vector; |
44 |
import org.txm.statsengine.core.messages.StatsEngineCoreMessages; |
|
45 | 45 |
import org.txm.statsengine.core.utils.ArrayIndex; |
46 |
import org.txm.statsengine.r.core.RException; |
|
47 | 46 |
import org.txm.statsengine.r.core.RWorkspace; |
48 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
47 |
import org.txm.statsengine.r.core.exceptions.RException; |
|
48 |
import org.txm.statsengine.r.core.exceptions.RObjectDoesNotExist; |
|
49 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException; |
|
50 |
import org.txm.statsengine.r.core.messages.RCoreMessages; |
|
49 | 51 |
import org.txm.utils.CharsetDetector; |
50 | 52 |
import org.txm.utils.OSDetector; |
51 | 53 |
|
... | ... | |
138 | 140 |
this(matrix); |
139 | 141 |
|
140 | 142 |
if (rowNames == null) { |
141 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_4);
|
|
143 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_4);
|
|
142 | 144 |
} |
143 | 145 |
// if (rowNames.length != nrow) { |
144 | 146 |
// throw new IllegalArgumentException(Messages.MatrixImpl_5); |
... | ... | |
147 | 149 |
rw.assignRowNamesToMatrix(symbol, new VectorImpl(rowNames).getSymbol()); |
148 | 150 |
|
149 | 151 |
if (columnNames == null) { |
150 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_6);
|
|
152 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_6);
|
|
151 | 153 |
} |
152 | 154 |
// if (columnNames.length != ncol) { |
153 | 155 |
// throw new IllegalArgumentException(Messages.MatrixImpl_7 |
... | ... | |
203 | 205 |
this(matrix); |
204 | 206 |
|
205 | 207 |
if (lineNames == null) { |
206 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_4);
|
|
208 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_4);
|
|
207 | 209 |
} |
208 | 210 |
// if (lineNames.length != nrow) { |
209 | 211 |
// throw new IllegalArgumentException(Messages.MatrixImpl_5); |
... | ... | |
212 | 214 |
rw.assignRowNamesToMatrix(symbol, new VectorImpl(lineNames).getSymbol()); |
213 | 215 |
|
214 | 216 |
if (partNames == null) { |
215 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_6);
|
|
217 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_6);
|
|
216 | 218 |
} |
217 | 219 |
// if (partNames.length != ncol) { |
218 | 220 |
// throw new IllegalArgumentException(Messages.MatrixImpl_7 |
... | ... | |
236 | 238 |
protected MatrixImpl(String symbol) throws RWorkspaceException { |
237 | 239 |
super(symbol); |
238 | 240 |
if (!rw.containsVariable(symbol)) { |
239 |
throw new RObjectDoesNotExist(TXMCoreMessages.MatrixImpl_0 + symbol
|
|
240 |
+ TXMCoreMessages.MatrixImpl_1);
|
|
241 |
throw new RObjectDoesNotExist(StatsEngineCoreMessages.MatrixImpl_0 + symbol
|
|
242 |
+ StatsEngineCoreMessages.MatrixImpl_1);
|
|
241 | 243 |
} |
242 | 244 |
REXP res = rw.eval("dim(" + symbol + ")"); //$NON-NLS-2$ //$NON-NLS-1$ |
243 | 245 |
int[] dim = null; |
... | ... | |
432 | 434 |
throw new RWorkspaceException(e); |
433 | 435 |
} |
434 | 436 |
} else if (r.isNull()) { |
435 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_19);
|
|
437 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_19);
|
|
436 | 438 |
} else { |
437 | 439 |
// System.out.println("row: " + row); |
438 | 440 |
// System.out.println("col: " + col); |
439 | 441 |
// System.out.println("nrow: " + nrow); |
440 | 442 |
// System.out.println("ncol: " + ncol); |
441 | 443 |
// System.out.println(rw.eval("print(" + getSymbol() + ");")); |
442 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_20
|
|
443 |
+ r.getAttribute(TXMCoreMessages.MatrixImpl_21));
|
|
444 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_20
|
|
445 |
+ r.getAttribute(StatsEngineCoreMessages.MatrixImpl_21));
|
|
444 | 446 |
} |
445 | 447 |
} |
446 | 448 |
|
... | ... | |
452 | 454 |
int ncol = this.getNColumns(); |
453 | 455 |
|
454 | 456 |
if (index < 0 || index >= ncol) { |
455 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_28 + index
|
|
456 |
+ TXMCoreMessages.MatrixImpl_29 + ncol + ")"); //$NON-NLS-1$
|
|
457 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_28 + index
|
|
458 |
+ StatsEngineCoreMessages.MatrixImpl_29 + ncol + ")"); //$NON-NLS-1$
|
|
457 | 459 |
} |
458 | 460 |
String colName = createSymbole(Vector.class); |
459 | 461 |
rw.voidEval(colName + "<- " + symbol + "[ ," + (index + 1) + "];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
... | ... | |
504 | 506 |
@Override |
505 | 507 |
public int getNColumns() { |
506 | 508 |
try { |
507 |
return RWorkspace.getRWorkspaceInstance().eval(TXMCoreMessages.MatrixImpl_2+symbol+")[2]").asInteger(); //$NON-NLS-2$
|
|
509 |
return RWorkspace.getRWorkspaceInstance().eval(StatsEngineCoreMessages.MatrixImpl_2+symbol+")[2]").asInteger(); //$NON-NLS-2$
|
|
508 | 510 |
} catch (Exception e) { |
509 | 511 |
System.out.println("Matrix: failed to get nrow: "+e); //$NON-NLS-1$ |
510 | 512 |
} |
... | ... | |
517 | 519 |
@Override |
518 | 520 |
public int getNRows() { |
519 | 521 |
try { |
520 |
return RWorkspace.getRWorkspaceInstance().eval(TXMCoreMessages.MatrixImpl_2+symbol+")[1]").asInteger(); //$NON-NLS-2$
|
|
522 |
return RWorkspace.getRWorkspaceInstance().eval(StatsEngineCoreMessages.MatrixImpl_2+symbol+")[1]").asInteger(); //$NON-NLS-2$
|
|
521 | 523 |
} catch (Exception e) { |
522 |
System.out.println(TXMCoreMessages.MatrixImpl_67+e);
|
|
524 |
System.out.println(StatsEngineCoreMessages.MatrixImpl_67+e);
|
|
523 | 525 |
} |
524 | 526 |
return 0; |
525 | 527 |
} |
... | ... | |
531 | 533 |
public Vector getRow(int index) throws RException, RWorkspaceException { |
532 | 534 |
int nrow = getNRows(); |
533 | 535 |
if (index < 0 || index >= nrow) { |
534 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_22 + index
|
|
535 |
+ TXMCoreMessages.MatrixImpl_23 + nrow + ")"); //$NON-NLS-1$
|
|
536 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_22 + index
|
|
537 |
+ StatsEngineCoreMessages.MatrixImpl_23 + nrow + ")"); //$NON-NLS-1$
|
|
536 | 538 |
} |
537 | 539 |
String rowName = createSymbole(Vector.class); |
538 | 540 |
rw.voidEval(rowName + "<- " + symbol + "[" + (index + 1) + ", ];"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
... | ... | |
629 | 631 |
int linesize = rw.eval("dim(tmpmat)[1]").asInteger(); //$NON-NLS-1$ |
630 | 632 |
int ncol = this.getNColumns(); |
631 | 633 |
if (colsize != ncol) { |
632 |
System.out.println(TXMCoreMessages.MatrixImpl_73+ncol+" imported="+colsize); //$NON-NLS-2$
|
|
634 |
System.out.println(StatsEngineCoreMessages.MatrixImpl_73+ncol+" imported="+colsize); //$NON-NLS-2$
|
|
633 | 635 |
return false; |
634 | 636 |
} |
635 | 637 |
|
... | ... | |
853 | 855 |
try { |
854 | 856 |
rowNames = getRowNames().asStringsArray(); |
855 | 857 |
} catch (StatException e) { |
856 |
System.out.println(TXMCoreMessages.MatrixImpl_79);
|
|
858 |
System.out.println(StatsEngineCoreMessages.MatrixImpl_79);
|
|
857 | 859 |
org.txm.utils.logger.Log.printStackTrace(e); |
858 | 860 |
return; |
859 | 861 |
} |
... | ... | |
907 | 909 |
try { |
908 | 910 |
rowNames = getRowNames().asStringsArray(); |
909 | 911 |
} catch (StatException e) { |
910 |
System.out.println(TXMCoreMessages.MatrixImpl_79);
|
|
912 |
System.out.println(StatsEngineCoreMessages.MatrixImpl_79);
|
|
911 | 913 |
org.txm.utils.logger.Log.printStackTrace(e); |
912 | 914 |
return; |
913 | 915 |
} |
914 | 916 |
String lastRowName = rowNames[last]; |
915 | 917 |
System.out.println("table<-matrix(table[c(-"+idx+"),],nrow=1,dimnames = list(rownames="+lastRowName+",colnames(table)))"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
916 | 918 |
} else { |
917 |
System.out.println(TXMCoreMessages.MatrixImpl_88);
|
|
919 |
System.out.println(StatsEngineCoreMessages.MatrixImpl_88);
|
|
918 | 920 |
} |
919 | 921 |
} |
920 | 922 |
|
... | ... | |
936 | 938 |
int nrow = this.getNRows(); |
937 | 939 |
int ncol = this.getNColumns(); |
938 | 940 |
if (row < 0 || row >= nrow) { |
939 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_10 + row
|
|
940 |
+ TXMCoreMessages.MatrixImpl_11 + nrow + ")"); //$NON-NLS-1$
|
|
941 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_10 + row
|
|
942 |
+ StatsEngineCoreMessages.MatrixImpl_11 + nrow + ")"); //$NON-NLS-1$
|
|
941 | 943 |
} |
942 | 944 |
if (col < 0 || col >= ncol) { |
943 |
throw new IllegalArgumentException(TXMCoreMessages.MatrixImpl_13 + col
|
|
944 |
+ TXMCoreMessages.MatrixImpl_14 + ncol + ")"); //$NON-NLS-1$
|
|
945 |
throw new IllegalArgumentException(StatsEngineCoreMessages.MatrixImpl_13 + col
|
|
946 |
+ StatsEngineCoreMessages.MatrixImpl_14 + ncol + ")"); //$NON-NLS-1$
|
|
945 | 947 |
} |
946 | 948 |
// appel à R |
947 | 949 |
try { |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/ContingencyTableImpl.java (revision 277) | ||
---|---|---|
31 | 31 |
import org.txm.statsengine.core.StatException; |
32 | 32 |
import org.txm.statsengine.core.data.ContingencyTable; |
33 | 33 |
import org.txm.statsengine.core.data.Vector; |
34 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
34 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
35 | 35 |
|
36 | 36 |
import cern.colt.matrix.DoubleMatrix2D; |
37 | 37 |
|
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/QuantitativeDataStructureImpl.java (revision 277) | ||
---|---|---|
28 | 28 |
package org.txm.statsengine.r.core.data; |
29 | 29 |
|
30 | 30 |
import org.rosuda.REngine.REXP; |
31 |
import org.txm.core.messages.TXMCoreMessages; |
|
32 | 31 |
import org.txm.core.results.TXMResult; |
33 | 32 |
import org.txm.statsengine.core.data.QuantitativeDataStructure; |
34 | 33 |
import org.txm.statsengine.core.data.Vector; |
34 |
import org.txm.statsengine.core.messages.StatsEngineCoreMessages; |
|
35 | 35 |
import org.txm.statsengine.r.core.RWorkspace; |
36 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
36 |
import org.txm.statsengine.r.core.exceptions.RObjectDoesNotExist; |
|
37 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException; |
|
37 | 38 |
|
38 | 39 |
// TODO: Auto-generated Javadoc |
39 | 40 |
/** |
... | ... | |
122 | 123 |
protected void removeFromRWorkspace() throws RWorkspaceException { |
123 | 124 |
if (!rw.containsVariable(symbol)) { |
124 | 125 |
throw new RObjectDoesNotExist( |
125 |
TXMCoreMessages.QuantitativeDataStructureImpl_2);
|
|
126 |
StatsEngineCoreMessages.QuantitativeDataStructureImpl_2);
|
|
126 | 127 |
} |
127 | 128 |
rw.voidEval("rm(" + symbol + ")"); //$NON-NLS-1$ //$NON-NLS-2$ |
128 | 129 |
} |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/Factor.java (revision 277) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.statsengine.r.core.data; |
29 | 29 |
|
30 |
import org.txm.core.messages.TXMCoreMessages;
|
|
31 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
30 |
import org.txm.statsengine.core.messages.StatsEngineCoreMessages;
|
|
31 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
32 | 32 |
|
33 | 33 |
// TODO: Auto-generated Javadoc |
34 | 34 |
/** |
... | ... | |
46 | 46 |
* @throws RWorkspaceException the r workspace exception |
47 | 47 |
*/ |
48 | 48 |
public Factor(String values) throws RWorkspaceException { |
49 |
throw new UnsupportedOperationException(TXMCoreMessages.Factor_0);
|
|
49 |
throw new UnsupportedOperationException(StatsEngineCoreMessages.Factor_0);
|
|
50 | 50 |
} |
51 | 51 |
|
52 | 52 |
/** |
... | ... | |
56 | 56 |
* @return the levels |
57 | 57 |
*/ |
58 | 58 |
public String[] getLevels() { |
59 |
throw new UnsupportedOperationException(TXMCoreMessages.Factor_0);
|
|
59 |
throw new UnsupportedOperationException(StatsEngineCoreMessages.Factor_0);
|
|
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
@Override |
tmp/org.txm.statsengine.r.core/src/org/txm/statsengine/r/core/data/DoubleMatrix.java (revision 277) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.statsengine.r.core.data; |
29 | 29 |
|
30 |
import org.txm.statsengine.r.core.RWorkspaceException; |
|
30 |
import org.txm.statsengine.r.core.exceptions.RWorkspaceException;
|
|
31 | 31 |
|
32 | 32 |
import cern.colt.matrix.DoubleMatrix2D; |
33 | 33 |
|
tmp/org.txm.statsengine.r.core/build.properties (revision 277) | ||
---|---|---|
1 |
source.. = src/ |
|
2 | 1 |
output.. = bin/ |
3 | 2 |
bin.includes = META-INF/,\ |
4 |
.,\ |
|
5 |
lib/colt-1.2.0.jar,\ |
|
6 |
plugin.xml,\ |
|
7 |
lib/RserveEngine.jar,\ |
|
8 |
lib/REngine.jar |
|
3 |
plugin.xml |
Formats disponibles : Unified diff