Search in sources :

Example 21 with Variable

use of org.flyte.api.v1.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();
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query) Compound(org.jpl7.Compound) Term(org.jpl7.Term)

Example 22 with Variable

use of org.flyte.api.v1.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();
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query) Compound(org.jpl7.Compound) Term(org.jpl7.Term) Map(java.util.Map)

Example 23 with Variable

use of org.flyte.api.v1.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;
    }
}
Also used : Group(ucar.nc2.Group) Variable(ucar.nc2.Variable) ServiceException(loci.common.services.ServiceException) InvalidRangeException(ucar.ma2.InvalidRangeException) IOException(java.io.IOException)

Example 24 with Variable

use of org.flyte.api.v1.Variable in project packages-jpl by SWI-Prolog.

the class Time method test_3.

static void test_3() {
    Variable Y = new Variable("Y");
    Query query = new Query("noop_nobind", new Term[] { tree, Y });
    System.out.print("noop_nobind");
    for (int i = 0; i < num_trials; ++i) {
        timer.start();
        query.hasSolution();
        timer.stop();
        data[3][i] = timer.getElapsedTimeInMillis();
        System.out.print("");
    }
    System.out.println(" done");
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query)

Example 25 with Variable

use of org.flyte.api.v1.Variable in project packages-jpl by SWI-Prolog.

the class Time method test_4.

static void test_4() {
    Variable Y = new Variable("Y");
    Query query = new Query("noop_bind", new Term[] { tree, Y });
    System.out.print("noop_bind");
    for (int i = 0; i < num_trials; ++i) {
        timer.start();
        query.oneSolution();
        timer.stop();
        data[4][i] = timer.getElapsedTimeInMillis();
        System.out.print("");
    }
    System.out.println(" done");
}
Also used : Variable(org.jpl7.Variable) Query(org.jpl7.Query)

Aggregations

Variable (ucar.nc2.Variable)78 IOException (java.io.IOException)41 Variable (org.jpl7.Variable)33 Query (org.jpl7.Query)32 Term (org.jpl7.Term)29 Array (ucar.ma2.Array)21 Attribute (ucar.nc2.Attribute)21 Compound (org.jpl7.Compound)19 NetcdfFile (ucar.nc2.NetcdfFile)18 Map (java.util.Map)17 Dimension (ucar.nc2.Dimension)17 InvalidRangeException (ucar.ma2.InvalidRangeException)16 ArrayList (java.util.ArrayList)15 Atom (org.jpl7.Atom)15 ArrayDouble (ucar.ma2.ArrayDouble)14 File (java.io.File)10 List (java.util.List)9 ArrayFloat (ucar.ma2.ArrayFloat)9 WritableRaster (java.awt.image.WritableRaster)8 HashMap (java.util.HashMap)8