简体   繁体   中英

How to import excel into Cplex if not all the cells in excel matrix are filled with number?

The questions before are neither about filling cells or about reading a certain cell.

Already tried to key in excel data into "data" sheet of Cplex, but we require really big scope of data so manually key in will not be possible.

B from SheetRead(sheet,"'Original+B+R+S'!J2:O41");

Error shows that cannot read the matrix from excel sheet. We are thinking whether it's because some cells in excel are empty and some are with numbers. Really thanks a lot for the help.

Turning my comment into an answer:

In case you have sparse data in Excel you have two options:

  1. You can mark non-existent values with a special marker value, for example infinity or something very big/small. Sometimes even 0 (zero) can serve as a marker.
  2. You can use tuples in OPL. This way you only have to specify the list of elements that are non-zero. This is usually much more compact and saves quite some memory. Take a look at the chapter about sparse data in the online user manual.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM