84 lines
2.6 KiB
PHP
84 lines
2.6 KiB
PHP
<?php
|
|
|
|
namespace Arma;
|
|
|
|
/**
|
|
* Constants for saving/loading options.
|
|
*
|
|
* @package Arma
|
|
*/
|
|
abstract class FileType
|
|
{
|
|
/**
|
|
* Attempt to automatically detect the file type as one of the formats described below.
|
|
*
|
|
* Used by load() only.
|
|
*/
|
|
const AUTO_DETECT = 0;
|
|
|
|
/**
|
|
* Numerical data stored in machine dependent binary format, with a simple header to speed up loading.
|
|
* The header indicates the type and size of matrix.
|
|
*/
|
|
const ARMA_BINARY = 1;
|
|
|
|
/**
|
|
* Numerical data stored in human readable text format, with a simple header to speed up loading.
|
|
* The header indicates the type and size of matrix.
|
|
*/
|
|
const ARMA_ASCII = 2;
|
|
|
|
/**
|
|
* Numerical data stored in machine dependent raw binary format, without a header. Matrices are
|
|
* loaded to have one column.
|
|
*
|
|
* The reshape() function can be used to alter the size of the loaded matrix without losing data.
|
|
*/
|
|
const RAW_BINARY = 3;
|
|
|
|
/**
|
|
* Numerical data stored in raw ASCII format, without a header. The numbers are separated by whitespace.
|
|
* The number of columns must be the same in each row.
|
|
*
|
|
* Complex numbers are stored in standard C++ notation, which is a tuple surrounded by brackets.
|
|
*/
|
|
const RAW_ASCII = 4;
|
|
|
|
/**
|
|
* Numerical data stored in comma separated value (CSV) text format, without a header.
|
|
*
|
|
* Applicable to dense matrices only.
|
|
*/
|
|
const CSV_ASCII = 5;
|
|
|
|
/**
|
|
* Numerical data stored as a text file in coordinate list format, without a header.
|
|
* Only non-zero values are stored.
|
|
*
|
|
* Applicable only to sparse matrices.
|
|
*/
|
|
const COORD_ASCII = 6;
|
|
|
|
/**
|
|
* Image data stored in Portable Gray Map (PGM) format.
|
|
*
|
|
* Applicable to dense matrices only.
|
|
*
|
|
* Each element is copied and converted to an 8 bit representation. As such the matrix should have values
|
|
* in the [0,255] interval, otherwise the resulting image may not display correctly.
|
|
*/
|
|
const PGM_BINARY = 7;
|
|
|
|
/**
|
|
* Numerical data stored in portable HDF5 binary format.
|
|
*
|
|
* For saving, the default dataset name within the HDF5 file is "dataset". For loading, the order of
|
|
* operations is: (1) try loading a dataset named "dataset", (2) try loading a dataset named "value",
|
|
* (3) try loading the first available dataset.
|
|
*
|
|
* To explicitly control the dataset name, specify it by passing an array with the following format to the
|
|
* first argument: ['filename' => string, 'dataset' => string(default='dataset'), 'settings' => int(default=0)]
|
|
*/
|
|
const HDF5_BINARY = 8;
|
|
}
|