help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-glpk] Matrix (premulplication?) in MathProg


From: Noli Sicad
Subject: [Help-glpk] Matrix (premulplication?) in MathProg
Date: Thu, 7 Jan 2010 08:38:14 +0700

Hi,

I am having problems in formatting my LP result to represent into
maps. I need to show my LP results into maps or outputted in GIS. I
need to create 70 maps, each harvest period. This is multi period LP
model, 1 to 70 years planning period.

Inorder to do this, I need to have one-to-one table relationship as
required by GIS file system (i.e. shapefile). Shapefile requires this
relationship to properly render the maps and polygon, one polygon, one
row of data.

Here is my problem, I need the LP result transpose (I wish there is
transpose function in MathProg in results section).  Now, I created 2
matrixes / tables and put into one matrix / table.

Here are the tables / matrixes (below). Someone suggested in R-help ML
that probably "matrix premultiplication" can do this.

I think MathProg can do this, but I don't know how.

Thanks in Advance.

Noli

~~~~~~~~~~~~~~~~~~~~~~~
Matrix A

Harvest_LP_result_cut.
~~~~~~~~~~~~~~~~~

Crop_ID Croptype        Period  Cut_Age
1       SORI    1       31
1       SORI    1       32
1       SORI    1       33
1       SORI    1       34
2       SORI    2       30
2       SORI    2       31
2       SORI    2       32
2       SORM    2       37
3       OTRM    3       33
3       SORI    3       30
3       SORM    3       38
4       SORI    4       30
4       SORM    4       38
5       OTRI    5       30
5       OTRM    5       34
5       SORM    5       37
5       SORM    5       38
5       SORM    5       40
6       OTRI    6       28
6       OTRI    6       29
6       OTRI    6       30
6       OTRM    6       32
6       OTRM    6       33
6       OTRM    6       34
7       OTRM    7       33
8       OTRM    8       34
9       OTRM    9       35
10      OTRM    10      34
10      OTRM    10      35
10      OTRM    10      36
10      SORM    10      41
~~~~~~~~~~~~~~~~~~~~~~~~~~

Matrix B - template.
        P1      P2      P3      P4      P5      P6      P7      P8      P9      
P10
1       1       0       0       0       0       0       0       0       0       0
2       1       0       0       0       0       0       0       0       0       0
3       1       0       0       0       0       0       0       0       0       0
4       1       0       0       0       0       0       0       0       0       0
5       0       2       0       0       0       0       0       0       0       0
6       0       2       0       0       0       0       0       0       0       0
7       0       2       0       0       0       0       0       0       0       0
8       0       2       0       0       0       0       0       0       0       0
9       0       0       3       0       0       0       0       0       0       0
10      0       0       3       0       0       0       0       0       0       0
11      0       0       3       0       0       0       0       0       0       0
12      0       0       0       4       0       0       0       0       0       0
13      0       0       0       4       0       0       0       0       0       0
14      0       0       0       0       5       0       0       0       0       0
15      0       0       0       0       5       0       0       0       0       0
16      0       0       0       0       5       0       0       0       0       0
17      0       0       0       0       5       0       0       0       0       0
18      0       0       0       0       5       0       0       0       0       0
19      0       0       0       0       0       6       0       0       0       0
20      0       0       0       0       0       6       0       0       0       0
21      0       0       0       0       0       6       0       0       0       0
22      0       0       0       0       0       6       0       0       0       0
23      0       0       0       0       0       6       0       0       0       0
24      0       0       0       0       0       6       0       0       0       0
25      0       0       0       0       0       0       7       0       0       0
26      0       0       0       0       0       0       0       8       0       0
27      0       0       0       0       0       0       0       0       9       0
28      0       0       0       0       0       0       0       0       0       
10
29      0       0       0       0       0       0       0       0       0       
10
30      0       0       0       0       0       0       0       0       0       
10
31      0       0       0       0       0       0       0       0       0       
10

Needed Table.
~~~~~~~~~~
Crop_ID Croptype        P1      P2      P3      P4      P5      P6      P7      
P8      P9      P10
1       SORI    31      0       0       0       0       0       0       0       
0       0
1       SORI    32      0       0       0       0       0       0       0       
0       0
1       SORI    33      0       0       0       0       0       0       0       
0       0
1       SORI    34      0       0       0       0       0       0       0       
0       0
2       SORI    0       30      0       0       0       0       0       0       
0       0
2       SORI    0       31      0       0       0       0       0       0       
0       0
2       SORI    0       32      0       0       0       0       0       0       
0       0
2       SORM    0       37      0       0       0       0       0       0       
0       0
3       OTRM    0       0       33      0       0       0       0       0       
0       0
3       SORI    0       0       30      0       0       0       0       0       
0       0
3       SORM    0       0       38      0       0       0       0       0       
0       0
4       SORI    0       0       0       30      0       0       0       0       
0       0
4       SORM    0       0       0       38      0       0       0       0       
0       0
5       OTRI    0       0       0       0       30      0       0       0       
0       0
5       OTRM    0       0       0       0       34      0       0       0       
0       0
5       SORM    0       0       0       0       37      0       0       0       
0       0
5       SORM    0       0       0       0       38      0       0       0       
0       0
5       SORM    0       0       0       0       40      0       0       0       
0       0
6       OTRI    0       0       0       0       0       28      0       0       
0       0
6       OTRI    0       0       0       0       0       29      0       0       
0       0
6       OTRI    0       0       0       0       0       30      0       0       
0       0
6       OTRM    0       0       0       0       0       32      0       0       
0       0
6       OTRM    0       0       0       0       0       33      0       0       
0       0
6       OTRM    0       0       0       0       0       34      0       0       
0       0
7       OTRM    0       0       0       0       0       0       33      0       
0       0
8       OTRM    0       0       0       0       0       0       0       34      
0       0
9       OTRM    0       0       0       0       0       0       0       0       
35      0
10      OTRM    0       0       0       0       0       0       0       0       
0       34
10      OTRM    0       0       0       0       0       0       0       0       
0       35
10      OTRM    0       0       0       0       0       0       0       0       
0       36
10      SORM    0       0       0       0       0       0       0       0       
0       41




reply via email to

[Prev in Thread] Current Thread [Next in Thread]