Package eu.simuline.octave.io.impl

Provides the implementations of the services specified in eu.simuline.octave.io.spi; one for each octave type given in octave via typeinfo. The reader classes are in META-INF/services/eu.simuline.octave.io.OctaveDataReader whereas the writer classes are in META-INF/services/eu.simuline.octave.io.OctaveDataWriter. Consequently, the classes are given by the following table
index octave class java class reader writer
1 "<unknown type>" --- --- ---
2 "cell" OctaveCell CellReader CellWriter
3 "scalar" see 5 ScalarReader see 5
4 "complex scalar" see 7 ComplexScalarReader see 7
5 "matrix" OctaveDouble MatrixReader MatrixWriter
6 "diagonal matrix" --- --- ---
7 "complex matrix" OctaveComplex ComplexMatrixReader ???
8 "complex diagonal matrix" --- --- ---
9 "range" OctaveFake FakeRangeReader FakeWriter
10 "bool" see 11 BooleanSingleReader see 11
11 "bool matrix" OctaveBoolean BooleanReader BooleanWriter
12 "string" OctaveString OctaveStringReader OctaveStringWriter/---
13 "sq_string" see 12 OctaveSqStringReader OctaveStringWriter/---
14 "int8 scalar" --- --- ---
15 "int16 scalar" --- --- ---
16 "int32 scalar" see 24 Int32ScalarReader see 24
17 "int64 scalar" see 25 Int64ScalarReader see 25
18 "uint8 scalar" --- --- ---
19 "uint16 scalar" --- --- ---
20 "uint32 scalar" --- --- ---
21 "uint64 scalar" --- --- ---
22 "int8 matrix" --- --- ---
23 "int16 matrix" --- --- ---
24 "int32 matrix" OctaveInt Int32MatrixReader Int32MatrixWriter
25 "int64 matrix" OctaveLong Int64MatrixReader Int64MatrixWriter
26 "uint8 matrix" --- --- ---
26 "uint8 matrix" Uint?? use OctaveInt with int32 do not use: Uint8MatrixReader ---
27 "uint16 matrix" --- --- ---
28 "uint32 matrix" --- --- ---
29 "uint64 matrix" --- --- ---
30 "sparse bool matrix" OctaveSparseBoolean SparseBooleanReader SparseBooleanWriter
31 "sparse matrix" --- --- ---
32 "sparse complex matrix" --- --- ---
33 "struct" OctaveStruct StructReader StructWriter
34 "scalar struct" OctaveStruct ScalarStructReader ---
35 "class" --- --- ---
36 "cs-list" --- --- ---
37 "magic-colon" --- --- ---
38 "built-in function" --- --- ---
39 "user-defined function" --- --- ---
40 "dynamically-linked function" --- --- ---
41 "function handle" OctaveFunctionHandle ???? FunctionHandleWriter
42 "inline function" (which will be deprecated) --- --- ---
43 "float scalar" --- --- ---
44 "float complex scalar" --- --- ---
45 "float matrix" --- --- ---
46 "float diagonal matrix" --- --- ---
47 "float complex matrix" --- --- ---
48 "float complex diagonal matrix" --- --- ---
49 "permutation matrix" --- --- ---
50 "null_matrix" --- --- ---
51 "null_string" --- --- ---
52 "null_sq-string" --- --- ---
53 "lazy_index" --- --- ---
54 "onCleanup" --- --- ---
55 "octave_java" --- --- ---
56 "object" --- --- ---
does not take fake into account (see below). does not take very much integer types into account (see below). The unsigned have no correspondence in current java version, from the signed ones we just support octave int32, i.e. java int.

There three categories of basic types in octave: boolean, floating point and integer.

  • bool is the boolean (scalar) type,
  • double and float are the floating point (scalar) types,
  • int8, int16, int32 and int64, are the signed (scalar) integer types and uint8, uint16, uint32 and uint64, are the according unsigned (scalar) integer types.

Principally, all these types may be vector valued, matrix valued or even in higher dimensions. To express this, they are endowed with the suffix matrix even for higher dimensions and are thus called bool matrix, float matrix, int8 matrix, int16 matrix, int32 matrix and int64 matrix and accordingly for the unsigned integers. Since double is the standard type occurring most frequently, what should be called double matrix is just called matrix.

Likewise, if endowed with the suffix scalar, only scalars, i.e. 1x1 matrices are allowed. This type is to spare memory, i.e. the format information. likewise, double scalar is just called scalar and bool scalar is just called bool, which seems strange but comes from the fact, that bools mostly come as scalars. The other names are regular, as int8 scalar, int16 scalar, int32 scalar and int64 scalar. Although strutcs are not atomic but as the name says structures, they can in general be array valued. If not, it is a scalar struct, in the general case it is just a struct Note that this is the only case where the text scalar is prefixed (since scalar itself is short for double scalar).

For the moment, we do not treat complex types.

Floating matrix types may be diagonal. Thus we have double diagonal matrix called just diagonal matrix, float diagonal matrix.

Floating matrix types and also boolean matrices may be sparse. Thus we have double sparse matrix called just sparse matrix, but no float sparse matrix.

  • BooleanReader/ BooleanWriter for reading/writing octave (double) "bool matrix"s represented by OctaveBoolean.

    There is also a BooleanSingleReader for reading octave (scalar) "bool"s whereas no BooleanSingleWriter is provided.

  • CellReader/ CellWriter for reading/writing octave "cell"s represented by OctaveCell.
  • MatrixReader/ MatrixWriter for reading/writing octave (double) "matrix"s represented by OctaveDouble.

    There is also a ScalarReader for reading octave (double) "scalar"s whereas no ScalarWriter is provided.

  • ComplexMatrixReader/ ComplexScalarReader for reading octave (double) "complex matrix"s and "complex scalar"s both represented by OctaveComplex.

    Both ComplexMatrixWriter and ComplexScalarWriter are missing.

  • FakeRangeReader ***** and FakeWriter... maybe for ranges. Seemingly, FakeRangeReader is not fully functional. Both read/write OctaveFake; package eu.simuline.octave.type does not contain a class representing range explicitly.
  • FunctionHandleWriter for writing octave "function handle"s represented by OctaveFunctionHandle. CAUTION: there is no according reader.

    There is no support for octave types "built-in function", "user-defined function", "dynamically-linked function", "inline function" (which will be deprecated).

  • OctaveStringReader/ OctaveStringWriter for reading/writing octave "string"s represented by OctaveString. CAUTION: There is also an OctaveSqStringReader, which is not fully functional: It reads like OctaveStringReader and performs an additional check to ensure that the octave "sq_string" can be in fact represented by an octave "string". Thus OctaveStringReader and OctaveSqStringReader share the same writer OctaveStringWriter.
  • StructReader/ StructWriter for reading/writing octave "struct"s represented by OctaveStruct.

    There is also a ScalarStructReader for reading octave "scalar struct"s (which is optimized for 1x1 structs) also into OctaveStruct. There is no according ScalarStructWriter.

  • SparseBooleanReader/ SparseBooleanWriter for reading/writing octave "sparse bool matrix"s represented by OctaveSparseBoolean.

    Note that there is no treatment for the octave types "sparse matrix" representing doubles and "sparse complex matrix".

  • Uint8MatrixReader for readingoctave (double) "uint8 matrix"s represented by OctaveInt. There is no according writer. Also there are no reader/writer for other octave integer types: "uint8 scalar", and in both variants, scalar and matrix, and signed/unsigned "int16", "int32", "int64". Note that java has no type corresponding with "uint64".
  • Both, (real) "diagonal matrix" and "complex diagonal matrix" reader/writer are missing.
  • There is no support for octave type "octave_java"
  • There is no support for octave types "class", "cs-list", "magic-colon", "lazy_index" "onCleanup", "object".
  • There is no support for octave "float" types: neither scalar, nor matrix, neither real nor complex, and not for diagonal matrices.
  • There is no support for octave "permutation matrix".
  • There is no support for octave "null_matrix", "null_string" nor "null_sq_string".
  • Of course, there cannot be a reader/writer for octave's unknown type.