use of org.jpl7.Variable in project packages-jpl by SWI-Prolog.
the class TestOLD method test10l.
private static void test10l() {
Query q5 = new Query(new Compound("length", new Term[] { new Variable("Zs"), new org.jpl7.Integer(5) }));
Map<String, Term> s5 = q5.oneSolution();
System.err.println("test10l:");
System.err.println(" length(Zs,5)");
System.err.println(" " + Util.toString(s5));
System.err.println(" Zs = " + (Term) s5.get("Zs"));
System.err.println();
}
use of org.jpl7.Variable in project packages-jpl by SWI-Prolog.
the class TestOLD method test10.
private static void test10() {
System.err.println("test10:");
System.err.println(" java_lib_version = " + JPL.version_string());
System.err.println(" c_lib_version = " + org.jpl7.fli.Prolog.get_c_lib_version());
System.err.println(" pl_lib_version = " + new Query(new Compound("jpl_pl_lib_version", new Term[] { new Variable("V") })).oneSolution().get("V"));
System.err.println(" java.version = " + System.getProperty("java.version"));
System.err.println(" os.name = " + System.getProperty("os.name"));
System.err.println(" os.arch = " + System.getProperty("os.arch"));
System.err.println(" os.version = " + System.getProperty("os.version"));
System.err.println();
}
use of org.jpl7.Variable in project packages-jpl by SWI-Prolog.
the class TestOLD method test10o.
private static void test10o() {
System.err.println("test10o:");
Term l2b = Util.termArrayToList(new Term[] { new Variable("A"), new Variable("B"), new Variable("C"), new Variable("D"), new Variable("E") });
Query q9b = new Query(new Compound("append", new Term[] { new Variable("Xs"), new Variable("Ys"), l2b }));
Map<String, Term>[] s9bs = q9b.allSolutions();
for (int i = 0; i < s9bs.length; i++) {
System.err.println(" append(Xs,Ys,[A,B,C,D,E]) -> " + Util.toString(s9bs[i]));
}
System.err.println();
}
use of org.jpl7.Variable in project bioformats by openmicroscopy.
the class NetCDFServiceImpl method getArray.
/* (non-Javadoc)
* @see loci.formats.NetCDFService#getArray(java.lang.String, int[], int[])
*/
@Override
public Object getArray(String path, int[] origin, int[] shape) throws ServiceException {
String groupName = getDirectory(path);
String variableName = getName(path);
Group group = getGroup(groupName);
Variable variable = group.findVariable(variableName);
try {
if (origin != null && shape != null) {
return variable.read(origin, shape).reduce().copyToNDJavaArray();
}
return variable.read().copyToNDJavaArray();
} catch (InvalidRangeException e) {
throw new ServiceException(e);
} catch (IOException e) {
throw new ServiceException(e);
} catch (NullPointerException e) {
return null;
}
}
use of org.jpl7.Variable in project vcell by virtualcell.
the class NetCDFReader method getSavePeriod.
/**
* Get save period, which is the time interval for saving the data. 0 dimension.
* @return double, save period.
*/
public double getSavePeriod() throws IOException {
Variable v = ncfile.findVariable("SaveTime");
Double val = 0.0;
try {
val = v.readScalarDouble();
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
throw new IOException("Cannot get proper save period from the model.");
}
return val;
}
Aggregations