help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] glp_set_row_name and glp_find_row


From: Ignacio Cartes
Subject: [Help-glpk] glp_set_row_name and glp_find_row
Date: Thu, 10 Oct 2013 02:10:16 -0300

I will like to identify some rows and cols. 
I need to create a constraints set like the code shown below and give it an ID or index to the constraints names, then find the number of some rows and give them their respective value to load the constraint matrix.

glp_add_rows(lp,a*b);
    for(int i=0; i<a; i++){
        for(int j=0; j<b; j++){
                glp_set_row_name(lp,i*a*b+j,"rest[i][j]"); //create some like "rest[i][j]"
                }
    }
glp_create_index(lp);

int ind[2];
ind[0]=glp_find_row(lp,rest[1][2]); 
ind[1]=glp_find_row(lp,rest[2][3]);

int val[2]= 1, 1;
for(i=0; i<2; i++){
glp_set_mat_row(lp, i+1, int len, ind[i], val[i]);
}


Best regards

reply via email to

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