void CONSTR_LOAD_PF_allocate(Constr* c) { // Local variables int num_constr; int num_vars; int A_nnz; num_vars = NET_get_num_vars(CONSTR_get_network(c)); num_constr = CONSTR_get_A_row(c); A_nnz = CONSTR_get_A_nnz(c); // J f CONSTR_set_J(c,MAT_new(0,num_vars,0)); CONSTR_set_f(c,VEC_new(0)); // A b CONSTR_set_A(c,MAT_new(num_constr, // rows num_vars, // cols A_nnz)); // nnz CONSTR_set_b(c,VEC_new(num_constr)); // G l u CONSTR_set_l(c,VEC_new(0)); CONSTR_set_u(c,VEC_new(0)); CONSTR_set_G(c,MAT_new(0, // rows num_vars, // cols 0)); // nnz }
void CONSTR_FIX_allocate(Constr* c) { // Local variables int num_constr; int num_vars; int A_nnz; // Constr data num_vars = NET_get_num_vars(CONSTR_get_network(c)); num_constr = CONSTR_get_A_row(c); A_nnz = CONSTR_get_A_nnz(c); // J f CONSTR_set_J(c,MAT_new(0,num_vars,0)); CONSTR_set_f(c,VEC_new(0)); // G l u CONSTR_set_G(c,MAT_new(0,num_vars,0)); CONSTR_set_l(c,VEC_new(0)); CONSTR_set_u(c,VEC_new(0)); // b CONSTR_set_b(c,VEC_new(num_constr)); // A CONSTR_set_A(c,MAT_new(num_constr, // size1 (rows) num_vars, // size2 (cols) A_nnz)); // nnz }
void CONSTR_DC_FLOW_LIM_allocate(Constr* c) { // Local variables Net* net; int num_br; int num_vars; int Gcounter; net = CONSTR_get_network(c); num_br = NET_get_num_branches(net); num_vars = NET_get_num_vars(net); Gcounter = CONSTR_get_Gcounter(c); // J f CONSTR_set_J(c,MAT_new(0,num_vars,0)); CONSTR_set_f(c,VEC_new(0)); // A b CONSTR_set_A(c,MAT_new(0,num_vars,0)); CONSTR_set_b(c,VEC_new(0)); // h CONSTR_set_l(c,VEC_new(num_br)); CONSTR_set_u(c,VEC_new(num_br)); // G CONSTR_set_G(c,MAT_new(num_br, // size1 (rows) num_vars, // size2 (cols) Gcounter)); // nnz }