Package libai.io

Enum MatrixIO.Target

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MatrixIO.Target>
    Enclosing class:
    MatrixIO

    public static enum MatrixIO.Target
    extends java.lang.Enum<MatrixIO.Target>
    Serialization target
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      CSV
      Saves the matrix in csv (comma separated values) format.
      OCTAVE
      Saves the matrix in GNU Octave's binary (mat) format.
      OPENOFFICE
      Saves the matrix in a format that's compatible with the formula format of OpenOffice and LibreOffice.
      SERIAL
      Saves the matrix using the JVM serialization algorithm.
      TSV
      Saves the matrix in tsv (tab separated values) format.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MatrixIO.Target valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MatrixIO.Target[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • SERIAL

        public static final MatrixIO.Target SERIAL
        Saves the matrix using the JVM serialization algorithm.
      • CSV

        public static final MatrixIO.Target CSV
        Saves the matrix in csv (comma separated values) format.
      • TSV

        public static final MatrixIO.Target TSV
        Saves the matrix in tsv (tab separated values) format.
      • OCTAVE

        public static final MatrixIO.Target OCTAVE
        Saves the matrix in GNU Octave's binary (mat) format.

        The specification for Octave's mat format can be found a bit here and another bit here and yet another bit here

        About this implementation:

        • GNU Octave supports different matrix types (diagonal matrix, sparse matrix, etc), this method will always output a full/dense matrix format. You will be able to read it with GNU Octave, but there's a chance that if you re-save the matrix using GNU Octave the file won't be the same, since libai won't support the special cases.
        • Even though Java's default endianness is ByteOrder.BIG_ENDIAN, this matrices are saved with ByteOrder.LITTLE_ENDIAN.
        • This matrices will NOT be Matlab® compatible (never).
        • Files will not be gzipped since not all versions of GNU Octave support it
      • OPENOFFICE

        public static final MatrixIO.Target OPENOFFICE
        Saves the matrix in a format that's compatible with the formula format of OpenOffice and LibreOffice.
    • Method Detail

      • values

        public static MatrixIO.Target[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MatrixIO.Target c : MatrixIO.Target.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MatrixIO.Target valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null