addRow vs addRows #3123
|
Hi @jajhall, @galabovaa Very quick question for you guys: I have a dummy code that basically does the following: // Creating n constraints and saving the row index in an array // For performance reasons, I would like to use the the addRows method The key for the me here is to be sure the addRows method doesn't change the order of the constraints: i.e. I need to be sure that the constraint stored on row i is the one that has the indices= [i, i+1] and values=[3*i; -2]. I am not a C specialist but have looked at the source code and it looks like addRow actually calls addRows underneath which makes me believe that switching from one implementation to the other is safe. Would you be kind enough to confirm? Thank you |
Replies: 1 comment 1 reply
|
Yes, whether you're adding one row or several, they are added after the current rows in the model, and with the order of rows preserved when more than one is added |
Yes, whether you're adding one row or several, they are added after the current rows in the model, and with the order of rows preserved when more than one is added