c++ - How to pass IloNumArray as an argument by reference -


i want pass ilonumarray argument reference in function this:

void myfuntion(...., ilonumarray & x, ...) {   // ... } 

i know not correct. there other alternative?

it's considered 'wrong' pass iloxxx objects reference because handles pointing actual data, cost of passing iloxxx object same cost off passing reference. semantics of copying iloxxx objects passing reference, so

void myfunction(ilonumarray x) {   x[0] = 1.0; }  iloenv env; // create array 1 element, value of 0 ilonumarray x(env, 1, 0.0); myfunction(x); cout << x[0] << endl; // 1.0 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -