PSG Matrix can be specified in Packed Matrix (pmatrix) Format, which contains only nonzero elements.

Syntax

pmatrix_<pmatrix_name>

 

Description

 

Packed Matrix (pmatrix) contains only non-zero elements of matrix. This format is recommended for large sparse matrices.

The first row of  Packed Matrix coincides with the first row of the unpacked PSG Matrix. The second and further rows define one nonzero element from the unpacked matrix in the following format:

<row number in unpacked PSG Matrix> <number of column in unpacked PSG Matrix> <value of element>

 

Remarks

 

Packed Matrix format is not available in Shell Environment.
Problems with matrices in   Packed Matrix format may be imported to Shell Environment from General (Text) Format of PSG. In this case, packed matrices are transformed to the unpacked format.

 

Example 1 (without id column)

 

Matrix in unpacked format:

 

x1        x2        x3        scenario_probability        scenario_benchmark

0.0        0.0        10.0                        1.0e-001                0

0.0        20.0        0.0                  2.0e-001                0

30.0        0.0        0.0                        2.0e-001                0

0.0        40.0        0.0                        5.0e-001                0

 

Matrix in packed format::

 

x1        x2        x3        scenario_probability        scenario_benchmark

1        3        10.0

1        4        1.0e-001

2        2        20.0

2        4        2.0e-001

3        1        30.0

3        4        2.0e-001

4        2        40.0

4        4        5.0e-001

 

 

Example 2 (with id column)

 

Matrix in unpacked format:

 

id        x1        x2        x3        scenario_probability        scenario_benchmark

1        0.0        0.0        10.0                        1.0e-001                0

2        0.0        20.0        0.0                  2.0e-001                0

3        30.0        0.0        0.0                        2.0e-001                0

4        0.0        40.0        0.0                        5.0e-001                0

 

Matrix in packed format::

 

id        x1        x2        x3        scenario_probability        scenario_benchmark

1        1        1

1        4        10.0

1        5        1.0e-001

2        1        2

2        3        20.0

2        5        2.0e-001

3        1        3

3        2        30.0

3        5        2.0e-001

4        1        4

4        3        40.0

4        5        5.0e-001

 

See also

Matrix of Scenarios, PSG PMatrix in MATLAB