Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: Français - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Files : Input/Output functions > save_format

save_format

format of files produced by "save"

Description

Variables are saved by Scilab with the save function in the following format:

each variable record is appended consecutively to the file. The variable record begins with 6 long integer holding the variable name in encoded format (see the Remarks section below), after that comes the variable type (long integer), then, depending on it, for:

Floating matrices (type 1)

row_size m (a long integer),

column_size n (a long integer),

real/complex flag it (a long integer in {0,1}),

data (n*m*(it+1) doubles)

Polynomials (type 2) and Size implicit polynomial used for indexing (type 129)

row_size m (a long integer),

column_size n (a long integer),

real/complex flag it (a long integer in {0,1}),

formal variable name (16 bytes),

index_table (m*n+1 long integers),

data ((N-1)*(it+1) doubles), where N is the value of the last entry of the index_table.

Booleans (type 4)

row_size m (a long integer),

column_size n (a long integer),

data (n*m long integers).

Floating sparse matrices (type 5)

row_size m (a long integer),

column_size n (a long integer),

real/complex_flag it (a long integer in {0,1}),

total_number_of_non_zero_elements nel (a long integer),

number_of_non_zero_elements_per_row (m long integers),

column_index_non_zero_elements (nel long integers),

non_zero_values (nel*(it+1) doubles).

Boolean sparse matrices (type 6)

row_size m (a long integer),

column_size n (a long integer),

unused it (a long integer),

total_number_of_non_zero_elements nel (a long integer),

number_of_non_zero_elements_per_row (m long integers),

column_index_non_zero_elements (nel long integers).

Matlab sparse matrix (type 7)

row_size m (a long integer),

column_size n (a long integer),

real/complex_flag it (a long integer in {0,1}),

total_number_of_non_zero_elements nel (a long integer),

number_of_non_zero_elements_per_column (n long integers),

row_index_non_zero_elements (nel long integers),

non_zero_values (nel*(it+1) doubles).

Integer matrices (type 8)

row_size m (a long integer),

column_size n (a long integer),

integer_type (a long integer): 1,2,4, or 11,12,14 for signed and unsigned 1,2,4 bytes integers,

data (n*m bytes for integer_type 1 or 11, n*m short integers for integer_type 2 or 12, n*m long integers for integer_type 4 or 14).

handles (type 9)

version (4 bytes)

row_size m (a byte),

column_size n (a byte),

data (m*n serialization_records)

A serialization_record is a flat representation of the C data structure associated with the corresponding graphic object. Each graphic object is defined by a (recursive) set of properties (see the get function).

The saved serialization_record of a graphic object is structured as follow.

serialization_record

type_length n (a byte),

type (n bytes, the ascii codes of the type name),

property_values record (variable length).

Strings (type 10)

row_size m (a long integer),

column_size n (a long integer),

index_table (n*m+1 long integers),

data (N long integers, the Scilab encoding of the characters (see code2str), where N is the value of the last entry of the index_table.

Uncompiled functions (type 11)

nout (a long integer),

lhs_names (6*nout long integers, see the Remarks section below),

nin (a long integer),

rhs_names (6*nin long integers, see the Remarks section below),

code_length N (a long integer),

code (N long integers).

Compiled functions (type 13)

nout (a long integer),

lhs_names (6*nout long integers, see the Remarks section below),

nin (a long integer),

rhs_names (6*nin long integers, see the Remarks section below),

pseudo_code_length N (a long integer),

pseudo_code (N long integers).

Libraries (type 14)

path_length np (a long integer),

path_name (np long integers: the path character codes sequence, (see code2str)),

number of names nn (a long integer),

names (6*nn long integers, see the Remarks section below).

Lists (type 15), tlists (type 16), mlists (type 17)

number of fields n (a long integer),

index (n+1 long integers),

variables_sequence (n variables, each one written according to its format).

Pointers (type 128)

Not handled

Function pointers (type 130)

function_ptr (a long integer, (see funptr)),

function_name_code (6 long integers, see the Remarks section below).

Remarks

Numbers (a long interger, a short integer, a double) are stored using the little endian convention.

The variable names are stored as a sequence of 6 long integers, with a specific encoding. See the cvname.f file for details.

See Also

  • save — Save a variable or a serie of variables in a binary file
  • load — Load a saved variable or a serie of variables
  • listvarinfile — list of variables in a saved data file
  • type — returns the type of a variable
  • typeof — object type
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:34:52 CEST 2012