diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fb2e8c7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.bak +.DS_Store diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..f1ceb9c --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [2015] [IBM Corporation] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png b/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png new file mode 100644 index 0000000..e1e198f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map b/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map new file mode 100644 index 0000000..81faaac --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png b/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png new file mode 100644 index 0000000..58596ff Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png differ diff --git a/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map b/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map new file mode 100644 index 0000000..a984c77 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png b/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png new file mode 100644 index 0000000..a7909be Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map b/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map new file mode 100644 index 0000000..1bf0e05 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png b/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png new file mode 100644 index 0000000..b64ff49 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map b/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map new file mode 100644 index 0000000..ec2dd7c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png b/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png new file mode 100644 index 0000000..86c8538 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png differ diff --git a/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map b/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map new file mode 100644 index 0000000..5dbcf1d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png b/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png new file mode 100644 index 0000000..8d37974 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png differ diff --git a/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map b/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map new file mode 100644 index 0000000..eb3b2f8 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png b/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png new file mode 100644 index 0000000..861f207 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map b/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map new file mode 100644 index 0000000..b14c728 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png b/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png new file mode 100644 index 0000000..80db9ff Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map b/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map new file mode 100644 index 0000000..7d5dfe1 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png b/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png new file mode 100644 index 0000000..4642db0 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map b/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map new file mode 100644 index 0000000..a70aa0e --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png b/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png new file mode 100644 index 0000000..820ff1b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map b/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map new file mode 100644 index 0000000..107d5a0 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png b/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png new file mode 100644 index 0000000..8f3df78 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map b/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map new file mode 100644 index 0000000..5b395ae --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png b/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png new file mode 100644 index 0000000..74cdca5 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map b/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map new file mode 100644 index 0000000..ae83296 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png b/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png new file mode 100644 index 0000000..1956548 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png differ diff --git a/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map b/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map new file mode 100644 index 0000000..1e21327 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png b/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png new file mode 100644 index 0000000..f869434 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png differ diff --git a/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map b/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map new file mode 100644 index 0000000..e00aab5 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png b/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png new file mode 100644 index 0000000..0a09369 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map b/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map new file mode 100644 index 0000000..0eee586 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png b/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png new file mode 100644 index 0000000..536a37a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png differ diff --git a/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map b/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map new file mode 100644 index 0000000..cb19945 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png b/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png new file mode 100644 index 0000000..fc39a7c Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png differ diff --git a/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map b/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map new file mode 100644 index 0000000..e761245 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png b/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png new file mode 100644 index 0000000..ea95f96 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map b/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map new file mode 100644 index 0000000..5d39c52 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png b/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png new file mode 100644 index 0000000..5e5dd15 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png differ diff --git a/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map b/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map new file mode 100644 index 0000000..74fa6ad --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png b/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png new file mode 100644 index 0000000..2e345d1 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png differ diff --git a/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map b/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map new file mode 100644 index 0000000..942c711 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png b/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png new file mode 100644 index 0000000..16ae02b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map b/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map new file mode 100644 index 0000000..d343125 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png b/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png new file mode 100644 index 0000000..20a3d20 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png differ diff --git a/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map b/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map new file mode 100644 index 0000000..68b608f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png b/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png new file mode 100644 index 0000000..d2d5111 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png differ diff --git a/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map b/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map new file mode 100644 index 0000000..6c5d31d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png b/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png new file mode 100644 index 0000000..e3d5a26 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png differ diff --git a/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map b/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map new file mode 100644 index 0000000..398f4bb --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png b/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png new file mode 100644 index 0000000..901761f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png differ diff --git a/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map b/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map new file mode 100644 index 0000000..404f3c9 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png b/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png new file mode 100644 index 0000000..6121005 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map b/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map new file mode 100644 index 0000000..0f27d94 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png b/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png new file mode 100644 index 0000000..afd93c4 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png differ diff --git a/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map b/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map new file mode 100644 index 0000000..be3a2c0 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png b/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png new file mode 100644 index 0000000..0ff8dde Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map b/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map new file mode 100644 index 0000000..9a6f112 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png b/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png new file mode 100644 index 0000000..0552b1d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png differ diff --git a/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map b/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map new file mode 100644 index 0000000..5823778 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png b/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png new file mode 100644 index 0000000..eb99507 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map b/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map new file mode 100644 index 0000000..4cdc121 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png b/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png new file mode 100644 index 0000000..2c144bc Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png differ diff --git a/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map b/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map new file mode 100644 index 0000000..f3c7b58 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png b/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png new file mode 100644 index 0000000..30e0d17 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map b/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map new file mode 100644 index 0000000..8b43bc5 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png b/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png new file mode 100644 index 0000000..fedd0b6 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map b/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map new file mode 100644 index 0000000..bf92544 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png b/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png new file mode 100644 index 0000000..ea148bb Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map b/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map new file mode 100644 index 0000000..a2c5ed2 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png b/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png new file mode 100644 index 0000000..26487e8 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map b/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map new file mode 100644 index 0000000..533f2f8 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png b/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png new file mode 100644 index 0000000..54c6ce6 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png differ diff --git a/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map b/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map new file mode 100644 index 0000000..6b8b15d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png b/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png new file mode 100644 index 0000000..ce2287e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map b/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map new file mode 100644 index 0000000..849fbea --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png b/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png new file mode 100644 index 0000000..03b4fb2 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png differ diff --git a/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map b/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map new file mode 100644 index 0000000..ffaf7f8 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png b/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png new file mode 100644 index 0000000..146a08d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map b/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map new file mode 100644 index 0000000..76d5d8e --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png b/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png new file mode 100644 index 0000000..fa72142 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png differ diff --git a/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map b/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map new file mode 100644 index 0000000..b34a647 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png b/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png new file mode 100644 index 0000000..b5f9239 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map b/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map new file mode 100644 index 0000000..d5c6ee7 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png b/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png new file mode 100644 index 0000000..9595cbc Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png differ diff --git a/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map b/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map new file mode 100644 index 0000000..c6ef302 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png b/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png new file mode 100644 index 0000000..d3f9ee0 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map b/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map new file mode 100644 index 0000000..0f41cc0 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png b/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png new file mode 100644 index 0000000..ba169f5 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map b/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map new file mode 100644 index 0000000..ca74487 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png b/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png new file mode 100644 index 0000000..e2fbf4b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map b/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map new file mode 100644 index 0000000..1e6bb17 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png b/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png new file mode 100644 index 0000000..d6f38dd Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map b/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map new file mode 100644 index 0000000..10df119 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png b/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png new file mode 100644 index 0000000..69197c3 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map b/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map new file mode 100644 index 0000000..b6074e2 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png b/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png new file mode 100644 index 0000000..5348d7d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png differ diff --git a/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map b/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map new file mode 100644 index 0000000..1c5aafa --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png b/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png new file mode 100644 index 0000000..96292e2 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png differ diff --git a/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map b/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map new file mode 100644 index 0000000..3d76e21 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png b/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png new file mode 100644 index 0000000..4c02e5f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png differ diff --git a/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map b/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map new file mode 100644 index 0000000..d934cbd --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png b/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png new file mode 100644 index 0000000..8297194 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map b/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map new file mode 100644 index 0000000..c0c887a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png b/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png new file mode 100644 index 0000000..1093edd Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map b/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map new file mode 100644 index 0000000..7ab2006 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png b/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png new file mode 100644 index 0000000..a709ea4 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png differ diff --git a/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map b/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map new file mode 100644 index 0000000..fa8c961 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png b/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png new file mode 100644 index 0000000..9510844 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map b/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map new file mode 100644 index 0000000..8fa336e --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png b/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png new file mode 100644 index 0000000..00620c5 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png differ diff --git a/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map b/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map new file mode 100644 index 0000000..cfb2df9 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png b/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png new file mode 100644 index 0000000..5183cb1 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png differ diff --git a/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map b/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map new file mode 100644 index 0000000..547237b --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png b/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png new file mode 100644 index 0000000..633c64b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map b/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map new file mode 100644 index 0000000..d59a750 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png b/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png new file mode 100644 index 0000000..0051d82 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png differ diff --git a/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map b/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map new file mode 100644 index 0000000..bda8e01 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png b/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png new file mode 100644 index 0000000..f9ed887 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png differ diff --git a/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map b/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map new file mode 100644 index 0000000..4e6396d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png b/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png new file mode 100644 index 0000000..2f1c3b4 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png differ diff --git a/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map b/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map new file mode 100644 index 0000000..d7da03a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png b/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png new file mode 100644 index 0000000..7094f37 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png differ diff --git a/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map b/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map new file mode 100644 index 0000000..0e8ca03 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png b/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png new file mode 100644 index 0000000..421362d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png differ diff --git a/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map b/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map new file mode 100644 index 0000000..a3c46e7 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png b/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png new file mode 100644 index 0000000..139a066 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map b/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map new file mode 100644 index 0000000..851014c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png b/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png new file mode 100644 index 0000000..8a4519b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png differ diff --git a/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map b/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map new file mode 100644 index 0000000..86b8eaf --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png b/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png new file mode 100644 index 0000000..8a6a993 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png differ diff --git a/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map b/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map new file mode 100644 index 0000000..b1f2894 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png b/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png new file mode 100644 index 0000000..6ed527a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map b/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map new file mode 100644 index 0000000..20fb609 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png b/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png new file mode 100644 index 0000000..3e48444 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png differ diff --git a/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map b/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map new file mode 100644 index 0000000..6339d1c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png b/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png new file mode 100644 index 0000000..a70f440 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png differ diff --git a/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map b/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map new file mode 100644 index 0000000..f0ce79c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png b/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png new file mode 100644 index 0000000..53ae929 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png differ diff --git a/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map b/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map new file mode 100644 index 0000000..62d7c18 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png b/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png new file mode 100644 index 0000000..ae39fc2 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map b/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map new file mode 100644 index 0000000..02d7d56 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png b/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png new file mode 100644 index 0000000..fd6bb3e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map b/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map new file mode 100644 index 0000000..f9987d9 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png b/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png new file mode 100644 index 0000000..df0bd68 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png differ diff --git a/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map b/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map new file mode 100644 index 0000000..8b2a90f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png b/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png new file mode 100644 index 0000000..c28887d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png differ diff --git a/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map b/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map new file mode 100644 index 0000000..ef32466 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png b/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png new file mode 100644 index 0000000..9905449 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png differ diff --git a/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map b/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map new file mode 100644 index 0000000..ce7ea09 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png b/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png new file mode 100644 index 0000000..c38eb01 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map b/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map new file mode 100644 index 0000000..9e46112 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png b/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png new file mode 100644 index 0000000..dc870db Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png differ diff --git a/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map b/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map new file mode 100644 index 0000000..fffdaf1 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png b/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png new file mode 100644 index 0000000..c4fd673 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png differ diff --git a/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map b/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map new file mode 100644 index 0000000..f3b759b --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png b/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png new file mode 100644 index 0000000..4a5bb30 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png differ diff --git a/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map b/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map new file mode 100644 index 0000000..5a9c836 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png b/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png new file mode 100644 index 0000000..9e94acd Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map b/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map new file mode 100644 index 0000000..8e4a4b0 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png b/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png new file mode 100644 index 0000000..f891b73 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map b/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map new file mode 100644 index 0000000..c333c89 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png b/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png new file mode 100644 index 0000000..33b1e59 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map b/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map new file mode 100644 index 0000000..23ddbce --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png b/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png new file mode 100644 index 0000000..4084125 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map b/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map new file mode 100644 index 0000000..0f8506c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png b/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png new file mode 100644 index 0000000..e79c1bb Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png differ diff --git a/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map b/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map new file mode 100644 index 0000000..e206c30 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png b/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png new file mode 100644 index 0000000..5ff9e42 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png differ diff --git a/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map b/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map new file mode 100644 index 0000000..9d6e376 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png b/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png new file mode 100644 index 0000000..633c32e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png differ diff --git a/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map b/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map new file mode 100644 index 0000000..e0bbd6c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png b/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png new file mode 100644 index 0000000..a882a98 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map b/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map new file mode 100644 index 0000000..3f2bfe3 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png b/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png new file mode 100644 index 0000000..8aa0895 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png differ diff --git a/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map b/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map new file mode 100644 index 0000000..e43e784 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png b/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png new file mode 100644 index 0000000..7c132b8 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png differ diff --git a/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map b/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map new file mode 100644 index 0000000..e479009 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png b/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png new file mode 100644 index 0000000..b035189 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png differ diff --git a/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map b/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map new file mode 100644 index 0000000..138088f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png b/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png new file mode 100644 index 0000000..53ae929 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png differ diff --git a/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map b/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map new file mode 100644 index 0000000..ec3dc8e --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png b/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png new file mode 100644 index 0000000..d727754 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png differ diff --git a/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map b/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map new file mode 100644 index 0000000..de4ef87 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png b/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png new file mode 100644 index 0000000..3f2e93d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map b/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map new file mode 100644 index 0000000..323f0b3 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png b/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png new file mode 100644 index 0000000..4fc538c Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png differ diff --git a/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map b/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map new file mode 100644 index 0000000..852bcd7 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png b/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png new file mode 100644 index 0000000..21a18b2 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map b/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map new file mode 100644 index 0000000..3be2c95 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png b/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png new file mode 100644 index 0000000..3052e8b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png differ diff --git a/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map b/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map new file mode 100644 index 0000000..572eadd --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png b/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png new file mode 100644 index 0000000..a6c9f76 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map b/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map new file mode 100644 index 0000000..84b0ead --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png b/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png new file mode 100644 index 0000000..35cfc69 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png differ diff --git a/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map b/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map new file mode 100644 index 0000000..a479708 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png b/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png new file mode 100644 index 0000000..258e21e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png differ diff --git a/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map b/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map new file mode 100644 index 0000000..2e02969 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png b/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png new file mode 100644 index 0000000..9d9ccab Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png differ diff --git a/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map b/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map new file mode 100644 index 0000000..8c2723a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png b/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png new file mode 100644 index 0000000..e9ac006 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png differ diff --git a/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map b/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map new file mode 100644 index 0000000..f9e90e1 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png b/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png new file mode 100644 index 0000000..b0afaca Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map b/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map new file mode 100644 index 0000000..ec38e42 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png b/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png new file mode 100644 index 0000000..edfad73 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map b/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map new file mode 100644 index 0000000..749f410 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png b/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png new file mode 100644 index 0000000..1b72401 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png differ diff --git a/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map b/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map new file mode 100644 index 0000000..fa2e462 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png b/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png new file mode 100644 index 0000000..f3c8b20 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png differ diff --git a/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map b/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map new file mode 100644 index 0000000..dba8bec --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png b/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png new file mode 100644 index 0000000..6ab220a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png differ diff --git a/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map b/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map new file mode 100644 index 0000000..199e008 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png b/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png new file mode 100644 index 0000000..9b155ce Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map b/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map new file mode 100644 index 0000000..fa3a0e0 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png b/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png new file mode 100644 index 0000000..a834b15 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map b/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map new file mode 100644 index 0000000..9deae5c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png b/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png new file mode 100644 index 0000000..dfd3b3d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map b/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map new file mode 100644 index 0000000..2506b53 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png b/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png new file mode 100644 index 0000000..d332b23 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map b/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map new file mode 100644 index 0000000..844217d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png b/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png new file mode 100644 index 0000000..2dfec59 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map b/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map new file mode 100644 index 0000000..54e1e1c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png b/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png new file mode 100644 index 0000000..cd92731 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map b/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map new file mode 100644 index 0000000..51e1a0c --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png b/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png new file mode 100644 index 0000000..78ef13b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png differ diff --git a/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map b/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map new file mode 100644 index 0000000..d1151d5 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png b/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png new file mode 100644 index 0000000..d7fd659 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png differ diff --git a/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map b/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map new file mode 100644 index 0000000..081547a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png b/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png new file mode 100644 index 0000000..0d29c75 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png differ diff --git a/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map b/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map new file mode 100644 index 0000000..9e90315 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png b/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png new file mode 100644 index 0000000..30f3611 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png differ diff --git a/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map b/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map new file mode 100644 index 0000000..3d2c360 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png b/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png new file mode 100644 index 0000000..0f2130f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png differ diff --git a/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map b/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map new file mode 100644 index 0000000..10cc703 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png b/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png new file mode 100644 index 0000000..916a450 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png differ diff --git a/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map b/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map new file mode 100644 index 0000000..cd89c75 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png b/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png new file mode 100644 index 0000000..46bdfcf Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map b/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map new file mode 100644 index 0000000..41050e9 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png b/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png new file mode 100644 index 0000000..c2e7402 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png differ diff --git a/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map b/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map new file mode 100644 index 0000000..241e845 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png b/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png new file mode 100644 index 0000000..a4ffdae Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map b/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map new file mode 100644 index 0000000..28d2a5d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png b/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png new file mode 100644 index 0000000..1eb5bb9 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map b/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map new file mode 100644 index 0000000..43738fb --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png b/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png new file mode 100644 index 0000000..d9cdabb Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map b/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map new file mode 100644 index 0000000..01d4e36 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png b/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png new file mode 100644 index 0000000..264d2ed Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map b/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map new file mode 100644 index 0000000..05f3e94 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png b/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png new file mode 100644 index 0000000..a882a98 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map b/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map new file mode 100644 index 0000000..3d88bdf --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png b/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png new file mode 100644 index 0000000..54fcb9f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map b/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map new file mode 100644 index 0000000..e82f948 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png b/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png new file mode 100644 index 0000000..ab8a75b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png differ diff --git a/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map b/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map new file mode 100644 index 0000000..8ef2db8 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png b/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png new file mode 100644 index 0000000..e68bd02 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map b/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map new file mode 100644 index 0000000..d528c30 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png b/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png new file mode 100644 index 0000000..7049b2e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map b/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map new file mode 100644 index 0000000..0df06ae --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png b/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png new file mode 100644 index 0000000..9905449 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png differ diff --git a/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map b/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map new file mode 100644 index 0000000..ef35c17 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png b/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png new file mode 100644 index 0000000..25bf36e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png differ diff --git a/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map b/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map new file mode 100644 index 0000000..16370c3 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png b/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png new file mode 100644 index 0000000..0205abd Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map b/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map new file mode 100644 index 0000000..9967f0d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png b/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png new file mode 100644 index 0000000..b61772d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png differ diff --git a/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map b/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map new file mode 100644 index 0000000..758dec1 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png b/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png new file mode 100644 index 0000000..1b5f6bc Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map b/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map new file mode 100644 index 0000000..e9835b2 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png b/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png new file mode 100644 index 0000000..1aa5024 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map b/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map new file mode 100644 index 0000000..dcf59a4 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png b/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png new file mode 100644 index 0000000..dddb82f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map b/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map new file mode 100644 index 0000000..ab66d51 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png b/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png new file mode 100644 index 0000000..8e1e2f7 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map b/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map new file mode 100644 index 0000000..1ab4fa2 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png b/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png new file mode 100644 index 0000000..fb2e9e9 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map b/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map new file mode 100644 index 0000000..060d10a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png b/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png new file mode 100644 index 0000000..51c56ad Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map b/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map new file mode 100644 index 0000000..67a8122 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png b/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png new file mode 100644 index 0000000..180f239 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png differ diff --git a/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map b/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map new file mode 100644 index 0000000..ded9365 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png b/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png new file mode 100644 index 0000000..84cdc2b Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png differ diff --git a/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map b/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map new file mode 100644 index 0000000..13c0824 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png b/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png new file mode 100644 index 0000000..451d57a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png differ diff --git a/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map b/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map new file mode 100644 index 0000000..dc6b865 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png b/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png new file mode 100644 index 0000000..50dd9b1 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map b/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map new file mode 100644 index 0000000..f815d0d --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png b/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png new file mode 100644 index 0000000..f2f4a56 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png differ diff --git a/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map b/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map new file mode 100644 index 0000000..0ba67a6 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png b/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png new file mode 100644 index 0000000..cec2cd9 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png differ diff --git a/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map b/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map new file mode 100644 index 0000000..ce71f9a --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png b/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png new file mode 100644 index 0000000..a9b0d9a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png differ diff --git a/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map b/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map new file mode 100644 index 0000000..aff8c01 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png b/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png new file mode 100644 index 0000000..e602497 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png differ diff --git a/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map b/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map new file mode 100644 index 0000000..bdc963b --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png b/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png new file mode 100644 index 0000000..56c7ea9 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png differ diff --git a/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map b/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map new file mode 100644 index 0000000..a44e6ac --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png b/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png new file mode 100644 index 0000000..18bd8aa Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map b/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map new file mode 100644 index 0000000..63cd417 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png b/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png new file mode 100644 index 0000000..ed55f29 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map b/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map new file mode 100644 index 0000000..90c4b46 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png b/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png new file mode 100644 index 0000000..4b3a35d Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map b/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map new file mode 100644 index 0000000..e397b4f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png b/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png new file mode 100644 index 0000000..8f8e83a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map b/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map new file mode 100644 index 0000000..5b6ac4f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png b/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png new file mode 100644 index 0000000..e681c0c Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map b/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map new file mode 100644 index 0000000..1bcf33f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png b/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png new file mode 100644 index 0000000..e0f52bb Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map b/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map new file mode 100644 index 0000000..01e571b --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png b/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png new file mode 100644 index 0000000..f63fe7f Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map b/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map new file mode 100644 index 0000000..42ff504 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png b/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png new file mode 100644 index 0000000..9248041 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map b/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map new file mode 100644 index 0000000..7d3fa54 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png b/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png new file mode 100644 index 0000000..d9cdabb Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map b/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map new file mode 100644 index 0000000..13373ca --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png b/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png new file mode 100644 index 0000000..fd50942 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map b/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map new file mode 100644 index 0000000..fac2245 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png b/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png new file mode 100644 index 0000000..d308067 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map b/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map new file mode 100644 index 0000000..9774d16 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png b/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png new file mode 100644 index 0000000..61f17b6 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png differ diff --git a/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map b/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map new file mode 100644 index 0000000..2a2dd4e --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png b/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png new file mode 100644 index 0000000..813a005 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png differ diff --git a/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map b/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map new file mode 100644 index 0000000..03b56fc --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png b/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png new file mode 100644 index 0000000..84e1bc8 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png differ diff --git a/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map b/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map new file mode 100644 index 0000000..c6c6888 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png b/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png new file mode 100644 index 0000000..0051e78 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png differ diff --git a/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map b/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map new file mode 100644 index 0000000..6a56305 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png b/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png new file mode 100644 index 0000000..1bb5b3a Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png differ diff --git a/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map b/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map new file mode 100644 index 0000000..384865f --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png b/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png new file mode 100644 index 0000000..6428979 Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png differ diff --git a/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map b/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map new file mode 100644 index 0000000..8b975f2 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png b/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png new file mode 100644 index 0000000..9278b9e Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map b/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map new file mode 100644 index 0000000..828d863 --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png b/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png new file mode 100644 index 0000000..02db94c Binary files /dev/null and b/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png differ diff --git a/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map b/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map new file mode 100644 index 0000000..d46dc5b --- /dev/null +++ b/docs/22.1.2.0/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/22.1.2.0/_modules/cplex.html b/docs/22.1.2.0/_modules/cplex.html new file mode 100644 index 0000000..2f81b18 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex.html @@ -0,0 +1,2350 @@ + + + + + + + cplex — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex

+# --------------------------------------------------------------------------
+# File: __init__.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""The CPLEX Python API.
+
+This package contains classes for accessing CPLEX from the Python
+programming language. The most important class defined by this package
+is the `Cplex` class, which provides methods for creating, modifying,
+querying, or solving an optimization problem, and for querying aspects of
+a solution.
+
+The `exceptions` module defines the exception classes that are raised
+during abnormal operation by the CPLEX Python API.
+
+The `callbacks` module defines callback classes that can be used to alter
+the behavior of the algorithms used by CPLEX.
+
+The constant `infinity`, defined in the cplex package, should be used to
+set infinite upper and lower bounds.
+
+The classes `SparsePair` and `SparseTriple` are used as input and output
+classes for sparse vector and sparse matrix output, respectively. See
+the documentation for individual methods for details about the usage
+of these classes.
+"""
+__all__ = ["Cplex", "Stats", "Aborter", "callbacks", "exceptions",
+           "infinity", "ParameterSet", "SparsePair", "SparseTriple",
+           "model_info", "constant_class"]
+__version__ = "22.1.2.0"
+
+from contextlib import closing
+from io import BytesIO
+import os
+import weakref
+
+from .aborter import Aborter
+from . import callbacks
+from . import model_info
+from .exceptions import CplexError, WrongNumberOfArgumentsError
+from ._internal import ProblemType, Environment
+from ._internal._anno import (DoubleAnnotationInterface,
+                              LongAnnotationInterface)
+from ._internal._aux_functions import (init_list_args,
+                                       validate_arg_lengths)
+from ._internal._matrices import SparsePair, SparseTriple
+from ._internal._subinterfaces import (AdvancedCplexInterface,
+                                       ConflictInterface,
+                                       FeasoptInterface,
+                                       IndicatorConstraintInterface,
+                                       InitialInterface,
+                                       LinearConstraintInterface,
+                                       MIPStartsInterface,
+                                       ObjectiveInterface,
+                                       ObjSense,
+                                       OrderInterface,
+                                       PresolveInterface,
+                                       QuadraticConstraintInterface,
+                                       SolutionInterface,
+                                       SOSInterface,
+                                       VariablesInterface)
+from ._internal import _constants as _const
+from ._internal import _procedural as _proc
+from ._internal._multiobj import MultiObjInterface
+from ._internal._parameter_classes import RootParameterGroup  # noqa: F401
+from ._internal._pwl import PWLConstraintInterface
+from .paramset import ParameterSet
+
+infinity = _const.CPX_INFBOUND
+"""See CPX_INFBOUND in the C API."""
+
+
+
+[docs] +class Stats(): + """A class whose data members reflect statistics about a CPLEX + problem. + + An instance of this class is returned by the `Cplex.get_stats()` + method. + + The __str__ method of this class returns a string containing a + summary of the problem statistics in human readable form. + + An instance of this class always has the following integer members: + + * num_objectives + * num_variables + * num_nonnegative + * num_fixed + * num_boxed + * num_free + * num_other + * num_binary + * num_integer + * num_semicontinuous + * num_semiinteger + * num_quadratic_variables + * num_linear_objective_nz + * num_quadratic_objective_nz + * num_linear_constraints + * num_linear_less + * num_linear_equal + * num_linear_greater + * num_linear_range + * num_linear_nz + * num_linear_rhs_nz + * num_indicator_constraints + * num_indicator_less + * num_indicator_equal + * num_indicator_greater + * num_indicator_complemented + * num_indicator_nz + * num_indicator_rhs_nz + * num_quadratic_constraints + * num_quadratic_less + * num_quadratic_greater + * num_quadratic_linear_nz + * num_quadratic_nz + * num_quadratic_rhs_nz + * num_SOS_constraints + * num_SOS1 + * num_SOS1_members + * type_SOS1 + * num_SOS2 + * num_SOS2_members + * type_SOS2 + * num_lazy_constraints + * num_lazy_nnz + * num_lazy_lt + * num_lazy_eq + * num_lazy_gt + * num_lazy_rhs_nnz + * num_user_cuts + * num_user_cuts_nnz + * num_user_cuts_lt + * num_user_cuts_eq + * num_user_cuts_gt + * num_user_cuts_rhs_nnz + * num_pwl_constraints + * num_pwl_breaks + + An instance of this class always has the following float members: + + * min_lower_bound + * max_upper_bound + * min_linear_objective + * max_linear_objective + * min_linear_constraints + * max_linear_constraints + * min_linear_constraints_rhs + * max_linear_constraints_rhs + + An instance of this class returned by an instance of the Cplex + class with a quadratic objective also has the following float + members: + + * min_quadratic_objective + * max_quadratic_objective + + An instance of this class returned by an instance of the Cplex + class with ranged constraints also has the following float + members: + + * min_linear_range + * max_linear_range + + An instance of this class returned by an instance of the Cplex + class with quadratic constraints also has the following float + members: + + * min_quadratic_linear + * max_quadratic_linear + * min_quadratic + * max_quadratic + * min_quadratic_rhs + * max_quadratic_rhs + + An instance of this class returned by an instance of the Cplex + class with indicator constraints also has the following float + members: + + * min_indicator + * max_indicator + * min_indicator_rhs + * max_indicator_rhs + + An instance of this class returned by an instance of the Cplex + class with lazy constraints also has the following float members: + + * min_lazy_constraint + * max_lazy_constraint + * min_lazy_constraint_rhs + * max_lazy_constraint_rhs + + An instance of this class returned by an instance of the Cplex + class with user cuts also has the following float members: + + * min_user_cut + * max_user_cut + * min_user_cut_rhs + * max_user_cut_rhs + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, c): + self.name = c.get_problem_name() + self.sense = c.objective.sense[c.objective.get_sense()].capitalize() + + raw_stats = _proc.getprobstats(c._env._e, c._lp) + + # multi-objective stats + self.num_objectives = raw_stats.objs + + # counts of problem objects + # variable data + self.num_variables = raw_stats.cols + self.num_nonnegative = raw_stats.ncnt + self.num_fixed = raw_stats.xcnt + self.num_boxed = raw_stats.bcnt + self.num_free = raw_stats.fcnt + self.num_other = raw_stats.ocnt + self.num_binary = raw_stats.bicnt + self.num_integer = raw_stats.icnt + self.num_semicontinuous = raw_stats.scnt + self.num_semiinteger = raw_stats.sicnt + self.num_quadratic_variables = raw_stats.qpcnt + self.num_linear_objective_nz = raw_stats.objcnt + self.num_quadratic_objective_nz = raw_stats.qpnzcnt + + # linear constraint data + self.num_linear_constraints = raw_stats.rows + self.num_linear_less = raw_stats.lcnt + self.num_linear_equal = raw_stats.ecnt + self.num_linear_greater = raw_stats.gcnt + self.num_linear_range = raw_stats.rngcnt + self.num_linear_nz = raw_stats.nzcnt + self.num_linear_rhs_nz = raw_stats.rhscnt + + # indicator data + self.num_indicator_constraints = raw_stats.nindconstr + self.num_indicator_less = raw_stats.indlcnt + self.num_indicator_equal = raw_stats.indecnt + self.num_indicator_greater = raw_stats.indgcnt + self.num_indicator_complemented = raw_stats.indcompcnt + self.num_indicator_nz = raw_stats.indnzcnt + self.num_indicator_rhs_nz = raw_stats.indrhscnt + + # quadratic constraints + self.num_quadratic_constraints = raw_stats.nqconstr + self.num_quadratic_less = raw_stats.qlcnt + self.num_quadratic_greater = raw_stats.qgcnt + self.num_quadratic_linear_nz = raw_stats.linnzcnt + self.num_quadratic_nz = raw_stats.quadnzcnt + self.num_quadratic_rhs_nz = raw_stats.qrhscnt + + # SOS data + self.num_SOS_constraints = raw_stats.nsos + sos_string_list = ["", + "all continuous", + "all binary", + "all integer", + "continuous, binary, and integer", + "continuous and binary", + "continuous and integer", + "binary and integer", ] + self.num_SOS1 = raw_stats.nsos1 + self.num_SOS1_members = raw_stats.sos1nmem + self.type_SOS1 = sos_string_list[raw_stats.sos1type] + self.num_SOS2 = raw_stats.nsos2 + self.num_SOS2_members = raw_stats.sos2nmem + self.type_SOS2 = sos_string_list[raw_stats.sos2type] + + # lazy constraint data + self.num_lazy_constraints = raw_stats.lazycnt + self.num_lazy_nnz = raw_stats.lazynzcnt + self.num_lazy_lt = raw_stats.lazylcnt + self.num_lazy_eq = raw_stats.lazyecnt + self.num_lazy_gt = raw_stats.lazygcnt + self.num_lazy_rhs_nnz = raw_stats.lazyrhscnt + + # user cut data + self.num_user_cuts = raw_stats.ucutcnt + self.num_user_cuts_nnz = raw_stats.ucutnzcnt + self.num_user_cuts_lt = raw_stats.ucutlcnt + self.num_user_cuts_eq = raw_stats.ucutecnt + self.num_user_cuts_gt = raw_stats.ucutgcnt + self.num_user_cuts_rhs_nnz = raw_stats.ucutrhscnt + + # PWL constraints + self.num_pwl_constraints = raw_stats.npwl + self.num_pwl_breaks = raw_stats.npwlbreaks + + # min and max data + # variables + self.min_lower_bound = raw_stats.minlb + self.max_upper_bound = raw_stats.maxub + self.min_linear_objective = raw_stats.minobj + self.max_linear_objective = raw_stats.maxobj + if self.num_quadratic_objective_nz > 0: + self.min_quadratic_objective = raw_stats.minqcoef + self.max_quadratic_objective = raw_stats.maxqcoef + + # linear constraints + self.min_linear_constraints = raw_stats.mincoef + self.max_linear_constraints = raw_stats.maxcoef + self.min_linear_constraints_rhs = raw_stats.minrhs + self.max_linear_constraints_rhs = raw_stats.maxrhs + if self.num_linear_range > 0: + self.min_linear_range = raw_stats.minrng + self.max_linear_range = raw_stats.maxrng + + # quadratic constraints + if self.num_quadratic_constraints > 0: + self.min_quadratic_linear = raw_stats.minqcl + self.max_quadratic_linear = raw_stats.maxqcl + self.min_quadratic = raw_stats.minqcq + self.max_quadratic = raw_stats.maxqcq + self.min_quadratic_rhs = raw_stats.minqcr + self.max_quadratic_rhs = raw_stats.maxqcr + + # indicator constraints + if self.num_indicator_constraints > 0: + self.min_indicator = raw_stats.minind + self.max_indicator = raw_stats.maxind + self.min_indicator_rhs = raw_stats.minindrhs + self.max_indicator_rhs = raw_stats.maxindrhs + + # lazy constraints + if self.num_lazy_constraints > 0: + self.min_lazy_constraint = raw_stats.minlazy + self.max_lazy_constraint = raw_stats.maxlazy + self.min_lazy_constraint_rhs = raw_stats.minlazyrhs + self.max_lazy_constraint_rhs = raw_stats.maxlazyrhs + + # user cuts + if self.num_user_cuts > 0: + self.min_user_cut = raw_stats.minucut + self.max_user_cut = raw_stats.maxucut + self.min_user_cut_rhs = raw_stats.minucutrhs + self.max_user_cut_rhs = raw_stats.maxucutrhs
+ + +
+[docs] + def __str__(self): + """Returns a string containing a summary of the problem + statistics in human readable form. + """ + allinf = "all infinite" + allzero = "all zero" + sep = ", " + ret = "" + ret = ret + "Problem name : " + self.name + "\n" + ret = ret + "Objective sense : " + self.sense + "\n" + ret = ret + "Variables : %7d" % self.num_variables + if self.num_nonnegative != self.num_variables or self.num_quadratic_variables > 0: + ret = ret + " [" + sep_ind = 0 + if self.num_nonnegative > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Nneg: %d" % self.num_nonnegative + sep_ind = 1 + if self.num_fixed > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Fix: %d" % self.num_fixed + sep_ind = 1 + if self.num_boxed > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Box: %d" % self.num_boxed + sep_ind = 1 + if self.num_free > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Free: %d" % self.num_free + sep_ind = 1 + if self.num_binary > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Binary: %d" % self.num_binary + sep_ind = 1 + if self.num_integer > 0: + if sep_ind: + ret = ret + sep + ret = ret + "General Integer: %d" % self.num_integer + sep_ind = 1 + if self.num_semicontinuous > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Semi-continuous: %d" % self.num_semicontinuous + sep_ind = 1 + if self.num_semiinteger > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Semi-integer: %d" % self.num_semiinteger + sep_ind = 1 + if self.num_other > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Other: %d" % self.num_other + sep_ind = 1 + if self.num_quadratic_variables > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Qobj: %d" % self.num_quadratic_variables + sep_ind = 1 + ret = ret + "]" + ret = ret + "\n" + if self.num_objectives > 1: + ret = ret + "Objectives : %7d" % self.num_objectives + "\n" + ret = ret + " Objective nonzeros : %7d" % self.num_linear_objective_nz + "\n" + else: + ret = ret + "Objective nonzeros : %7d" % self.num_linear_objective_nz + "\n" + if self.num_quadratic_objective_nz > 0: + ret = ret + "Objective Q nonzeros : %7d" % self.num_quadratic_objective_nz + "\n" + ret = ret + "Linear constraints : %7d" % self.num_linear_constraints + if self.num_linear_constraints > 0: + ret = ret + " [" + sep_ind = 0 + if self.num_linear_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_linear_less + sep_ind = 1 + if self.num_linear_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_linear_greater + sep_ind = 1 + if self.num_linear_equal > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Equal: %d" % self.num_linear_equal + sep_ind = 1 + if self.num_linear_range > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Range: %d" % self.num_linear_range + sep_ind = 1 + ret = ret + "]" + ret = ret + "\n" + ret = ret + " Nonzeros : %7d\n" % self.num_linear_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_linear_rhs_nz + if self.num_indicator_constraints > 0: + ret = ret + \ + "Indicator constraints: %7d [" % self.num_indicator_constraints + sep_ind = 0 + if self.num_indicator_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_indicator_less + sep_ind = 1 + if self.num_indicator_equal > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Equal: %d" % self.num_indicator_equal + sep_ind = 1 + if self.num_indicator_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_indicator_greater + sep_ind = 1 + ret = ret + "]\n" + if self.num_indicator_complemented: + ret = ret + " Complemented : %7d\n" % self.num_indicator_complemented + ret = ret + " Nonzeros : %7d\n" % self.num_indicator_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_indicator_rhs_nz + if self.num_quadratic_constraints > 0: + ret = ret + \ + "Quadratic constraints: %7d [" % self.num_quadratic_constraints + sep_ind = 0 + if self.num_quadratic_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_quadratic_less + sep_ind = 1 + if self.num_quadratic_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_quadratic_greater + sep_ind = 1 + ret = ret + "]\n" + ret = ret + " Linear terms : %7d\n" % self.num_quadratic_linear_nz + ret = ret + " Quadratic terms : %7d\n" % self.num_quadratic_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_quadratic_rhs_nz + if self.num_SOS_constraints > 0: + ret = ret + \ + "SOS : %7d [" % self.num_SOS_constraints + sep_ind = 0 + if self.num_SOS1 > 0: + if sep_ind: + ret = ret + sep + ret = ret + "SOS1: %d, %d members" % (self.num_SOS1, + self.num_SOS1_members) + if self.type_SOS1: + ret += ", %s" % self.type_SOS1 + sep_ind = 1 + if self.num_SOS2 > 0: + if sep_ind: + ret = ret + "; " + ret = ret + "SOS2: %d, %d members" % (self.num_SOS2, + self.num_SOS2_members) + if self.type_SOS2: + ret += ", %s" % self.type_SOS2 + sep_ind = 1 + ret = ret + "]\n" + if self.num_pwl_constraints > 0: + ret = ret + \ + "PWL : %7d [" % self.num_pwl_constraints + if self.num_pwl_breaks > 0: + ret = ret + "Breaks: %d" % self.num_pwl_breaks + ret = ret + "]\n" + ret = ret + "\n" + if self.min_lower_bound > -infinity: + valstr1 = str("%#-15.7g" % self.min_lower_bound) + else: + valstr1 = allinf + if self.max_upper_bound < infinity: + valstr2 = str("%#-15.7g" % self.max_upper_bound) + else: + valstr2 = allinf + ret = ret + \ + "Variables : Min LB: %-15s Max UB: %-15s\n" % ( + valstr1, valstr2) + if self.min_linear_objective > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_objective) + else: + valstr1 = allzero + if self.max_linear_objective < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_objective) + else: + valstr2 = allzero + ret = ret + \ + "Objective nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_quadratic_objective_nz > 0: + if self.min_quadratic_objective > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_objective) + else: + valstr1 = allzero + if self.max_quadratic_objective < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_objective) + else: + valstr2 = allzero + ret = ret + \ + "Objective Q nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + ret = ret + "Linear constraints :\n" + if self.min_linear_constraints > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_constraints) + else: + valstr1 = allzero + if self.max_linear_constraints < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_constraints) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_linear_constraints_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_constraints_rhs) + else: + valstr1 = allzero + if self.max_linear_constraints_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_constraints_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_linear_range > 0: + ret = ret + " Range values : Min : %#-15.7g Max : %#-15.7g\n" % ( + self.min_linear_range, self.max_linear_range) + if self.num_quadratic_constraints > 0: + ret = ret + "Quadratic constraints:\n" + if self.min_quadratic_linear > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_linear) + else: + valstr1 = allzero + if self.max_quadratic_linear < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_linear) + else: + valstr2 = allzero + ret = ret + \ + " Linear terms : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_quadratic > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic) + else: + valstr1 = allzero + if self.max_quadratic < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic) + else: + valstr2 = allzero + ret = ret + \ + " Quadratic terms : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_quadratic_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_rhs) + else: + valstr1 = allzero + if self.max_quadratic_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_indicator_constraints > 0: + ret = ret + "Indicator constraints:\n" + if self.min_indicator > -infinity: + valstr1 = str("%#-15.7g" % self.min_indicator) + else: + valstr1 = allzero + if self.max_indicator < infinity: + valstr2 = str("%#-15.7g" % self.max_indicator) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_indicator_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_indicator_rhs) + else: + valstr1 = allzero + if self.max_indicator_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_indicator_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_lazy_constraints > 0: + ret = ret + "Lazy constraints :\n" + if self.min_lazy_constraint > -infinity: + valstr1 = str("%#-15.7g" % self.min_lazy_constraint) + else: + valstr1 = allzero + if self.max_lazy_constraint < infinity: + valstr2 = str("%#-15.7g" % self.max_lazy_constraint) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_lazy_constraint_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_lazy_constraint_rhs) + else: + valstr1 = allzero + if self.max_lazy_constraint_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_lazy_constraint_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_user_cuts > 0: + ret = ret + "User cuts :\n" + if self.min_user_cut > -infinity: + valstr1 = str("%#-15.7g" % self.min_user_cut) + else: + valstr1 = allzero + if self.max_user_cut < infinity: + valstr2 = str("%#-15.7g" % self.max_user_cut) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_user_cut_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_user_cut_rhs) + else: + valstr1 = allzero + if self.max_user_cut_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_user_cut_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + return ret
+
+ + + +def _is_special_filetype(filename, filetype, ext): + if filetype is None or filetype == "": + for extra_ext in ('', '.gz', '.bz2'): + if (isinstance(filename, str) and + filename.endswith('.' + ext + extra_ext)): + return True + else: + if filetype == ext: + return True + return False + + +def _getcplexstudiodir(): + version, release, modification, _ = __version__.split(".") + # There is a small oddity in how the environment variable + # CPLEX_STUDIO_DIR<VERSION> is called: A "0" in MODIFICATION is + # ignored (i.e., instead of "1280" for 12.8.0, we use "128"). + if modification == "0": + modification = "" + return "CPLEX_STUDIO_DIR{0}{1}{2}".format(version, release, modification) + + +def _setcpxchecklicdir(): + # Only try to set CPLEX_CPXCHECKLIC_BINDIR if CPLEX_STUDIO_KEY is set + # and CPLEX_STUDIO_DIR and CPLEX_CPXCHECKLIC_BINDIR are not set. + if ((not os.getenv("CPLEX_STUDIO_KEY")) or os.getenv(_getcplexstudiodir()) or os.getenv("CPLEX_CPXCHECKLIC_BINDIR")): + return + # First, try using shutil.which(). + import shutil + cpxchecklic = shutil.which("cpxchecklic") + if cpxchecklic: + os.environ["CPLEX_CPXCHECKLIC_BINDIR"] = os.path.dirname(cpxchecklic) + return + # Then, if not successful, try using site.getusersitepackages(). + import site + pydir = os.path.dirname(site.getusersitepackages()) + for dirname in ("bin", "Scripts"): + cpxchecklic = os.path.join(pydir, dirname, "cpxchecklic") + if os.path.exists(cpxchecklic): + os.environ["CPLEX_CPXCHECKLIC_BINDIR"] = os.path.dirname(cpxchecklic) + return + # If neither of those works, then give up. + + +# Attempt to set CPLEX_CPXCHECKLIC_BINDIR automatically. This should +# happen once on "import cplex". +_setcpxchecklicdir() + + +
+[docs] +class Cplex(): + """A class encapsulating a CPLEX Problem. + + An instance of the Cplex class provides methods for creating, + modifying, and querying an optimization problem, solving it, and + querying aspects of the solution. + + Most of the methods are provided within subinterfaces: for example, + methods for adding, modifying, and querying data associated with + variables are within the `Cplex.variables` interface, and methods for + querying the solution are within the `Cplex.solution` category. + + :undocumented: __del__ + """ + + problem_type = ProblemType() + """See `ProblemType` """ + +
+[docs] + def __init__(self, *args): + """Constructor of the Cplex class. + + The Cplex constructor accepts four types of argument lists. + + >>> cpx = cplex.Cplex() + + cpx is a new problem with no data + + >>> cpx = cplex.Cplex("filename") + + cpx is a new problem containing the data in filename. If filename + does not exist, an exception is raised. + + >>> cpx = cplex.Cplex("filename", "filetype") + + same as form 2, but cplex reads the file filename as a file of + type filetype, rather than inferring the file type from its + extension. + + >>> cpx = cplex.Cplex(old_cpx) + + cpx contains the same problem data as old_cpx, but is a different + object and contains no solution data. Future changes to one do + not affect the other. + + The Cplex object is a context manager and can be used, like so: + + >>> import cplex + >>> with cplex.Cplex() as cpx: + ... # do stuff + ... pass + + When the with-block is finished, the `end()` method will be + called automatically. + """ + # Declare and initialize attributes + self._disposed = False + self._aborter = None + self._env = None + self._lp = None + self._pslst = [] + # Initialize data strucutures associated with CPLEX + nargs = len(args) + if nargs > 2: + raise WrongNumberOfArgumentsError() + self._env = Environment() + if nargs == 0: + self._lp = _proc.createprob(self._env._e, "") + elif nargs == 1: + if isinstance(args[0], Cplex): + self._lp = _proc.cloneprob(self._env._e, args[0]._lp) + elif isinstance(args[0], str): + self._lp = _proc.createprob(self._env._e, args[0]) + _proc.readcopyprob(self._env._e, self._lp, args[0]) + else: + raise TypeError("invalid argument: {0}".format(args[0])) + else: + assert nargs == 2 + if isinstance(args[0], str) and isinstance(args[1], str): + self._lp = _proc.createprob(self._env._e, args[0]) + _proc.readcopyprob(self._env._e, self._lp, args[0], args[1]) + else: + raise TypeError("invalid arguments: {0}".format(args)) + self._env_lp_ptr = _proc.pack_env_lp_ptr(self._env._e, self._lp) + + self.parameters = self._env.parameters + """See `RootParameterGroup`""" + self.parameters._cplex = weakref.proxy(self) + + self.variables = VariablesInterface(self) + """See `VariablesInterface`""" + + self.linear_constraints = LinearConstraintInterface( + self) + """See `LinearConstraintInterface`""" + + self.quadratic_constraints = QuadraticConstraintInterface(self) + """See `QuadraticConstraintInterface`""" + + self.indicator_constraints = IndicatorConstraintInterface(self) + """See `IndicatorConstraintInterface`""" + + self.SOS = SOSInterface(self) + """See `SOSInterface`""" + + self.objective = ObjectiveInterface(self) + """See `ObjectiveInterface`""" + + self.multiobj = MultiObjInterface(self) + """See `MultiObjInterface`""" + + self.MIP_starts = MIPStartsInterface(self) + """See `MIPStartsInterface`""" + + self.solution = SolutionInterface(self) + """See `SolutionInterface`""" + + self.presolve = PresolveInterface(self) + """See `PresolveInterface`""" + + self.order = OrderInterface(self) + """See `OrderInterface`""" + + self.conflict = ConflictInterface(self) + """See `ConflictInterface`""" + + self.advanced = AdvancedCplexInterface(self) + """See `AdvancedCplexInterface`""" + + self.start = InitialInterface(self) + """See `InitialInterface`""" + + self.feasopt = FeasoptInterface(self) + """See `FeasoptInterface`""" + + self.long_annotations = LongAnnotationInterface(self) + """See `LongAnnotationInterface`""" + + self.double_annotations = DoubleAnnotationInterface(self) + """See `DoubleAnnotationInterface`""" + + self.pwl_constraints = PWLConstraintInterface(self) + """See `PWLConstraintInterface`"""
+ + +
+[docs] + def end(self): + """Releases the Cplex object. + + Frees all data structures associated with CPLEX. After a call of + the method end(), the invoking Cplex object and all objects that + have been created with it (such as variables and constraints) can + no longer be used. Attempts to use them subsequently raise a + ValueError. + + Note + The Cplex object is a context manager. Thus, rather than + calling this method explicitly, the best practice should be to + use a Cplex object in a "with" statement (see `__enter__` and + `__exit__`). + + Example usage: + + >>> import cplex + >>> cpx = cplex.Cplex() + >>> cpx.end() + """ + if self._disposed: + return + self._disposed = True + # free aborter if necc. + if self._aborter: + self.remove_aborter() + # free prob + if self._env and self._lp: + try: + _proc.setgenericcallbackfunc(self._env._e, self._lp, 0, None) + except: # noqa: E722 + # Ignore exception in destructor, in particular we may + # get CPXERR_NOT_ONE_PROBLEM here. + pass + _proc.freeprob(self._env._e, self._lp) + # free parameter sets if necc. + for ps in self._pslst: + ps.end() + # free env + if self._env: + self._env._end()
+ + +
+[docs] + def __del__(self): + """non-public""" + self.end()
+ + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The "with" statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + Cplex objects return themselves. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as cpx: + ... # do stuff + ... pass + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with-block, the `end()` method is called + automatically. + """ + self.end()
+ + +
+[docs] + def read(self, filename, filetype=""): + """Reads a problem from file. + + The first argument is a string specifying the filename from which + the problem will be read. + + If the method is called with two arguments, the second argument + is a string specifying the file type. If this argument is + omitted, filetype is taken to be the extension of the filename. + + See `CPXreadcopyprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopyprob.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + """ + _proc.readcopyprob(self._env._e, self._lp, filename, filetype)
+ + +
+[docs] + def write(self, filename, filetype=""): + """Writes a problem to a file. + + The first argument is a string specifying the filename to which + the problem will be written. + + If the filename ends with .bz2 (for BZip2) or .gz (for GNU Zip), + a compressed file is written. + + If the method is called with two arguments, the second argument + is a string specifying the file type. If this argument is + omitted, filetype is taken to be the extension of the filename. + + If filetype is any of "sav", "mps", "lp", the problem is written + in the corresponding format. If filetype is either "rew" or "rlp" + the problem is written with generic names in mps or lp format, + respectively. If filetype is "alp" the problem is written with + generic names in lp format, where the variable names are + annotated to indicate the type and bounds of each variable. + + If filetype is "dua", the dual problem is written to a file. If + filetype is "emb", an embedded network problem is written to a + file. If filetype is "ppe", the perturbed problem is written to a + file. If filetype is "dpe", the perturbed dual problem is written + to a file. + + For documentation of the file types, see the CPLEX File Format + Reference Manual. + + See `CPXwriteprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeprob.html>`_, `CPXdualwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dualwrite.html>`_, + `CPXembwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/embwrite.html>`_, `CPXdperwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dperwrite.html>`_, and + `CPXpperwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/pperwrite.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> c.write("example.lp") + """ + if _is_special_filetype(filename, filetype, 'dua'): + _proc.dualwrite(self._env._e, self._lp, filename) + elif _is_special_filetype(filename, filetype, 'emb'): + _proc.embwrite(self._env._e, self._lp, filename) + elif _is_special_filetype(filename, filetype, 'dpe'): + epsilon = self.parameters.simplex.perturbation.constant.get() + _proc.dperwrite(self._env._e, self._lp, filename, epsilon) + elif _is_special_filetype(filename, filetype, 'ppe'): + epsilon = self.parameters.simplex.perturbation.constant.get() + _proc.pperwrite(self._env._e, self._lp, filename, epsilon) + else: + _proc.writeprob(self._env._e, self._lp, filename, filetype)
+ + +
+[docs] + def write_to_stream(self, stream, filetype='LP', comptype=''): + """Writes a problem to a file-like object in the given file format. + + The filetype argument can be any of "sav" (a binary format), "lp" + (the default), "mps", "rew", "rlp", or "alp" (see `Cplex.write` + for an explanation of these). + + If comptype is "bz2" (for BZip2) or "gz" (for GNU Zip), a + compressed file is written. + + See `CPXwriteprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeprob.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> class NoOpStream(): + ... def __init__(self): + ... self.was_called = False + ... def write(self, bytes): + ... self.was_called = True + ... pass + ... def flush(self): + ... pass + >>> stream = NoOpStream() + >>> c.write_to_stream(stream) + >>> stream.was_called + True + """ + try: + callable(stream.write) + except AttributeError: + raise CplexError("stream must have a write method") + try: + callable(stream.flush) + except AttributeError: + raise CplexError("stream must have a flush method") + # Since there is no filename argument, we validate the + # compression type. + if comptype not in ('', 'bz2', 'gz'): + raise ValueError( + "invalid compression type specified for comptype: {0}".format( + comptype)) + # Any base name will do for the filename. Note that the + # compression type must be specified in the filename (not the + # filetype). + filename = "prob.{0}".format(filetype) + if comptype: + filename += ".{0}".format(comptype) + _proc.writeprobdev(self._env._e, self._lp, stream, + filename, filetype)
+ + +
+[docs] + def write_as_string(self, filetype='LP', comptype=''): + """Writes a problem as a string in the given file format. + + For an explanation of the filetype and comptype arguments, see + `Cplex.write_to_stream`. + + Note + When SAV format is specified for filetype or a compressed file + format is specified for comptype, the return value will be a + byte string. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> lp_str = c.write_as_string("lp") + >>> len(lp_str) > 0 + True + """ + fileenc = self.parameters.read.fileencoding.get() + with closing(BytesIO()) as output: + self.write_to_stream(output, filetype, comptype) + result = output.getvalue() + # Never decode for SAV format nor compressed files. + if not (filetype.lower().startswith("sav") or comptype): + result = result.decode(fileenc) + return result
+ + +
+[docs] + def read_annotations(self, filename): + """Reads annotations from a file. + + See `CPXreadcopyannotations <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopyannotations.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> idx = c.double_annotations.add('ann1', 0) + >>> objtype = c.double_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.write_annotations('example.ann') + >>> c.long_annotations.delete() + >>> c.double_annotations.delete() + >>> c.long_annotations.get_num() + 0 + >>> c.double_annotations.get_num() + 0 + >>> c.read_annotations('example.ann') + >>> c.long_annotations.get_num() + 1 + >>> c.double_annotations.get_num() + 1 + """ + _proc.readcopyanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def write_annotations(self, filename): + """Writes the annotations to a file. + + See `CPXwriteannotations <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeannotations.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.write_annotations('example.ann') + """ + _proc.writeanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def write_benders_annotation(self, filename): + """Writes the annotation of the auto-generated decomposition. + + Writes the annotation of the decompostion CPLEX automatically + generates for the model of the CPLEX problem object to the + specified file. + + See `CPXwritebendersannotation <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writebendersannotation.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read('UFL_25_35_1.mps') + >>> c.write_benders_annotation('UFL_25_35_1.ann') + """ + _proc.writebendersanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def get_problem_type(self): + """Returns the problem type. + + See `CPXgetprobtype <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getprobtype.html>`_ in the Callable Library Reference + Manual for more detail. + + The return value is an attribute of `problem_type`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.get_problem_type() + 0 + >>> c.problem_type[c.get_problem_type()] + 'LP' + """ + return _proc.getprobtype(self._env._e, self._lp)
+ + +
+[docs] + def set_problem_type(self, type, soln=None): + """Changes the problem type. + + If only one argument is given, that argument specifies the new + problem type (see `problem_type`). It must be one of the + following: + + * Cplex.problem_type.LP + * Cplex.problem_type.MILP + * Cplex.problem_type.fixed_MILP + * Cplex.problem_type.QP + * Cplex.problem_type.MIQP + * Cplex.problem_type.fixed_MIQP + * Cplex.problem_type.QCP + * Cplex.problem_type.MIQCP + + If an optional second argument is given, it is taken to be an + identifier of a member of the solution pool. In this case, the + first argument must be one of the following: + + * Cplex.problem_type.fixed_MILP + * Cplex.problem_type.fixed_MIQP + + See `CPXchgprobtype <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobtype.html>`_ and `CPXchgprobtypesolnpool <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobtypesolnpool.html>`_ + in the Callable Library Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_type(c.problem_type.LP) + """ + if soln is None: + _proc.chgprobtype(self._env._e, self._lp, type) + else: + _proc.chgprobtypesolnpool(self._env._e, self._lp, type, soln)
+ + + def _is_MIP(self): + """non-public""" + probtype = self.get_problem_type() + return probtype in (Cplex.problem_type.MILP, + Cplex.problem_type.MIQP, + Cplex.problem_type.MIQCP) + + def _setup_callbacks(self): + """non-public""" + for cb in self._env._callbacks: + cb._env_lp_ptr = self._env_lp_ptr + if hasattr(cb, "_setup"): + cb._setup(self._env._e, self._lp) + +
+[docs] + def solve(self, paramsets=None): + """Solves the problem. + + The optional paramsets argument can only be specified when + multiple objectives are present (otherwise, a ValueError is + raised). paramsets must be a sequence containing `ParameterSet` + objects (see `Cplex.create_parameter_set`) or None. See + `CPXmultiobjopt <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjopt.html>`_ in the Callable Library Reference Manual + for more detail. + + Note + The solve method returning normally (i.e., without raising an + exception) does not necessarily mean that an optimal or + feasible solution has been found. Use + `SolutionInterface.get_status()` to query the status of the + current solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> status = c.solution.get_status() + """ + (paramsets,) = init_list_args(paramsets) + self._setup_callbacks() + ismultiobj = _proc.ismultiobj(self._env._e, self._lp) + if (not ismultiobj and paramsets): + raise ValueError("paramsets argument can only be specified" + " for a multi-objective model") + if ismultiobj: + nprios = _proc.getnumprios(self._env._e, self._lp) + nparamsets = len(paramsets) + if nparamsets > 0 and nprios != nparamsets: + raise ValueError("if specified, len(paramsets) ({0})" + " must be equal to the number of" + " priorities ({1})".format(nparamsets, nprios)) + _proc.multiobjopt(self._env._e, self._lp, + [None if ps is None else ps._ps + for ps in paramsets]) + elif self._is_MIP(): + _proc.mipopt(self._env._e, self._lp) + elif self.quadratic_constraints.get_num() > 0: + lpmethod = self.parameters.lpmethod.get() + if lpmethod in (_const.CPX_ALG_BARRIER, _const.CPX_ALG_AUTOMATIC): + _proc.hybbaropt(self._env._e, self._lp, _const.CPX_ALG_NONE) + else: + _proc.qpopt(self._env._e, self._lp) + elif not self.objective.get_num_quadratic_nonzeros() > 0: + _proc.lpopt(self._env._e, self._lp) + else: + _proc.qpopt(self._env._e, self._lp)
+ + +
+[docs] + def runseeds(self, cnt=30): + """Evaluates the variability of the problem. + + Solves the same problem instance multiple times using different + random seeds allowing the user to evaluate the variability of the + problem class the instance belongs to. + + The optional cnt argument specifies the number of times + optimization should be performed (the default is 30). + + A problem must be an MILP, MIQP, or MIQCP and must exist in + memory. + """ + self._setup_callbacks() + _proc.runseeds(self._env._e, self._lp, cnt)
+ + +
+[docs] + def populate_solution_pool(self): + """Generates a variety of solutions to a discrete problem (MIP, MIQP, MIQCP). + + The algorithm that populates the solution pool works in two + phases. + + In the first phase, it solves the problem to optimality (or + some stopping criterion set by the user) while it sets up a + branch and cut tree for the second phase. + + In the second phase, it generates multiple solutions by using + the information computed and stored in the first phase and by + continuing to explore the tree. + + For more information, see the function `CPXpopulate <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/populate.html>`_ in the + Callable Library Reference Manual and the topic solution pool + in the CPLEX User's Manual. + """ + self._setup_callbacks() + _proc.populate(self._env._e, self._lp)
+ + +
+[docs] + def get_problem_name(self): + """Returns the problem name. + + See `CPXgetprobname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getprobname.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_name("prob1") + >>> c.get_problem_name() + 'prob1' + """ + return _proc.getprobname(self._env._e, self._lp)
+ + +
+[docs] + def set_problem_name(self, name): + """Sets the problem name. + + See `CPXchgprobname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobname.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_name("prob1") + >>> c.get_problem_name() + 'prob1' + """ + _proc.chgprobname(self._env._e, self._lp, name)
+ + +
+[docs] + def cleanup(self, epsilon): + """Deletes values from the problem data with absolute value + smaller than epsilon. + + See `CPXcleanup <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/cleanup.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0, 1e-10, 1.0]) + >>> c.objective.get_linear() + [1.0, 1e-10, 1.0] + >>> c.cleanup(epsilon=1e-6) + >>> c.objective.get_linear() + [1.0, 0.0, 1.0] + """ + _proc.cleanup(self._env._e, self._lp, epsilon)
+ + +
+[docs] + def register_callback(self, callback_class): + """Registers a callback class for use during optimization. + + callback_class must be a proper subclass of one of the callback + classes defined in the module `callbacks`. To implement custom + logic, override the __call__ method with a method that has + signature __call__(self) -> None. If callback_class is a subclass + of more than one callback class, it will only be called when its + first superclass is called. register_callback returns the + instance of callback_class registered for use. Any previously + registered callback of the same class will no longer be + registered. + + Returns an instance of callback_class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback): + ... pass + >>> cb = c.register_callback(MyMIPInfoCallback) + """ + return self._env.register_callback(callback_class)
+ + +
+[docs] + def unregister_callback(self, callback_class): + """Stops a callback class from being used. + + callback_class must be one of the callback classes defined in the + module `callbacks` or a subclass of one of them. This method + unregisters any previously registered callback of the same class. + If callback_class is a subclass of more than one callback class, + this method will unregister only the callback of the same type as + its first superclass. + + Returns the instance of callback_class just unregistered. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback): + ... pass + >>> cb = c.register_callback(MyMIPInfoCallback) + >>> cb = c.unregister_callback(MyMIPInfoCallback) + """ + return self._env.unregister_callback(callback_class)
+ + +
+[docs] + def set_results_stream(self, results_file, fn=None): + """Specifies where results will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which results will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_results_stream(f) + ... output.write("this is an example") + """ + return self._env.set_results_stream(results_file, fn)
+ + +
+[docs] + def set_warning_stream(self, warning_file, fn=None): + """Specifies where warnings will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which warnings will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_warning_stream(f) + ... output.write("this is an example") + """ + return self._env.set_warning_stream(warning_file, fn)
+ + +
+[docs] + def set_error_stream(self, error_file, fn=None): + """Specifies where errors will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which errors will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_error_stream(f) + ... output.write("this is an example") + """ + return self._env.set_error_stream(error_file, fn)
+ + +
+[docs] + def set_log_stream(self, log_file, fn=None): + """Specifies where the log will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which the log will be written. To write to + this stream, use this object's write() method. + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_log_stream(f) + ... output.write("this is an example") + """ + return self._env.set_log_stream(log_file, fn)
+ + +
+[docs] + def get_version(self): + """Returns a string specifying the version of CPLEX. + + See `CPXversion <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/version.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> version = c.get_version() + """ + return self._env.get_version()
+ + +
+[docs] + def get_versionnumber(self): + """Returns an integer specifying the version of CPLEX. + + The version of CPLEX is in the format vvrrmmff, where vv is the + version, rr is the release, mm is the modification, and ff is the + fixpack number. For example, for CPLEX version 12.5.0.1 the + returned value is 12050001. + + See `CPXversionnumber <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/versionnumber.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> versionnumber = c.get_versionnumber() + """ + return self._env.get_versionnumber()
+ + +
+[docs] + def get_num_cores(self): + """Returns the number of cores on this machine. + + See `CPXgetnumcores <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getnumcores.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> num_cores = c.get_num_cores() + """ + return self._env.get_num_cores()
+ + +
+[docs] + def get_stats(self): + """Returns a `Stats` object containing problem statistics. + + Note + Printing the `Stats` object will give a nice summary of the + problem statistics in human readable form (e.g. as with the + "display problem statistics" command in the CPLEX interactive). + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> stats = c.get_stats() + >>> stats.num_variables + 32 + >>> stats.num_linear_constraints + 27 + """ + return Stats(self)
+ + +
+[docs] + def get_time(self): + """Returns a time stamp in seconds. + + To measure time spent between a starting point and ending point + of an operation, take the result of this method at the starting + point; take the result of this method at the end point; subtract + the starting time stamp from the ending time stamp; the + subtraction yields elapsed time in seconds. + + The interpretation of this value as wall clock time or CPU time + is controlled by the parameter clocktype. + + The absolute value of the time stamp is not meaningful. + + See `CPXgettime <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/gettime.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> start = c.get_time() + >>> c.solve() + >>> solve_time = c.get_time() - start + """ + return self._env.get_time()
+ + +
+[docs] + def get_dettime(self): + """Returns a deterministic time stamp in ticks. + + To measure elapsed deterministic time in ticks between a starting + point and ending point of an operation, take the deterministic + time stamp at the starting point; take the deterministic time + stamp at the ending point; subtract the starting deterministic + time stamp from the ending deterministic time stamp. + + The absolute value of the deterministic time stamp is not + meaningful. + + See `CPXgetdettime <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getdettime.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> start = c.get_dettime() + >>> c.solve() + >>> solve_dettime = c.get_dettime() - start + """ + return self._env.get_dettime()
+ + +
+[docs] + def use_aborter(self, aborter): + """Use an `Aborter` to control termination of solve methods. + + Instructs the invoking object to use the aborter to control + termination of its solving and tuning methods. + + If another aborter is already being used by the invoking object, + then this method overrides the previously used aborter. + + Returns the aborter installed in the invoking object or None. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + """ + self.remove_aborter() + self._aborter = aborter + if self._aborter is not None: + _proc.setterminate(self._env._e, self._env_lp_ptr, + self._aborter._p) + self._aborter._register(self) + return self._aborter
+ + +
+[docs] + def remove_aborter(self): + """Removes the `Aborter` being used by the invoking object. + + Returns the aborter that was removed or None. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + >>> aborter = c.remove_aborter() + """ + aborter, self._aborter = (self._aborter, None) + _proc.setterminate(self._env._e, self._env_lp_ptr, None) + if aborter is not None: + aborter._unregister(self) + return aborter
+ + +
+[docs] + def get_aborter(self): + """Returns the `Aborter` being used by the invoking object. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + >>> aborter = c.get_aborter() + """ + return self._aborter
+ + +
+[docs] + def set_callback(self, functor=None, contextmask=0): + """Set callback function to use during optimization. + + Sets the callback that CPLEX invokes during optimization. If + functor is None then contextmask will be treated as 0 and the + callback is effectively cleared from CPLEX. + + In all other cases functor must be a reference to an object that + has a callable member called 'invoke' (if that does not exist, or + is not a callable, an exception will occur the first time CPLEX + attempts to invoke the callback). Whenever CPLEX needs to invoke + the callback it calls this member with exactly one argument: an + instance of `cplex.callbacks.Context`. + + Note that in the 'invoke' function you must not invoke any + functions of the Cplex instance that is performing the current + solve. All functions that can be invoked from a callback are + members of the `cplex.callbacks.Context` class. + + contextmask must be the bitwise OR of values from + `cplex.callbacks.Context.id` and specifies in which contexts + CPLEX shall invoke the callback: the callback is invoked in all + contexts for which the corresponding bit is set in contextmask. + + Note about cplex.callbacks.Context.id.thread_down: This is + considered a "destructor" function and should not raise any + exception. Any exception raised from the callback in this context + will just be ignored. + + See `cplex.callbacks.Context`. + + See `CPXcallbacksetfunc <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbacksetfunc.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class GenericCB(): + ... def invoke(self, context): + ... pass # Do something here. + >>> cb = GenericCB() + >>> c.set_callback(cb) # Register callback. + >>> c.set_callback(None) # Clear callback. + """ + # First of all, clear any existing callback + self._genericcallback = None + self._genericcontextmask = None + _proc.setgenericcallbackfunc(self._env._e, self._lp, contextmask, None) + # TODO: Use hasattr() or similar to check whether 'functor' has + # a method called 'invoke'? This is never a complete + # guard since the attribute may be deleted from the instance + # later. So for now we just don't do it. + # FIXME: This is very shaky since the callback will be deleted + # whenever we create a new self._lp :-( So far I don't see us + # deleting/recreating self._lp anywhere, but if that ever + # happens we have to be careful. + if contextmask != 0 and functor is not None: + _proc.setgenericcallbackfunc(self._env._e, self._lp, contextmask, + self) + self._genericcallback = functor + self._genericcontextmask = contextmask
+ + + def _invoke_generic_callback(self, contextptr, contextid): + """non-public""" + # This is invoked by the cpxpygenericcallbackfuncwrap() trampoline + # function in the native code and is responsible for invoking the + # user callback. + context = callbacks.Context(weakref.proxy(self), contextptr, contextid) + if context.get_id() == callbacks.Context.id.thread_down: + # For thread_down we ignore any exception + try: + self._genericcallback.invoke(context) + except: # noqa: E722 + pass + else: + self._genericcallback.invoke(context) + +
+[docs] + def set_modeling_assistance_callback(self, functor=None): + """Set callback function to use for modeling assistance warnings. + + Sets the callback that CPLEX invokes before and after + optimization (once for every modeling issue detected). If functor + is None then the callback is effectively cleared from CPLEX. The + callback function will only be invoked if the CPLEX parameter + Cplex.parameters.read.datacheck is set to + Cplex.parameters.read.datacheck.values.assist (2). In addition, + the parameter Cplex.parameters.read.warninglimit controls the + number of times each type of modeling assistance warning will be + reported (the rest will be ignored). See CPX_PARAM_DATACHECK and + CPX_PARAM_WARNLIM in the Parameters of CPLEX Reference Manual. + + In all other cases functor must be a reference to an object that + has a callable attribute named 'invoke' (if that does not exist, + or is not a callable, an exception will occur the first time CPLEX + attempts to invoke the callback). Whenever CPLEX needs to invoke + the callback it calls this member with two argument: the modeling + issue ID and the associated warning message. + + See `model_info`. + + See `CPXmodelasstcallbacksetfunc <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/modelasstcallbacksetfunc.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.read.datacheck.set( + ... c.parameters.read.datacheck.values.assist) + >>> class ModelAsstCB(): + ... def invoke(self, issueid, message): + ... pass # Do something here. + >>> cb = ModelAsstCB() + >>> c.set_modeling_assistance_callback(cb) # Register callback. + >>> c.set_modeling_assistance_callback(None) # Clear callback. + """ + # First of all, clear any existing callback + self._modelasstcb = None + _proc.modelasstcallbacksetfunc(self._env._e, self._lp, None) + # We could use hasattr() or similar to check whether 'functor' + # has a method called 'invoke'. This is never a complete guard + # since the attribute may be deleted from the instance later. So, + # for now, we just don't check anything. + # FIXME: See FIXME in set_callback above. + if functor is not None: + _proc.modelasstcallbacksetfunc(self._env._e, self._lp, self) + self._modelasstcb = functor
+ + + def _invoke_modelasst_callback(self, issueid, message): + """non-public""" + # This is invoked by the cpxpymodelasstcallbackfuncwrap() + # trampoline function in the native code and is responsible for + # invoking the user callback. + self._modelasstcb.invoke(issueid, message) + +
+[docs] + def create_parameter_set(self): + """Returns a new CPLEX parameter set object that is associated + with this CPLEX problem object. + + Note + When this CPLEX problem object is destroyed, the parameter set + object returned by this function will also be destoyed. + + See `ParameterSet`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(ps) + 1 + """ + ps = ParameterSet(self._env) + self._pslst.append(ps) + return ps
+ + +
+[docs] + def copy_parameter_set(self, source): + """Returns a deep copy of a parameter set. + + In a sense, this a convenience function; it is equivalent to + querying what parameters are in the source parameter set, + querying their values, and then adding those parameters to the + target parameter set. + + Note + The source parameter set must have been created by this CPLEX + problem object. Mixing parameter sets from different CPLEX + problem objects is not supported. + + Note + When this CPLEX problem object is destroyed, the parameter set + object returned by this function will also be destoyed. + + See `ParameterSet`. + + See `CPXparamsetcopy <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/paramsetcopy.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> source = c.create_parameter_set() + >>> source.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(source) + 1 + >>> target = c.copy_parameter_set(source) + >>> len(target) + 1 + """ + if not isinstance(source, ParameterSet): + raise TypeError("source must be a ParameterSet") + if source not in self._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + target = ParameterSet(self._env) + self._pslst.append(target) + _proc.paramsetcopy(self._env._e, target._ps, source._ps) + return target
+ + +
+[docs] + def get_parameter_set(self): + """Returns a parameter set containing parameters that have been + changed from their default values in the environment. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.advance.set(c.parameters.advance.values.none) + >>> ps = c.get_parameter_set() + >>> val = ps.get(c.parameters.advance) + >>> val == c.parameters.advance.values.none + True + """ + ps = ParameterSet(self._env) + self._pslst.append(ps) + for param, value in self.parameters.get_changed(): + ps.add(param._id, value) + return ps
+ + +
+[docs] + def set_parameter_set(self, source): + """Applies the parameter values in the paramset to the + environment. + + Note + The source parameter set must have been created by this CPLEX + problem object. Mixing parameter sets from different CPLEX + problem objects is not supported. + + See `CPXparamsetapply <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/paramsetapply.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> c.set_parameter_set(ps) + >>> value = c.parameters.advance.get() + >>> value == c.parameters.advance.values.none + True + """ + if not isinstance(source, ParameterSet): + raise TypeError("source must be a ParameterSet") + if source not in self._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + _proc.paramsetapply(self._env._e, source._ps)
+ + +
+[docs] + def copylp(self, numcols, numrows, objsense=ObjSense.minimize, + obj=None, rhs=None, senses="", + matbeg=None, matcnt=None, matind=None, matval=None, + lb=None, ub=None, range_values=None, colnames=None, + rownames=None): + """Copies LP data into a CPLEX problem object. + + The arguments define an objective function, constraint matrix, + variable bounds, righthand side, constraint senses, range values, + names of constraints, and names of variables. + + Note + This method can give better performance when building a model, + but it may not be as user friendly as using other methods. To + compare different techniques, see the lpex1.py example. + + Note + Calling this method destroys any existing data associated with + the problem object. + + numcols : the number of columns in the constraint matrix, or + equivalently, the number of variables in the problem object. + + numrows : the number of rows in the constraint matrix, not + including the objective function or bounds on the variables. + + objsense : sets the sense of the objective function. Must be + either Cplex.objective.sense.minimize or + Cplex.objective.sense.maximize. + + obj : a list of floats of length at least ``numcols`` containing + the objective function coefficients. Required if ``numcols`` > 0. + + rhs : a list of floats of length at least ``numrows`` containing + the righthand side value for each constraint in the constraint + matrix. Required if ``numrows`` > 0. + + senses : A list of single-character strings or a string + containing the sense of each constraint in the constraint matrix. + Must be of length at least ``numrows``. Each entry must be one of + 'G', 'L', 'E', and 'R', indicating greater-than-or-equal-to (>=), + less-than-or-equal-to (<=), equality (=), and ranged constraints, + respectively. Required if ``numrows`` > 0. + + With respect to the arguments ``matbeg`` (beginning of the matrix), + ``matcnt`` (count of the matrix), ``matind`` (indices of the matrix), + and ``matval`` (values of the matrix), CPLEX needs to know only the + nonzero coefficients. These arguments are required if + ``numcols`` > 0 and ``numrows`` > 0. + + These arrays are accessed as follows. Suppose that CPLEX wants to + access the entries in some column j. These are assumed to be + given by the entries: + matval[matbeg[j]],.., matval[matbeg[j]+matcnt[j]-1] + + The corresponding row indices are: + matind[matbeg[j]],.., matind[matbeg[j]+matcnt[j]-1] + + lb : a list of length at least ``numcols`` containing the lower + bound on each of the variables. Required if ``numcols`` > 0. + + ub : a list of length at least ``numcols`` containing the upper + bound on each of the variables. Required if ``numcols`` > 0. + + range_values : a list of floats, specifying the difference + between lefthand side and righthand side of each linear + constraint. If range_values[i] > 0 (zero) then the constraint i + is defined as rhs[i] <= rhs[i] + range_values[i]. If + range_values[i] < 0 (zero) then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + colnames : a list of strings of length at least ``numcols`` + containing the names of the matrix columns or, equivalently, the + constraint names. + + rownames : a list of strings of length at least ``numrows`` + containing the names of the matrix rows or, equivalently, the + constraint names. + + See `CPXcopylpwnames <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/copylpwnames.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.copylp(numcols=3, + ... numrows=2, + ... objsense=c.objective.sense.maximize, + ... obj=[1.0, 2.0, 3.0], + ... rhs=[20.0, 30.0], + ... senses="LL", + ... matbeg=[0, 2, 4], + ... matcnt=[2, 2, 2], + ... matind=[0, 1, 0, 1, 0, 1], + ... matval=[-1.0, 1.0, 1.0, -3.0, 1.0, 1.0], + ... lb=[0.0, 0.0, 0.0], + ... ub=[40.0, cplex.infinity, cplex.infinity], + ... range_values=[0.0, 0.0], + ... colnames=["x1", "x2", "x3"], + ... rownames=["c1", "c2"]) + """ + (obj, rhs, senses, matbeg, + matcnt, matind, matval, + lb, ub, range_values, + colnames, rownames) = init_list_args(obj, rhs, senses, matbeg, matcnt, + matind, matval, lb, ub, + range_values, colnames, rownames) + if not isinstance(senses, str): + senses = "".join(senses) + # Check arg lengths to avoid potential segfault in the C API. + validate_arg_lengths([obj, lb, ub, colnames], + extra_msg=": obj, lb, ub, colnames") + # Special case: Check that numcols <= len(obj). + if numcols > 0 and numcols > len(obj): + raise CplexError("inconsistent arguments: numcols > len(obj)") + validate_arg_lengths([rhs, senses, range_values, rownames], + extra_msg=": rhs, senses, range_values, rownames") + # Special case: Check that numrows <= len(rhs). + if numrows > 0 and numrows > len(rhs): + raise CplexError("inconsistent arguments: numrows > len(rhs)") + validate_arg_lengths([matbeg, matcnt], extra_msg=": matbeg, matcnt") + validate_arg_lengths([matind, matval], extra_msg=": matind, matval") + # Check special case: that len(matind) == sum(matcnt). We don't + # have to check matval b/c of validate_arg_lengths check above. + nnz = sum(matcnt) + nmatind = len(matind) + if nmatind > 0 and nmatind != nnz: + raise CplexError( + "inconsistent arguments: len(matind) != sum(matcnt)") + _proc.copylpwnames(self._env._e, self._lp, numcols, numrows, + objsense, obj, rhs, senses, + matbeg, matcnt, matind, matval, + lb, ub, range_values, + colnames, rownames)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal.html b/docs/22.1.2.0/_modules/cplex/_internal.html new file mode 100644 index 0000000..9a5eb01 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal.html @@ -0,0 +1,523 @@ + + + + + + + cplex._internal — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal

+# --------------------------------------------------------------------------
+# File: __init__.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""
+
+   :undocumented: Environment, _aux_functions, _list_array_utils, _ostream
+
+"""
+import sys
+
+from . import _aux_functions
+from . import _baseinterface
+from . import _list_array_utils
+from . import _ostream
+from . import _procedural
+from . import _constants
+from . import _matrices
+from . import _multiobj
+from . import _multiobjsoln
+from . import _parameter_classes
+from . import _parameter_hierarchy
+from . import _subinterfaces
+from . import _pycplex
+from . import _parameters_auto
+from . import _anno
+from . import _pwl
+from . import _constantsenum
+from . import _callbackinfoenum
+from . import _solutionstrategyenum
+from ..exceptions import CplexError
+from ..constant_class import ConstantClass
+
+__all__ = ["Environment", "_aux_functions", "_baseinterface",
+           "_list_array_utils", "_ostream", "_procedural",
+           "_constants", "_matrices", "_multiobj", "_multiobjsoln",
+           "_parameter_classes", "_subinterfaces", "_pycplex",
+           "_parameters_auto", "_anno", "_pwl", "ProblemType",
+           "_constantsenum", "_constants", "_callbackinfoenum",
+           "_solutionstrategyenum"]
+
+
+
+[docs] +class ProblemType(ConstantClass): + """Types of problems the Cplex object can encapsulate. + + For explanations of the problem types, see those topics in the + CPLEX User's Manual in the topic titled Continuous Optimization + for LP, QP, and QCP or the topic titled Discrete Optimization + for MILP, FIXEDMILP, NODELP, NODEQP, MIQCP, NODEQCP. + """ + LP = _constants.CPXPROB_LP + """See CPXPROB_LP in the C API.""" + + MILP = _constants.CPXPROB_MILP + """See CPXPROB_MILP in the C API.""" + + fixed_MILP = _constants.CPXPROB_FIXEDMILP + """See CPXPROB_FIXEDMILP in the C API.""" + + node_LP = _constants.CPXPROB_NODELP + """See CPXPROB_NODELP in the C API.""" + + QP = _constants.CPXPROB_QP + """See CPXPROB_QP in the C API.""" + + MIQP = _constants.CPXPROB_MIQP + """See CPXPROB_MIQP in the C API.""" + + fixed_MIQP = _constants.CPXPROB_FIXEDMIQP + """See CPXPROB_MIQP in the C API.""" + + node_QP = _constants.CPXPROB_NODEQP + """See CPXPROB_NODEQP in the C API.""" + + QCP = _constants.CPXPROB_QCP + """See CPXPROB_QCP in the C API.""" + + MIQCP = _constants.CPXPROB_MIQCP + """See CPXPROB_MIQCP in the C API.""" + + node_QCP = _constants.CPXPROB_NODEQCP + """See CPXPROB_QCP in the C API."""
+ + + +def _needs_delete_callback(callback_instance): + # If the user has registered any callback that may change + # the user data at a node then we need to register the + # delete callback. + # The Control, Node, and Incumbent callbacks have the set_node_data + # method (and all who inherit from these). + return hasattr(callback_instance, "set_node_data") + + +def _getcbattrname(cb_type_string): + """Returns the attribute name to be used to store the callback + instance. + """ + return "_{0}_callback".format(cb_type_string) + + +def _checkcbcls(obj): + """Checks callback class instance for expected attribute. + + Raises a CplexError if it is not found. + """ + if getattr(obj, "_cb_type_string", None) is None: + raise CplexError(str(obj) + + " is not a subclass of a subclassable Callback class.") + + +
+[docs] +class Environment(): + """non-public""" + RESULTS_CHNL_IDX = 0 + WARNING_CHNL_IDX = 1 + ERROR_CHNL_IDX = 2 + LOG_CHNL_IDX = 3 + +
+[docs] + def __init__(self): + """non-public""" + # Declare and initialize attributes + self._e = None + self._lock = None + self._streams = {self.RESULTS_CHNL_IDX: None, + self.WARNING_CHNL_IDX: None, + self.ERROR_CHNL_IDX: None, + self.LOG_CHNL_IDX: None} + self._callback_exception = None + self._callbacks = [] + self._disposed = False + # Initialize data strucutures associated with CPLEX + self._e = _procedural.openCPLEX() + self.parameters = _parameter_classes.RootParameterGroup( + self, _parameter_hierarchy.root_members) + _procedural.set_status_checker() + self._lock = _procedural.initlock() + self.set_results_stream(sys.stdout) + self.set_warning_stream(sys.stderr) + self.set_error_stream(sys.stderr) + self.set_log_stream(sys.stdout)
+ + + def _end(self): + """Frees all of the data structures associated with CPLEX.""" + if self._disposed: + return + self._disposed = True + for chnl_idx in self._streams: + self._delete_stream(chnl_idx) + if self._lock and self._e: + _procedural.finitlock(self._lock) + if self._e: + _procedural.closeCPLEX(self._e) + self._e = None + +
+[docs] + def __del__(self): + """non-public""" + self._end()
+ + + def _get_num_delete(self): + """Count the callbacks that are installed and require a delete + callback. + """ + return sum(1 for c in self._callbacks + if _needs_delete_callback(c)) + +
+[docs] + def register_callback(self, callback_class): + """Registers a callback for use when solving. + + callback_class must be a proper subclass of one of the + callback classes defined in the module callbacks. It must + override the __call__ method with a method that has signature + __call__(self) -> None. If callback_class is a subclass of + more than one callback class, it will only be called when its + first superclass is called. register_callback returns the + instance of callback_class registered for use. Any previously + registered callback of the same class will no longer be + registered. + """ + cb = callback_class(self) + _checkcbcls(cb) + num_delete = self._get_num_delete() + old_cb = getattr( + self, _getcbattrname(cb._cb_type_string), None) + if old_cb: + self._callbacks.remove(old_cb) + setattr(self, _getcbattrname(cb._cb_type_string), cb) + if cb._cb_type_string == "MIP_info": + # self._MIP_info_callback is set above with the call to + # setattr. So, we are passing the callback instance as the + # second argument here rather than the environment + # (i.e., self). + # pylint: disable=no-member + cb._cb_set_function(self._e, self._MIP_info_callback) + else: + cb._cb_set_function(self._e, self) + self._callbacks.append(cb) + if _needs_delete_callback(cb) and num_delete < 1: + # We need a delete callback and did not have one + # before -> install it. + _procedural.setpydel(self._e) + return cb
+ + +
+[docs] + def unregister_callback(self, callback_class): + """Unregisters a callback. + + callback_class must be one of the callback classes defined in + the module callback or a subclass of one of them. This method + unregisters any previously registered callback of the same + class. If callback_class is a subclass of more than one + callback class, this method unregisters only the callback of the + same type as its first superclass. unregister_callback + returns the instance of callback_class just unregistered. + + """ + cb = callback_class(self) + _checkcbcls(cb) + current_cb = getattr( + self, _getcbattrname(cb._cb_type_string), None) + if current_cb: + if (_needs_delete_callback(current_cb) and + self._get_num_delete() < 2): + # We are about to remove the last callback that requires + # a delete callback. + _procedural.delpydel(self._e) + current_cb._cb_set_function(self._e, None) + self._callbacks.remove(current_cb) + delattr(self, _getcbattrname(current_cb._cb_type_string)) + return current_cb
+ + + def _add_stream(self, which_channel): + """non-public""" + channel = _procedural.getchannels(self._e)[which_channel] + _procedural.addfuncdest(self._e, channel, + self._streams[which_channel]) + + def _delete_stream(self, which_channel): + """non-public""" + if self._streams[which_channel] is None: + return + channel = _procedural.getchannels(self._e)[which_channel] + _procedural.delfuncdest(self._e, channel, + self._streams[which_channel]) + self._streams[which_channel]._end() + + def _set_stream(self, which, outputfile, func=None, initerrstr=False): + self._delete_stream(which) + self._streams[which] = _ostream.OutputStream( + outputfile, self, fn=func, initerrorstr=initerrstr) + self._add_stream(which) + return self._streams[which] + +
+[docs] + def set_results_stream(self, results_file, fn=None): + """Specifies where results will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which results will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.RESULTS_CHNL_IDX, + outputfile=results_file, + func=fn, + initerrstr=False)
+ + +
+[docs] + def set_warning_stream(self, warning_file, fn=None): + """Specifies where warnings will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which warnings will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.WARNING_CHNL_IDX, + outputfile=warning_file, + func=fn, + initerrstr=False)
+ + +
+[docs] + def set_error_stream(self, error_file, fn=None): + """Specifies where errors will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which errors will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.ERROR_CHNL_IDX, + outputfile=error_file, + func=fn, + initerrstr=True)
+ + +
+[docs] + def set_log_stream(self, log_file, fn=None): + """Specifies where the log will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which the log will be written. To write + to this stream, use this object's write() method. + """ + return self._set_stream(which=self.LOG_CHNL_IDX, + outputfile=log_file, + func=fn, + initerrstr=False)
+ + + def _get_results_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.RESULTS_CHNL_IDX] + + def _get_warning_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.WARNING_CHNL_IDX] + + def _get_error_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.ERROR_CHNL_IDX] + + def _get_log_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.LOG_CHNL_IDX] + +
+[docs] + def get_version(self): + """Returns a string specifying the version of CPLEX.""" + return _procedural.version(self._e)
+ + +
+[docs] + def get_versionnumber(self): + """Returns an integer specifying the version of CPLEX. + + The version of CPLEX is in the format vvrrmmff, where vv is + the version, rr is the release, mm is the modification, and ff + is the fixpack number. For example, for CPLEX version 12.5.0.1 + the returned value is 12050001. + """ + return _procedural.versionnumber(self._e)
+ + +
+[docs] + def get_num_cores(self): + """Returns the number of cores on this machine.""" + return _procedural.getnumcores(self._e)
+ + +
+[docs] + def get_time(self): + """Returns a timestamp in CPU or wallclock seconds from CPLEX.""" + return _procedural.gettime(self._e)
+ + +
+[docs] + def get_dettime(self): + """Returns the current deterministic time in ticks.""" + return _procedural.getdettime(self._e)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_anno.html b/docs/22.1.2.0/_modules/cplex/_internal/_anno.html new file mode 100644 index 0000000..07a8ba8 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_anno.html @@ -0,0 +1,753 @@ + + + + + + + cplex._internal._anno — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._anno

+# --------------------------------------------------------------------------
+# File: _anno.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Annotation API"""
+from ._baseinterface import BaseInterface
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+from . import _constants
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class AnnotationObjectType(ConstantClass): + """Constants defining annotation object types.""" + objective = _constants.CPX_ANNOTATIONOBJ_OBJ + variable = _constants.CPX_ANNOTATIONOBJ_COL + row = _constants.CPX_ANNOTATIONOBJ_ROW + sos_constraint = _constants.CPX_ANNOTATIONOBJ_SOS + indicator_constraint = _constants.CPX_ANNOTATIONOBJ_IND + quadratic_constraint = _constants.CPX_ANNOTATIONOBJ_QC
+ + + +
+[docs] +class AnnotationInterface(BaseInterface): + """Methods for adding, querying, and modifying annotations.""" + + object_type = AnnotationObjectType() + """See `AnnotationObjectType()` """ + + def _getnumobjtype(self, objtype): + switcher = { + # NB: For now, it is documented that multiobj is not supported. + self.object_type.objective: lambda env, lp: 1, + self.object_type.variable: _proc.getnumcols, + self.object_type.row: _proc.getnumrows, + self.object_type.sos_constraint: _proc.getnumsos, + self.object_type.indicator_constraint: _proc.getnumindconstrs, + self.object_type.quadratic_constraint: _proc.getnumqconstrs + } + func = switcher[objtype] + return func(self._env._e, self._cplex._lp)
+ + + +
+[docs] +class LongAnnotationInterface(AnnotationInterface): + """Methods for adding, querying, and modifying long annotations.""" + + benders_annotation = _constants.CPX_BENDERS_ANNOTATION + """String constant for the name of the Benders annotation.""" + + benders_mastervalue = _constants.CPX_BENDERS_MASTERVALUE + """Default value for the Benders master partition.""" + +
+[docs] + def __init__(self, cpx): + """Creates a new LongAnnotationInterface. + + The long annotation interface is exposed by the top-level `Cplex` + class as `Cplex.long_annotations`. This constructor is not meant + to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getlongannoindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of long annotations in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.long_annotations.get_num() + 0 + >>> idx = c.long_annotations.add('ann1', 0) + >>> c.long_annotations.get_num() + 1 + """ + return _proc.getnumlonganno(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, name, defval): + """Adds an annotation to the problem. + + name: the name of the annotation. + + defval: the default value for annotation objects. + + Returns the index of the added annotation. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add(name='ann1', defval=0) + >>> c.long_annotations.get_num() + 1 + """ + # For Python 2.7, int() will automatically upconvert to long + # if necessary. For 3.x, there is only int (they have been + # unified). + def _add(name, defval): + _proc.newlonganno( + self._env._e, self._cplex._lp, name, int(defval)) + return self._add_single(self.get_num, _add, name, defval)
+ + +
+[docs] + def delete(self, *args): + """Deletes long annotations from the problem. + + There are four forms by which long_annotations.delete may be + called. + + long_annotations.delete() + deletes all long annotations from the problem. + + long_annotations.delete(i) + i must be an annotation name or index. Deletes the long + annotation whose index or name is i. + + long_annotations.delete(seq) + seq must be a sequence of annotation names or indices. + Deletes the long annotations with names or indices contained + within s. Equivalent to [long_annotations.delete(i) for i in s]. + + long_annotations.delete(begin, end) + begin and end must be annotation indices or annotation names. + Deletes the long annotations with indices between begin and + end, inclusive of end. Equivalent to + long_annotations.delete(range(begin, end + 1)). This will give + the best performance when deleting batches of long annotations. + + See CPXdellongannotations in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> c.long_annotations.get_num() + 1 + >>> c.long_annotations.delete(idx) + >>> c.long_annotations.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.dellonganno(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of long annotations. + + May be called by four forms. + + long_annotations.get_names() + return the names of all long annotations in the problem. + + long_annotations.get_names(i) + i must be an annotation name or index. Returns the name of + long annotation i. + + long_annotations.get_names(seq) + seq must be a sequence of annotation names or indices. + Returns the names of long annotations with names or indices in + s. Equivalent to + [long_annotations.get_names(i) for i in s] + + long_annotations.get_names(begin, end) + begin and end must be annotation indices or annotation names. + Returns the names of long annotations with indices between + begin and end, inclusive of end. Equivalent to + long_annotations.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.long_annotations.add('ann{0}'.format(i), i) + ... for i in range(1, 6)] + [0, 1, 2, 3, 4] + >>> c.long_annotations.get_names() + ['ann1', 'ann2', 'ann3', 'ann4', 'ann5'] + >>> c.long_annotations.get_names(0) + 'ann1' + >>> c.long_annotations.get_names([0, 2, 4]) + ['ann1', 'ann3', 'ann5'] + >>> c.long_annotations.get_names(1, 3) + ['ann2', 'ann3', 'ann4'] + """ + def _get_names(idx): + return _proc.getlongannoname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_default_values(self, *args): + """Returns the default value of a set of long annotations. + + May be called by four forms. + + long_annotations.get_default_values() + return the default values of all long annotations in the + problem. + + long_annotations.get_default_values(i) + i must be an annotation name or index. Returns the default + value of long annotation i. + + long_annotations.get_default_values(seq) + seq must be a sequence of annotation names or indices. + Returns the default values of long annotations with names or + indices in s. Equivalent to + [long_annotations.get_default_values(i) for i in s] + + long_annotations.get_default_values(begin, end) + begin and end must be annotation indices or annotation names. + Returns the default values of long annotations with indices + between begin and end, inclusive of end. Equivalent to + long_annotations.get_default_values(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx1 = c.long_annotations.add(name='ann1', defval=0) + >>> idx2 = c.long_annotations.add(name='ann2', defval=1) + >>> c.long_annotations.get_default_values() + [0, 1] + """ + def _getdefval(idx): + return _proc.getlongannodefval( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _getdefval, self._conv, self.get_num(), args)
+ + +
+[docs] + def set_values(self, idx, objtype, *args): + """Sets the values for objects in the specified long annotation. + + idx: the long annotation index or name. + + objtype: the annotation object type. + + Can be called by two forms: + + long_annotations.set_values(idx, objtype, i, val) + i must be a name or index. Changes the long annotation value + of the object identified by i. + + long_annotations.set_values(idx, objtype, seq) + seq is a sequence of pairs (i, val) as described above. + Changes the long annotation values for the specified objects. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.objective + >>> c.long_annotations.set_values(idx, objtype, 0, 1) + >>> c.long_annotations.get_values(idx, objtype, 0) + 1 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.long_annotations.object_type.variable + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.long_annotations.get_values(idx, objtype) + [1, 1, 1] + """ + def _set_values(ind, val): + _proc.setlonganno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, ind, val) + _aux.apply_pairs(_set_values, self._conv, *args)
+ + +
+[docs] + def get_values(self, idx, objtype, *args): + """Returns the long annotation values for the specified objects. + + idx: the long annotation index or name. + + objtype: the annotation object type. + + Can be called by four forms: + + long_annotations.get_values(idx, objtype) + return the values of all objects for a given annotation. + + long_annotations.get_values(idx, objtype, i) + i must be a name or index. Returns the long annotation value + of the object identified by i. + + long_annotations.get_values(idx, objtype, seq) + seq is a sequence of object names or indices. Returns the + long annotation values for the specified objects. Equivalent + to + [long_annotations.get_values(idx, objtype, i) for i in seq] + + long_annotations.get_values(idx, objtype, begin, end) + begin and end must be object indices or object names. Returns + the long annotation values of objects with indices between + begin and end, inclusive of end. Equivalent to + long_annotations.get_values(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.objective + >>> c.long_annotations.set_values(idx, objtype, 0, 1) + >>> c.long_annotations.get_values(idx, objtype, 0) + 1 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.long_annotations.object_type.variable + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.long_annotations.get_values(idx, objtype, list(indices)) + [1, 1, 1] + """ + def _get_values(begin, end=self._getnumobjtype(objtype) - 1): + return _proc.getlonganno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, + begin, end) + return _aux.apply_freeform_two_args( + _get_values, self._conv, args)
+
+ + + +
+[docs] +class DoubleAnnotationInterface(AnnotationInterface): + """Methods for adding, querying, and modifying double annotations.""" + +
+[docs] + def __init__(self, cpx): + """Creates a new DoubleAnnotationInterface. + + The double annotation interface is exposed by the top-level + `Cplex` class as `Cplex.double_annotations`. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getdblannoindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of double annotations in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.double_annotations.get_num() + 0 + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> c.double_annotations.get_num() + 1 + """ + return _proc.getnumdblanno(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, name, defval): + """Adds an annotation to the problem. + + name: the name of the annotation. + + defval: the default value for annotation objects. + + Returns the index of the added annotation. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add(name='ann1', defval=0.0) + >>> c.double_annotations.get_num() + 1 + """ + def _add(name, defval): + _proc.newdblanno( + self._env._e, self._cplex._lp, name, float(defval)) + return self._add_single(self.get_num, _add, name, defval)
+ + +
+[docs] + def delete(self, *args): + """Deletes double annotations from the problem. + + There are four forms by which double_annotations.delete may be + called. + + double_annotations.delete() + deletes all double annotations from the problem. + + double_annotations.delete(i) + i must be an annotation name or index. Deletes the double + annotation whose index or name is i. + + double_annotations.delete(seq) + seq must be a sequence of annotation names or indices. + Deletes the double annotations with names or indices contained + within s. Equivalent to + [double_annotations.delete(i) for i in s]. + + double_annotations.delete(begin, end) + begin and end must be annotation indices or annotation names. + Deletes the double annotations with indices between begin and + end, inclusive of end. Equivalent to + double_annotations.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of double + annotations. + + See CPXdeldblannotations in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> c.double_annotations.get_num() + 1 + >>> c.double_annotations.delete(idx) + >>> c.double_annotations.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.deldblanno(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of double annotations. + + May be called by four forms. + + double_annotations.get_names() + return the names of all double annotations in the problem. + + double_annotations.get_names(i) + i must be an annotation name or index. Returns the name of + double annotation i. + + double_annotations.get_names(seq) + seq must be a sequence of annotation names or indices. + Returns the names of double annotations with names or indices + in s. Equivalent to + [double_annotations.get_names(i) for i in s] + + double_annotations.get_names(begin, end) + begin and end must be annotation indices or annotation names. + Returns the names of double annotations with indices between + begin and end, inclusive of end. Equivalent to + double_annotations.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.double_annotations.add('ann{0}'.format(i), i) + ... for i in range(1, 6)] + [0, 1, 2, 3, 4] + >>> c.double_annotations.get_names() + ['ann1', 'ann2', 'ann3', 'ann4', 'ann5'] + >>> c.double_annotations.get_names(0) + 'ann1' + >>> c.double_annotations.get_names([0, 2, 4]) + ['ann1', 'ann3', 'ann5'] + >>> c.double_annotations.get_names(1, 3) + ['ann2', 'ann3', 'ann4'] + """ + def _get_names(idx): + return _proc.getdblannoname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_default_values(self, *args): + """Returns the default value of a set of double annotations. + + May be called by four forms. + + double_annotations.get_default_values() + return the default values of all double annotations in the + problem. + + double_annotations.get_default_values(i) + i must be an annotation name or index. Returns the default + value of double annotation i. + + double_annotations.get_default_values(seq) + seq must be a sequence of annotation names or indices. + Returns the default values of double annotations with names or + indices in s. Equivalent to + [double_annotations.get_default_values(i) for i in s] + + double_annotations.get_default_values(begin, end) + begin and end must be annotation indices or annotation names. + Returns the default values of double annotations with indices + between begin and end, inclusive of end. Equivalent to + double_annotations.get_default_values(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx1 = c.double_annotations.add(name='ann1', defval=0.0) + >>> idx2 = c.double_annotations.add(name='ann2', defval=1.0) + >>> c.double_annotations.get_default_values() + [0.0, 1.0] + """ + def _getdefval(idx): + return _proc.getdblannodefval( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _getdefval, self._conv, self.get_num(), args)
+ + +
+[docs] + def set_values(self, idx, objtype, *args): + """Sets the values for objects in the specified double annotation. + + idx: the double annotation index or name. + + objtype: the annotation object type. + + Can be called by two forms: + + double_annotations.set_values(idx, objtype, i, val) + i must be a name or index. Changes the double annotation + value of the object identified by i. + + double_annotations.set_values(idx, objtype, seq) + seq is a sequence of pairs (i, val) as described above. + Changes the double annotation values for the specified + objects. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> objtype = c.double_annotations.object_type.objective + >>> c.double_annotations.set_values(idx, objtype, 0, 1.0) + >>> c.double_annotations.get_values(idx, objtype, 0) + 1.0 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.double_annotations.object_type.variable + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1.0) for i in indices]) + >>> c.double_annotations.get_values(idx, objtype) + [1.0, 1.0, 1.0] + """ + def _set_values(ind, val): + _proc.setdblanno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, ind, val) + _aux.apply_pairs(_set_values, self._conv, *args)
+ + +
+[docs] + def get_values(self, idx, objtype, *args): + """Returns the double annotation values for the specified objects. + + idx: the double annotation index or name. + + objtype: the annotation object type. + + Can be called by four forms: + + double_annotations.get_values(idx, objtype) + return the values of all objects for a given annotation. + + double_annotations.get_values(idx, objtype, i) + i must be a name or index. Returns the double annotation + value of the object identified by i. + + double_annotations.get_values(idx, objtype, seq) + seq is a sequence of object names or indices. Returns the + double annotation values for the specified objects. + Equivalent to + [double_annotations.get_values(idx, objtype, i) for i in seq] + + double_annotations.get_values(idx, objtype, begin, end) + begin and end must be object indices or object names. Returns + the double annotation values of objects with indices between + begin and end, inclusive of end. Equivalent to + double_annotations.get_values(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> objtype = c.double_annotations.object_type.objective + >>> c.double_annotations.set_values(idx, objtype, 0, 1.0) + >>> c.double_annotations.get_values(idx, objtype, 0) + 1.0 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.double_annotations.object_type.variable + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1.0) for i in indices]) + >>> c.double_annotations.get_values(idx, objtype, list(indices)) + [1.0, 1.0, 1.0] + """ + def _get_values(begin, end=self._getnumobjtype(objtype) - 1): + return _proc.getdblanno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, + begin, end) + return _aux.apply_freeform_two_args( + _get_values, self._conv, args)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_aux_functions.html b/docs/22.1.2.0/_modules/cplex/_internal/_aux_functions.html new file mode 100644 index 0000000..992a15c --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_aux_functions.html @@ -0,0 +1,545 @@ + + + + + + + cplex._internal._aux_functions — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._aux_functions

+# --------------------------------------------------------------------------
+# File: _aux_functions.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Internal auxiliary functions."""
+try:
+    import collections.abc as collections_abc  # For Python >= 3.3
+except ImportError:
+    import collections as collections_abc
+import functools
+import inspect
+import itertools
+import os
+import warnings
+
+from ..exceptions import CplexError, WrongNumberOfArgumentsError
+
+CPLEX_PY_DISABLE_NAME_CONV = os.getenv("CPLEX_PY_DISABLE_NAME_CONV")
+
+
+
+[docs] +class deprecated(): + """A decorator that marks methods/functions as deprecated.""" + +
+[docs] + def __init__(self, version): + self.version = version
+ + + def __call__(self, cls_or_func): + if (inspect.isfunction(cls_or_func) or + inspect.ismethod(cls_or_func)): + fmt = "{0} function or method" + # NOTE: Doesn't work for classes .. haven't figured that out yet. + # Specifically, when a decorated class is used as a base + # class. + # elif inspect.isclass(cls_or_func): + # fmt = "{0} class" + else: + raise TypeError(type(cls_or_func)) + msg = _getdeprecatedmsg(fmt.format(cls_or_func.__name__), + self.version) + + @functools.wraps(cls_or_func) + def wrapped(*args, **kwargs): + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return cls_or_func(*args, **kwargs) + return wrapped
+ + + +
+[docs] +def deprecated_class(name, version, stacklevel=3): + """Emits a warning for a deprecated class. + + This should be called in __init__. + + name - the name of the class (e.g., PresolveCallback). + + version - the version at which the class was deprecated (e.g., + "V12.7.1"). + + stacklevel - indicates how many levels up the stack is the caller. + """ + msg = _getdeprecatedmsg("{0} class".format(name), version) + warnings.warn(msg, DeprecationWarning, stacklevel=stacklevel)
+ + + +def _getdeprecatedmsg(item, version): + return "the {0} is deprecated since {1}".format(item, version) + + +
+[docs] +def max_arg_length(arg_list): + """Returns the max length of the arguments in arg_list.""" + return max([len(x) for x in arg_list])
+ + + +if __debug__: + + # With non-optimzied bytecode, validate_arg_lengths actually does + # something. + def validate_arg_lengths(arg_list, allow_empty=True, extra_msg=""): + """Checks for equivalent argument lengths. + + If allow_empty is True (the default), then empty arguments are not + checked against the max length of non-empty arguments. Some functions + allow NULL arguments in the Callable Library, for example. + """ + arg_lengths = [len(x) for x in arg_list] + if allow_empty: + arg_lengths = [x for x in arg_lengths if x > 0] + if not arg_lengths: + return + max_length = max(arg_lengths) + for arg_length in arg_lengths: + if arg_length != max_length: + raise CplexError("inconsistent argument lengths" + extra_msg) + +else: + +
+[docs] + def validate_arg_lengths( + arg_list, + allow_empty=True, + extra_msg="" + ): # pylint: disable=unused-argument + """A no-op. + + A no-op if using python -O or the PYTHONOPTIMIZE environment + variable is defined as a non-empty string. + """ + pass
+ + + +
+[docs] +def make_ranges(indices): + """non-public""" + i = 0 + j = 0 + while i < len(indices): + while j < len(indices) - 1 and indices[j + 1] == indices[j] + 1: + j += 1 + yield (indices[i], indices[j]) + i = j + 1 + j = i
+ + + +
+[docs] +def identity(x): + """Simple identity function.""" + return x
+ + + +
+[docs] +def apply_freeform_two_args(fn, conv, args, unpack_single=True): + """non-public""" + if conv is None: + conv = identity + nargs = len(args) + if nargs == 2: + conarg0, conarg1 = (conv(args[0]), conv(args[1])) + if (isinstance(conarg0, int) and isinstance(conarg1, int)): + return fn(conarg0, conarg1) + raise TypeError("expecting names or indices") + elif nargs == 1: + if isinstance(args[0], (list, tuple)): + return list(itertools.chain.from_iterable( + fn(i, j) for i, j in make_ranges(conv(args[0])))) + conarg0 = conv(args[0]) + if isinstance(conarg0, int): + result = fn(conarg0, conarg0) + if unpack_single: + return result[0] + return result + raise TypeError("expecting name or index") + elif nargs == 0: + return fn(0) + raise WrongNumberOfArgumentsError()
+ + + +
+[docs] +def apply_freeform_one_arg(fn, conv, maxval, args): + """non-public""" + if conv is None: + conv = identity + nargs = len(args) + if nargs == 2: + conarg0, conarg1 = (conv(args[0]), conv(args[1])) + if (isinstance(conarg0, int) and isinstance(conarg1, int)): + return [fn(x) for x in range(conarg0, conarg1 + 1)] + raise TypeError("expecting names or indices") + elif nargs == 1: + if isinstance(args[0], (list, tuple)): + return [fn(x) for x in conv(args[0])] + conarg0 = conv(args[0]) + if isinstance(conarg0, int): + return fn(conarg0) + raise TypeError("expecting name or index") + elif nargs == 0: + return apply_freeform_one_arg(fn, conv, 0, + (list(range(maxval)),)) + raise WrongNumberOfArgumentsError()
+ + + +
+[docs] +def apply_pairs(fn, conv, *args): + """non-public""" + nargs = len(args) + if nargs == 2: + fn([conv(args[0])], [args[1]]) + return + if nargs == 1: + pair = unzip(args[0]) + # NB: If pair is empty, then we do nothing. + if pair: + fn(conv(pair[0]), list(pair[1])) + return + raise WrongNumberOfArgumentsError(nargs)
+ + + +
+[docs] +def delete_set_by_range(fn, conv, max_num, *args): + """non-public""" + nargs = len(args) + if nargs == 0: + # Delete All: + if max_num > 0: + fn(0, max_num - 1) + elif nargs == 1: + # Delete all items from a possibly unordered list of mixed types: + args = listify(conv(args[0])) + ranges = make_ranges(list(sorted(args))) + for i, j in reversed(list(ranges)): + fn(i, j) + elif nargs == 2: + # Delete range from arg[0] to arg[1]: + fn(conv(args[0]), conv(args[1])) + else: + raise WrongNumberOfArgumentsError()
+ + + +class _group(): + """Object to contain constraint groups""" + + def __init__(self, gp): + """Constructor for the _group object + + gp is a list of tuples of length two (the first entry of which + is the preference for the group (a float), the second of which + is a tuple of pairs (type, id), where type is an attribute of + conflict.constraint_type and id is either an index or a valid + name for the type). + + Example input: [(1.0, ((2, 0),)), (1.0, ((3, 0), (3, 1)))] + """ + self._gp = gp + + def __str__(self): + return str(self._gp) + + +
+[docs] +def make_group(conv, max_num, c_type, *args): + """Returns a _group object + + input: + conv - a function that will convert names to indices + max_num - number of existing constraints of a given type + c_type - constraint type + args - arbitrarily many arguments (see description below) + + If args is empty, every constraint/bound is assigned weight 1.0. + + If args is of length one or more, every constraint/bound is assigned + a weight equal to the float passed in as the first item. + + If args contains additional items, they determine a subset of + constraints/bounds to be included. If one index or name is + specified, it is the only one that will be included. If two indices + or names are specified, all constraints between the first and the + second, inclusive, will be included. If a sequence of names or + indices is passed in, all of their constraints/bounds will be + included. + + See example usage in _subinterfaces.ConflictInterface. + """ + nargs = len(args) + if nargs <= 1: + cons = list(range(max_num)) + if nargs == 0: + weight = 1.0 + else: + weight = args[0] + if nargs == 2: + weight = args[0] + cons = listify(conv(args[1])) + elif nargs == 3: + cons = list(range(conv(args[1]), conv(args[2]) + 1)) + return _group([(weight, ((c_type, i),)) for i in cons])
+ + + +
+[docs] +def init_list_args(*args): + """Initialize default arguments with empty lists if necessary.""" + return tuple([] if a is None else a for a in args)
+ + + +
+[docs] +def listify(x): + """Returns [x] if x isn't already a list. + + This is used to wrap arguments for functions that require lists. + """ + # Assumes name to index conversions already done. + assert not isinstance(x, str) + try: + iter(x) + return x + except TypeError: + return [x]
+ + + +def _cachelookup(item, getindexfunc, cache): + try: + idx = cache[item] + except KeyError: + idx = getindexfunc(item) + cache[item] = idx + return idx + + +# If the CPLEX_PY_DISABLE_NAME_CONV environment variable is defined, +# we will skip name-to-index conversion (i.e., these functions become +# no-ops), which can improve performance. +if CPLEX_PY_DISABLE_NAME_CONV: + + def convert_sequence( + seq, + getindexfunc, + cache=None + ): # pylint: disable=unused-argument + """Returns seq immediately. + + See comments about CPLEX_PY_DISABLE_NAME_CONV. + """ + return seq + + def convert( + name, + getindexfunc, + cache=None + ): # pylint: disable=unused-argument + """Returns name immediately. + + See comments about CPLEX_PY_DISABLE_NAME_CONV. + """ + return name + +else: + + # By default (i.e., if the CPLEX_PY_DISABLE_NAME_CONV environment + # variable is not defined), these functions perform name-to-index + # conversion, which can hurt performance. + +
+[docs] + def convert_sequence(seq, getindexfunc, cache=None): + """Converts a sequence of names to indices as necessary. + + If you are calling `convert` (see below) in a tight loop, but you + know that you are always working with a sequence, then it can be + more efficient to call this method directly (there is no overhead + checking if it is a sequence). + """ + if cache is None: + cache = {} + results = [] + for item in seq: + if isinstance(item, str): + idx = _cachelookup(item, getindexfunc, cache) + results.append(idx) + else: + results.append(item) + return results
+ + +
+[docs] + def convert(name, getindexfunc, cache=None): + """Converts from names to indices as necessary. + + If name is a string, an index is returned. + + If name is a sequence, a sequence of indices is returned. + + If name is neither (i.e., it's an integer), then that is returned + as is. + + getindexfunc is a function that takes a name and returns an index. + + The optional cache argument allows for further localized + caching (e.g., within a loop). + """ + # In some cases, it can be benficial to cache lookups. + if cache is None: + cache = {} + if isinstance(name, str): + return _cachelookup(name, getindexfunc, cache) + if isinstance(name, collections_abc.Sequence): + # It's tempting to use a recursive solution here, but that kills + # performance for the case where all indices are passed in (i.e., + # no names). This is due to the fact that we end up doing the + # extra check for sequence types over and over (above). + return convert_sequence(name, getindexfunc, cache) + return name
+ + + +
+[docs] +def unzip(iterable=None): + """Inverse of the zip function. + + Example usage: + + >>> z = list(zip([1, 2, 3], [4, 5, 6])) + >>> unzip(z) + [(1, 2, 3), (4, 5, 6)] + """ + if iterable is None: + iterable = [] + return list(zip(*iterable))
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_baseinterface.html b/docs/22.1.2.0/_modules/cplex/_internal/_baseinterface.html new file mode 100644 index 0000000..507b413 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_baseinterface.html @@ -0,0 +1,189 @@ + + + + + + + cplex._internal._baseinterface — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._baseinterface

+# --------------------------------------------------------------------------
+# File: _baseinterface.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Base-interface of the CPLEX API"""
+import weakref
+from . import _aux_functions as _aux
+
+
+
+[docs] +class BaseInterface(): + """Common methods for sub-interfaces.""" + +
+[docs] + def __init__(self, cplex, advanced=False, getindexfunc=None): + """Creates a new BaseInterface. + + This class is not meant to be instantiated directly nor used + externally. + """ + if advanced: + self._cplex = cplex + else: + self._cplex = weakref.proxy(cplex) + self._env = weakref.proxy(cplex._env) + self._get_index_function = getindexfunc
+ + + def _conv(self, name, cache=None): + """Converts from names to indices as necessary.""" + return _aux.convert(name, self._get_index, cache) + + @staticmethod + def _add_iter(getnumfun, addfun, *args, **kwargs): + """non-public""" + old = getnumfun() + addfun(*args, **kwargs) + return range(old, getnumfun()) + + @staticmethod + def _add_single(getnumfun, addfun, *args, **kwargs): + """non-public""" + addfun(*args, **kwargs) + return getnumfun() - 1 # minus one for zero-based indices + + def _get_index(self, name): + return self._get_index_function( + self._env._e, self._cplex._lp, name) + +
+[docs] + def get_indices(self, name): + """Converts from names to indices. + + If name is a string, get_indices returns the index of the + object with that name. If no such object exists, an + exception is raised. + + If name is a sequence of strings, get_indices returns a list + of the indices corresponding to the strings in name. + Equivalent to map(self.get_indices, name). + + If the subclass does not provide an index function (i.e., the + interface is not indexed), then a NotImplementedError is raised. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["a", "b"]) + >>> c.variables.get_indices("a") + 0 + >>> c.variables.get_indices(["a", "b"]) + [0, 1] + """ + if self._get_index_function is None: + raise NotImplementedError("This is not an indexed interface") + if isinstance(name, str): + return self._get_index(name) + return [self._get_index(x) for x in name]
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_matrices.html b/docs/22.1.2.0/_modules/cplex/_internal/_matrices.html new file mode 100644 index 0000000..79b84be --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_matrices.html @@ -0,0 +1,386 @@ + + + + + + + cplex._internal._matrices — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._matrices

+# -----------------------------------------------------------------------
+# File: _matrices.py
+# -----------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# -----------------------------------------------------------------------
+"""
+:undocumented: _C_HB_Matrix, _HB_Matrix
+"""
+
+from ._aux_functions import init_list_args, validate_arg_lengths
+from ..exceptions import CplexError
+from . import _pycplex as CPX
+
+class SparsePair():
+    """A class for storing sparse vector data.
+
+    An instance of this class has two attributes, ind and val.  ind
+    specifies the indices and val specifies the values.  ind and val
+    must be sequences of the same length.  In general, ind may contain
+    any identifier; for example, when a SparsePair object is passed to
+    Cplex.linear_constraints.add, its ind attribute may be a list
+    containing both variable names and variable indices.
+    """
+
+    __module__ = "cplex"
+
+
+[docs] + def __init__(self, ind=None, val=None): + """Constructor for SparsePair. + + Takes two arguments, ind and val; ind specifies the indices that + the SparsePair refers to, and val specifies the float values + associated with those indices; ind and val must have the same + length. If ind or val is omitted, they will default to an empty + list. + + >>> spair = SparsePair(ind=[0], val=[1.0]) + """ + ind, val = init_list_args(ind, val) + self.ind = ind + self.val = val + if not self.isvalid(): + raise CplexError("Inconsistent input data to SparsePair")
+ + +
+[docs] + def __repr__(self): + """Representation method of SparsePair. + + Example usage: + + >>> SparsePair(ind=[0], val=[1.0]) + SparsePair(ind = [0], val = [1.0]) + """ + return "".join(["SparsePair(ind = ", + repr(self.ind), + ", val = ", + repr(self.val), ")"])
+ + +
+[docs] + def isvalid(self): + """Tests that ind and val have the same length. + + Example usage: + + >>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0]) + >>> spair.isvalid() + True + """ + return len(self.ind) == len(self.val)
+ + +
+[docs] + def unpack(self): + """Extracts the indices and values sequences as a tuple. + + Returns ind and val as given in __init__. + + >>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0]) + >>> ind, val = spair.unpack() + """ + return self.ind, self.val
+ + + +class _HBMatrix(): + """non-public + + :undocumented: __init__, __len__, __getitem__ + """ + + def __init__(self, matrix=None, matbeg=None, matind=None, matval=None): + """non-public""" + self.matbeg = [] + self.matind = [] + self.matval = [] + if matrix is not None: + for vector in matrix: + if isinstance(vector, SparsePair): + ind = vector.ind + val = vector.val + else: + ind = vector[0] + val = vector[1] + validate_arg_lengths([ind, val]) + self.matbeg.append(len(self.matind)) + self.matind.extend(ind) + self.matval.extend(val) + else: + self.matbeg = matbeg + self.matind = matind + self.matval = matval + + def __len__(self): + """non-public""" + return len(self.matbeg) + + def __getitem__(self, key): + """non-public""" + if isinstance(key, int): + if key < 0: + key += len(self) + begin = self.matbeg[key] + if key == len(self) - 1: + end = len(self.matind) + else: + end = self.matbeg[key + 1] + return SparsePair(CPX._getArrayView(self.matind, begin, end), CPX._getArrayView(self.matval, begin, end)) + elif isinstance(key, slice): + start, stop, step = key.start, key.stop, key.step + if start is None: + start = 0 + if stop is None or stop > len(self): + stop = len(self) + if step is None: + step = 1 + return [self[i] for i in range(start, stop, step)] + else: + raise TypeError + + def __iter__(self): + for i in range(len(self)): + yield self[i] + + +class SparseTriple(): + """A class for storing sparse matrix data. + + An instance of this class has three attributes, ind1, ind2, and val. + ind1 and ind2 specify the indices and val specifies the values. + ind1, ind2, and val must be sequences of the same length. In + general, ind1 and ind2 may contain any identifier; for example, when + a SparseTriple object is passed to Cplex.quadratic_constraints.add, + its ind1 attribute may be a list containing both variable names and + variable indices. + """ + + __module__ = "cplex" + +
+[docs] + def __init__(self, ind1=None, ind2=None, val=None): + """Constructor for SparseTriple. + + Takes three arguments, ind1, ind2 and val, specifying the + indices that the SparseTriple refers to and the float values + associated with those indices, respectively. ind1, ind2, and + val must all have the same length. If ind1, ind2, or val is + omitted, they will default to an empty list. + + >>> striple = SparseTriple(ind1=[0], ind2=[0], val=[1.0]) + """ + ind1, ind2, val = init_list_args(ind1, ind2, val) + self.ind1 = ind1 + self.ind2 = ind2 + self.val = val + if not self.isvalid(): + raise CplexError("Inconsistent input data to SparseTriple")
+ + +
+[docs] + def __repr__(self): + """Representation method of SparseTriple. + + Example usage: + + >>> SparseTriple(ind1=[0], ind2=[0], val=[1.0]) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + """ + return "".join(["SparseTriple(ind1 = ", + repr(self.ind1), + ", ind2 = ", + repr(self.ind2), + ", val = ", + repr(self.val), ")"])
+ + +
+[docs] + def isvalid(self): + """Tests that ind1, ind2, and val have the same length. + + Example usage: + + >>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1], + ... val=[1.0, 1.0]) + >>> striple.isvalid() + True + """ + return (len(self.ind1) == len(self.ind2) and + len(self.ind1) == len(self.val))
+ + +
+[docs] + def unpack(self): + """Extracts the indices and values sequences as a tuple. + + Returns ind1, ind2, and val as given in __init__. + + >>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1], + ... val=[1.0, 1.0]) + >>> ind1, ind2, val = striple.unpack() + """ + return self.ind1, self.ind2, self.val
+ + + +
+[docs] +def unpack_pair(item): + """Extracts the indices and values from an object. + + The argument item can either be an instance of SparsePair or a + sequence of length two. + + Example usage: + + >>> sp = SparsePair() + >>> ind, val = unpack_pair(sp) + >>> lin_expr = [[], []] + >>> ind, val = unpack_pair(lin_expr) + """ + try: + assert item.isvalid() + ind, val = item.unpack() + except AttributeError: + ind, val = item[0:2] + validate_arg_lengths([ind, val]) + return ind, val
+ + + +
+[docs] +def unpack_triple(item): + """Extracts the indices and values from an object. + + The argument item can either be an instance of SparseTriple or a + sequence of length three. + + Example usage: + + >>> st = SparseTriple() + >>> ind1, ind2, val = unpack_triple(st) + >>> quad_expr = [[], [], []] + >>> ind1, ind2, val = unpack_triple(quad_expr) + """ + try: + assert item.isvalid() + ind1, ind2, val = item.unpack() + except AttributeError: + ind1, ind2, val = item[0:3] + validate_arg_lengths([ind1, ind2, val]) + return ind1, ind2, val
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_multiobj.html b/docs/22.1.2.0/_modules/cplex/_internal/_multiobj.html new file mode 100644 index 0000000..6fdc27a --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_multiobj.html @@ -0,0 +1,772 @@ + + + + + + + cplex._internal._multiobj — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._multiobj

+# --------------------------------------------------------------------------
+# File: _multiobj.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Multi-Objective API"""
+from ._baseinterface import BaseInterface
+from ._subinterfaces import ObjSense
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+from . import _matrices as _mat
+from . import _pycplex as CPX
+
+class _Pair():
+    def __init__(self):
+        self.first = None
+        self.second = None
+
+
+
+[docs] +class MultiObjInterface(BaseInterface): + """Methods for adding, querying, and modifying multiple objectives. + + The methods in this interface can be used to add, query, and modify + objectives in a specified problem. These objectives are used when + multi-objective optimization is initiated. + + See also `MultiObjSolnInterface` where methods for accessing + solutions for multi-objective models can be found. + + For more details see the section on multi-objective optimization in + the CPLEX User's Manual. + """ + + sense = ObjSense() + """See `ObjSense()`""" + +
+[docs] + def __init__(self, cpx): + """Creates a new MultiObjInterface. + + The Multi-Objective interface is exposed by the top-level `Cplex` + class as `Cplex.multiobj`. This constructor is not meant to be + used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.multiobjgetindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of objectives in the problem. + + See `CPXgetnumobjs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getnumobjs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.get_num() + 1 + >>> indices = c.multiobj.set_num(2) + >>> c.multiobj.get_num() + 2 + """ + return _proc.getnumobjs(self._env._e, self._cplex._lp)
+ + +
+[docs] + def set_num(self, numobj): + """Sets the number of objectives in the problem instance. + + There is always at least one objective in the problem instance + (indexed 0) thus numobj must be at least 1. If before calling + this method there were more objectives in the instance than the + specified numobj then the objectives whose index is >= numobj are + removed from the instance. If before calling this method the + number of objectives was <= numobj then new objectives are + created, all with all-zero coefficients and default settings + (like priority, weight, etc). + + See `CPXsetnumobjs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/setnumobjs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_num(2) + >>> c.multiobj.get_num() + 2 + """ + _proc.setnumobjs(self._env._e, self._cplex._lp, numobj)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of objectives. + + There are four forms by which multiobj.get_names may be called. + + multiobj.get_names() + return the names of all objectives from the problem. + + multiobj.get_names(i) + i must be an objective index. Returns the name of row i. + + multiobj.get_names(s) + s must be a sequence of objective indices. Returns the names of + the objectives with indices the members of s. Equivalent to + [multiobj.get_names(i) for i in s] + + multiobj.get_names(begin, end) + begin and end must be objective indices. Returns the names of + the objectives with indices between begin and end, inclusive of + end. Equivalent to multiobj.get_names(range(begin, end + 1)). + + See `CPXmultiobjgetname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetname.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_definition(0, name='mo1') + >>> c.multiobj.get_names(0) + 'mo1' + """ + def _get_name(objidx): + return _proc.multiobjgetname(self._env._e, self._cplex._lp, + objidx) + return _aux.apply_freeform_one_arg(_get_name, self._conv, + self.get_num(), args)
+ + +
+[docs] + def set_name(self, objidx, name): + """Sets the name of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_num(3) + >>> for i in range(3): + ... c.multiobj.set_name(i, str(i)) + >>> c.multiobj.get_names() + ['0', '1', '2'] + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, name=name)
+ + +
+[docs] + def get_definition(self, objidx, begin=None, end=None): + """Returns the definition of an objective. + + Returns an objective definitions, where the definition is a list + containing the following components: obj (a list containing the + linear objective coefficients), offset, weight, priority, abstol, + reltol (see `set_definition`). + + objidx is the name or index of the objective to be accessed. + + The optional begin and end arguments must be variable indices + or names. Together, begin and end specify the range of objective + function coefficients to be returned. By default, the linear + objective coefficients of all variables from the problem will be + returned (i.e., begin will default to the first variable index + and end will default to the last variable index). + + See `CPXmultiobjgetobj <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobj.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> varind = list(c.variables.add(obj=[1.0, 2.0])) + >>> c.multiobj.get_definition(0) + [[1.0, 2.0], 0.0, 1.0, 0, 0.0, 0.0] + """ + objidx = self._conv(objidx) + varconv = self._cplex.variables._conv + if begin is None: + begin = 0 + else: + begin = varconv(begin) + if end is None: + end = self._cplex.variables.get_num() - 1 + else: + end = varconv(end) + return _proc.multiobjgetobj(self._env._e, self._cplex._lp, + objidx, begin, end)
+ + +
+[docs] + def set_definition(self, objidx, obj=None, offset=0.0, weight=1.0, + priority=0, abstol=None, reltol=None, name=None): + """Sets the definition of an objective. + + multiobj.set_definition accepts the keyword arguments objidx, + obj, offset, weight, priority, abstol, reltol, and name. + + objidx is the name or index of the objective to be set. The + objective index must be in the interval + [0, Cplex.multiobj.get_num() - 1]. + + obj can be either a SparsePair or a list of two lists specifying + the linear component of the objective. If not specified, the + coefficients of every variable are set to 0.0. + + Note + obj must not contain duplicate indices. If obj references a + variable more than once, either by index, name, or a + combination of index and name, an exception will be raised. + + offset is the offset of the objective to be set. If not + specififed, the offset is set to 0.0. + + weight is the weight of the objective to be set. For the + definition of the weight see the description of blended objective + in the multi-objective optimization section of the CPLEX User's + Manual. If not specified, the weight is set to 1.0. + + priority is the priority of the objective to be set. It must be a + nonnegative integer. For the definition of the priority see the + description of lexicographic objective in the multi-objective + optimization section of the CPLEX User's Manual. If not + specified, the priority is set to 0. + + abstol is the absolute tolerance of the objective to be set. If + not specified, the absolute tolerance is set to 0.0. + + reltol is the relative tolerance of the objective to be set. If + not specified, the relative tolerance is set to 0.0. + + name is a string representing the name of the objective to be + set. If not specified, the objective name will default to None. + + See `CPXmultiobjsetobj <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjsetobj.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> varind = list(c.variables.add(names=['x1', 'x2'])) + >>> c.multiobj.set_definition( + ... objidx=0, + ... obj=cplex.SparsePair(ind=varind, val=[1.0, 2.0]), + ... offset=0.0, + ... weight=1.0, + ... priority=0, + ... abstol=1e-06, + ... reltol=1e-04, + ... name='obj1') + >>> c.multiobj.get_definition('obj1') + [[1.0, 2.0], 0.0, 1.0, 0, 1e-06, 0.0001] + >>> c.multiobj.get_names(0) + 'obj1' + """ + if obj is None: + obj = _mat.SparsePair() + objind, objval = _mat.unpack_pair(obj) + objind = self._cplex.variables._conv(objind) + if abstol is None: + abstol = self._cplex.parameters.mip.tolerances.absmipgap.default() + if reltol is None: + reltol = self._cplex.parameters.mip.tolerances.mipgap.default() + _proc.multiobjsetobj(self._env._e, self._cplex._lp, objidx, objind, + objval, offset, weight, priority, abstol, reltol, + name)
+ + +
+[docs] + def get_linear(self, objidx, *args): + """Returns the linear coefficients of a set of variables. + + Can be called by four forms each of which requires an objidx + argument. objidx must be an objective name or index. + + multiobj.get_linear(objidx) + return the linear objective coefficients of all variables + from the problem. + + multiobj.get_linear(objidx, i) + i must be a variable name or index. Returns the linear + objective coefficient of the variable whose index or name is i. + + multiobj.get_linear(objidx, s) + s must be a sequence of variable names or indices. Returns the + linear objective coefficient of the variables with indices the + members of s. Equivalent to + [multiobj.get_linear(objidx, i) for i in s] + + multiobj.get_linear(objidx, begin, end) + begin and end must be variable indices or variable names. + Returns the linear objective coefficient of the variables with + indices between begin and end, inclusive of end. Equivalent to + multiobj.get_linear(objidx, range(begin, end + 1)). + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... obj=[1.5 * i for i in range(10)], + ... names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.multiobj.get_linear(0, 8) + 12.0 + >>> c.multiobj.get_linear(0, '1', 3) + [1.5, 3.0, 4.5] + >>> c.multiobj.get_linear(0, [2, '0', 5]) + [3.0, 0.0, 7.5] + >>> c.multiobj.get_linear(0) + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + (coeffs, _, _, _, _, _) = self.get_definition(objidx) + def getcoeffs(begin, end=self._cplex.variables.get_num() - 1): + return CPX._getArrayView(coeffs, begin, end + 1) + return _aux.apply_freeform_two_args( + getcoeffs, self._cplex.variables._conv, args)
+ + +
+[docs] + def set_linear(self, objidx, *args): + """Changes the linear part of an objective function. + + Can be called by two forms each of which requires an objidx + argument. objidx must be an objective name or index. + + multiobj.set_linear(objidx, var, value) + var must be a variable index or name and value must be a float. + Changes the coefficient of the variable identified by var to + value. + + multiobj.set_linear(objidx, sequence) + sequence is a sequence of pairs (var, value) as described + above. Changes the coefficients for the specified variables to + the given values. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(4)]) + >>> c.multiobj.get_linear(0) + [0.0, 0.0, 0.0, 0.0] + >>> c.multiobj.set_linear(0, 0, 1.0) + >>> c.multiobj.get_linear(0) + [1.0, 0.0, 0.0, 0.0] + >>> c.multiobj.set_linear(0, '3', -1.0) + >>> c.multiobj.get_linear(0) + [1.0, 0.0, 0.0, -1.0] + >>> c.multiobj.set_linear(0, [('2', 2.0), (1, 0.5)]) + >>> c.multiobj.get_linear(0) + [1.0, 0.5, 2.0, -1.0] + """ + objidx = self._conv(objidx) + pair = _Pair() + # NB: pair.first and pair.second get set as a side effect of + # running apply_pairs below! + def set_pair(first, second): + pair.first = first + pair.second = second + _aux.apply_pairs(set_pair, self._cplex.variables._conv, *args) + ncols = self._cplex.variables.get_num() + allind = list(range(ncols)) + # To preserve the values that have not been provided, we query + # current objective. This is to maintain consistent semantics + # with Cplex.objective.set_linear. + allval = self._cplex.multiobj.get_linear(objidx) + for idx, val in zip(pair.first, pair.second): + allval[idx] = val + _proc.multiobjsetobj(self._env._e, self._cplex._lp, objidx, + objind=allind, objval=allval)
+ + +
+[docs] + def get_sense(self): + """Returns the sense of all objective functions. + + See `ObjSense`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + >>> c.multiobj.set_sense(c.multiobj.sense.maximize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'maximize' + >>> c.multiobj.set_sense(c.multiobj.sense.minimize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + """ + return self._cplex.objective.get_sense()
+ + +
+[docs] + def set_sense(self, sense): + """Sets the sense of all objective functions. + + Note + All objective functions share the same sense. To model an + objective with a different sense use a negative value for the + weight attribute. See `set_weight`. + + The argument to this method must be either `ObjSense.minimize` + or `ObjSense.maximize`. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + >>> c.multiobj.set_sense(c.multiobj.sense.maximize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'maximize' + >>> c.multiobj.set_sense(c.multiobj.sense.minimize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + """ + self._cplex.objective.set_sense(sense)
+ + +
+[docs] + def get_offset(self, objidx): + """Returns the constant offset of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_offset(0) + 0.0 + """ + (_, offset, _, _, _, _) = self.get_definition(objidx) + return offset
+ + +
+[docs] + def set_offset(self, objidx, offset): + """Sets the constant offset of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.objective.set_offset(3.14) + >>> c.objective.get_offset() + 3.14 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, offset=offset)
+ + +
+[docs] + def get_weight(self, objidx): + """Returns the weight of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_weight(0) + 1.0 + """ + (_, _, weight, _, _, _) = self.get_definition(objidx) + return weight
+ + +
+[docs] + def set_weight(self, objidx, weight): + """Sets the weight of an objective function. + + objidx must be an objective name or index. + + Note + All objective functions share the same sense. To model an + objective with a different sense use a negative value for the + weight attribute. See `set_sense`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_weight(0, -2.0) + >>> c.multiobj.get_weight(0) + -2.0 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, weight=weight)
+ + +
+[docs] + def get_priority(self, objidx): + """Returns the priority of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_priority(0) + 0 + """ + (_, _, _, priority, _, _) = self.get_definition(objidx) + return priority
+ + +
+[docs] + def set_priority(self, objidx, priority): + """Sets the priority of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_priority(0, 2) + >>> c.multiobj.get_priority(0) + 2 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, priority=priority)
+ + +
+[docs] + def get_abstol(self, objidx): + """Returns the absolute tolerance of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_abstol(0) + 0.0 + """ + (_, _, _, _, abstol, _) = self.get_definition(objidx) + return abstol
+ + +
+[docs] + def set_abstol(self, objidx, abstol): + """Sets the absolute tolerance of an objective function. + + objidx must be an objective name or index. + + abstol should be a float. When specifying a new value, the same + limits apply as with the + Cplex.parameters.mip.tolerances.absmipgap parameter. See the + section on Specifying multiple objective problems in the CPLEX + User's Manual for the details on the meaning of this tolerance. + + See `CPXmultiobjchgattribs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjchgattribs.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_abstol(0, 1e-6) + >>> c.multiobj.get_abstol(0) + 1e-06 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, abstol=abstol)
+ + +
+[docs] + def get_reltol(self, objidx): + """Returns the relative tolerance of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_reltol(0) + 0.0 + """ + (_, _, _, _, _, reltol) = self.get_definition(objidx) + return reltol
+ + +
+[docs] + def set_reltol(self, objidx, reltol): + """Sets the relative tolerance of an objective function. + + objidx must be an objective name or index. + + reltol should be a float. When specifying a new value, the same + limits apply as with the Cplex.parameters.mip.tolerances.mipgap + parameter. Note that a nondefault setting of this parameter only + applies to MIP multiobjective problems. See the section on + Specifying multiple objective problems in the CPLEX User's Manual + for the details on the meaning of this tolerance. + + See `CPXmultiobjchgattribs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjchgattribs.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_reltol(0, 1e-4) + >>> c.multiobj.get_reltol(0) + 0.0001 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, reltol=reltol)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_multiobjsoln.html b/docs/22.1.2.0/_modules/cplex/_internal/_multiobjsoln.html new file mode 100644 index 0000000..a19c980 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_multiobjsoln.html @@ -0,0 +1,444 @@ + + + + + + + cplex._internal._multiobjsoln — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._multiobjsoln

+# --------------------------------------------------------------------------
+# File: _multiobjsoln.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Multi-Objective Solution API"""
+from . import _constants as _const
+from . import _procedural as _proc
+from ._baseinterface import BaseInterface
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class MultiObjFloatInfo(ConstantClass): + """Types of floating point information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + time = _const.CPX_MULTIOBJ_TIME + """See `CPX_MULTIOBJ_TIME <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_TIME.html>`_ in the C API.""" + + dettime = _const.CPX_MULTIOBJ_DETTIME + """See `CPX_MULTIOBJ_DETTIME <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DETTIME.html>`_ in the C API.""" + + objective = _const.CPX_MULTIOBJ_OBJVAL + """See `CPX_MULTIOBJ_OBJVAL <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_OBJVAL.html>`_ in the C API.""" + + best_objective = _const.CPX_MULTIOBJ_BESTOBJVAL + """See `CPX_MULTIOBJ_BESTOBJVAL <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BESTOBJVAL.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjIntInfo(ConstantClass): + """Types of integer information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + error = _const.CPX_MULTIOBJ_ERROR + """See `CPX_MULTIOBJ_ERROR <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_ERROR.html>`_ in the C API.""" + + status = _const.CPX_MULTIOBJ_STATUS + """See `CPX_MULTIOBJ_STATUS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_STATUS.html>`_ in the C API.""" + + method = _const.CPX_MULTIOBJ_METHOD + """See `CPX_MULTIOBJ_METHOD <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_METHOD.html>`_ in the C API.""" + + priority = _const.CPX_MULTIOBJ_PRIORITY + """See `CPX_MULTIOBJ_PRIORITY <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PRIORITY.html>`_ in the C API.""" + + blend = _const.CPX_MULTIOBJ_BLEND + """See `CPX_MULTIOBJ_BLEND <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BLEND.html>`_ in the C API.""" + + pfeas = _const.CPX_MULTIOBJ_PFEAS + """See `CPX_MULTIOBJ_PFEAS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PFEAS.html>`_ in the C API.""" + + dfeas = _const.CPX_MULTIOBJ_DFEAS + """See `CPX_MULTIOBJ_DFEAS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DFEAS.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjLongInfo(ConstantClass): + """Types of long integer information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + num_barrier_iterations = _const.CPX_MULTIOBJ_BARITCNT + """See `CPX_MULTIOBJ_BARITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BARITCNT.html>`_ in the C API.""" + + num_sifting_iterations = _const.CPX_MULTIOBJ_SIFTITCNT + """See `CPX_MULTIOBJ_SIFTITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_SIFTITCNT.html>`_ in the C API.""" + + num_sifting_phase1_iterations = _const.CPX_MULTIOBJ_SIFTPHASE1CNT + """See `CPX_MULTIOBJ_SIFTPHASE1CNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_SIFTPHASE1CNT.html>`_ in the C API.""" + + num_degenerate_iterations = _const.CPX_MULTIOBJ_DEGCNT + """See `CPX_MULTIOBJ_DEGCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DEGCNT.html>`_ in the C API.""" + + num_iterations = _const.CPX_MULTIOBJ_ITCNT + """See `CPX_MULTIOBJ_ITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_ITCNT.html>`_ in the C API.""" + + num_phase1_iterations = _const.CPX_MULTIOBJ_PHASE1CNT + """See `CPX_MULTIOBJ_PHASE1CNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PHASE1CNT.html>`_ in the C API.""" + + num_primal_pushes = _const.CPX_MULTIOBJ_PPUSH + """See `CPX_MULTIOBJ_PPUSH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PPUSH.html>`_ in the C API.""" + + num_primal_exchanges = _const.CPX_MULTIOBJ_PEXCH + """See `CPX_MULTIOBJ_PEXCH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PEXCH.html>`_ in the C API.""" + + num_dual_pushes = _const.CPX_MULTIOBJ_DPUSH + """See `CPX_MULTIOBJ_DPUSH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DPUSH.html>`_ in the C API.""" + + num_dual_exchanges = _const.CPX_MULTIOBJ_DEXCH + """See `CPX_MULTIOBJ_DEXCH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DEXCH.html>`_ in the C API.""" + + num_nodes = _const.CPX_MULTIOBJ_NODECNT + """See `CPX_MULTIOBJ_NODECNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_NODECNT.html>`_ in the C API.""" + + num_nodes_left = _const.CPX_MULTIOBJ_NODELEFTCNT + """See `CPX_MULTIOBJ_NODELEFTCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_NODELEFTCNT.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjSolnInterface(BaseInterface): + """Methods for accessing solutions for multi-objective models. + + The methods in this interface can be used to query solutions for + multi-objective models. + + See also `MultiObjInterface` where methods for adding, querying, and + modifying multiple objectives can be found. + """ + + float_info = MultiObjFloatInfo() + """See `MultiObjFloatInfo()` """ + + int_info = MultiObjIntInfo() + """See `MultiObjIntInfo()` """ + + long_info = MultiObjLongInfo() + """See `MultiObjLongInfo()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new MIPSolutionInterface. + + The multi-objective solution interface is exposed by the + top-level `Cplex` class as Cplex.solution.multiobj. This + constructor is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_objective_value(self, objidx): + """Returns the value of an objective function. + + objidx is the name or index of the objective to be accessed. + + See `CPXmultiobjgetobjval <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobjval.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.solve() + >>> c.solution.multiobj.get_objective_value(0) + -202.5 + >>> c.solution.multiobj.get_objective_value(1) + -202.5 + """ + objidx = self._cplex.multiobj._conv(objidx) + return _proc.multiobjgetobjval( + self._env._e, + self._cplex._lp, + objidx)
+ + +
+[docs] + def get_objval_by_priority(self, priority): + """Returns the value of an objective function by priority. + + After multi-objective optimization, returns the blended objective + value for the specified priority. + + See `CPXmultiobjgetobjvalbypriority <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobjvalbypriority.html>`_ in the Callable + Library Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> c.solution.multiobj.get_objval_by_priority(1) + -202.5 + >>> c.solution.multiobj.get_objval_by_priority(2) + -202.5 + """ + return _proc.multiobjgetobjvalbypriority( + self._env._e, + self._cplex._lp, + priority)
+ + +
+[docs] + def get_num_solves(self): + """Returns the number of sub-problems that where successfully + solved during the last optimization of a multi-objective problem. + + See `CPXmultiobjgetnumsolves <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetnumsolves.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> c.solution.multiobj.get_num_solves() + 2 + """ + return _proc.multiobjgetnumsolves(self._env._e, self._cplex._lp)
+ + + @staticmethod + def _isintinfo(what): + try: + _ = MultiObjSolnInterface.int_info[what] + return True + except KeyError: + return False + + @staticmethod + def _islonginfo(what): + try: + _ = MultiObjSolnInterface.long_info[what] + return True + except KeyError: + return False + + @staticmethod + def _isdblinfo(what): + try: + _ = MultiObjSolnInterface.float_info[what] + return True + except KeyError: + return False + +
+[docs] + def get_info(self, subprob, what): + """Returns the solution information of a sub-problem of a + multi-objective optimization. + + subprob is the sub-problem of a multi-objective optimization. + + what is an attribute from Cplex.solution.multiobj.float_info + (see `MultiObjFloatInfo`), Cplex.solution.multiobj.int_info + (see `MultiObjIntInfo`), or Cplex.solution.multiobj.long_info + (see `MultiObjLongInfo`). + + See `CPXmultiobjgetdblinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetdblinfo.html>`_, + `CPXmultiobjgetintinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetintinfo.html>`_, + `CPXmultiobjgetlonginfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetlonginfo.html>`_, etc. in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> num = c.solution.multiobj.get_num_solves() + >>> for i in range(num): + ... priority = c.solution.multiobj.get_info( + ... i, + ... c.solution.multiobj.int_info.priority + ... ) + """ + if MultiObjSolnInterface._isintinfo(what): + return _proc.multiobjgetintinfo(self._env._e, self._cplex._lp, + subprob, what) + if MultiObjSolnInterface._islonginfo(what): + return _proc.multiobjgetlonginfo(self._env._e, self._cplex._lp, + subprob, what) + if MultiObjSolnInterface._isdblinfo(what): + return _proc.multiobjgetdblinfo(self._env._e, self._cplex._lp, + subprob, what) + raise ValueError(what)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_parameter_classes.html b/docs/22.1.2.0/_modules/cplex/_internal/_parameter_classes.html new file mode 100644 index 0000000..cd05c10 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_parameter_classes.html @@ -0,0 +1,1460 @@ + + + + + + + cplex._internal._parameter_classes — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._parameter_classes

+# --------------------------------------------------------------------------
+# File: _parameter_classes.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Parameters for the CPLEX Python API.
+
+This module defines classes for parameters, groups of parameters, and
+parameter constants used in the CPLEX Python API.  For more detail, see also
+the corresponding commands of the Interactive Optimizer documented in the
+CPLEX Parameters Reference Manual.
+"""
+import functools
+import weakref
+
+from ._aux_functions import init_list_args
+from . import _procedural as CPX_PROC
+from . import _constants
+from ..exceptions import CplexError, CplexSolverError, error_codes
+from ..paramset import ParameterSet
+from ..constant_class import ConstantClass
+
+
+def _get_info_wrapper(func):
+    """Decorator to lazily load parameter info.
+
+    We have to lazily load parameter info in several methods of the
+    Parameter class. This decorator makes it easy and consistent to do
+    this.
+    """
+    @functools.wraps(func)
+    def wrap(self, *args, **kwargs):
+        # First, lazily load parameter info if necc.
+        self._get_info()
+        # Then call the function.
+        return func(self, *args, **kwargs)
+    return wrap
+
+
+
+[docs] +class Parameter(): + """Base class for Cplex parameters. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env, about, parent, name, constants=None): + """non-public""" + self._env = weakref.proxy(env) + self._id, self._help, self._type = about + self._parent = parent + self._name = name + if constants is not None: + self.values = constants() + self._has_info = False + # self._defval gets set lazily by self._get_info(). + self._defval = None
+ + +
+[docs] + def __repr__(self): + """Returns the name of the parameter within the hierarchy.""" + return "".join([self._parent.__repr__(), '.', self._name])
+ + + def _check_value(self, value): + """Checks the validity of the parameter value.""" + raise NotImplementedError + +
+[docs] + def set(self, value): + """Sets the parameter to value.""" + self._check_value(value) + try: + self._env.parameters._set(self._id, value, self._type) + except TypeError: + # Replace ugly TypeError message from the SWIG layer with + # something more informative. + raise TypeError("invalid parameter value: {0}".format(value))
+ + +
+[docs] + def get(self): + """Returns the current value of the parameter.""" + return self._env.parameters._get(self._id, self._type)
+ + +
+[docs] + def reset(self): + """Sets the parameter to its default value.""" + try: + self.set(self.default()) + except CplexSolverError as cse: + if ((self._id == _constants.CPX_PARAM_CPUMASK) and + cse.args[2] == error_codes.CPXERR_UNSUPPORTED_OPERATION): + pass + else: + raise
+ + + def _get_info(self): + """Lazily load the default, min, and max values.""" + raise NotImplementedError + +
+[docs] + @_get_info_wrapper + def default(self): + """Returns the default value of the parameter.""" + return self._defval
+ + +
+[docs] + def type(self): + """Returns the type of the parameter. + + Allowed types are float, int, and str. + """ + return type(self.default())
+ + +
+[docs] + def help(self): + """Returns the documentation for the parameter.""" + return self._help
+
+ + + +
+[docs] +class NumParameter(Parameter): + """Class for integer and float parameters. + + :undocumented: __init__ + """ + + @_get_info_wrapper + def _check_value(self, value): + """Checks the validity of the parameter value.""" + # As we define a special min value for CPX_PARAM_CLONELOG in the Python API + # we have to have special handling for it. + if (self._id == _constants.CPX_PARAM_CLONELOG and + value < self._minval): + raise ValueError("invalid {0} parameter value: {1}".format( + self._name, value)) + + def _get_info(self): + """Lazily load the default, min, and max values.""" + if self._has_info: + return + self._has_info = True + (self._defval, + self._minval, + self._maxval) = self._env.parameters._get_info(self._id, self._type) + # Override some default values for the Python API. + if self._id == _constants.CPX_PARAM_CLONELOG: + self._minval = 0 + elif self._id == _constants.CPX_PARAM_DATACHECK: + self._defval = _constants.CPX_DATACHECK_WARN + +
+[docs] + @_get_info_wrapper + def min(self): + """Returns the minimum value for the parameter.""" + return self._minval
+ + +
+[docs] + @_get_info_wrapper + def max(self): + """Returns the maximum value for the parameter.""" + return self._maxval
+
+ + + +
+[docs] +class StrParameter(Parameter): + """Class for string parameters. + + :undocumented: __init__ + """ + + def _check_value(self, value): + """Checks the validity of the parameter value.""" + + def _get_info(self): + """Lazily load the default value. + + Note + For string parameters there is no min and max value. + """ + if self._has_info: + return + self._has_info = True + self._defval = self._env.parameters._get_info(self._id, self._type)
+ + + +
+[docs] +class ParameterGroup(): + """Class containing a group of Cplex parameters. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env, members, parent): + """non-public""" + self._env = weakref.proxy(env) + self._parent = parent + # self._name gets set dynamically below when we call + # self.__dict__.update() (see _parameter_hierarchy.py). + self._name = None + self.__dict__.update(members(env, self))
+ + +
+[docs] + def __repr__(self): + """Returns the name of the parameter group within the hierarchy.""" + return "".join([self._parent.__repr__(), '.', self._name])
+ + +
+[docs] + def reset(self): + """Sets the parameters in the group to their default values.""" + for member in self.__dict__.values(): + if (isinstance(member, (ParameterGroup, Parameter)) and + member != self._parent): + member.reset()
+ + + def _get_params(self, filterfunc): + """non-public""" + retval = [] + for member in self.__dict__.values(): + if isinstance(member, ParameterGroup) and member != self._parent: + retval.extend(member._get_params(filterfunc)) + if isinstance(member, Parameter): + if filterfunc(member): + retval.append((member, member.get())) + return retval + +
+[docs] + def get_changed(self): + """Returns a list of the changed parameters in the group. + + Returns a list of (parameter, value) pairs. Each parameter is + an instance of the Parameter class, and thus the parameter + value can be changed via its set method, or this object can be + passed to the tuning functions. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.read.datacheck.set( + ... c.parameters.read.datacheck.values.assist) + >>> for parameter, value in c.parameters.get_changed(): + ... pass # do something + """ + return self._get_params(lambda x: x.get() != x.default())
+ + +
+[docs] + def get_all(self): + """Returns a list of all the parameters in the group. + + Returns a list of (parameter, value) pairs. Each parameter is + an instance of the Parameter class, and thus the parameter + value can be changed via its set method, or this object can be + passed to the tuning functions. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> for parameter, value in c.parameters.get_all(): + ... pass # do something + """ + return self._get_params(lambda x: True)
+
+ + + +
+[docs] +class TuningConstants(ConstantClass): + """Status codes returned by tuning methods. + + For an explanation of tuning, see that topic in + the CPLEX User's Manual. + """ + + completed = 0 # There is no constant for this. + abort = _constants.CPX_TUNE_ABORT + time_limit = _constants.CPX_TUNE_TILIM + dettime_limit = _constants.CPX_TUNE_DETTILIM
+ + + +
+[docs] +class RootParameterGroup(ParameterGroup): + """Class containing all the Cplex parameters. + + :undocumented: __init__, _set, _get, _get_info + """ + + tuning_status = TuningConstants() + """See `TuningConstants()`""" + +
+[docs] + def __init__(self, env, members): + if env is None and members is None: + return + env.parameters = self + super().__init__(env, members, None) + # At the C-level, the apiencoding parameter is always UTF-8 in + # the Python API. + self._set(_constants.CPX_PARAM_APIENCODING, "UTF-8", + _constants.CPX_PARAMTYPE_STRING) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_APIENCODING) + # Turn off access to presolved problem in callbacks in the Python API. + # CPX_PARAM_MIPCBREDLP is hidden so we have to set it via the + # parameter ID. + self._set(_constants.CPX_PARAM_MIPCBREDLP, 0, + _constants.CPX_PARAMTYPE_INT) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_MIPCBREDLP) + # Fix CPX_PARAM_SCRIND to "off" (see RTC-36832). + self._set(_constants.CPX_PARAM_SCRIND, _constants.CPX_OFF, + _constants.CPX_PARAMTYPE_INT) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_SCRIND) + # By default, the datacheck parameter is "on" in the Python API. + self.read.datacheck.set(_constants.CPX_DATACHECK_WARN)
+ + +
+[docs] + def reset(self): + """Sets the parameters in the group to their default values.""" + # Rather than calling ParameterGroup.reset(self), we can just + # reset using CPXXsetdefaults, which should be much faster. We + # still allow users to call reset() on individual parameters or + # parameter groups, though. + CPX_PROC.setdefaults(self._env._e) + # By default, the datacheck parameter is "on" in the Python API. + self.read.datacheck.set(_constants.CPX_DATACHECK_WARN)
+ + +
+[docs] + def __repr__(self): + """Return 'parameters'.""" + return self._name
+ + + def _set(self, which_parameter, value, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + if paramtype == _constants.CPX_PARAMTYPE_INT: + if isinstance(value, float): + value = int(value) # will upconvert to long, if necc. + CPX_PROC.setintparam(self._env._e, which_parameter, value) + elif paramtype == _constants.CPX_PARAMTYPE_DOUBLE: + if isinstance(value, int): + value = float(value) + CPX_PROC.setdblparam(self._env._e, which_parameter, value) + elif paramtype == _constants.CPX_PARAMTYPE_STRING: + CPX_PROC.setstrparam(self._env._e, which_parameter, value) + else: + assert paramtype == _constants.CPX_PARAMTYPE_LONG + if isinstance(value, float): + value = int(value) # will upconvert to long, if necc. + CPX_PROC.setlongparam(self._env._e, which_parameter, value) + + def _get(self, which_parameter, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + switcher = { + _constants.CPX_PARAMTYPE_INT: CPX_PROC.getintparam, + _constants.CPX_PARAMTYPE_DOUBLE: CPX_PROC.getdblparam, + _constants.CPX_PARAMTYPE_STRING: CPX_PROC.getstrparam, + _constants.CPX_PARAMTYPE_LONG: CPX_PROC.getlongparam + } + func = switcher[paramtype] + return func(self._env._e, which_parameter) + + def _get_info(self, which_parameter, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + switcher = { + _constants.CPX_PARAMTYPE_INT: CPX_PROC.infointparam, + _constants.CPX_PARAMTYPE_DOUBLE: CPX_PROC.infodblparam, + _constants.CPX_PARAMTYPE_STRING: CPX_PROC.infostrparam, + _constants.CPX_PARAMTYPE_LONG: CPX_PROC.infolongparam + } + func = switcher[paramtype] + return func(self._env._e, which_parameter) + + def _validate_fixed_args(self, fixed_parameters_and_values): + if isinstance(fixed_parameters_and_values, ParameterSet): + if fixed_parameters_and_values not in self._cplex._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + else: + return # done checking + valid = False # guilty until proven innocent + try: + paramset = set() + for (param, _) in fixed_parameters_and_values: + param_id, _ = param._id, param._type + if param_id in paramset: + raise CplexError("duplicate parameters detected") + else: + paramset.add(param_id) + # If we can iterate over fixed_parameters_and_values and + # access the _id and _type attributes of the parameters, + # then it's considered valid. + valid = True + except (AttributeError, TypeError): + pass + if not valid: + raise TypeError("invalid fixed_parameters_and_values arg detected") + + def _get_fixed_args_iter(self, arg): + if isinstance(arg, ParameterSet): + for param_id in arg.get_ids(): + param_type = CPX_PROC.getparamtype(self._env._e, param_id) + param_value = arg.get(param_id) + yield param_id, param_type, param_value + else: + for (param, value) in arg: + yield param._id, param._type, value + + def _process_fixed_args(self, fixed_parameters_and_values): + """non-public""" + if __debug__: + self._validate_fixed_args(fixed_parameters_and_values) + int_params_and_values = [] + dbl_params_and_values = [] + str_params_and_values = [] + has_datacheck = False + for (param_id, param_type, value) in self._get_fixed_args_iter( + fixed_parameters_and_values): + if param_id == _constants.CPX_PARAM_DATACHECK: + has_datacheck = True + if param_type in (_constants.CPX_PARAMTYPE_INT, + _constants.CPX_PARAMTYPE_LONG): + int_params_and_values.append((param_id, value)) + elif param_type == _constants.CPX_PARAMTYPE_DOUBLE: + dbl_params_and_values.append((param_id, value)) + else: + assert param_type == _constants.CPX_PARAMTYPE_STRING, \ + "unexpected parameter type" + str_params_and_values.append((param_id, value)) + # In the Python API, the datacheck parameter defaults to "on". + # When calling the tuning functions the datacheck parameter can + # be changed as a side effect. Here, we ensure that the value of + # the datacheck parameter is the same before and after. That is, + # _unless_ the user overrides it here, explicitly, by passing the + # datacheck parameter in as a fixed parameter. + if not has_datacheck: + int_params_and_values.append( + (_constants.CPX_PARAM_DATACHECK, + self.read.datacheck.get())) + return (int_params_and_values, dbl_params_and_values, + str_params_and_values) + +
+[docs] + def tune_problem_set(self, filenames, filetypes=None, + fixed_parameters_and_values=None): + """Tunes parameters for a set of problems. + + filenames must be a sequence of strings specifying a set of + problems to tune. + + If filetypes is given, it must be a sequence of the same + length as filenames also consisting of strings that specify + the types of the corresponding files. + + If fixed_parameters_and_values is given, it may be either a + ParameterSet instance or a sequence of sequences of length 2 + containing instances of the Parameter class that are to be fixed + during the tuning process and the values at which they are to be + fixed. + + tune_problem_set returns the status of the tuning procedure, + which is an attribute of parameters.tuning_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto) + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"], + ... fixed_parameters_and_values=ps) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"], + ... fixed_parameters_and_values=[ + ... (c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto)]) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"]) + >>> c.parameters.tuning_status[status] + 'completed' + """ + filetypes, fixed_parameters_and_values = init_list_args( + filetypes, fixed_parameters_and_values) + (int_params_and_values, + dbl_params_and_values, + str_params_and_values) = self._process_fixed_args( + fixed_parameters_and_values) + return CPX_PROC.tuneparamprobset(self._env._e, + filenames, filetypes, + int_params_and_values, + dbl_params_and_values, + str_params_and_values)
+ + +
+[docs] + def tune_problem(self, fixed_parameters_and_values=None): + """Tunes parameters for a Cplex problem. + + If fixed_parameters_and_values is given, it may be either a + ParameterSet instance or a sequence of sequences of length 2 + containing instances of the Parameter class that are to be fixed + during the tuning process and the values at which they are to be + fixed. + + tune_problem returns the status of the tuning procedure, which + is an attribute of parameters.tuning_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto) + >>> status = c.parameters.tune_problem(ps) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem([ + ... (c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto)]) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem() + >>> c.parameters.tuning_status[status] + 'completed' + """ + (fixed_parameters_and_values,) = init_list_args( + fixed_parameters_and_values) + (int_params_and_values, + dbl_params_and_values, + str_params_and_values) = self._process_fixed_args( + fixed_parameters_and_values) + return CPX_PROC.tuneparam(self._env._e, self._cplex._lp, + int_params_and_values, + dbl_params_and_values, + str_params_and_values)
+ + +
+[docs] + def read_file(self, filename): + """Reads a set of parameters from the file filename.""" + CPX_PROC.readcopyparam(self._env._e, filename)
+ + +
+[docs] + def write_file(self, filename): + """Writes a set of parameters to the file filename.""" + CPX_PROC.writeparam(self._env._e, filename)
+
+ + + +
+[docs] +class off_on_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + off = _constants.CPX_OFF + on = _constants.CPX_ON
+ + + +
+[docs] +class auto_off_on_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_AUTO + off = _constants.CPX_OFF + on = _constants.CPX_ON
+ + + +
+[docs] +class writelevel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_WRITELEVEL_AUTO + all_variables = _constants.CPX_WRITELEVEL_ALLVARS + discrete_variables = _constants.CPX_WRITELEVEL_DISCRETEVARS + nonzero_variables = _constants.CPX_WRITELEVEL_NONZEROVARS + nonzero_discrete_variables = _constants.CPX_WRITELEVEL_NONZERODISCRETEVARS
+ + + +
+[docs] +class scale_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + equilibration = 0 + aggressive = 1
+ + + +
+[docs] +class mip_emph_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + balanced = _constants.CPX_MIPEMPHASIS_BALANCED + optimality = _constants.CPX_MIPEMPHASIS_OPTIMALITY + feasibility = _constants.CPX_MIPEMPHASIS_FEASIBILITY + best_bound = _constants.CPX_MIPEMPHASIS_BESTBOUND + hidden_feasibility = _constants.CPX_MIPEMPHASIS_HIDDENFEAS + heuristic = _constants.CPX_MIPEMPHASIS_HEURISTIC
+ + + +
+[docs] +class brdir_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + down = _constants.CPX_BRDIR_DOWN + auto = _constants.CPX_BRDIR_AUTO + up = _constants.CPX_BRDIR_UP
+ + + +
+[docs] +class search_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_MIPSEARCH_AUTO + traditional = _constants.CPX_MIPSEARCH_TRADITIONAL + dynamic = _constants.CPX_MIPSEARCH_DYNAMIC
+ + + +
+[docs] +class subalg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + network = _constants.CPX_ALG_NET + barrier = _constants.CPX_ALG_BARRIER + sifting = _constants.CPX_ALG_SIFTING
+ + + +
+[docs] +class nodesel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + depth_first = _constants.CPX_NODESEL_DFS + best_bound = _constants.CPX_NODESEL_BESTBOUND + best_estimate = _constants.CPX_NODESEL_BESTEST + best_estimate_alt = _constants.CPX_NODESEL_BESTEST_ALT
+ + + +
+[docs] +class alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + sifting = _constants.CPX_ALG_SIFTING + network = _constants.CPX_ALG_NET + concurrent = _constants.CPX_ALG_CONCURRENT
+ + + +
+[docs] +class varsel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + min_infeasibility = _constants.CPX_VARSEL_MININFEAS + default = _constants.CPX_VARSEL_DEFAULT + max_infeasibility = _constants.CPX_VARSEL_MAXINFEAS + pseudo_costs = _constants.CPX_VARSEL_PSEUDO + strong_branching = _constants.CPX_VARSEL_STRONG + pseudo_reduced_costs = _constants.CPX_VARSEL_PSEUDOREDUCED
+ + + +
+[docs] +class dive_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + traditional = 1 + probing = 2 + guided = 3
+ + + +
+[docs] +class file_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + memory = 1 + disk = 2 + disk_compressed = 3
+ + + +
+[docs] +class fpheur_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + feas = 1 + obj_and_feas = 2
+ + + +
+[docs] +class cardls_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + disabled = -1 + auto = 0 + at_root = 1 + at_all_nodes = 2
+ + + +
+[docs] +class miqcp_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + QCP_at_node = 1 + LP_at_node = 2
+ + + +
+[docs] +class presolve_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + force = 1 + probe = 2
+ + + +
+[docs] +class v_agg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + moderate = 1 + aggressive = 2 + very_aggressive = 3
+ + + +
+[docs] +class kappastats_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + sample = 1 + full = 2
+ + + +
+[docs] +class agg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + moderate = 1 + aggressive = 2
+ + + +
+[docs] +class replace_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + firstin_firstout = _constants.CPX_SOLNPOOL_FIFO + worst_objective = _constants.CPX_SOLNPOOL_OBJ + diversity = _constants.CPX_SOLNPOOL_DIV
+ + + +
+[docs] +class ordertype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + default = 0 + cost = _constants.CPX_MIPORDER_COST + bounds = _constants.CPX_MIPORDER_BOUNDS + scaled_cost = _constants.CPX_MIPORDER_SCALEDCOST
+ + + +
+[docs] +class mip_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + integer_feasible = 1 + mip_interval_nodes = 2 + node_cuts = 3 + LP_root = 4 + LP_all = 5
+ + + +
+[docs] +class conflict_algorithm_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_CONFLICTALG_AUTO + fast = _constants.CPX_CONFLICTALG_FAST + propagate = _constants.CPX_CONFLICTALG_PROPAGATE + presolve = _constants.CPX_CONFLICTALG_PRESOLVE + iis = _constants.CPX_CONFLICTALG_IIS + limitedsolve = _constants.CPX_CONFLICTALG_LIMITSOLVE + solve = _constants.CPX_CONFLICTALG_SOLVE
+ + + +
+[docs] +class dual_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_DPRIIND_AUTO + full = _constants.CPX_DPRIIND_FULL + steep = _constants.CPX_DPRIIND_STEEP + full_steep = _constants.CPX_DPRIIND_FULLSTEEP + steep_Q_start = _constants.CPX_DPRIIND_STEEPQSTART + devex = _constants.CPX_DPRIIND_DEVEX
+ + + +
+[docs] +class primal_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + partial = _constants.CPX_PPRIIND_PARTIAL + auto = _constants.CPX_PPRIIND_AUTO + devex = _constants.CPX_PPRIIND_DEVEX + steep = _constants.CPX_PPRIIND_STEEP + steep_Q_start = _constants.CPX_PPRIIND_STEEPQSTART + full = _constants.CPX_PPRIIND_FULL
+ + + +
+[docs] +class display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + normal = 1 + detailed = 2
+ + + +
+[docs] +class prered_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_PREREDUCE_NOPRIMALORDUAL + primal = _constants.CPX_PREREDUCE_PRIMALONLY + dual = _constants.CPX_PREREDUCE_DUALONLY + primal_and_dual = _constants.CPX_PREREDUCE_PRIMALANDDUAL
+ + +
+[docs] +class prereform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_PREREFORM_NONE + interfere_crush = _constants.CPX_PREREFORM_INTERFERE_CRUSH + interfere_uncrush = _constants.CPX_PREREFORM_INTERFERE_UNCRUSH + all = _constants.CPX_PREREFORM_ALL
+ + + +
+[docs] +class sos1reform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + logarithmic = 1
+ + + +
+[docs] +class sos2reform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + logarithmic = 1
+ + + +
+[docs] +class coeffreduce_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + integral = 1 + any = 2
+ + + +
+[docs] +class dependency_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + begin = 1 + end = 2 + begin_and_end = 3
+ + + +
+[docs] +class dual_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + no = -1 + auto = 0 + yes = 1
+ + + +
+[docs] +class linear_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + only_linear = 0 + full = 1
+ + + +
+[docs] +class repeatpre_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + without_cuts = 1 + with_cuts = 2 + new_root_cuts = 3
+ + + +
+[docs] +class sym_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + mild = 1 + moderate = 2 + aggressive = 3 + more_aggressive = 4 + very_aggressive = 5
+ + + +
+[docs] +class qcpduals_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + no = 0 + if_possible = 1 + force = 2
+ + + +
+[docs] +class sift_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + network = _constants.CPX_ALG_NET
+ + + +
+[docs] +class feasopt_mode_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + min_sum = _constants.CPX_FEASOPT_MIN_SUM + opt_sum = _constants.CPX_FEASOPT_OPT_SUM + min_inf = _constants.CPX_FEASOPT_MIN_INF + opt_inf = _constants.CPX_FEASOPT_OPT_INF + min_quad = _constants.CPX_FEASOPT_MIN_QUAD + opt_quad = _constants.CPX_FEASOPT_OPT_QUAD
+ + + +
+[docs] +class measure_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + average = _constants.CPX_TUNE_AVERAGE + minmax = _constants.CPX_TUNE_MINMAX
+ + + +
+[docs] +class tune_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + minimal = 1 + settings = 2 + settings_and_logs = 3
+ + + +
+[docs] +class bar_order_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + approx_min_degree = _constants.CPX_BARORDER_AMD + approx_min_fill = _constants.CPX_BARORDER_AMF + nested_dissection = _constants.CPX_BARORDER_ND
+ + + +
+[docs] +class crossover_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_ALG_NONE + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL
+ + + +
+[docs] +class bar_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + default = 0 + infeas_estimate = 1 + infeas_constant = 2 + standard = 3
+ + + +
+[docs] +class bar_start_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + zero_dual = 1 + estimated_dual = 2 + average_primal_zero_dual = 3 + average_primal_estimated_dual = 4
+ + + +
+[docs] +class par_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + opportunistic = _constants.CPX_PARALLEL_OPPORTUNISTIC + auto = _constants.CPX_PARALLEL_AUTO + deterministic = _constants.CPX_PARALLEL_DETERMINISTIC
+ + + +
+[docs] +class qp_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + network = _constants.CPX_ALG_NET + barrier = _constants.CPX_ALG_BARRIER
+ + + +
+[docs] +class advance_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + standard = 1 + alternate = 2
+ + + +
+[docs] +class clocktype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + CPU = 1 + wall = 2
+ + + +
+[docs] +class solutiontype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_AUTO_SOLN + basic = _constants.CPX_BASIC_SOLN + non_basic = _constants.CPX_NONBASIC_SOLN
+ + + +
+[docs] +class optimalitytarget_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + optimal_convex = 1 + first_order = 2 + optimal_global = 3
+ + + +
+[docs] +class datacheck_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + off = _constants.CPX_DATACHECK_OFF + warn = _constants.CPX_DATACHECK_WARN + assist = _constants.CPX_DATACHECK_ASSIST
+ + + +
+[docs] +class benders_strategy_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_BENDERSSTRATEGY_OFF + auto = _constants.CPX_BENDERSSTRATEGY_AUTO + user = _constants.CPX_BENDERSSTRATEGY_USER + workers = _constants.CPX_BENDERSSTRATEGY_WORKERS + full = _constants.CPX_BENDERSSTRATEGY_FULL
+ + + +
+[docs] +class network_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPXNET_NO_DISPLAY_OBJECTIVE + true_objective_values = _constants.CPXNET_TRUE_OBJECTIVE + penalized_objective_values = _constants.CPXNET_PENALIZED_OBJECTIVE
+ + + +
+[docs] +class network_netfind_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + pure = _constants.CPX_NETFIND_PURE + reflection_scaling = _constants.CPX_NETFIND_REFLECT + general_scaling = _constants.CPX_NETFIND_SCALE
+ + + +
+[docs] +class network_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPXNET_PRICE_AUTO + partial = _constants.CPXNET_PRICE_PARTIAL + multiple_partial = _constants.CPXNET_PRICE_MULT_PART + multiple_partial_with_sorting = _constants.CPXNET_PRICE_SORT_MULT_PART
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_procedural.html b/docs/22.1.2.0/_modules/cplex/_internal/_procedural.html new file mode 100644 index 0000000..fa0c695 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_procedural.html @@ -0,0 +1,5529 @@ + + + + + + + cplex._internal._procedural — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._procedural

+# --------------------------------------------------------------------------
+# File: _procedural.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Wrapper functions for the CPLEX C Callable Library"""
+from collections import namedtuple
+from contextlib import contextmanager
+import os
+
+from . import _constants as _const
+from . import _list_array_utils as LAU
+from . import _pycplex as CR
+
+from ..exceptions import CplexSolverError, CplexError, ErrorChannelMessage
+
+CPLEX_PY_DISABLE_SIGHANDLER = os.getenv("CPLEX_PY_DISABLE_SIGHANDLER")
+
+# pylint: disable=missing-docstring
+
+
+def _safeDoubleArray(arraylen):
+    # Make sure that we never request a zero-length array.  This results in
+    # a malloc(0) call in the SWIG layer.  On AIX this returns NULL which
+    # causes problems.  By ensuring that the array is at least size 1, we
+    # avoid these problems and the overhead should be negligable.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.doubleArray(arraylen)
+
+
+def _safeIntArray(arraylen):
+    # See comment for _safeDoubleArray above.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.intArray(arraylen)
+
+
+def _safeLongArray(arraylen):
+    # See comment for _safeDoubleArray above.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.longArray(arraylen)
+
+
+def _arraylen(seq):
+    """If seq is None, return 0, else len(seq).
+
+    CPLEX often requires a count argument to specify the length of
+    subsequent array arguments. This function allows us to return a
+    length of 0 for None (i.e., NULL) arrays.
+    """
+    if seq is None:
+        return 0
+    return len(seq)
+
+
+def _rangelen(begin, end):
+    """Returns length of the range specified by begin and end.
+
+    As this is typically used to calculate the length of a buffer, it
+    always returns a result >= 0.
+
+    See functions like `_safeDoubleArray` and `safeLongArray`.
+    """
+    # We allow arguments like begin=0, end=-1 on purpose. This represents
+    # an empty range; the callable library should do nothing in this case
+    # (see RTC-31484).
+    result = end - begin + 1
+    if result < 0:
+        return 0
+    return result
+
+
+
+[docs] +def getstatstring(env, statind): + output = [] + CR.CPXXgetstatstring(env, statind, output) + return output[0]
+ + + +
+[docs] +def geterrorstring(env, errcode): + output = [] + CR.CPXXgeterrorstring(env, errcode, output) + return output[0]
+ + + +
+[docs] +def cb_geterrorstring(env, status): + return CR.cb_geterrorstring(env, status)
+ + + +
+[docs] +def new_native_int(): + return CR.new_native_int()
+ + + +
+[docs] +def delete_native_int(p): + CR.delete_native_int(p)
+ + + +
+[docs] +def set_native_int(p, v): + CR.set_native_int(p, v)
+ + + +
+[docs] +def get_native_int(p): + return CR.get_native_int(p)
+ + + +
+[docs] +def setterminate(env, env_lp_ptr, p): + status = CR.setterminate(env_lp_ptr, p) + check_status(env, status)
+ + + +# If the CPLEX_PY_DISABLE_SIGHANDLER environment variable is defined, +# we will not install our SIGINT handler (i.e., for Ctrl+C handling). +# This may be useful if the user wants to install their own handler. +if CPLEX_PY_DISABLE_SIGHANDLER: + + class SigIntHandler(): + """A no-op signal handler (no handler installed). + + :undocumented + """ + + def __init__(self): + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + +else: + + # By default (i.e., if the CPLEX_PY_DISABLE_SIGHANDLER environment + # variable is not defined), then we install a custom SIGINT handler + # around long running CPLEX operations. This allows the user to abort + # the current optimization with a Ctrl+C. + +
+[docs] + class SigIntHandler(): + """Handle Ctrl-C events during long running processes. + + :undocumented + """ + +
+[docs] + def __init__(self): + CR.sigint_register()
+ + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + CR.sigint_unregister()
+ + + +
+[docs] +def pack_env_lp_ptr(env, lp): + return CR.pack_env_lp_ptr(env, lp)
+ + + +
+[docs] +@contextmanager +def chbmatrix(lolmat, env_lp_ptr, r_c): + """See matrix_conversion.c:Pylolmat_to_CHBmat().""" + mat = Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c) + try: + # yields ([matbeg, matind, matval], nnz) + yield mat[:-1], mat[-1] + finally: + free_CHBmat(mat)
+ + + +
+[docs] +def Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c): + return CR.Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c)
+ + + +
+[docs] +def free_CHBmat(lolmat): + CR.free_CHBmat(lolmat)
+ + + +def _handle_cb_error(env, cberror): + """Handle the callback exception. + + These can be triggered either in the SWIG Python C API layer + (e.g., SWIG_callback.c) or in _ostream.py. + """ + if isinstance(cberror, Exception): + # If cberror is already an exception, then just throw it as is. + # We can only get here from: _ostream.py:_write_wrap. + raise cberror + if isinstance(cberror[1], Exception): + # In this case the first item is the type of exception and + # the second item is the exception. This is raised from the + # SWIG C layer (e.g., SWIG_callback.c:). + cberror = cberror[1] + elif isinstance(cberror[1], tuple): + # The second item is a tuple containing the error string and + # the error number. We can get this from, for example: + # SWIG_callback.c:fast_getcallbackinfo. + assert len(cberror[1]) == 2 + cberror = cberror[0](cberror[1][0], env, cberror[1][1]) + else: + # The second item is the error string or perhaps None. + # See code in SWIG_callback.c where the _callback_exception + # attribute is set. + cberror = cberror[0](cberror[1]) + raise cberror + + +
+[docs] +class StatusChecker(): + """A callable object used for checking status codes. + + :undocumented + """ + +
+[docs] + def __init__(self): + class NoOp(): + pass + self._pyenv = NoOp() + self._pyenv._callback_exception = None
+ + + def __call__(self, env, status, from_cb=False): + error_string = None + try: + if self._pyenv._callback_exception is not None: + callback_exception = self._pyenv._callback_exception + self._pyenv._callback_exception = None + if isinstance(callback_exception, ErrorChannelMessage): + # We can only get here from _ostream.py:_write_wrap. + # If we encounter an error, we use the last message + # from the error channel for the message (i.e., rather + # than calling CPXXgeterrorstring). + error_string = callback_exception.args[0] + else: + _handle_cb_error(env, callback_exception) + except ReferenceError: + pass + if status == CR.CPXERR_NO_ENVIRONMENT: + raise ValueError('illegal method invocation after Cplex.end()') + elif status != 0: + if error_string is None: + if from_cb: + error_string = cb_geterrorstring(env, status) + else: + error_string = geterrorstring(env, status) + raise CplexSolverError(error_string, env, status)
+ + + +check_status = StatusChecker() + + +
+[docs] +def set_status_checker(): + CR.set_status_checker(check_status)
+ + +# Environment + + +
+[docs] +def version(env): + return CR.CPXXversion(env)
+ + + +
+[docs] +def versionnumber(env): + ver = CR.intPtr() + status = CR.CPXXversionnumber(env, ver) + check_status(env, status) + return ver.value()
+ + + +
+[docs] +def openCPLEX(): + status = CR.intPtr() + env = CR.CPXXopenCPLEX(status) + check_status(env, status.value()) + # Always set the pyterminate flag immediately when initializing + # a CPLEX environment. + CR.setpyterminate(env) + return env
+ + + +
+[docs] +def closeCPLEX(env): + envp = CR.CPXENVptrPtr() + envp.assign(env) + status = CR.CPXXcloseCPLEX(envp) + check_status(env, status)
+ + + +
+[docs] +def getchannels(env): + results = CR.CPXCHANNELptrPtr() + warning = CR.CPXCHANNELptrPtr() + error = CR.CPXCHANNELptrPtr() + log = CR.CPXCHANNELptrPtr() + status = CR.CPXXgetchannels(env, results, warning, error, log) + check_status(env, status) + return (results.value(), warning.value(), error.value(), log.value())
+ + + +
+[docs] +def addfuncdest(env, channel, fileobj): + status = CR.CPXXaddfuncdest(env, channel, fileobj) + check_status(env, status)
+ + + +
+[docs] +def delfuncdest(env, channel, fileobj): + status = CR.CPXXdelfuncdest(env, channel, fileobj) + check_status(env, status)
+ + + +
+[docs] +def setlpcallbackfunc(env, cbhandle): + status = CR.CPXXsetlpcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setnetcallbackfunc(env, cbhandle): + status = CR.CPXXsetnetcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def settuningcallbackfunc(env, cbhandle): + status = CR.CPXXsettuningcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setheuristiccallbackfunc(env, cbhandle): + status = CR.CPXXsetheuristiccallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setlazyconstraintcallbackfunc(env, cbhandle): + status = CR.CPXXsetlazyconstraintcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setusercutcallbackfunc(env, cbhandle): + status = CR.CPXXsetusercutcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setincumbentcallbackfunc(env, cbhandle): + status = CR.CPXXsetincumbentcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setnodecallbackfunc(env, cbhandle): + status = CR.CPXXsetnodecallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setbranchcallbackfunc(env, cbhandle): + status = CR.CPXXsetbranchcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setbranchnosolncallbackfunc(env, cbhandle): + status = CR.CPXXsetbranchnosolncallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setsolvecallbackfunc(env, cbhandle): + status = CR.CPXXsetsolvecallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setinfocallbackfunc(env, cbhandle): + status = CR.CPXXsetinfocallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setmipcallbackfunc(env, cbhandle): + status = CR.CPXXsetmipcallbackfunc(env, cbhandle) + check_status(env, status)
+ + +# Parameters + +
+[docs] +def setdefaults(env): + status = CR.CPXXsetdefaults(env) + check_status(env, status)
+ + + +
+[docs] +def setintparam(env, whichparam, newvalue): + status = CR.CPXXsetintparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setlongparam(env, whichparam, newvalue): + status = CR.CPXXsetlongparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setdblparam(env, whichparam, newvalue): + status = CR.CPXXsetdblparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setstrparam(env, whichparam, newvalue): + status = CR.CPXXsetstrparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def getintparam(env, whichparam): + curval = CR.intPtr() + status = CR.CPXXgetintparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getlongparam(env, whichparam): + curval = CR.cpxlongPtr() + status = CR.CPXXgetlongparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getdblparam(env, whichparam): + curval = CR.doublePtr() + status = CR.CPXXgetdblparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getstrparam(env, whichparam): + output = [] + status = CR.CPXXgetstrparam(env, whichparam, output) + check_status(env, status) + return output[0]
+ + + +
+[docs] +def infointparam(env, whichparam): + default = CR.intPtr() + minimum = CR.intPtr() + maximum = CR.intPtr() + status = CR.CPXXinfointparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infolongparam(env, whichparam): + default = CR.cpxlongPtr() + minimum = CR.cpxlongPtr() + maximum = CR.cpxlongPtr() + status = CR.CPXXinfolongparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infodblparam(env, whichparam): + default = CR.doublePtr() + minimum = CR.doublePtr() + maximum = CR.doublePtr() + status = CR.CPXXinfodblparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infostrparam(env, whichparam): + output = [] + status = CR.CPXXinfostrparam(env, whichparam, output) + check_status(env, status) + return output[0]
+ + + +
+[docs] +def getparamtype(env, param_name): + output = CR.intPtr() + status = CR.CPXXgetparamtype(env, param_name, output) + check_status(env, status) + return output.value()
+ + + +
+[docs] +def readcopyparam(env, filename): + status = CR.CPXXreadcopyparam(env, filename) + check_status(env, status)
+ + + +
+[docs] +def writeparam(env, filename): + status = CR.CPXXwriteparam(env, filename) + check_status(env, status)
+ + + +
+[docs] +def tuneparam(env, lp, int_param_values, dbl_param_values, str_param_values): + tuning_status = CR.intPtr() + intcnt = len(int_param_values) + dblcnt = len(dbl_param_values) + strcnt = len(str_param_values) + intnum = [int_param_values[i][0] for i in range(intcnt)] + intval = [int_param_values[i][1] for i in range(intcnt)] + dblnum = [dbl_param_values[i][0] for i in range(dblcnt)] + dblval = [dbl_param_values[i][1] for i in range(dblcnt)] + strnum = [str_param_values[i][0] for i in range(strcnt)] + strval = [str_param_values[i][1] for i in range(strcnt)] + with SigIntHandler(): + status = CR.CPXXtuneparam( + env, lp, intcnt, + LAU.int_list_to_array(intnum), + LAU.int_list_to_array_trunc_int32(intval), + dblcnt, + LAU.int_list_to_array(dblnum), + LAU.double_list_to_array(dblval), + strcnt, + LAU.int_list_to_array(strnum), + strval, + tuning_status) + check_status(env, status) + return tuning_status.value()
+ + + +
+[docs] +def tuneparamprobset(env, filenames, filetypes, int_param_values, + dbl_param_values, str_param_values): + tuning_status = CR.intPtr() + intcnt = len(int_param_values) + dblcnt = len(dbl_param_values) + strcnt = len(str_param_values) + intnum = [int_param_values[i][0] for i in range(intcnt)] + intval = [int_param_values[i][1] for i in range(intcnt)] + dblnum = [dbl_param_values[i][0] for i in range(dblcnt)] + dblval = [dbl_param_values[i][1] for i in range(dblcnt)] + strnum = [str_param_values[i][0] for i in range(strcnt)] + strval = [str_param_values[i][1] for i in range(strcnt)] + with SigIntHandler(): + status = CR.CPXXtuneparamprobset( + env, len(filenames), + filenames, + filetypes, + intcnt, LAU.int_list_to_array(intnum), + LAU.int_list_to_array_trunc_int32(intval), + dblcnt, LAU.int_list_to_array(dblnum), + LAU.double_list_to_array(dblval), + strcnt, LAU.int_list_to_array(strnum), + strval, + tuning_status) + check_status(env, status) + return tuning_status.value()
+ + + +
+[docs] +def fixparam(env, paramnum): + status = CR.CPXXEfixparam(env, paramnum) + check_status(env, status)
+ + +######################################################################## +# Parameter Set API +######################################################################## + +
+[docs] +def paramsetadd(env, ps, whichparam, newvalue, paramtype=None): + if paramtype is None: + paramtype = getparamtype(env, whichparam) + if paramtype == _const.CPX_PARAMTYPE_INT: + if isinstance(newvalue, float): + newvalue = int(newvalue) # will upconvert to long, if necc. + paramsetaddint(env, ps, whichparam, newvalue) + elif paramtype == _const.CPX_PARAMTYPE_DOUBLE: + if isinstance(newvalue, int): + newvalue = float(newvalue) + paramsetadddbl(env, ps, whichparam, newvalue) + elif paramtype == _const.CPX_PARAMTYPE_STRING: + paramsetaddstr(env, ps, whichparam, newvalue) + else: + assert paramtype == _const.CPX_PARAMTYPE_LONG + if isinstance(newvalue, float): + newvalue = int(newvalue) # will upconvert to long, if necc. + paramsetaddlong(env, ps, whichparam, newvalue)
+ + + +
+[docs] +def paramsetadddbl(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetadddbl(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddint(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddint(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddlong(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddlong(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddstr(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddstr(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetapply(env, ps): + status = CR.CPXXparamsetapply(env, ps) + check_status(env, status)
+ + +
+[docs] +def paramsetcopy(env, targetps, sourceps): + status = CR.CPXXparamsetcopy(env, targetps, sourceps) + check_status(env, status)
+ + +
+[docs] +def paramsetcreate(env): + status = CR.intPtr() + ps = CR.CPXXparamsetcreate(env, status) + check_status(env, status.value()) + return ps
+ + +
+[docs] +def paramsetdel(env, ps, whichparam): + status = CR.CPXXparamsetdel(env, ps, whichparam) + check_status(env, status)
+ + +
+[docs] +def paramsetfree(env, ps): + ps_p = CR.CPXPARAMSETptrPtr() + ps_p.assign(ps) + status = CR.CPXXparamsetfree(env, ps_p) + check_status(env, status)
+ + +
+[docs] +def paramsetget(env, ps, whichparam, paramtype=None): + if paramtype is None: + paramtype = getparamtype(env, whichparam) + switcher = { + _const.CPX_PARAMTYPE_INT: paramsetgetint, + _const.CPX_PARAMTYPE_DOUBLE: paramsetgetdbl, + _const.CPX_PARAMTYPE_STRING: paramsetgetstr, + _const.CPX_PARAMTYPE_LONG: paramsetgetlong + } + func = switcher[paramtype] + return func(env, ps, whichparam)
+ + +
+[docs] +def paramsetgetdbl(env, ps, whichparam): + value = CR.doublePtr() + status = CR.CPXXparamsetgetdbl(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetint(env, ps, whichparam): + value = CR.intPtr() + status = CR.CPXXparamsetgetint(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetlong(env, ps, whichparam): + value = CR.cpxlongPtr() + status = CR.CPXXparamsetgetlong(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetstr(env, ps, whichparam): + output = [] + status = CR.CPXXparamsetgetstr(env, ps, whichparam, output) + check_status(env, status) + return output[0]
+ + +
+[docs] +def paramsetgetids(env, ps): + cnt = paramsetgetnum(env, ps) + if cnt == 0: + return [] + inout_list = [cnt] + status = CR.CPXXparamsetgetids(env, ps, inout_list) + check_status(env, status) + # We expect to get [whichparams] + assert len(inout_list) == 1 + return inout_list[0]
+ + +
+[docs] +def paramsetreadcopy(env, ps, filename): + status = CR.CPXXparamsetreadcopy(env, ps, filename) + check_status(env, status)
+ + +
+[docs] +def paramsetwrite(env, ps, filename): + status = CR.CPXXparamsetwrite(env, ps, filename) + check_status(env, status)
+ + +
+[docs] +def paramsetgetnum(env, ps): + inout_list = [0] + status = CR.CPXXparamsetgetids(env, ps, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return inout_list[0]
+ + +######################################################################## +# Runseeds +######################################################################## + +
+[docs] +def runseeds(env, lp, cnt): + with SigIntHandler(): + status = CR.CPXErunseeds(env, lp, cnt) + check_status(env, status)
+ + +# Cplex + + +
+[docs] +def createprob(env, probname): + status = CR.intPtr() + lp = CR.CPXXcreateprob(env, status, probname) + check_status(env, status.value()) + return lp
+ + + +
+[docs] +def readcopyprob(env, lp, filename, filetype=""): + if filetype == "": + status = CR.CPXXreadcopyprob(env, lp, filename) + else: + status = CR.CPXXreadcopyprob(env, lp, filename, filetype) + check_status(env, status)
+ + + +
+[docs] +def cloneprob(env, lp): + status = CR.intPtr() + lp = CR.CPXXcloneprob(env, lp, status) + check_status(env, status.value()) + return lp
+ + + +
+[docs] +def freeprob(env, lp): + lpp = CR.CPXLPptrPtr() + lpp.assign(lp) + status = CR.CPXXfreeprob(env, lpp) + check_status(env, status)
+ + + +
+[docs] +def mipopt(env, lp): + with SigIntHandler(): + status = CR.CPXXmipopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def qpopt(env, lp): + with SigIntHandler(): + status = CR.CPXXqpopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def baropt(env, lp): + with SigIntHandler(): + status = CR.CPXXbaropt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def hybbaropt(env, lp, method): + with SigIntHandler(): + status = CR.CPXXhybbaropt(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def hybnetopt(env, lp, method): + with SigIntHandler(): + status = CR.CPXXhybnetopt(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def lpopt(env, lp): + with SigIntHandler(): + status = CR.CPXXlpopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def primopt(env, lp): + status = CR.CPXXprimopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def dualopt(env, lp): + status = CR.CPXXdualopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def siftopt(env, lp): + status = CR.CPXXsiftopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def feasoptext(env, lp, grppref, grpbeg, grpind, grptype): + grpcnt = len(grppref) + concnt = len(grpind) + with SigIntHandler(), \ + LAU.double_c_array(grppref) as c_grppref, \ + LAU.long_c_array(grpbeg) as c_grpbeg, \ + LAU.int_c_array(grpind) as c_grpind: + status = CR.CPXXfeasoptext(env, lp, grpcnt, concnt, + c_grppref, c_grpbeg, + c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def delnames(env, lp): + status = CR.CPXXdelnames(env, lp) + check_status(env, status)
+ + + +
+[docs] +def writeprob(env, lp, filename, filetype=""): + if filetype == "": + status = CR.CPXXwriteprob(env, lp, filename) + else: + status = CR.CPXXwriteprob(env, lp, filename, filetype) + check_status(env, status)
+ + + +
+[docs] +def writeprobdev(env, lp, stream, filename, filetype): + arg_list = [stream, filename, filetype] + status = CR.CPXEwriteprobdev(env, lp, arg_list) + check_status(env, status)
+ + + +
+[docs] +def embwrite(env, lp, filename): + status = CR.CPXXembwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def dperwrite(env, lp, filename, epsilon): + status = CR.CPXXdperwrite(env, lp, filename, epsilon) + check_status(env, status)
+ + + +
+[docs] +def pperwrite(env, lp, filename, epsilon): + status = CR.CPXXpperwrite(env, lp, filename, epsilon) + check_status(env, status)
+ + + +
+[docs] +def preslvwrite(env, lp, filename): + objoff = CR.doublePtr() + status = CR.CPXXpreslvwrite(env, lp, filename, objoff) + check_status(env, status) + return objoff.value()
+ + + +
+[docs] +def dualwrite(env, lp, filename): + objshift = CR.doublePtr() + status = CR.CPXXdualwrite(env, lp, filename, objshift) + check_status(env, status) + return objshift.value()
+ + + +
+[docs] +def chgprobtype(env, lp, probtype): + status = CR.CPXXchgprobtype(env, lp, probtype) + check_status(env, status)
+ + + +
+[docs] +def chgprobtypesolnpool(env, lp, probtype, soln): + status = CR.CPXXchgprobtypesolnpool(env, lp, probtype, soln) + check_status(env, status)
+ + + +
+[docs] +def getprobtype(env, lp): + return CR.CPXXgetprobtype(env, lp)
+ + + +
+[docs] +def chgprobname(env, lp, probname): + status = CR.CPXXchgprobname(env, lp, probname) + check_status(env, status)
+ + + +
+[docs] +def getprobname(env, lp): + namefn = CR.CPXXgetprobname + return _getnamesingle(env, lp, namefn)
+ + + +
+[docs] +def getnumcols(env, lp): + return CR.CPXXgetnumcols(env, lp)
+ + + +
+[docs] +def getnumint(env, lp): + return CR.CPXXgetnumint(env, lp)
+ + + +
+[docs] +def getnumbin(env, lp): + return CR.CPXXgetnumbin(env, lp)
+ + + +
+[docs] +def getnumsemicont(env, lp): + return CR.CPXXgetnumsemicont(env, lp)
+ + + +
+[docs] +def getnumsemiint(env, lp): + return CR.CPXXgetnumsemiint(env, lp)
+ + + +
+[docs] +def getnumrows(env, lp): + return CR.CPXXgetnumrows(env, lp)
+ + + +
+[docs] +def populate(env, lp): + with SigIntHandler(): + status = CR.CPXXpopulate(env, lp) + check_status(env, status)
+ + + +def _getnumusercuts(env, lp): + return CR.CPXXgetnumusercuts(env, lp) + + +def _getnumlazyconstraints(env, lp): + return CR.CPXXgetnumlazyconstraints(env, lp) + + +
+[docs] +def getnumqconstrs(env, lp): + return CR.CPXXgetnumqconstrs(env, lp)
+ + + +
+[docs] +def getnumindconstrs(env, lp): + return CR.CPXXgetnumindconstrs(env, lp)
+ + + +
+[docs] +def getnumsos(env, lp): + return CR.CPXXgetnumsos(env, lp)
+ + + +
+[docs] +def cleanup(env, lp, eps): + status = CR.CPXXcleanup(env, lp, eps) + check_status(env, status)
+ + + +
+[docs] +def basicpresolve(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + redlb = _safeDoubleArray(numcols) + redub = _safeDoubleArray(numcols) + rstat = _safeIntArray(numrows) + status = CR.CPXXbasicpresolve(env, lp, redlb, redub, rstat) + check_status(env, status) + return (LAU.array_to_list(redlb, numcols), + LAU.array_to_list(redub, numcols), + LAU.array_to_list(rstat, numrows))
+ + + +
+[docs] +def pivotin(env, lp, rlist): + status = CR.CPXXpivotin(env, lp, + LAU.int_list_to_array(rlist), + len(rlist)) + check_status(env, status)
+ + + +
+[docs] +def pivotout(env, lp, clist): + status = CR.CPXXpivotout(env, lp, + LAU.int_list_to_array(clist), + len(clist)) + check_status(env, status)
+ + + +
+[docs] +def pivot(env, lp, jenter, jleave, leavestat): + status = CR.CPXXpivot(env, lp, jenter, jleave, leavestat) + check_status(env, status)
+ + + +
+[docs] +def strongbranch(env, lp, goodlist, itlim): + goodlen = len(goodlist) + downpen = _safeDoubleArray(goodlen) + uppen = _safeDoubleArray(goodlen) + with SigIntHandler(): + status = CR.CPXXstrongbranch( + env, lp, LAU.int_list_to_array(goodlist), goodlen, + downpen, uppen, itlim) + check_status(env, status) + return (LAU.array_to_list(downpen, goodlen), + LAU.array_to_list(uppen, goodlen))
+ + + +
+[docs] +def completelp(env, lp): + status = CR.CPXXcompletelp(env, lp) + check_status(env, status)
+ + +# Variables +
+[docs] +@contextmanager +def fast_getrows(env, lp): + env_lp_ptr = pack_env_lp_ptr(env, lp) + rows = CR.CPXX_fast_get_rows(env_lp_ptr) + try: + yield rows + finally: + CR.CPXX_free_rows(rows)
+ + +
+[docs] +@contextmanager +def fast_getcolname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getcolname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getrowname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getrowname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getsosname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getsosname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getmipstartname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getmipstartname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getobj(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + coefs = CR.CPXX_fast_getobj(env_lp_ptr, begin, end) + try: + yield coefs + finally: + CR.CPXX_free_getobj(coefs)
+ +
+[docs] +@contextmanager +def fast_multiobjgetobj(env, lp, objidx, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + coefs = CR.CPXX_fast_multiobjgetobj(env_lp_ptr, objidx, begin, end) + try: + yield coefs + finally: + CR.CPXX_free_getobj(coefs)
+ + +
+[docs] +def fast_multiobjgetoffset(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetoffset(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetweight(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetweight(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetpriority(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetpriority(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetabstol(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetabstol(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetreltol(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetreltol(env_lp_ptr, objidx)
+ + + +
+[docs] +def fast_newcols(env, lp, nb, lb, ub, xctype): + env_lp_ptr = pack_env_lp_ptr(env, lp) + CR.CPXX_fast_newcols(env_lp_ptr, nb, lb, ub, xctype)
+ + +
+[docs] +def has_name(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_name(env_lp_ptr, start, end) != 0 else False
+ +
+[docs] +def has_non_default_lb(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_non_default_lb(env_lp_ptr, start, end) != 0 else False
+ +
+[docs] +def has_non_default_ub(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_non_default_ub(env_lp_ptr, start, end) != 0 else False
+ + + +
+[docs] +def newcols(env, lp, obj, lb, ub, xctype, colname): + ccnt = max(len(obj), len(lb), len(ub), len(xctype), len(colname)) + with LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub: + status = CR.CPXXnewcols( + env, lp, ccnt, c_obj, c_lb, c_ub, + xctype, colname) + check_status(env, status)
+ + + +
+[docs] +def addcols(env, lp, ccnt, nzcnt, obj, cmat, lb, ub, colname): + with LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub: + status = CR.CPXXaddcols( + env, lp, ccnt, nzcnt, + c_obj, cmat, c_lb, c_ub, colname) + check_status(env, status)
+ + + +
+[docs] +def delcols(env, lp, begin, end): + delfn = CR.CPXXdelcols + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def chgbds(env, lp, indices, lu, bd): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(bd) as c_bd: + status = CR.CPXXchgbds(env, lp, len(indices), + c_ind, lu, c_bd) + check_status(env, status)
+ + + +
+[docs] +def chgcolname(env, lp, indices, newnames): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgcolname(env, lp, len(indices), + c_indices, newnames) + check_status(env, status)
+ + + +
+[docs] +def chgctype(env, lp, indices, xctype): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgctype(env, lp, len(indices), + c_indices, xctype) + check_status(env, status)
+ + + +
+[docs] +def getcolindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetcolindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getcolname(env, lp, begin, end): + namefn = CR.CPXXgetcolname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getctype(env, lp, begin, end): + inout_list = [begin, end] + status = CR.CPXXgetctype(env, lp, inout_list) + check_status(env, status) + # We expect to get [sense] + assert len(inout_list) == 1 + return inout_list[0]
+ + + +
+[docs] +def getlb(env, lp, begin, end): + lblen = _rangelen(begin, end) + lb = _safeDoubleArray(lblen) + status = CR.CPXXgetlb(env, lp, lb, begin, end) + check_status(env, status) + return LAU.array_to_list(lb, lblen)
+ + + +
+[docs] +def getub(env, lp, begin, end): + ublen = _rangelen(begin, end) + ub = _safeDoubleArray(ublen) + status = CR.CPXXgetub(env, lp, ub, begin, end) + check_status(env, status) + return LAU.array_to_list(ub, ublen)
+ + + +
+[docs] +def getcols(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetcols(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetcols(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +
+[docs] +def copyprotected(env, lp, indices): + status = CR.CPXXcopyprotected(env, lp, len(indices), + LAU.int_list_to_array(indices)) + check_status(env, status)
+ + + +
+[docs] +def getprotected(env, lp): + count = CR.intPtr() + surplus = CR.intPtr() + indices = LAU.int_list_to_array([]) + pspace = 0 + status = CR.CPXXgetprotected(env, lp, count, indices, pspace, surplus) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return [] + pspace = -surplus.value() + indices = _safeIntArray(pspace) + status = CR.CPXXgetprotected(env, lp, count, indices, pspace, surplus) + check_status(env, status) + return LAU.array_to_list(indices, pspace)
+ + + +
+[docs] +def tightenbds(env, lp, indices, lu, bd): + status = CR.CPXXtightenbds(env, lp, len(indices), + LAU.int_list_to_array(indices), + lu, LAU.double_list_to_array(bd)) + check_status(env, status)
+ + +# Linear Constraints + + +
+[docs] +def newrows(env, lp, rhs, sense, rngval, rowname): + rcnt = max(len(rhs), len(sense), len(rngval), len(rowname)) + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.double_c_array(rngval) as c_rng: + status = CR.CPXXnewrows(env, lp, rcnt, c_rhs, sense, + c_rng, rowname) + check_status(env, status)
+ + + +
+[docs] +def addrows(env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmat, colname, rowname): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXaddrows( + env, lp, ccnt, rcnt, nzcnt, c_rhs, + sense, rmat, colname, rowname) + check_status(env, status)
+ + + +
+[docs] +def delrows(env, lp, begin, end): + delfn = CR.CPXXdelrows + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def chgrowname(env, lp, indices, newnames): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgrowname(env, lp, len(indices), c_indices, + newnames) + check_status(env, status)
+ + + +
+[docs] +def chgcoeflist(env, lp, rowlist, collist, vallist): + with LAU.int_c_array(rowlist) as c_rowlist, \ + LAU.int_c_array(collist) as c_collist, \ + LAU.double_c_array(vallist) as c_vallist: + status = CR.CPXXchgcoeflist(env, lp, len(rowlist), + c_rowlist, c_collist, c_vallist) + check_status(env, status)
+ + + +
+[docs] +def chgrhs(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgrhs(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgrngval(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgrngval(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgsense(env, lp, indices, senses): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgsense(env, lp, len(indices), c_indices, + senses) + check_status(env, status)
+ + + +
+[docs] +def getrhs(env, lp, begin, end): + rhslen = _rangelen(begin, end) + rhs = _safeDoubleArray(rhslen) + status = CR.CPXXgetrhs(env, lp, rhs, begin, end) + check_status(env, status) + return LAU.array_to_list(rhs, rhslen)
+ + + +
+[docs] +def getsense(env, lp, begin, end): + inout_list = [begin, end] + status = CR.CPXXgetsense(env, lp, inout_list) + check_status(env, status) + # We expect to get [sense] + assert len(inout_list) == 1 + return inout_list[0]
+ + + +
+[docs] +def getrngval(env, lp, begin, end): + rngvallen = _rangelen(begin, end) + rngval = _safeDoubleArray(rngvallen) + status = CR.CPXXgetrngval(env, lp, rngval, begin, end) + check_status(env, status) + return LAU.array_to_list(rngval, rngvallen)
+ + + +
+[docs] +def getrowname(env, lp, begin, end): + namefn = CR.CPXXgetrowname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getcoef(env, lp, i, j): + coef = CR.doublePtr() + status = CR.CPXXgetcoef(env, lp, i, j, coef) + check_status(env, status) + return coef.value()
+ + + +
+[docs] +def getrowindex(env, lp, rowname): + index = CR.intPtr() + status = CR.CPXXgetrowindex(env, lp, rowname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getrows(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetrows(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetrows(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +
+[docs] +def getnumnz(env, lp): + return CR.CPXXgetnumnz(env, lp)
+ + + +
+[docs] +def addlazyconstraints(env, lp, rhs, sense, lin_expr, names): + env_lp_ptr = pack_env_lp_ptr(env, lp) + with chbmatrix(lin_expr, env_lp_ptr, 0) as (rmat, nnz), \ + LAU.double_c_array(rhs) as c_rhs: + rmatbeg, rmatind, rmatval = rmat + status = CR.CPXXaddlazyconstraints( + env, lp, len(rhs), nnz, + c_rhs, sense, + rmatbeg, rmatind, rmatval, + names) + check_status(env, status)
+ + + +
+[docs] +def addusercuts(env, lp, rhs, sense, lin_expr, names): + env_lp_ptr = pack_env_lp_ptr(env, lp) + with chbmatrix(lin_expr, env_lp_ptr, 0) as (rmat, nnz), \ + LAU.double_c_array(rhs) as c_rhs: + rmatbeg, rmatind, rmatval = rmat + status = CR.CPXXaddusercuts( + env, lp, len(rhs), nnz, + c_rhs, sense, + rmatbeg, rmatind, rmatval, + names) + check_status(env, status)
+ + + +
+[docs] +def freelazyconstraints(env, lp): + status = CR.CPXXfreelazyconstraints(env, lp) + check_status(env, status)
+ + + +
+[docs] +def freeusercuts(env, lp): + status = CR.CPXXfreeusercuts(env, lp) + check_status(env, status)
+ + + +# CPXLIBAPI int CPXPUBLIC +# CPXXcopylpwnames (CPXCENVptr env, +# CPXLPptr lp, +# CPXDIM numcols, +# CPXDIM numrows, +# int objsense, +# const double *objective, +# const double *rhs, +# const char *sense, +# CPXNNZ int *matbeg, +# CPXDIM int *matcnt, +# CPXDIM int *matind, +# const double *matval, +# const double *lb, +# const double *ub, +# const double *rngval, +# char const *const *colname, +# char const *const *rowname); +
+[docs] +def copylpwnames(env, lp, numcols, numrows, objsense, obj, rhs, sense, + matbeg, matcnt, matind, matval, lb, ub, rngval, colname, + rowname): + with LAU.long_c_array(matbeg) as c_matbeg, \ + LAU.int_c_array(matcnt) as c_matcnt, \ + LAU.int_c_array(matind) as c_matind, \ + LAU.double_c_array(matval) as c_matval, \ + LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(rhs) as c_rhs, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub, \ + LAU.double_c_array(rngval) as c_rngval: # noqa: E126 + status = CR.CPXXcopylpwnames(env, lp, numcols, numrows, objsense, + c_obj, c_rhs, sense, + c_matbeg, c_matcnt, c_matind, c_matval, + c_lb, c_ub, c_rngval, + colname, rowname) + check_status(env, status)
+ + + +######################################################################## +# SOS API +######################################################################## + + +
+[docs] +def addsos(env, lp, sostype, sosbeg, sosind, soswt, sosnames): + with LAU.long_c_array(sosbeg) as c_sosbeg, \ + LAU.int_c_array(sosind) as c_sosind, \ + LAU.double_c_array(soswt) as c_soswt: + status = CR.CPXXaddsos(env, lp, len(sosbeg), len(sosind), sostype, + c_sosbeg, c_sosind, c_soswt, + sosnames) + check_status(env, status)
+ + + +
+[docs] +def delsos(env, lp, begin, end): + delfn = CR.CPXXdelsos + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsos_info(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetsos(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [sostype, surplus] + assert len(inout_list) == 2 + return tuple(inout_list)
+ + + +
+[docs] +def getsos(env, lp, begin, end): + numsos = _rangelen(begin, end) + _, surplus = getsos_info(env, lp, begin, end) + if surplus == 0: + return ([0] * numsos, [], []) + inout_list = [surplus, begin, end] + status = CR.CPXXgetsos(env, lp, inout_list) + check_status(env, status) + # We expect to get [sosbeg, sosind, soswt] + assert len(inout_list) == 3 + return tuple(inout_list)
+ + + +
+[docs] +def getsosindex(env, lp, name): + indexfn = CR.CPXXgetsosindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getsosname(env, lp, begin, end): + namefn = CR.CPXXgetsosname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + +######################################################################## +# Indicator Constraint API +######################################################################## + + +
+[docs] +def addindconstr(env, lp, indcnt, indvar, complemented, rhs, sense, linmat, + indtype, name, nzcnt): + with LAU.int_c_array(indtype) as c_indtype, \ + LAU.int_c_array(indvar) as c_indvar, \ + LAU.int_c_array(complemented) as c_complemented, \ + LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXaddindconstraints( + env, lp, indcnt, c_indtype, c_indvar, + c_complemented, nzcnt, c_rhs, + sense, linmat, + name) + check_status(env, status)
+ + + +
+[docs] +def getindconstr(env, lp, begin, end): + _, _, _, _, _, surplus = getindconstr_constant(env, lp, begin, end) + if surplus == 0: + return ([0] * _rangelen(begin, end), [], []) + # inout_list contains the linspace, begin, and end args to + # CPXXgetindconstraints. + inout_list = [surplus, begin, end] + status = CR.CPXXgetindconstraints(env, lp, inout_list) + check_status(env, status) + # We expect to get [linbeg, linind, linval] + assert len(inout_list) == 3 + return tuple(inout_list)
+ + + +
+[docs] +def getindconstr_constant(env, lp, begin, end): + # inout_list contains the linspace, begin, and end args to + # CPXXgetindconstraints. + inout_list = [0, begin, end] + status = CR.CPXXgetindconstraints(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get: + # [type, indvar, complemented, rhs, sense, surplus] + assert len(inout_list) == 6 + return tuple(inout_list)
+ + + +
+[docs] +def getindconstrindex(env, lp, name): + indexfn = CR.CPXXgetindconstrindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def delindconstrs(env, lp, begin, end): + delfn = CR.CPXXdelindconstrs + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getindconstrslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slacks = _safeDoubleArray(slacklen) + status = CR.CPXXgetindconstrslack(env, lp, slacks, begin, end) + check_status(env, status) + return LAU.array_to_list(slacks, slacklen)
+ + + +
+[docs] +def getindconstrname(env, lp, which): + namefn = CR.CPXXgetindconstrname + return _getname(env, lp, which, namefn, index_first=False)
+ + +######################################################################## +# Quadratic Constraints +######################################################################## + + +
+[docs] +def addqconstr(env, lp, rhs, sense, linind, linval, quadrow, quadcol, + quadval, name): + with LAU.int_c_array(linind) as c_linind, \ + LAU.double_c_array(linval) as c_linval, \ + LAU.int_c_array(quadrow) as c_quadrow, \ + LAU.int_c_array(quadcol) as c_quadcol, \ + LAU.double_c_array(quadval) as c_quadval: + status = CR.CPXXaddqconstr(env, lp, len(linind), len(quadrow), + rhs, sense, + c_linind, c_linval, + c_quadrow, c_quadcol, c_quadval, + name) + check_status(env, status)
+ + + +
+[docs] +def getqconstr_info(env, lp, which): + inout_list = [0, 0, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [rhs, sense, linsurplus, quadsurplus] + assert len(inout_list) == 4 + assert len(inout_list[1]) == 1 # sense string should be one char + return tuple(inout_list)
+ + + +
+[docs] +def getqconstr_lin(env, lp, which): + _, _, linsurplus, _ = getqconstr_info(env, lp, which) + if linsurplus == 0: + return ([], []) + inout_list = [linsurplus, 0, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [linind, linval, quadrow, quadcol, quadval] + assert len(inout_list) == 5 + return tuple(inout_list[:2]) # slice off the quad info
+ + + +
+[docs] +def getqconstr_quad(env, lp, which): + _, _, _, quadsurplus = getqconstr_info(env, lp, which) + if quadsurplus == 0: + return ([], [], []) + inout_list = [0, quadsurplus, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [linind, linval, quadrow, quadcol, quadval] + assert len(inout_list) == 5 + return tuple(inout_list[2:]) # slice off the lin info
+ + + +
+[docs] +def delqconstrs(env, lp, begin, end): + delfn = CR.CPXXdelqconstrs + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getqconstrindex(env, lp, name): + indexfn = CR.CPXXgetqconstrindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getqconstrslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slacks = _safeDoubleArray(slacklen) + status = CR.CPXXgetqconstrslack(env, lp, slacks, begin, end) + check_status(env, status) + return LAU.array_to_list(slacks, slacklen)
+ + + +
+[docs] +def getqconstrname(env, lp, which): + namefn = CR.CPXXgetqconstrname + return _getname(env, lp, which, namefn, index_first=False)
+ + +######################################################################## +# Generic helper methods +######################################################################## + + +def _delbyrange(delfn, env, lp, begin, end=None): + if end is None: + end = begin + status = delfn(env, lp, begin, end) + check_status(env, status) + + +def _getindex(env, lp, name, indexfn): + idx = CR.intPtr() + status = indexfn(env, lp, name, idx) + check_status(env, status) + return idx.value() + + +def _getname(env, lp, idx, namefn, index_first=True): + # Some name functions have the index argument first and some have it + # last. Thus, we do this little dance, so things are called in the + # right way depending on index_first. + def _namefn(env, lp, idx, inoutlist): + if index_first: + return namefn(env, lp, idx, inoutlist) + return namefn(env, lp, inoutlist, idx) + inoutlist = [0] + # NB: inoutlist will be modified as a side effect + status = _namefn(env, lp, idx, inoutlist) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inoutlist == [0]: + return None + status = _namefn(env, lp, idx, inoutlist) + check_status(env, status) + return inoutlist[0] + + +def _getnamebyrange(env, lp, begin, end, namefn): + inout_list = [0, begin, end] + status = namefn(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return [None] * _rangelen(begin, end) + inout_list.extend([begin, end]) + status = namefn(env, lp, inout_list) + check_status(env, status) + return inout_list + + +def _getnamesingle(env, lp, namefn): + inoutlist = [0] + status = namefn(env, lp, inoutlist) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inoutlist == [0]: + return None + status = namefn(env, lp, inoutlist) + check_status(env, status) + return inoutlist[0] + +######################################################################## +# Annotation API +######################################################################## + + +def _newanno(env, lp, name, defval, newfn): + status = newfn(env, lp, name, defval) + check_status(env, status) + + +
+[docs] +def newlonganno(env, lp, name, defval): + newfn = CR.CPXXnewlongannotation + _newanno(env, lp, name, defval, newfn)
+ + + +
+[docs] +def newdblanno(env, lp, name, defval): + newfn = CR.CPXXnewdblannotation + _newanno(env, lp, name, defval, newfn)
+ + + +
+[docs] +def dellonganno(env, lp, begin, end): + delfn = CR.CPXXdellongannotations + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def deldblanno(env, lp, begin, end): + delfn = CR.CPXXdeldblannotations + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getlongannoindex(env, lp, name): + indexfn = CR.CPXXgetlongannotationindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getdblannoindex(env, lp, name): + indexfn = CR.CPXXgetdblannotationindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getlongannoname(env, lp, idx): + namefn = CR.CPXXgetlongannotationname + return _getname(env, lp, idx, namefn)
+ + + +
+[docs] +def getdblannoname(env, lp, idx): + namefn = CR.CPXXgetdblannotationname + return _getname(env, lp, idx, namefn)
+ + + +
+[docs] +def getnumlonganno(env, lp): + return CR.CPXXgetnumlongannotations(env, lp)
+ + + +
+[docs] +def getnumdblanno(env, lp): + return CR.CPXXgetnumdblannotations(env, lp)
+ + + +
+[docs] +def getlongannodefval(env, lp, idx): + defval = CR.cpxlongPtr() + status = CR.CPXXgetlongannotationdefval(env, lp, idx, defval) + check_status(env, status) + return int(defval.value())
+ + + +
+[docs] +def getdblannodefval(env, lp, idx): + defval = CR.doublePtr() + status = CR.CPXXgetdblannotationdefval(env, lp, idx, defval) + check_status(env, status) + return defval.value()
+ + + +
+[docs] +def setlonganno(env, lp, idx, objtype, ind, val): + assert len(ind) == len(val) + cnt = len(ind) + status = CR.CPXXsetlongannotations(env, lp, idx, objtype, cnt, + LAU.int_list_to_array(ind), + LAU.long_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def setdblanno(env, lp, idx, objtype, ind, val): + assert len(ind) == len(val) + cnt = len(ind) + status = CR.CPXXsetdblannotations(env, lp, idx, objtype, cnt, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def getlonganno(env, lp, idx, objtype, begin, end): + annolen = _rangelen(begin, end) + val = _safeLongArray(annolen) + status = CR.CPXXgetlongannotations(env, lp, idx, objtype, val, + begin, end) + check_status(env, status) + return [int(i) for i in LAU.array_to_list(val, annolen)]
+ + + +
+[docs] +def getdblanno(env, lp, idx, objtype, begin, end): + annolen = _rangelen(begin, end) + val = _safeDoubleArray(annolen) + status = CR.CPXXgetdblannotations(env, lp, idx, objtype, val, + begin, end) + check_status(env, status) + return LAU.array_to_list(val, annolen)
+ + + +
+[docs] +def readcopyanno(env, lp, filename): + status = CR.CPXXreadcopyannotations(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def writeanno(env, lp, filename): + status = CR.CPXXwriteannotations(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def writebendersanno(env, lp, filename): + status = CR.CPXXwritebendersannotation(env, lp, filename) + check_status(env, status)
+ + +######################################################################## +# PWL API +######################################################################## + + +
+[docs] +def addpwl(env, lp, vary, varx, preslope, postslope, nbreaks, + breakx, breaky, name): + assert len(breakx) == nbreaks + assert len(breaky) == nbreaks + with LAU.double_c_array(breakx) as c_breakx, \ + LAU.double_c_array(breaky) as c_breaky: + status = CR.CPXXaddpwl(env, lp, vary, varx, preslope, postslope, + nbreaks, c_breakx, c_breaky, name) + check_status(env, status)
+ + + +
+[docs] +def delpwl(env, lp, begin, end): + delfn = CR.CPXXdelpwl + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getnumpwl(env, lp): + return CR.CPXXgetnumpwl(env, lp)
+ + + +
+[docs] +def getpwl(env, lp, idx): + # Initially, the inout_list contains the pwlindex and breakspace args + # to CPXXgetpwl. We use zero (0) for breakspace to query the + # surplus. + inout_list = [idx, 0] + status = CR.CPXXgetpwl(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [vary, varx, preslope, postslope, surplus] + assert len(inout_list) == 5 + vary, varx, preslope, postslope, surplus = inout_list + # FIXME: Should we assert surplus is > 0? + inout_list = [idx, surplus] + status = CR.CPXXgetpwl(env, lp, inout_list) + check_status(env, status) + # We expect to get [breakx, breaky] + assert len(inout_list) == 2 + breakx, breaky = inout_list + return [vary, varx, preslope, postslope, breakx, breaky]
+ + + +
+[docs] +def getpwlindex(env, lp, name): + indexfn = CR.CPXXgetpwlindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getpwlname(env, lp, idx): + namefn = CR.CPXXgetpwlname + return _getname(env, lp, idx, namefn, index_first=False)
+ + +######################################################################## +# Objective API +######################################################################## + + +
+[docs] +def copyobjname(env, lp, objname): + status = CR.CPXXcopyobjname(env, lp, objname) + check_status(env, status)
+ + + +
+[docs] +def chgobj(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgobj(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgobjsen(env, lp, maxormin): + status = CR.CPXXchgobjsen(env, lp, maxormin) + check_status(env, status)
+ + + +
+[docs] +def getobjsen(env, lp): + return CR.CPXXgetobjsen(env, lp)
+ + + +
+[docs] +def getobjoffset(env, lp): + objoffset = CR.doublePtr() + status = CR.CPXXgetobjoffset(env, lp, objoffset) + check_status(env, status) + return objoffset.value()
+ + + +
+[docs] +def chgobjoffset(env, lp, offset): + status = CR.CPXXchgobjoffset(env, lp, offset) + check_status(env, status)
+ + + +
+[docs] +def getobj(env, lp, begin, end): + objlen = _rangelen(begin, end) + obj = _safeDoubleArray(objlen) + status = CR.CPXXgetobj(env, lp, obj, begin, end) + check_status(env, status) + return LAU.array_to_list(obj, objlen)
+ + + +
+[docs] +def getobjname(env, lp): + namefn = CR.CPXXgetobjname + return _getnamesingle(env, lp, namefn)
+ + + +
+[docs] +def copyquad(env, lp, qmatbeg, qmatind, qmatval): + nqmatbeg = len(qmatbeg) + if nqmatbeg > 0: + qmatcnt = [qmatbeg[i + 1] - qmatbeg[i] + for i in range(nqmatbeg - 1)] + qmatcnt.append(len(qmatind) - qmatbeg[-1]) + else: + qmatcnt = [] + with LAU.long_c_array(qmatbeg) as c_qmatbeg, \ + LAU.int_c_array(qmatcnt) as c_qmatcnt, \ + LAU.int_c_array(qmatind) as c_qmatind, \ + LAU.double_c_array(qmatval) as c_qmatval: + status = CR.CPXXcopyquad(env, lp, c_qmatbeg, c_qmatcnt, + c_qmatind, c_qmatval) + check_status(env, status)
+ + + +
+[docs] +def copyqpsep(env, lp, qsepvec): + with LAU.double_c_array(qsepvec) as c_qsepvec: + status = CR.CPXXcopyqpsep(env, lp, c_qsepvec) + check_status(env, status)
+ + + +
+[docs] +def chgqpcoef(env, lp, row, col, value): + status = CR.CPXXchgqpcoef(env, lp, row, col, value) + check_status(env, status)
+ + + +
+[docs] +def getquad(env, lp, begin, end): + nzcnt = CR.cpxlongPtr() + ncols = _rangelen(begin, end) + qmatbeg = _safeLongArray(ncols) + qmatind = LAU.int_list_to_array([]) + qmatval = LAU.double_list_to_array([]) + space = 0 + surplus = CR.cpxlongPtr() + status = CR.CPXXgetquad(env, lp, nzcnt, qmatbeg, qmatind, qmatval, + space, surplus, begin, end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([], [], []) + space = -surplus.value() + qmatind = _safeIntArray(space) + qmatval = _safeDoubleArray(space) + status = CR.CPXXgetquad(env, lp, nzcnt, qmatbeg, qmatind, qmatval, + space, surplus, begin, end) + check_status(env, status) + return (LAU.array_to_list(qmatbeg, ncols), + LAU.array_to_list(qmatind, space), + LAU.array_to_list(qmatval, space))
+ + + +
+[docs] +def getqpcoef(env, lp, row, col): + val = CR.doublePtr() + status = CR.CPXXgetqpcoef(env, lp, row, col, val) + check_status(env, status) + return val.value()
+ + + +
+[docs] +def getnumquad(env, lp): + return CR.CPXXgetnumquad(env, lp)
+ + + +
+[docs] +def getnumqpnz(env, lp): + return CR.CPXXgetnumqpnz(env, lp)
+ + +######################################################################## +# Multi-Objective API +######################################################################## + +
+[docs] +def getnumobjs(env, lp): + return CR.CPXXgetnumobjs(env, lp)
+ + +
+[docs] +def multiobjchgattribs(env, lp, objidx, + offset=_const.CPX_NO_OFFSET_CHANGE, + weight=_const.CPX_NO_WEIGHT_CHANGE, + priority=_const.CPX_NO_PRIORITY_CHANGE, + abstol=_const.CPX_NO_ABSTOL_CHANGE, + reltol=_const.CPX_NO_RELTOL_CHANGE, + name=None): + status = CR.CPXXmultiobjchgattribs(env, lp, objidx, offset, weight, + priority, abstol, reltol, + name) + check_status(env, status)
+ + +
+[docs] +def multiobjgetindex(env, lp, name): + indexfn = CR.CPXXmultiobjgetindex + return _getindex(env, lp, name, indexfn)
+ + +
+[docs] +def multiobjgetname(env, lp, objidx): + namefn = CR.CPXXmultiobjgetname + return _getname(env, lp, objidx, namefn, index_first=True)
+ + +
+[docs] +def multiobjgetobj(env, lp, objidx, begin, end): + coeffslen = _rangelen(begin, end) + coeffs = _safeDoubleArray(coeffslen) + offset = CR.doublePtr() + weight = CR.doublePtr() + priority = CR.intPtr() + abstol = CR.doublePtr() + reltol = CR.doublePtr() + status = CR.CPXXmultiobjgetobj(env, lp, objidx, coeffs, begin, end, + offset, weight, priority, abstol, reltol) + check_status(env, status) + return [LAU.array_to_list(coeffs, coeffslen), offset.value(), + weight.value(), priority.value(), abstol.value(), + reltol.value()]
+ + +
+[docs] +def multiobjsetobj(env, lp, objidx, objind, objval, + offset=_const.CPX_NO_OFFSET_CHANGE, + weight=_const.CPX_NO_WEIGHT_CHANGE, + priority=_const.CPX_NO_PRIORITY_CHANGE, + abstol=_const.CPX_NO_ABSTOL_CHANGE, + reltol=_const.CPX_NO_RELTOL_CHANGE, + objname=None): + objnz = len(objind) + assert len(objval) == objnz + with LAU.int_c_array(objind) as c_objind, \ + LAU.double_c_array(objval) as c_objval: # noqa: E127 + status = CR.CPXXmultiobjsetobj(env, lp, objidx, objnz, c_objind, + c_objval, offset, weight, + priority, abstol, reltol, + objname) + check_status(env, status)
+ + +
+[docs] +def setnumobjs(env, lp, n): + status = CR.CPXXsetnumobjs(env, lp, n) + check_status(env, status)
+ + +
+[docs] +def multiobjopt(env, lp, paramsets): + with SigIntHandler(): + status = CR.CPXXmultiobjopt(env, lp, paramsets) + check_status(env, status)
+ + +
+[docs] +def multiobjgetobjval(env, lp, objidx): + objval_p = CR.doublePtr() + status = CR.CPXXmultiobjgetobjval(env, lp, objidx, objval_p) + check_status(env, status) + return objval_p.value()
+ + +
+[docs] +def multiobjgetobjvalbypriority(env, lp, priority): + objval_p = CR.doublePtr() + status = CR.CPXXmultiobjgetobjvalbypriority(env, lp, priority, objval_p) + check_status(env, status) + return objval_p.value()
+ + +def _multiobjgetinfo(fn, env, lp, subprob, info_p, what): + status = fn(env, lp, subprob, info_p, what) + check_status(env, status) + return info_p.value() + +
+[docs] +def multiobjgetdblinfo(env, lp, subprob, what): + info_p = CR.doublePtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetdblinfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetintinfo(env, lp, subprob, what): + info_p = CR.intPtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetintinfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetlonginfo(env, lp, subprob, what): + info_p = CR.cpxlongPtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetlonginfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetnumsolves(env, lp): + return CR.CPXXmultiobjgetnumsolves(env, lp)
+ + +
+[docs] +def getnumprios(env, lp): + return CR.CPXEgetnumprios(env, lp)
+ + +
+[docs] +def ismultiobj(env, lp): + return CR.CPXEismultiobj(env, lp) != 0
+ + +# Optimizing Problems + +# Accessing LP results + +
+[docs] +def solninfo(env, lp): + lpstat = CR.intPtr() + stype = CR.intPtr() + pfeas = CR.intPtr() + dfeas = CR.intPtr() + status = CR.CPXXsolninfo(env, lp, lpstat, stype, pfeas, dfeas) + check_status(env, status) + return (lpstat.value(), stype.value(), pfeas.value(), dfeas.value())
+ + + +
+[docs] +def getstat(env, lp): + return CR.CPXXgetstat(env, lp)
+ + + +
+[docs] +def getmethod(env, lp): + return CR.CPXXgetmethod(env, lp)
+ + + +
+[docs] +def getobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getx(env, lp, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetx(env, lp, x, begin, end) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getnumcores(env): + numcores = CR.intPtr() + status = CR.CPXXgetnumcores(env, numcores) + check_status(env, status) + return numcores.value()
+ + + +
+[docs] +def getax(env, lp, begin, end): + axlen = _rangelen(begin, end) + ax = _safeDoubleArray(axlen) + status = CR.CPXXgetax(env, lp, ax, begin, end) + check_status(env, status) + return LAU.array_to_list(ax, axlen)
+ + + +
+[docs] +def getxqxax(env, lp, begin, end): + qaxlen = _rangelen(begin, end) + qax = _safeDoubleArray(qaxlen) + status = CR.CPXXgetxqxax(env, lp, qax, begin, end) + check_status(env, status) + return LAU.array_to_list(qax, qaxlen)
+ + + +
+[docs] +def getpi(env, lp, begin, end): + pilen = _rangelen(begin, end) + pi = _safeDoubleArray(pilen) + status = CR.CPXXgetpi(env, lp, pi, begin, end) + check_status(env, status) + return LAU.array_to_list(pi, pilen)
+ + + +
+[docs] +def getslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slack = _safeDoubleArray(slacklen) + status = CR.CPXXgetslack(env, lp, slack, begin, end) + check_status(env, status) + return LAU.array_to_list(slack, slacklen)
+ + + +
+[docs] +def getdj(env, lp, begin, end): + djlen = _rangelen(begin, end) + dj = _safeDoubleArray(djlen) + status = CR.CPXXgetdj(env, lp, dj, begin, end) + check_status(env, status) + return LAU.array_to_list(dj, djlen)
+ + + +
+[docs] +def getqconstrdslack(env, lp, qind): + inout_list = [0, qind] + status = CR.CPXXgetqconstrdslack(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([], []) + inout_list.extend([qind]) + status = CR.CPXXgetqconstrdslack(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +# Infeasibility + +
+[docs] +def getrowinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetrowinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getcolinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetcolinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getqconstrinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetqconstrinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getindconstrinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetindconstrinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getsosinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetsosinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + +# Basis + + +
+[docs] +def getbase(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cstat = _safeIntArray(numcols) + rstat = _safeIntArray(numrows) + status = CR.CPXXgetbase(env, lp, cstat, rstat) + check_status(env, status) + return (LAU.array_to_list(cstat, numcols), + LAU.array_to_list(rstat, numrows))
+ + + +
+[docs] +def getbhead(env, lp): + headlen = CR.CPXXgetnumrows(env, lp) + head = _safeIntArray(headlen) + x = _safeDoubleArray(headlen) + status = CR.CPXXgetbhead(env, lp, head, x) + check_status(env, status) + return (LAU.array_to_list(head, headlen), + LAU.array_to_list(x, headlen))
+ + + +
+[docs] +def mbasewrite(env, lp, filename): + status = CR.CPXXmbasewrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getijrow(env, lp, idx, is_row_index): + row = CR.intPtr() + if is_row_index: + i, j = (idx, -1) # Seek a basic row. + else: + i, j = (-1, idx) # Seek a basic column. + status = CR.CPXXgetijrow(env, lp, i, j, row) + if status == CR.CPXERR_INDEX_NOT_BASIC: + return -1 + check_status(env, status) + return row.value()
+ + + +
+[docs] +def getpnorms(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cnorm = _safeDoubleArray(numcols) + rnorm = _safeDoubleArray(numrows) + length = CR.intPtr() + status = CR.CPXXgetpnorms(env, lp, cnorm, rnorm, length) + check_status(env, status) + return (LAU.array_to_list(cnorm, length.value()), + LAU.array_to_list(rnorm, numrows))
+ + + +
+[docs] +def getdnorms(env, lp): + numrows = CR.CPXXgetnumrows(env, lp) + norm = _safeDoubleArray(numrows) + head = _safeIntArray(numrows) + length = CR.intPtr() + status = CR.CPXXgetdnorms(env, lp, norm, head, length) + check_status(env, status) + return (LAU.array_to_list(norm, length.value()), + LAU.array_to_list(head, length.value()))
+ + + +
+[docs] +def getbasednorms(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cstat = _safeIntArray(numcols) + rstat = _safeIntArray(numrows) + dnorm = _safeDoubleArray(numrows) + status = CR.CPXXgetbasednorms(env, lp, cstat, rstat, dnorm) + check_status(env, status) + return (LAU.array_to_list(cstat, numcols), + LAU.array_to_list(rstat, numrows), + LAU.array_to_list(dnorm, numrows))
+ + + +
+[docs] +def getpsbcnt(env, lp): + return CR.CPXXgetpsbcnt(env, lp)
+ + + +
+[docs] +def getdsbcnt(env, lp): + return CR.CPXXgetdsbcnt(env, lp)
+ + + +
+[docs] +def getdblquality(env, lp, what): + quality = CR.doublePtr() + status = CR.CPXXgetdblquality(env, lp, quality, what) + check_status(env, status) + return quality.value()
+ + + +
+[docs] +def getintquality(env, lp, what): + quality = CR.intPtr() + status = CR.CPXXgetintquality(env, lp, quality, what) + check_status(env, status) + return quality.value()
+ + + +# Sensitivity Analysis Results + +
+[docs] +def boundsa_lower(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = _safeDoubleArray(listlen) + lbupper = _safeDoubleArray(listlen) + ublower = LAU.double_list_to_array([]) + ubupper = LAU.double_list_to_array([]) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(lblower, listlen), + LAU.array_to_list(lbupper, listlen))
+ + + +
+[docs] +def boundsa_upper(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = LAU.double_list_to_array([]) + lbupper = LAU.double_list_to_array([]) + ublower = _safeDoubleArray(listlen) + ubupper = _safeDoubleArray(listlen) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(ublower, listlen), + LAU.array_to_list(ubupper, listlen))
+ + + +
+[docs] +def boundsa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = _safeDoubleArray(listlen) + lbupper = _safeDoubleArray(listlen) + ublower = _safeDoubleArray(listlen) + ubupper = _safeDoubleArray(listlen) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(lblower, listlen), + LAU.array_to_list(lbupper, listlen), + LAU.array_to_list(ublower, listlen), + LAU.array_to_list(ubupper, listlen))
+ + + +
+[docs] +def objsa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lower = _safeDoubleArray(listlen) + upper = _safeDoubleArray(listlen) + status = CR.CPXXobjsa(env, lp, begin, end, lower, upper) + check_status(env, status) + return (LAU.array_to_list(lower, listlen), + LAU.array_to_list(upper, listlen))
+ + + +
+[docs] +def rhssa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lower = _safeDoubleArray(listlen) + upper = _safeDoubleArray(listlen) + status = CR.CPXXrhssa(env, lp, begin, end, lower, upper) + check_status(env, status) + return (LAU.array_to_list(lower, listlen), + LAU.array_to_list(upper, listlen))
+ + + +# Conflicts + +
+[docs] +def refinemipstartconflictext(env, lp, mipstartindex, grppref, grpbeg, + grpind, grptype): + grpcnt = _arraylen(grppref) + concnt = _arraylen(grpind) + with SigIntHandler(), \ + LAU.double_c_array_or_none(grppref) as c_grppref, \ + LAU.long_c_array_or_none(grpbeg) as c_grpbeg, \ + LAU.int_c_array_or_none(grpind) as c_grpind: + status = CR.CPXXrefinemipstartconflictext( + env, lp, mipstartindex, grpcnt, concnt, + c_grppref, c_grpbeg, c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def refineconflictext(env, lp, grppref, grpbeg, grpind, grptype): + grpcnt = _arraylen(grppref) + concnt = _arraylen(grpind) + with SigIntHandler(), \ + LAU.double_c_array_or_none(grppref) as c_grppref, \ + LAU.long_c_array_or_none(grpbeg) as c_grpbeg, \ + LAU.int_c_array_or_none(grpind) as c_grpind: + status = CR.CPXXrefineconflictext( + env, lp, grpcnt, concnt, + c_grppref, c_grpbeg, c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def getconflictext(env, lp, begin, end): + grpstatlen = _rangelen(begin, end) + grpstat = _safeIntArray(grpstatlen) + status = CR.CPXXgetconflictext(env, lp, grpstat, begin, end) + check_status(env, status) + return LAU.array_to_list(grpstat, grpstatlen)
+ + + +
+[docs] +def getconflictnumgroups(env, lp): + return CR.CPXXgetconflictnumgroups(env, lp)
+ + + +
+[docs] +def getconflictgroups(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetconflictgroups(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([], [0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetconflictgroups(env, lp, inout_list) + check_status(env, status) + # We expect to get [grppref, grpbeg, grpind, grptype]. + assert len(inout_list) == 4, str(inout_list) + return tuple(inout_list)
+ + + +
+[docs] +def getconflictnumpasses(env, lp): + return CR.CPXXgetconflictnumpasses(env, lp)
+ + + +
+[docs] +def clpwrite(env, lp, filename): + status = CR.CPXXclpwrite(env, lp, filename) + check_status(env, status)
+ + +# Problem Modification Routines + +# File Reading Routines + +# File Writing Routines + + +
+[docs] +def solwrite(env, lp, filename): + status = CR.CPXXsolwrite(env, lp, filename) + check_status(env, status)
+ + +# Message Handling Routines + +# Advanced LP Routines + + +
+[docs] +def binvcol(env, lp, j): + xlen = CR.CPXXgetnumrows(env, lp) + x = _safeDoubleArray(xlen) + status = CR.CPXXbinvcol(env, lp, j, x) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def binvrow(env, lp, i): + ylen = CR.CPXXgetnumrows(env, lp) + y = _safeDoubleArray(ylen) + status = CR.CPXXbinvrow(env, lp, i, y) + check_status(env, status) + return LAU.array_to_list(y, ylen)
+ + + +
+[docs] +def binvacol(env, lp, j): + xlen = CR.CPXXgetnumrows(env, lp) + x = _safeDoubleArray(xlen) + status = CR.CPXXbinvacol(env, lp, j, x) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def binvarow(env, lp, i): + zlen = CR.CPXXgetnumcols(env, lp) + z = _safeDoubleArray(zlen) + status = CR.CPXXbinvarow(env, lp, i, z) + check_status(env, status) + return LAU.array_to_list(z, zlen)
+ + + +
+[docs] +def ftran(env, lp, x): + x_array = LAU.double_list_to_array(x) + status = CR.CPXXftran(env, lp, x_array) + check_status(env, status) + return LAU.array_to_list(x_array, len(x))
+ + + +
+[docs] +def btran(env, lp, y): + y_array = LAU.double_list_to_array(y) + status = CR.CPXXbtran(env, lp, y_array) + check_status(env, status) + return LAU.array_to_list(y_array, len(y))
+ + + +# Advanced Solution functions + +
+[docs] +def getgrad(env, lp, j): + numrows = CR.CPXXgetnumrows(env, lp) + head = _safeIntArray(numrows) + y = _safeDoubleArray(numrows) + status = CR.CPXXgetgrad(env, lp, j, head, y) + check_status(env, status) + return (LAU.array_to_list(head, numrows), + LAU.array_to_list(y, numrows))
+ + + +
+[docs] +def slackfromx(env, lp, x): + numrows = CR.CPXXgetnumrows(env, lp) + slack = _safeDoubleArray(numrows) + status = CR.CPXXslackfromx(env, lp, LAU.double_list_to_array(x), slack) + check_status(env, status) + return LAU.array_to_list(slack, numrows)
+ + + +
+[docs] +def qconstrslackfromx(env, lp, x): + numqcon = CR.CPXXgetnumqconstrs(env, lp) + slack = _safeDoubleArray(numqcon) + status = CR.CPXXqconstrslackfromx(env, lp, + LAU.double_list_to_array(x), slack) + check_status(env, status) + return LAU.array_to_list(slack, numqcon)
+ + + +
+[docs] +def djfrompi(env, lp, pi): + numcols = CR.CPXXgetnumcols(env, lp) + dj = _safeDoubleArray(numcols) + status = CR.CPXXdjfrompi(env, lp, LAU.double_list_to_array(pi), dj) + check_status(env, status) + return LAU.array_to_list(dj, numcols)
+ + + +
+[docs] +def qpdjfrompi(env, lp, pi, x): + numcols = CR.CPXXgetnumcols(env, lp) + dj = _safeDoubleArray(numcols) + status = CR.CPXXqpdjfrompi(env, lp, LAU.double_list_to_array(pi), + LAU.double_list_to_array(x), dj) + check_status(env, status) + return LAU.array_to_list(dj, numcols)
+ + + +
+[docs] +def mdleave(env, lp, goodlist): + goodlen = len(goodlist) + downratio = _safeDoubleArray(goodlen) + upratio = _safeDoubleArray(goodlen) + status = CR.CPXXmdleave(env, lp, LAU.int_list_to_array(goodlist), + goodlen, downratio, upratio) + check_status(env, status) + return (LAU.array_to_list(downratio, goodlen), + LAU.array_to_list(upratio, goodlen))
+ + + +
+[docs] +def qpindefcertificate(env, lp): + certlen = CR.CPXXgetnumquad(env, lp) + cert = _safeDoubleArray(certlen) + status = CR.CPXXqpindefcertificate(env, lp, cert) + check_status(env, status) + return LAU.array_to_list(cert, certlen)
+ + + +
+[docs] +def dualfarkas(env, lp): + ylen = CR.CPXXgetnumrows(env, lp) + y = _safeDoubleArray(ylen) + proof = CR.doublePtr() + status = CR.CPXXdualfarkas(env, lp, y, proof) + check_status(env, status) + return (LAU.array_to_list(y, ylen), proof.value())
+ + + +
+[docs] +def getijdiv(env, lp): + idiv = CR.intPtr() + jdiv = CR.intPtr() + status = CR.CPXXgetijdiv(env, lp, idiv, jdiv) + check_status(env, status) + if idiv.value() != -1: + return idiv.value() + getnumcols(env, lp) + if jdiv.value() != -1: + return jdiv.value() + # problem is not diverging + return -1
+ + + +
+[docs] +def getray(env, lp): + zlen = CR.CPXXgetnumcols(env, lp) + z = _safeDoubleArray(zlen) + status = CR.CPXXgetray(env, lp, z) + check_status(env, status) + return LAU.array_to_list(z, zlen)
+ + + +# Advanced Presolve Routines + +
+[docs] +def presolve(env, lp, method): + status = CR.CPXXpresolve(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def freepresolve(env, lp): + status = CR.CPXXfreepresolve(env, lp) + check_status(env, status)
+ + + +
+[docs] +def crushx(env, lp, x): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numcols = CR.CPXXgetnumcols(env, redlp.value()) + prex = _safeDoubleArray(numcols) + status = CR.CPXXcrushx(env, lp, LAU.double_list_to_array(x), prex) + check_status(env, status) + return LAU.array_to_list(prex, numcols)
+ + + +
+[docs] +def uncrushx(env, lp, prex): + numcols = CR.CPXXgetnumcols(env, lp) + x = _safeDoubleArray(numcols) + status = CR.CPXXuncrushx(env, lp, x, LAU.double_list_to_array(prex)) + check_status(env, status) + return LAU.array_to_list(x, numcols)
+ + + +
+[docs] +def crushpi(env, lp, pi): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numrows = CR.CPXXgetnumrows(env, redlp.value()) + prepi = _safeDoubleArray(numrows) + status = CR.CPXXcrushpi(env, lp, LAU.double_list_to_array(pi), prepi) + check_status(env, status) + return LAU.array_to_list(prepi, numrows)
+ + + +
+[docs] +def uncrushpi(env, lp, prepi): + numrows = CR.CPXXgetnumrows(env, lp) + pi = _safeDoubleArray(numrows) + status = CR.CPXXuncrushpi(env, lp, pi, LAU.double_list_to_array(prepi)) + check_status(env, status) + return LAU.array_to_list(pi, numrows)
+ + + +
+[docs] +def crushform(env, lp, ind, val): + plen = CR.intPtr() + poffset = CR.doublePtr() + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numcols = CR.CPXXgetnumcols(env, redlp.value()) + pind = _safeIntArray(numcols) + pval = _safeDoubleArray(numcols) + status = CR.CPXXcrushform(env, lp, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + plen, poffset, pind, pval) + check_status(env, status) + return (poffset.value(), LAU.array_to_list(pind, plen.value()), + LAU.array_to_list(pval, plen.value()))
+ + + +
+[docs] +def uncrushform(env, lp, pind, pval): + length = CR.intPtr() + offset = CR.doublePtr() + maxlen = CR.CPXXgetnumcols(env, lp) + CR.CPXXgetnumrows(env, lp) + ind = _safeIntArray(maxlen) + val = _safeDoubleArray(maxlen) + status = CR.CPXXuncrushform(env, lp, len(pind), + LAU.int_list_to_array(pind), + LAU.double_list_to_array(pval), + length, offset, ind, val) + check_status(env, status) + return (offset.value(), LAU.array_to_list(ind, length.value()), + LAU.array_to_list(val, length.value()))
+ + + +
+[docs] +def getprestat_status(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return prestat.value()
+ + + +
+[docs] +def getprestat_r(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + nrows = CR.CPXXgetnumrows(env, lp) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = _safeIntArray(nrows) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(prstat, nrows)
+ + + +
+[docs] +def getprestat_c(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + ncols = CR.CPXXgetnumcols(env, lp) + prestat = CR.intPtr() + pcstat = _safeIntArray(ncols) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(pcstat, ncols)
+ + + +
+[docs] +def getprestat_or(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + nprows = CR.CPXXgetnumrows(env, redlp.value()) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = _safeIntArray(nprows) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(orstat, nprows)
+ + + +
+[docs] +def getprestat_oc(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + npcols = CR.CPXXgetnumcols(env, redlp.value()) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = _safeIntArray(npcols) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(ocstat, npcols)
+ + + +
+[docs] +def prechgobj(env, lp, ind, val): + status = CR.CPXXprechgobj(env, lp, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def preaddrows(env, lp, rhs, sense, rmatbeg, rmatind, rmatval, names): + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.long_c_array(rmatbeg) as c_rmatbeg, \ + LAU.int_c_array(rmatind) as c_rmatind, \ + LAU.double_c_array(rmatval) as c_rmatval: # noqa: E126 + status = CR.CPXXpreaddrows(env, lp, len(rmatbeg), len(rmatind), + c_rhs, + sense, + c_rmatbeg, + c_rmatind, + c_rmatval, + names) + check_status(env, status)
+ + +######################################################################## +# MIP Starts API +######################################################################## + + +
+[docs] +def getnummipstarts(env, lp): + return CR.CPXXgetnummipstarts(env, lp)
+ + + +
+[docs] +def chgmipstarts(env, lp, mipstartindices, beg, varindices, values, + effortlevel): + with LAU.int_c_array(mipstartindices) as c_mipstartindices, \ + LAU.long_c_array(beg) as c_beg, \ + LAU.int_c_array(varindices) as c_varindices, \ + LAU.double_c_array(values) as c_values, \ + LAU.int_c_array(effortlevel) as c_effortlevel: + status = CR.CPXXchgmipstarts(env, lp, + len(mipstartindices), + c_mipstartindices, + len(varindices), + c_beg, + c_varindices, + c_values, + c_effortlevel) + check_status(env, status)
+ + + +
+[docs] +def addmipstarts(env, lp, beg, varindices, values, effortlevel, + mipstartname): + with LAU.long_c_array(beg) as c_beg, \ + LAU.int_c_array(varindices) as c_varindices, \ + LAU.double_c_array(values) as c_values, \ + LAU.int_c_array(effortlevel) as c_effortlevel: + status = CR.CPXXaddmipstarts( + env, lp, len(beg), len(varindices), + c_beg, c_varindices, c_values, c_effortlevel, + mipstartname) + check_status(env, status)
+ + + +
+[docs] +def delmipstarts(env, lp, begin, end): + delfn = CR.CPXXdelmipstarts + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getmipstarts_size(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return -surplus.value()
+ + + +
+[docs] +def getmipstarts_effort(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([0] * _rangelen(begin, end), [], [], + [0] * _rangelen(begin, end)) + startspace = -surplus.value() + beg = _safeLongArray(beglen) + varindices = _safeIntArray(startspace) + values = _safeDoubleArray(startspace) + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + check_status(env, status) + return LAU.array_to_list(effortlevel, beglen)
+ + + +
+[docs] +def getmipstarts(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([0] * _rangelen(begin, end), [], [], + [0] * _rangelen(begin, end)) + beg = _safeLongArray(beglen) + startspace = -surplus.value() + varindices = _safeIntArray(startspace) + values = _safeDoubleArray(startspace) + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + check_status(env, status) + return (LAU.array_to_list(beg, beglen), + LAU.array_to_list(varindices, startspace), + LAU.array_to_list(values, startspace), + LAU.array_to_list(effortlevel, beglen))
+ + + +
+[docs] +def getmipstartname(env, lp, begin, end): + namefn = CR.CPXXgetmipstartname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getmipstartindex(env, lp, mipstartname): + index = CR.intPtr() + status = CR.CPXXgetmipstartindex(env, lp, mipstartname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def readcopymipstarts(env, lp, filename): + status = CR.CPXXreadcopymipstarts(env, lp, + filename) + check_status(env, status)
+ + + +
+[docs] +def writemipstarts(env, lp, filename, begin, end): + status = CR.CPXXwritemipstarts(env, lp, filename, begin, end) + check_status(env, status)
+ + +# Optimizing Problems + +# Progress + + +
+[docs] +def getitcnt(env, lp): + return CR.CPXXgetitcnt(env, lp)
+ + + +
+[docs] +def getphase1cnt(env, lp): + return CR.CPXXgetphase1cnt(env, lp)
+ + + +
+[docs] +def getsiftitcnt(env, lp): + return CR.CPXXgetsiftitcnt(env, lp)
+ + + +
+[docs] +def getsiftphase1cnt(env, lp): + return CR.CPXXgetsiftphase1cnt(env, lp)
+ + + +
+[docs] +def getbaritcnt(env, lp): + return CR.CPXXgetbaritcnt(env, lp)
+ + + +
+[docs] +def getcrossppushcnt(env, lp): + return CR.CPXXgetcrossppushcnt(env, lp)
+ + + +
+[docs] +def getcrosspexchcnt(env, lp): + return CR.CPXXgetcrosspexchcnt(env, lp)
+ + + +
+[docs] +def getcrossdpushcnt(env, lp): + return CR.CPXXgetcrossdpushcnt(env, lp)
+ + + +
+[docs] +def getcrossdexchcnt(env, lp): + return CR.CPXXgetcrossdexchcnt(env, lp)
+ + + +
+[docs] +def getmipitcnt(env, lp): + return CR.CPXXgetmipitcnt(env, lp)
+ + + +
+[docs] +def getnodecnt(env, lp): + return CR.CPXXgetnodecnt(env, lp)
+ + + +
+[docs] +def getnodeleftcnt(env, lp): + return CR.CPXXgetnodeleftcnt(env, lp)
+ + + +# MIP Only solution interface + +
+[docs] +def getbestobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetbestobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getcutoff(env, lp): + cutoff = CR.doublePtr() + status = CR.CPXXgetcutoff(env, lp, cutoff) + check_status(env, status) + return cutoff.value()
+ + + +
+[docs] +def getmiprelgap(env, lp): + relgap = CR.doublePtr() + status = CR.CPXXgetmiprelgap(env, lp, relgap) + check_status(env, status) + return relgap.value()
+ + + +
+[docs] +def getnumcuts(env, lp, cuttype): + num = CR.intPtr() + status = CR.CPXXgetnumcuts(env, lp, cuttype, num) + check_status(env, status) + return num.value()
+ + + +
+[docs] +def getnodeint(env, lp): + return CR.CPXXgetnodeint(env, lp)
+ + + +
+[docs] +def getsubstat(env, lp): + return CR.CPXXgetsubstat(env, lp)
+ + +# for callback query methods + + +
+[docs] +def get_wherefrom(cbstruct): + return CR.get_wherefrom(cbstruct)
+ + + +cpxlong_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, + _const.CPX_CALLBACK_INFO_NODE_NODENUM_LONG, + _const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG, +] + +int_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_NIINF, + _const.CPX_CALLBACK_INFO_NODE_VAR, + _const.CPX_CALLBACK_INFO_NODE_SOS, + _const.CPX_CALLBACK_INFO_LAZY_SOURCE, +] + +double_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_SIINF, + _const.CPX_CALLBACK_INFO_NODE_ESTIMATE, + _const.CPX_CALLBACK_INFO_NODE_OBJVAL, +] + +# NB: CPX_CALLBACK_INFO_NODE_TYPE not used in the Python API. + +user_handle_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_USERHANDLE +] + + +
+[docs] +def gettime(env): + time = CR.doublePtr() + status = CR.CPXXgettime(env, time) + check_status(env, status) + return time.value()
+ + + +
+[docs] +def getdettime(env): + time = CR.doublePtr() + status = CR.CPXXgetdettime(env, time) + check_status(env, status) + return time.value()
+ + + +
+[docs] +def getcallbackincumbent(cbstruct, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetcallbackincumbent(cbstruct, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getcallbackpseudocosts(cbstruct, begin, end): + pclen = _rangelen(begin, end) + uppc = _safeDoubleArray(pclen) + dnpc = _safeDoubleArray(pclen) + status = CR.CPXXgetcallbackpseudocosts(cbstruct, uppc, dnpc, begin, end) + check_status(None, status) + return (LAU.array_to_list(uppc, pclen), + LAU.array_to_list(dnpc, pclen))
+ + + +
+[docs] +def getcallbacknodeintfeas(cbstruct, begin, end): + feaslen = _rangelen(begin, end) + feas = _safeIntArray(feaslen) + status = CR.CPXXgetcallbacknodeintfeas(cbstruct, feas, begin, end) + check_status(None, status) + return LAU.array_to_list(feas, feaslen)
+ + + +
+[docs] +def getcallbacknodelb(cbstruct, begin, end): + lblen = _rangelen(begin, end) + lb = _safeDoubleArray(lblen) + status = CR.CPXXgetcallbacknodelb(cbstruct, lb, begin, end) + check_status(None, status) + return LAU.array_to_list(lb, lblen)
+ + + +
+[docs] +def getcallbacknodeub(cbstruct, begin, end): + ublen = _rangelen(begin, end) + ub = _safeDoubleArray(ublen) + status = CR.CPXXgetcallbacknodeub(cbstruct, ub, begin, end) + check_status(None, status) + return LAU.array_to_list(ub, ublen)
+ + + +
+[docs] +def getcallbacknodeobjval(cbstruct): + x = CR.doublePtr() + status = CR.CPXXgetcallbacknodeobjval(cbstruct, x) + check_status(None, status) + return x.value()
+ + + +
+[docs] +def getcallbacknodex(cbstruct, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetcallbacknodex(cbstruct, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getcallbacknodeinfo(cbstruct, node, which): + if which in int_callback_node_info: + data = CR.intPtr() + elif which in cpxlong_callback_node_info: + data = CR.cpxlongPtr() + elif which in double_callback_node_info: + data = CR.doublePtr() + elif which in user_handle_callback_node_info: + data = [] + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbacknodeinfo") + status = CR.CPXXgetcallbacknodeinfo(cbstruct, [node, which, data]) + check_status(None, status) + if (which in int_callback_node_info or + which in double_callback_node_info or + which in cpxlong_callback_node_info): + return data.value() + assert which in user_handle_callback_node_info + return data[0]
+ + + +
+[docs] +def callbacksetuserhandle(cbstruct, userhandle): + data = [] + status = CR.CPXXcallbacksetuserhandle(cbstruct, [userhandle, data]) + check_status(None, status) + return data[0]
+ + + +
+[docs] +def callbacksetnodeuserhandle(cbstruct, nodeindex, userhandle): + data = [] + status = CR.CPXXcallbacksetnodeuserhandle( + cbstruct, [nodeindex, userhandle, data]) + check_status(None, status) + return data[0]
+ + + +
+[docs] +def getcallbackseqinfo(cbstruct, node, which): + if which in int_callback_node_info: + data = CR.intPtr() + elif which in cpxlong_callback_node_info: + data = CR.cpxlongPtr() + elif which in double_callback_node_info: + data = CR.doublePtr() + elif which in user_handle_callback_node_info: + data = [] + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbackseqinfo") + status = CR.CPXXgetcallbackseqinfo(cbstruct, [node, which, data]) + check_status(None, status) + if (which in int_callback_node_info or + which in double_callback_node_info or + which in cpxlong_callback_node_info): + return data.value() + assert which in user_handle_callback_node_info + return data[0]
+ + + +int_sos_info = [ + _const.CPX_CALLBACK_INFO_SOS_NUM, + _const.CPX_CALLBACK_INFO_SOS_SIZE, + _const.CPX_CALLBACK_INFO_SOS_IS_FEASIBLE, + _const.CPX_CALLBACK_INFO_SOS_MEMBER_INDEX, +] + +double_sos_info = [ + _const.CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL, +] + +# NB: CPX_CALLBACK_INFO_SOS_TYPE not used in the Python API. + + +
+[docs] +def getcallbacksosinfo(cbstruct, sosindex, member, which): + if which in int_sos_info: + data = CR.intPtr() + elif which in double_sos_info: + data = CR.doublePtr() + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbacksosinfo") + status = CR.CPXXgetcallbacksosinfo(cbstruct, sosindex, member, which, data) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def cutcallbackadd(cbstruct, rhs, sense, ind, val, purgeable): + status = CR.CPXXcutcallbackadd(cbstruct, len(ind), rhs, + sense, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + purgeable) + check_status(None, status)
+ + + +
+[docs] +def cutcallbackaddlocal(cbstruct, rhs, sense, ind, val): + status = CR.CPXXcutcallbackaddlocal(cbstruct, len(ind), rhs, + sense, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(None, status)
+ + + +
+[docs] +def branchcallbackbranchgeneral(cbstruct, ind, lu, bd, rhs, sense, matbeg, + matind, matval, nodeest, userhandle): + seqnum = CR.cpxlongPtr() + status = CR.CPXXbranchcallbackbranchgeneral( + cbstruct, len(ind), + LAU.int_list_to_array(ind), + lu, + LAU.double_list_to_array(bd), + len(matbeg), len(matind), + LAU.double_list_to_array(rhs), + sense, + LAU.long_list_to_array(matbeg), + LAU.int_list_to_array(matind), + LAU.double_list_to_array(matval), + nodeest, userhandle, seqnum) + check_status(None, status) + return seqnum.value()
+ + + +
+[docs] +def branchcallbackbranchasCPLEX(cbstruct, n, userhandle): + seqnum = CR.cpxlongPtr() + status = CR.CPXXbranchcallbackbranchasCPLEX( + cbstruct, n, userhandle, seqnum) + check_status(None, status) + return seqnum.value()
+ + + +
+[docs] +def setpydel(env): + status = CR.setpydel(env) + check_status(env, status)
+ + + +
+[docs] +def delpydel(env): + status = CR.delpydel(env) + check_status(env, status)
+ + +# Solution pool + + +
+[docs] +def addsolnpooldivfilter(env, lp, lb, ub, ind, wts, ref, name): + status = CR.CPXXaddsolnpooldivfilter(env, lp, lb, ub, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(wts), + LAU.double_list_to_array(ref), + name) + check_status(env, status)
+ + + +
+[docs] +def addsolnpoolrngfilter(env, lp, lb, ub, ind, val, name): + status = CR.CPXXaddsolnpoolrngfilter(env, lp, lb, ub, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + name) + check_status(env, status)
+ + + +
+[docs] +def getsolnpooldivfilter_constant(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + wts = LAU.double_list_to_array([]) + ref = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return (lb.value(), ub.value(), -surplus.value())
+ + + +
+[docs] +def getsolnpooldivfilter(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + wts = LAU.double_list_to_array([]) + ref = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + wts = _safeDoubleArray(space) + ref = _safeDoubleArray(space) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + check_status(env, status) + return (lb.value(), + ub.value(), + LAU.array_to_list(ind, space), + LAU.array_to_list(wts, space), + LAU.array_to_list(ref, space))
+ + + +
+[docs] +def getsolnpoolrngfilter_constant(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + val = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return (lb.value(), ub.value(), -surplus.value())
+ + + +
+[docs] +def getsolnpoolrngfilter(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + val = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + val = _safeDoubleArray(space) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + check_status(env, status) + return (lb.value(), ub.value(), LAU.array_to_list(ind, space), + LAU.array_to_list(val, space))
+ + + +
+[docs] +def delsolnpoolfilters(env, lp, begin, end): + delfn = CR.CPXXdelsolnpoolfilters + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsolnpoolfiltername(env, lp, which): + namefn = CR.CPXXgetsolnpoolfiltername + return _getname(env, lp, which, namefn, index_first=False)
+ + + +
+[docs] +def getsolnpoolnumfilters(env, lp): + return CR.CPXXgetsolnpoolnumfilters(env, lp)
+ + + +
+[docs] +def fltwrite(env, lp, filename): + status = CR.CPXXfltwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def readcopysolnpoolfilters(env, lp, filename): + status = CR.CPXXreadcopysolnpoolfilters(env, lp, + filename) + check_status(env, status)
+ + + +
+[docs] +def getsolnpoolfilterindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetsolnpoolfilterindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getsolnpoolfiltertype(env, lp, index): + type_ = CR.intPtr() + status = CR.CPXXgetsolnpoolfiltertype(env, lp, type_, index) + check_status(env, status) + return type_.value()
+ + + +
+[docs] +def delsolnpoolsolns(env, lp, begin, end): + delfn = CR.CPXXdelsolnpoolsolns + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsolnpoolnumsolns(env, lp): + return CR.CPXXgetsolnpoolnumsolns(env, lp)
+ + + +
+[docs] +def getsolnpoolnumreplaced(env, lp): + return CR.CPXXgetsolnpoolnumreplaced(env, lp)
+ + + +
+[docs] +def getsolnpoolsolnindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetsolnpoolsolnindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getsolnpoolmeanobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetsolnpoolmeanobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getsolnpoolsolnname(env, lp, which): + namefn = CR.CPXXgetsolnpoolsolnname + return _getname(env, lp, which, namefn, index_first=False)
+ + + +
+[docs] +def solwritesolnpool(env, lp, soln, filename): + status = CR.CPXXsolwritesolnpool(env, lp, soln, filename) + check_status(env, status)
+ + + +
+[docs] +def solwritesolnpoolall(env, lp, filename): + status = CR.CPXXsolwritesolnpoolall(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getsolnpoolobjval(env, lp, soln): + obj = CR.doublePtr() + status = CR.CPXXgetsolnpoolobjval(env, lp, soln, obj) + check_status(env, status) + return obj.value()
+ + + +
+[docs] +def getsolnpoolx(env, lp, soln, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetsolnpoolx(env, lp, soln, x, begin, end) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getsolnpoolslack(env, lp, soln, begin, end): + slacklen = _rangelen(begin, end) + slack = _safeDoubleArray(slacklen) + status = CR.CPXXgetsolnpoolslack(env, lp, soln, slack, begin, end) + check_status(env, status) + return LAU.array_to_list(slack, slacklen)
+ + + +
+[docs] +def getsolnpoolqconstrslack(env, lp, soln, begin, end): + qlen = _rangelen(begin, end) + q = _safeDoubleArray(qlen) + status = CR.CPXXgetsolnpoolqconstrslack(env, lp, soln, q, begin, end) + check_status(env, status) + return LAU.array_to_list(q, qlen)
+ + + +
+[docs] +def getsolnpoolintquality(env, lp, soln, what): + quality = CR.intPtr() + status = CR.CPXXgetsolnpoolintquality(env, lp, soln, quality, what) + check_status(env, status) + return quality.value()
+ + + +
+[docs] +def getsolnpooldblquality(env, lp, soln, what): + quality = CR.doublePtr() + status = CR.CPXXgetsolnpooldblquality(env, lp, soln, quality, what) + check_status(env, status) + return quality.value()
+ + + +# Initial data + + +
+[docs] +def copystart(env, lp, cstat, rstat, cprim, rprim, cdual, rdual): + status = CR.CPXXcopystart(env, lp, + LAU.int_list_to_array(cstat), + LAU.int_list_to_array(rstat), + LAU.double_list_to_array(cprim), + LAU.double_list_to_array(rprim), + LAU.double_list_to_array(cdual), + LAU.double_list_to_array(rdual)) + check_status(env, status)
+ + + +
+[docs] +def readcopybase(env, lp, filename): + status = CR.CPXXreadcopybase(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getorder(env, lp): + count = CR.intPtr() + surplus = CR.intPtr() + space = 0 + ind = LAU.int_list_to_array([]) + pri = LAU.int_list_to_array([]) + dir_ = LAU.int_list_to_array([]) + status = CR.CPXXgetorder(env, lp, count, ind, pri, dir_, space, surplus) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + pri = _safeIntArray(space) + dir_ = _safeIntArray(space) + status = CR.CPXXgetorder(env, lp, count, ind, pri, dir_, space, surplus) + check_status(env, status) + return (LAU.array_to_list(ind, space), LAU.array_to_list(pri, space), + LAU.array_to_list(dir_, space))
+ + + +
+[docs] +def copyorder(env, lp, indices, priority, direction): + status = CR.CPXXcopyorder(env, lp, len(indices), + LAU.int_list_to_array(indices), + LAU.int_list_to_array(priority), + LAU.int_list_to_array(direction)) + check_status(env, status)
+ + + +
+[docs] +def readcopyorder(env, lp, filename): + status = CR.CPXXreadcopyorder(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def ordwrite(env, lp, filename): + status = CR.CPXXordwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def readcopystartinfo(env, lp, filename): + status = CR.CPXXreadcopystartinfo(env, lp, filename) + check_status(env, status)
+ + +# handle the lock for parallel callbacks + + +
+[docs] +def initlock(): + return CR.init_callback_lock()
+ + + +
+[docs] +def finitlock(lock): + CR.finit_callback_lock(lock)
+ + + +# get problem statistics + +
+[docs] +def getprobstats(env, lp): + ProbStats = namedtuple( + 'ProbStats', + ['objs', # 0 + 'rows', # 1 + 'cols', # 2 + 'objcnt', # 3 + 'rhscnt', # 4 + 'nzcnt', # 5 + 'ecnt', # 6 + 'gcnt', # 7 + 'lcnt', # 8 + 'rngcnt', # 9 + 'ncnt', # 10 + 'fcnt', # 11 + 'xcnt', # 12 + 'bcnt', # 13 + 'ocnt', # 14 + 'bicnt', # 15 + 'icnt', # 16 + 'scnt', # 17 + 'sicnt', # 18 + 'qpcnt', # 19 + 'qpnzcnt', # 20 + 'nqconstr', # 21 + 'qrhscnt', # 22 + 'qlcnt', # 23 + 'qgcnt', # 24 + 'quadnzcnt', # 25 + 'linnzcnt', # 26 + 'nindconstr', # 27 + 'indrhscnt', # 28 + 'indnzcnt', # 29 + 'indcompcnt', # 30 + 'indlcnt', # 31 + 'indecnt', # 32 + 'indgcnt', # 33 + 'maxcoef', # 34 + 'mincoef', # 35 + 'minrhs', # 36 + 'maxrhs', # 37 + 'minrng', # 38 + 'maxrng', # 39 + 'minobj', # 40 + 'maxobj', # 41 + 'minlb', # 42 + 'maxub', # 43 + 'minqcoef', # 44 + 'maxqcoef', # 45 + 'minqcq', # 46 + 'maxqcq', # 47 + 'minqcl', # 48 + 'maxqcl', # 49 + 'minqcr', # 50 + 'maxqcr', # 51 + 'minind', # 52 + 'maxind', # 53 + 'minindrhs', # 54 + 'maxindrhs', # 55 + 'minlazy', # 56 + 'maxlazy', # 57 + 'minlazyrhs', # 58 + 'maxlazyrhs', # 59 + 'minucut', # 60 + 'maxucut', # 61 + 'minucutrhs', # 62 + 'maxucutrhs', # 63 + 'nsos', # 64 + 'nsos1', # 65 + 'sos1nmem', # 66 + 'sos1type', # 67 + 'nsos2', # 68 + 'sos2nmem', # 69 + 'sos2type', # 70 + 'lazyrhscnt', # 71 + 'lazygcnt', # 72 + 'lazylcnt', # 73 + 'lazyecnt', # 74 + 'lazycnt', # 75 + 'lazynzcnt', # 76 + 'ucutrhscnt', # 77 + 'ucutgcnt', # 78 + 'ucutlcnt', # 79 + 'ucutecnt', # 80 + 'ucutcnt', # 81 + 'ucutnzcnt', # 82 + 'npwl', # 83 + 'npwlbreaks']) # 84 + + objs_p = CR.intPtr() + rows_p = CR.intPtr() + cols_p = CR.intPtr() + objcnt_p = CR.intPtr() + rhscnt_p = CR.intPtr() + nzcnt_p = CR.intPtr() + ecnt_p = CR.intPtr() + gcnt_p = CR.intPtr() + lcnt_p = CR.intPtr() + rngcnt_p = CR.intPtr() + ncnt_p = CR.intPtr() + fcnt_p = CR.intPtr() + xcnt_p = CR.intPtr() + bcnt_p = CR.intPtr() + ocnt_p = CR.intPtr() + bicnt_p = CR.intPtr() + icnt_p = CR.intPtr() + scnt_p = CR.intPtr() + sicnt_p = CR.intPtr() + qpcnt_p = CR.intPtr() + qpnzcnt_p = CR.intPtr() + nqconstr_p = CR.intPtr() + qrhscnt_p = CR.intPtr() + qlcnt_p = CR.intPtr() + qgcnt_p = CR.intPtr() + quadnzcnt_p = CR.intPtr() + linnzcnt_p = CR.intPtr() + nindconstr_p = CR.intPtr() + indrhscnt_p = CR.intPtr() + indnzcnt_p = CR.intPtr() + indcompcnt_p = CR.intPtr() + indlcnt_p = CR.intPtr() + indecnt_p = CR.intPtr() + indgcnt_p = CR.intPtr() + maxcoef_p = CR.doublePtr() + mincoef_p = CR.doublePtr() + minrhs_p = CR.doublePtr() + maxrhs_p = CR.doublePtr() + minrng_p = CR.doublePtr() + maxrng_p = CR.doublePtr() + minobj_p = CR.doublePtr() + maxobj_p = CR.doublePtr() + minlb_p = CR.doublePtr() + maxub_p = CR.doublePtr() + minqcoef_p = CR.doublePtr() + maxqcoef_p = CR.doublePtr() + minqcq_p = CR.doublePtr() + maxqcq_p = CR.doublePtr() + minqcl_p = CR.doublePtr() + maxqcl_p = CR.doublePtr() + minqcr_p = CR.doublePtr() + maxqcr_p = CR.doublePtr() + minind_p = CR.doublePtr() + maxind_p = CR.doublePtr() + minindrhs_p = CR.doublePtr() + maxindrhs_p = CR.doublePtr() + minlazy_p = CR.doublePtr() + maxlazy_p = CR.doublePtr() + minlazyrhs_p = CR.doublePtr() + maxlazyrhs_p = CR.doublePtr() + minucut_p = CR.doublePtr() + maxucut_p = CR.doublePtr() + minucutrhs_p = CR.doublePtr() + maxucutrhs_p = CR.doublePtr() + nsos_p = CR.intPtr() + nsos1_p = CR.intPtr() + sos1nmem_p = CR.intPtr() + sos1type_p = CR.intPtr() + nsos2_p = CR.intPtr() + sos2nmem_p = CR.intPtr() + sos2type_p = CR.intPtr() + lazyrhscnt_p = CR.intPtr() + lazygcnt_p = CR.intPtr() + lazylcnt_p = CR.intPtr() + lazyecnt_p = CR.intPtr() + lazycnt_p = CR.intPtr() + lazynzcnt_p = CR.intPtr() + ucutrhscnt_p = CR.intPtr() + ucutgcnt_p = CR.intPtr() + ucutlcnt_p = CR.intPtr() + ucutecnt_p = CR.intPtr() + ucutcnt_p = CR.intPtr() + ucutnzcnt_p = CR.intPtr() + npwl_p = CR.intPtr() + npwlbreaks_p = CR.intPtr() + status = CR.CPXEgetprobstats(env, lp, + objs_p, + rows_p, + cols_p, + objcnt_p, + rhscnt_p, + nzcnt_p, + ecnt_p, + gcnt_p, + lcnt_p, + rngcnt_p, + ncnt_p, + fcnt_p, + xcnt_p, + bcnt_p, + ocnt_p, + bicnt_p, + icnt_p, + scnt_p, + sicnt_p, + qpcnt_p, + qpnzcnt_p, + nqconstr_p, + qrhscnt_p, + qlcnt_p, + qgcnt_p, + quadnzcnt_p, + linnzcnt_p, + nindconstr_p, + indrhscnt_p, + indnzcnt_p, + indcompcnt_p, + indlcnt_p, + indecnt_p, + indgcnt_p, + maxcoef_p, + mincoef_p, + minrhs_p, + maxrhs_p, + minrng_p, + maxrng_p, + minobj_p, + maxobj_p, + minlb_p, + maxub_p, + minqcoef_p, + maxqcoef_p, + minqcq_p, + maxqcq_p, + minqcl_p, + maxqcl_p, + minqcr_p, + maxqcr_p, + minind_p, + maxind_p, + minindrhs_p, + maxindrhs_p, + minlazy_p, + maxlazy_p, + minlazyrhs_p, + maxlazyrhs_p, + minucut_p, + maxucut_p, + minucutrhs_p, + maxucutrhs_p, + nsos_p, + nsos1_p, + sos1nmem_p, + sos1type_p, + nsos2_p, + sos2nmem_p, + sos2type_p, + lazyrhscnt_p, + lazygcnt_p, + lazylcnt_p, + lazyecnt_p, + lazycnt_p, + lazynzcnt_p, + ucutrhscnt_p, + ucutgcnt_p, + ucutlcnt_p, + ucutecnt_p, + ucutcnt_p, + ucutnzcnt_p, + npwl_p, + npwlbreaks_p) + check_status(env, status) + return ProbStats( + objs_p.value(), + rows_p.value(), + cols_p.value(), + objcnt_p.value(), + rhscnt_p.value(), + nzcnt_p.value(), + ecnt_p.value(), + gcnt_p.value(), + lcnt_p.value(), + rngcnt_p.value(), + ncnt_p.value(), + fcnt_p.value(), + xcnt_p.value(), + bcnt_p.value(), + ocnt_p.value(), + bicnt_p.value(), + icnt_p.value(), + scnt_p.value(), + sicnt_p.value(), + qpcnt_p.value(), + qpnzcnt_p.value(), + nqconstr_p.value(), + qrhscnt_p.value(), + qlcnt_p.value(), + qgcnt_p.value(), + quadnzcnt_p.value(), + linnzcnt_p.value(), + nindconstr_p.value(), + indrhscnt_p.value(), + indnzcnt_p.value(), + indcompcnt_p.value(), + indlcnt_p.value(), + indecnt_p.value(), + indgcnt_p.value(), + maxcoef_p.value(), + mincoef_p.value(), + minrhs_p.value(), + maxrhs_p.value(), + minrng_p.value(), + maxrng_p.value(), + minobj_p.value(), + maxobj_p.value(), + minlb_p.value(), + maxub_p.value(), + minqcoef_p.value(), + maxqcoef_p.value(), + minqcq_p.value(), + maxqcq_p.value(), + minqcl_p.value(), + maxqcl_p.value(), + minqcr_p.value(), + maxqcr_p.value(), + minind_p.value(), + maxind_p.value(), + minindrhs_p.value(), + maxindrhs_p.value(), + minlazy_p.value(), + maxlazy_p.value(), + minlazyrhs_p.value(), + maxlazyrhs_p.value(), + minucut_p.value(), + maxucut_p.value(), + minucutrhs_p.value(), + maxucutrhs_p.value(), + nsos_p.value(), + nsos1_p.value(), + sos1nmem_p.value(), + sos1type_p.value(), + nsos2_p.value(), + sos2nmem_p.value(), + sos2type_p.value(), + lazyrhscnt_p.value(), + lazygcnt_p.value(), + lazylcnt_p.value(), + lazyecnt_p.value(), + lazycnt_p.value(), + lazynzcnt_p.value(), + ucutrhscnt_p.value(), + ucutgcnt_p.value(), + ucutlcnt_p.value(), + ucutecnt_p.value(), + ucutcnt_p.value(), + ucutnzcnt_p.value(), + npwl_p.value(), + npwlbreaks_p.value())
+ + +# get histogram of non-zero row/column counts + + +
+[docs] +def gethist(env, lp, key): + if key == 'r': + space = CR.CPXXgetnumcols(env, lp) + 1 + else: + key = 'c' + space = CR.CPXXgetnumrows(env, lp) + 1 + hist = _safeIntArray(space) + status = CR.CPXEgethist(env, lp, key, hist) + check_status(env, status) + return LAU.array_to_list(hist, space)
+ + +# get solution quality metrics + + +
+[docs] +def getqualitymetrics(env, lp, soln): + space = 26 + data = _safeDoubleArray(space) + ispace = 10 + idata = _safeIntArray(ispace) + status = CR.CPXEgetqualitymetrics(env, lp, soln, data, idata) + check_status(env, status) + return [LAU.array_to_list(idata, ispace), + LAU.array_to_list(data, space)]
+ + +
+[docs] +def showquality(env, lp, soln): + status = CR.CPXEshowquality(env, lp, soln) + check_status(env, status)
+ + +# ########## Expert Callback BEGIN ######################################## + + +
+[docs] +def setgenericcallbackfunc(env, lp, contextmask, cbhandle): + # NOTE: The cbhandle that is passed in here, is the Cplex instance that + # installs the callback. We do not increment the reference count + # for this on purpose: First of all, it is not necessary since the + # lifetime of env/lp is controled by the lifetime of this instance. + # Hence any reference the callable library stores is valid as long + # as it may be used. + # Second, in the destructor of the Cplex class we attempt to set + # the callback to (0, None). This may fail with + # CPXERR_NOT_ONE_PROBLEM. If we had incremented the reference count + # we would have to figure out whether the attempt to unset got as + # far as decrementing the reference count or failed earlier. + status = CR.CPXXcallbacksetfunc(env, lp, contextmask, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def callbackgetinfoint(contextptr, which): + data = CR.intPtr() + status = CR.CPXXcallbackgetinfoint(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackgetinfolong(contextptr, which): + data = CR.cpxlongPtr() + status = CR.CPXXcallbackgetinfolong(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackgetinfodbl(contextptr, which): + data = CR.doublePtr() + status = CR.CPXXcallbackgetinfodbl(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackabort(contextptr): + CR.CPXXcallbackabort(contextptr)
+ + +
+[docs] +def callbackcandidateispoint(contextptr): + bounded = CR.intPtr() + status = CR.CPXXcallbackcandidateispoint(contextptr, bounded) + check_status(None, status) + return bounded.value() != 0
+ + +
+[docs] +def callbackgetcandidatepoint(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetcandidatepoint(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackcandidateisray(contextptr): + ray = CR.intPtr() + status = CR.CPXXcallbackcandidateisray(contextptr, ray) + check_status(None, status) + return ray.value() != 0
+ + +
+[docs] +def callbackgetcandidateray(contextptr, begin, end): + raylen = _rangelen(begin, end) + ray = _safeDoubleArray(raylen) + status = CR.CPXXcallbackgetcandidateray(contextptr, ray, begin, end) + check_status(None, status) + return LAU.array_to_list(ray, raylen)
+ + +
+[docs] +def callbackgetcandidateobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetcandidatepoint(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + + +
+[docs] +def callbackgetrelaxationpoint(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetrelaxationpoint(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackgetrelaxationpointobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetrelaxationpoint(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + +
+[docs] +def callbackgetrelaxationstatus(contextptr, flags): + nodelpstat = CR.intPtr() + status = CR.CPXXcallbackgetrelaxationstatus(contextptr, nodelpstat, flags) + check_status(None, status) + return nodelpstat.value()
+ + +
+[docs] +def callbackmakebranch(contextptr, ind, lu, bd, rhs, sense, matbeg, + matind, matval, nodeest): + seqnum = CR.cpxlongPtr() + with LAU.int_c_array(ind) as c_ind,\ + LAU.double_c_array(bd) as c_bd, \ + LAU.double_c_array(rhs) as c_rhs, \ + LAU.long_c_array(matbeg) as c_matbeg, \ + LAU.int_c_array(matind) as c_matind, \ + LAU.double_c_array(matval) as c_matval: + status = CR.CPXXcallbackmakebranch(contextptr, len(ind), + c_ind, lu, c_bd, + len(matbeg), len(matind), + c_rhs, sense, + c_matbeg, c_matind, c_matval, + nodeest, seqnum) + check_status(None, status) + return seqnum.value()
+ + +
+[docs] +def callbackprunenode(contextptr): + status = CR.CPXXcallbackprunenode(contextptr) + check_status(None, status)
+ + +
+[docs] +def callbackexitcutloop(contextptr): + status = CR.CPXXcallbackexitcutloop(contextptr) + check_status(None, status)
+ + +
+[docs] +def callbackgetincumbent(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetincumbent(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetincumbentobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetincumbent(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + + +
+[docs] +def callbackgetlocallb(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetlocallb(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetlocalub(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetlocalub(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackgetgloballb(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetgloballb(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetglobalub(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetglobalub(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackpostheursoln(contextptr, cnt, ind, val, obj, strategy): + status = CR.CPXXcallbackpostheursoln(contextptr, cnt, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + obj, strategy) + check_status(None, status)
+ + + +
+[docs] +def callbackaddusercuts(contextptr, rcnt, nzcnt, rhs, sense, rmat, + cutmanagement, local): + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.int_c_array(cutmanagement) as c_cutmanagement, \ + LAU.int_c_array(local) as c_local: + status = CR.CPXXcallbackaddusercuts(contextptr, rcnt, nzcnt, c_rhs, + sense, rmat, + c_cutmanagement, c_local) + check_status(None, status)
+ + + +
+[docs] +def callbackrejectcandidate(contextptr, rcnt, nzcnt, rhs, sense, rmat): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXcallbackrejectcandidate(contextptr, rcnt, nzcnt, c_rhs, + sense, rmat) + check_status(None, status)
+ + +
+[docs] +def callbackrejectcandidatelocal(contextptr, rcnt, nzcnt, rhs, sense, rmat): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXcallbackrejectcandidatelocal(contextptr, rcnt, nzcnt, + c_rhs, sense, rmat) + check_status(None, status)
+ + +# ########## Expert Callback END ########################################## + +# ########## Modeling Assistance Callback BEGIN ########################### + +
+[docs] +def modelasstcallbacksetfunc(env, lp, cbhandle): + # See note in setgenericcallbackfunc (the same applies here). + status = CR.CPXXmodelasstcallbacksetfunc(env, lp, cbhandle) + check_status(env, status)
+ + +# ########## Modeling Assistance Callback END ############################# +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_pwl.html b/docs/22.1.2.0/_modules/cplex/_internal/_pwl.html new file mode 100644 index 0000000..cad08fb --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_pwl.html @@ -0,0 +1,378 @@ + + + + + + + cplex._internal._pwl — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._pwl

+# --------------------------------------------------------------------------
+# File: _pwl.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Piecewise Linear API"""
+from ._baseinterface import BaseInterface
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+
+
+
+[docs] +class PWLConstraintInterface(BaseInterface): + """Methods for adding, querying, and modifying PWL constraints. + + A PWL constraint describes a piecewise linear relationship between + two variables: vary=pwl(varx). The PWL constraint is described by + specifying the index of the vary and varx variables involved and by + providing the breakpoints of the PWL function (specified by the + (breakx[i],breaky[i]) coordinate pairs). Before the first segment of + the PWL function there may be a half-line; its slope is specified by + preslope. After the last segment of the the PWL function there may + be a half-line; its slope is specified by postslope. Two consecutive + breakpoints may have the same x coordinate, in such cases there is a + discontinuity in the PWL function. Three consecutive breakpoints + may not have the same x coordinate. + """ + +
+[docs] + def __init__(self, cpx): + """Creates a new PWLConstraintInterface. + + The PWL constraint interface is exposed by the top-level `Cplex` + class as `Cplex.pwl_constraints`. This constructor is not meant + to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getpwlindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of PWL constraints in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.pwl_constraints.get_num() + 0 + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + """ + return _proc.getnumpwl(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, vary, varx, preslope, postslope, breakx, breaky, name=""): + """Adds a PWL constraint to the problem. + + vary: the index of the 'y' variable in the vary=pwl(varx) + function. + + varx: the index of the 'x' variable in the vary=pwl(varx) + function. + + preslope: before the first segment of the PWL function there is + a half-line; its slope is specified by preslope. + + postslope: after the last segment of the the PWL function there + is a half-line; its slope is specified by postslope. + + breakx: A list containing the indices of the 'x' variables + involved. + + breaky: A list containing the indices of the 'y' variables + involved. + + name: the name of the PWL constraint; defaults to the empty + string. + + Returns the index of the PWL constraint. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + """ + # FIXME: Should we provide defaults for any of the other arguments? + yidx = self._cplex.variables._conv(vary) + xidx = self._cplex.variables._conv(varx) + arg_list = [breakx, breaky] + nbreaks = _aux.max_arg_length(arg_list) + _aux.validate_arg_lengths( + arg_list, + allow_empty=False, + extra_msg=": breakx, breaky" + ) + + def _add(vary, varx, preslope, postslope, breakx, breaky, name): + _proc.addpwl(self._env._e, self._cplex._lp, + vary, varx, + preslope, postslope, + nbreaks, breakx, breaky, + name) + return self._add_single(self.get_num, _add, yidx, xidx, + preslope, postslope, breakx, breaky, + name)
+ + +
+[docs] + def delete(self, *args): + """Deletes PWL constraints from the problem. + + There are four forms by which pwl_constraints.delete may be + called. + + pwl_constraints.delete() + deletes all PWL constraints from the problem. + + pwl_constraints.delete(i) + i must be a PWL constraint name or index. Deletes the PWL + constraint whose index or name is i. + + pwl_constraints.delete(seq) + seq must be a sequence of PWL constraint names or indices. + Deletes the PWL constraints with names or indices contained + within s. Equivalent to [pwl_constraints.delete(i) for i in s]. + + pwl_constraints.delete(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Deletes the PWL constraints with indices between begin + and end, inclusive of end. Equivalent to + pwl_constraints.delete(range(begin, end + 1)). This will give + the best performance when deleting batches of PWL constraints. + + See CPXdelpwl in the Callable Library Reference Manual for more + detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + >>> c.pwl_constraints.delete(idx) + >>> c.pwl_constraints.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.delpwl(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of PWL constraints. + + May be called by four forms. + + pwl_constraints.get_names() + return the names of all PWL constraints in the problem. + + pwl_constraints.get_names(i) + i must be a PWL constraint name or index. Returns the name of + PWL constraint i. + + pwl_constraints.get_names(seq) + seq must be a sequence of PWL constraint names or indices. + Returns the names of PWL constraints with names or indices in + s. Equivalent to + [pwl_constraints.get_names(i) for i in s] + + pwl_constraints.get_names(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Returns the names of PWL constraints with indices + between begin and end, inclusive of end. Equivalent to + pwl_constraints.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_names(idx) + 'pwl1' + """ + def _get_names(idx): + return _proc.getpwlname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_definitions(self, *args): + """Returns the definitions of a set of PWL constraints. + + Returns a list of PWL definitions, where each definition is a + list containing the following components: vary, varx, preslope, + postslope, breakx, breaky (see `add`). + + May be called by four forms. + + pwl_constraints.get_definitions() + return the definitions of all PWL constraints in the + problem. + + pwl_constraints.get_definitions(i) + i must be a PWL constraint name or index. Returns the + definition of PWL constraint i. + + pwl_constraints.get_definitions(seq) + seq must be a sequence of PWL constraint names or indices. + Returns the definitions of PWL constraints with names or + indices in s. Equivalent to + [pwl_constraints.get_definitions(i) for i in s] + + pwl_constraints.get_definitions(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Returns the definitions of PWL constraints with indices + between begin and end, inclusive of end. Equivalent to + pwl_constraints.get_definitions(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_definitions(idx) + [0, 1, 0.5, 2.0, [0.0, 1.0, 2.0], [0.0, 1.0, 4.0]] + """ + def _getpwl(idx): + return _proc.getpwl(self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg(_getpwl, self._conv, + self.get_num(), args)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_solutionstrategyenum.html b/docs/22.1.2.0/_modules/cplex/_internal/_solutionstrategyenum.html new file mode 100644 index 0000000..ec09fec --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_solutionstrategyenum.html @@ -0,0 +1,137 @@ + + + + + + + cplex._internal._solutionstrategyenum — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._solutionstrategyenum

+# --------------------------------------------------------------------------
+# Version 22.1.2
+# --------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2000, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""A module for the SolutionStrategy class."""
+from . import _constantsenum
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class SolutionStrategy(ConstantClass): + """The different types of solutions that can submitted to + `cplex.callbacks.Context.post_heuristic_solution()`. + + For further details about these values, see the reference manual of + the CPLEX Callable Library (C API) particularly, the enumeration + `CPXCALLBACKSOLUTIONSTRATEGY <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/enum/CPXCALLBACKSOLUTIONSTRATEGY.html>`_. + """ + + no_check = _constantsenum.CPXCALLBACKSOLUTION_NOCHECK + """See CPXCALLBACKSOLUTION_NOCHECK in the C API.""" + + check_feasible = _constantsenum.CPXCALLBACKSOLUTION_CHECKFEAS + """See CPXCALLBACKSOLUTION_CHECKFEAS in the C API.""" + + propagate = _constantsenum.CPXCALLBACKSOLUTION_PROPAGATE + """See CPXCALLBACKSOLUTION_PROPAGATE in the C API.""" + + solve = _constantsenum.CPXCALLBACKSOLUTION_SOLVE + """See CPXCALLBACKSOLUTION_SOLVE in the C API."""
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/_internal/_subinterfaces.html b/docs/22.1.2.0/_modules/cplex/_internal/_subinterfaces.html new file mode 100644 index 0000000..c66d6b1 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/_internal/_subinterfaces.html @@ -0,0 +1,10242 @@ + + + + + + + cplex._internal._subinterfaces — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._subinterfaces

+# --------------------------------------------------------------------------
+# File: _subinterfaces.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Sub-interfaces of the CPLEX API."""
+from contextlib import closing, contextmanager
+from io import StringIO
+import numbers
+
+from . import _constants
+from . import _procedural as CPX_PROC
+from ._baseinterface import BaseInterface
+from ._multiobjsoln import MultiObjSolnInterface
+from ._matrices import (SparsePair, SparseTriple, _HBMatrix,
+                        unpack_pair, unpack_triple)
+from ._aux_functions import (apply_freeform_one_arg,
+                             apply_freeform_two_args,
+                             max_arg_length,
+                             validate_arg_lengths, apply_pairs,
+                             delete_set_by_range,
+                             make_group, _group,
+                             init_list_args, listify,
+                             unzip, convert_sequence)
+from ..exceptions import CplexSolverError, WrongNumberOfArgumentsError
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class Histogram(): + """A class to retrieve histogram data of the columns or rows of the + linear constraint matrix. + + See `VariablesInterface.get_histogram()` and + `LinearConstraintInterface.get_histogram()`. + """ + +
+[docs] + def __init__(self, c, key): + self.__hist = CPX_PROC.gethist(c._env._e, c._lp, key[0]) + self.orientation = key
+ + +
+[docs] + def __getitem__(self, key): + """Returns the number of columns/rows with a given nonzero count.""" + if isinstance(key, int): + if key < 0: + raise IndexError("histogram keys must be non-negative") + return self.__hist[key] + if isinstance(key, slice): + start, stop, step = key.start, key.stop, key.step + if start is None: + start = 0 + if stop is None or stop > len(self.__hist): + stop = len(self.__hist) + if step is None: + step = 1 + if start < 0: + raise IndexError("histogram keys must be non-negative") + if stop < 0: + raise IndexError("histogram keys must be non-negative") + return [self.__hist[i] for i in range(start, stop, step)] + raise TypeError("key must be an integer or a slice")
+ + +
+[docs] + def __str__(self): + """Returns a string containing a histogram in human readable form.""" + if self.orientation[0] == "c": + hdr0 = "Column counts (excluding fixed variables):" + hdr1 = " Nonzero Count:" + hdr2 = "Number of Columns:" + else: + hdr0 = "Row counts (excluding fixed variables):" + hdr1 = " Nonzero Count:" + hdr2 = "Number of Rows:" + rng = len(self.__hist) + maxhist = max(self.__hist) + length = max(2, + len(str(rng)), + len(str(maxhist))) + 2 + perline = max((75 - len(hdr1)) / length, 1) + ret = "" + i = 0 + needs_hdr0 = True + while True: + if i >= rng: + break + for j in range(i, rng): + if self.__hist[j] != 0: + break + else: + break + if needs_hdr0: + ret = ret + hdr0 + "\n\n" + needs_hdr0 = False + ret = ret + hdr1 + k = 0 + for j in range(i, rng): + if k >= perline: + break + if self.__hist[j] == 0: + continue + ret = ret + str("%*d" % (length, j)) + k += 1 + + ret = ret + "\n" + ret = ret + hdr2 + k = 0 + jj = i + for j in range(i, rng): + if k >= perline: + break + jj += 1 + if self.__hist[j] == 0: + continue + ret = ret + str("%*d" % (length, self.__hist[j])) + k += 1 + ret = ret + "\n\n" + i = jj + return ret
+
+ + + +
+[docs] +class AdvancedVariablesInterface(BaseInterface): + """Methods for advanced operations on variables.""" + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedVariablesInterface. + + The advanced variables interface is exposed by the top-level + `Cplex` class as Cplex.variables.advanced. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def protect(self, *args): + """Prevents variables from being aggregated during presolve. + + protect may be called with either a single variable identifier + or a sequence of variable identifiers. A variable identifier + is either an index or a name of a variable. + + Note + Subsequent calls to protect will replace previously protected + variables with the new set of protected variables. + + Note + If presolve can fix a variable to a value, it will be removed + from the problem even if it has been protected. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["a", "b", "c", "d"]) + >>> c.variables.advanced.protect("a") + >>> c.variables.advanced.protect(["b", "d"]) + """ + a = listify(self._cplex.variables._conv(args[0])) + CPX_PROC.copyprotected(self._env._e, self._cplex._lp, a)
+ + +
+[docs] + def get_protected(self): + """Returns the currently protected variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["a", "b", "c", "d"]) + >>> c.variables.advanced.protect("a") + >>> c.variables.advanced.get_protected() + [0] + >>> c.variables.advanced.protect(["b", "d"]) + >>> c.variables.advanced.get_protected() + [1, 3] + """ + return CPX_PROC.getprotected(self._env._e, self._cplex._lp)
+ + +
+[docs] + def tighten_lower_bounds(self, *args): + """Tightens the lower bounds on the specified variables. + + There are two forms by which + variables.advanced.tighten_lower_bounds may be called. + + variables.advanced.tighten_lower_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the lower bound of the variable whose index + or name is i to lb. + + variables.advanced.tighten_lower_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the lower bound of the specified variables to + the corresponding values. Equivalent to + [variables.advanced.tighten_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.advanced.tighten_lower_bounds(0, 1.0) + >>> c.variables.get_lower_bounds() + [1.0, 0.0, 0.0] + >>> c.variables.advanced.tighten_lower_bounds([(2, 3.0), ("x1", -1.0)]) + >>> c.variables.get_lower_bounds() + [1.0, -1.0, 3.0] + """ + def tlb(a, b): + CPX_PROC.tightenbds(self._env._e, self._cplex._lp, a, + 'L' * len(a), b) + apply_pairs(tlb, self._cplex.variables._conv, *args)
+ + +
+[docs] + def tighten_upper_bounds(self, *args): + """Tightens the upper bounds on the specified variables. + + There are two forms by which + variables.advanced.tighten_upper_bounds may be called. + + variables.advanced.tighten_upper_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the upper bound of the variable whose index + or name is i to lb. + + variables.advanced.tighten_upper_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the upper bound of the specified variables to + the corresponding values. Equivalent to + [variables.advanced.tighten_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.advanced.tighten_upper_bounds(0, 1.0) + >>> c.variables.advanced.tighten_upper_bounds([(2, 3.0), ("x1", 10.0)]) + >>> c.variables.get_upper_bounds() + [1.0, 10.0, 3.0] + """ + def tub(a, b): + CPX_PROC.tightenbds(self._env._e, self._cplex._lp, a, + 'U' * len(a), b) + apply_pairs(tub, self._cplex.variables._conv, *args)
+
+ + + +
+[docs] +class VarTypes(ConstantClass): + """Constants defining variable types + + For a definition of each type, see those topics in the CPLEX User's + Manual. + """ + continuous = _constants.CPX_CONTINUOUS + binary = _constants.CPX_BINARY + integer = _constants.CPX_INTEGER + semi_integer = _constants.CPX_SEMIINT + semi_continuous = _constants.CPX_SEMICONT
+ + + +
+[docs] +class VariablesInterface(BaseInterface): + """Methods for adding, querying, and modifying variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> # default values for lower_bounds are 0.0 + >>> c.variables.get_lower_bounds() + [0.0, 0.0, 0.0] + >>> # values can be set either one at a time or many at a time + >>> c.variables.set_lower_bounds(0, 1.0) + >>> c.variables.set_lower_bounds([("x1", -1.0), (2, 3.0)]) + >>> # values can be queried as a range + >>> c.variables.get_lower_bounds(0, "x1") + [1.0, -1.0] + >>> # values can be queried as a sequence in arbitrary order + >>> c.variables.get_lower_bounds(["x1", "x2", 0]) + [-1.0, 3.0, 1.0] + >>> # can query the number of variables + >>> c.variables.get_num() + 3 + >>> c.variables.set_types(0, c.variables.type.binary) + >>> c.variables.get_num_binary() + 1 + """ + + type = VarTypes() + """See `VarTypes()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new VariablesInterface. + + The variables interface is exposed by the top-level `Cplex` class + as `Cplex.variables`. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getcolindex) + self.advanced = AdvancedVariablesInterface(self) + """See `AdvancedVariablesInterface()` """
+ + +
+[docs] + def get_num(self): + """Returns the number of variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.get_num() + 3 + """ + return CPX_PROC.getnumcols(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_integer(self): + """Returns the number of integer variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.get_num_integer() + 1 + """ + return CPX_PROC.getnumint(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_binary(self): + """Returns the number of binary variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.binary, t.integer]) + >>> c.variables.get_num_binary() + 1 + """ + return CPX_PROC.getnumbin(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_semicontinuous(self): + """Returns the number of semi-continuous variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer]) + >>> c.variables.get_num_semicontinuous() + 1 + """ + return CPX_PROC.getnumsemicont(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_semiinteger(self): + """Returns the number of semi-integer variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer]) + >>> c.variables.get_num_semiinteger() + 2 + """ + return CPX_PROC.getnumsemiint(self._env._e, self._cplex._lp)
+ + + def _add(self, obj, lb, ub, types, names, columns): + """non-public""" + if not isinstance(types, str): + types = "".join(types) + arg_list = [obj, lb, ub, types, names, columns] + num_new_cols = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": obj, lb, ub, types, names, columns" + ) + num_old_cols = self.get_num() + if columns == []: + CPX_PROC.newcols(self._env._e, self._cplex._lp, obj, lb, ub, + types, names) + else: + with CPX_PROC.chbmatrix(columns, self._cplex._env_lp_ptr, + 1) as (cmat, nnz): + CPX_PROC.addcols(self._env._e, self._cplex._lp, + num_new_cols, nnz, obj, + cmat, lb, ub, names) + if types != "": + CPX_PROC.chgctype( + self._env._e, self._cplex._lp, + list(range(num_old_cols, num_old_cols + num_new_cols)), + types) + +
+[docs] + def add(self, obj=None, lb=None, ub=None, types="", names=None, + columns=None): + """Adds variables and related data to the problem. + + variables.add accepts the keyword arguments obj, lb, ub, + types, names, and columns. + + If more than one argument is specified, all arguments must + have the same length. + + obj is a list of floats specifying the linear objective + coefficients of the variables. + + lb is a list of floats specifying the lower bounds on the + variables. + + ub is a list of floats specifying the upper bounds on the + variables. + + types must be either a list of single-character strings or a + string containing the types of the variables. + + Note + If types is specified, the problem type will be a MIP, even if + all variables are specified to be continuous. + + names is a list of strings. + + columns may be either a list of sparse vectors or a matrix in + list-of-lists format. + + Note + The entries of columns must not contain duplicate indices. + If an entry of columns references a row more than once, + either by index, name, or a combination of index and name, + an exception will be raised. + + Returns an iterator containing the indices of the added + variables. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=["c0", "c1", "c2"]) + >>> indices = c.variables.add( + ... obj=[1.0, 2.0, 3.0], + ... types=[c.variables.type.integer] * 3) + >>> indices = c.variables.add( + ... obj=[1.0, 2.0, 3.0], + ... lb=[-1.0, 1.0, 0.0], + ... ub=[100.0, cplex.infinity, cplex.infinity], + ... types=[c.variables.type.integer] * 3, + ... names=["0", "1", "2"], + ... columns=[cplex.SparsePair(ind=['c0', 2], + ... val=[1.0, -1.0]), + ... [['c2'],[2.0]], + ... cplex.SparsePair(ind=[0, 1], + ... val=[3.0, 4.0])]) + >>> c.variables.get_lower_bounds() + [0.0, 0.0, 0.0, -1.0, 1.0, 0.0] + >>> c.variables.get_cols("1") + SparsePair(ind = [2], val = [2.0]) + """ + obj, lb, ub, names, columns = init_list_args(obj, lb, ub, names, + columns) + return self._add_iter(self.get_num, self._add, + obj, lb, ub, types, names, columns)
+ + +
+[docs] + def delete(self, *args): + """Deletes variables from the problem. + + There are four forms by which variables.delete may be called. + + variables.delete() + deletes all variables from the problem. + + variables.delete(i) + i must be a variable name or index. Deletes the variable + whose index or name is i. + + variables.delete(s) + s must be a sequence of variable names or indices. Deletes + the variables with names or indices contained within s. + Equivalent to [variables.delete(i) for i in s]. + + variables.delete(begin, end) + begin and end must be variable indices or variable names. + Deletes the variables with indices between begin and end, + inclusive of end. Equivalent to + variables.delete(range(begin, end + 1)). This will give the + best performance when deleting batches of variables. + + See `CPXdelcols <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/delcols.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.delete(8) + >>> c.variables.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.variables.delete("1", 3) + >>> c.variables.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.variables.delete([2, "0", 5]) + >>> c.variables.get_names() + ['4', '6', '7'] + >>> c.variables.delete() + >>> c.variables.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delcols(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def set_lower_bounds(self, *args): + """Sets the lower bound for a variable or set of variables. + + There are two forms by which variables.set_lower_bounds may be + called. + + variables.set_lower_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the lower bound of the variable whose index + or name is i to lb. + + variables.set_lower_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the lower bound of the specified variables to + the corresponding values. Equivalent to + [variables.set_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.set_lower_bounds(0, 1.0) + >>> c.variables.get_lower_bounds() + [1.0, 0.0, 0.0] + >>> c.variables.set_lower_bounds([(2, 3.0), ("x1", -1.0)]) + >>> c.variables.get_lower_bounds() + [1.0, -1.0, 3.0] + """ + def setlb(a, b): + CPX_PROC.chgbds(self._env._e, self._cplex._lp, a, "L" * len(a), b) + apply_pairs(setlb, self._conv, *args)
+ + +
+[docs] + def set_upper_bounds(self, *args): + """Sets the upper bound for a variable or set of variables. + + There are two forms by which variables.set_upper_bounds may be + called. + + variables.set_upper_bounds(i, ub) + i must be a variable name or index and ub must be a real + number. Sets the upper bound of the variable whose index + or name is i to ub. + + variables.set_upper_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, ub) pairs, each + of which consists of a variable name or index and a real + number. Sets the upper bound of the specified variables to + the corresponding values. Equivalent to + [variables.set_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.set_upper_bounds(0, 1.0) + >>> c.variables.set_upper_bounds([("x1", 10.0), (2, 3.0)]) + >>> c.variables.get_upper_bounds() + [1.0, 10.0, 3.0] + """ + def setub(a, b): + CPX_PROC.chgbds(self._env._e, self._cplex._lp, a, "U" * len(a), b) + apply_pairs(setub, self._conv, *args)
+ + +
+[docs] + def set_names(self, *args): + """Sets the name of a variable or set of variables. + + There are two forms by which variables.set_names may be + called. + + variables.set_names(i, name) + i must be a variable name or index and name must be a + string. + + variables.set_names(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, name) pairs, + each of which consists of a variable name or index and a + string. Sets the name of the specified variables to the + corresponding strings. Equivalent to + [variables.set_names(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.set_names(0, "first") + >>> c.variables.set_names([(2, "third"), (1, "second")]) + >>> c.variables.get_names() + ['first', 'second', 'third'] + """ + def setnames(a, b): + CPX_PROC.chgcolname(self._env._e, self._cplex._lp, a, b) + apply_pairs(setnames, self._conv, *args)
+ + +
+[docs] + def set_types(self, *args): + """Sets the type of a variable or set of variables. + + There are two forms by which variables.set_types may be + called. + + variables.set_types(i, type) + i must be a variable name or index and name must be a + single-character string. + + variables.set_types(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, type) pairs, + each of which consists of a variable name or index and a + single-character string. Sets the type of the specified + variables to the corresponding strings. Equivalent to + [variables.set_types(pair[0], pair[1]) for pair in seq_of_pairs]. + + Note + If the types are set, the problem will be treated as a MIP, + even if all variable types are continuous. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(5)]) + >>> c.variables.set_types(0, c.variables.type.continuous) + >>> c.variables.set_types([("1", c.variables.type.integer), + ("2", c.variables.type.binary), + ("3", c.variables.type.semi_continuous), + ("4", c.variables.type.semi_integer)]) + >>> c.variables.get_types() + ['C', 'I', 'B', 'S', 'N'] + >>> c.variables.type[c.variables.get_types(0)] + 'continuous' + """ + if len(args) == 2: + indices = [self._conv(args[0])] + xctypes = args[1] + elif len(args) == 1: + indices, xctypes = unzip(args[0]) + indices = self._conv(indices) + xctypes = "".join(xctypes) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgctype(self._env._e, self._cplex._lp, indices, xctypes)
+ + +
+[docs] + def get_lower_bounds(self, *args): + """Returns the lower bounds on variables from the problem. + + There are four forms by which variables.get_lower_bounds may be called. + + variables.get_lower_bounds() + return the lower bounds on all variables from the problem. + + variables.get_lower_bounds(i) + i must be a variable name or index. Returns the lower + bound on the variable whose index or name is i. + + variables.get_lower_bounds(s) + s must be a sequence of variable names or indices. Returns + the lower bounds on the variables with indices the members + of s. Equivalent to + [variables.get_lower_bounds(i) for i in s] + + variables.get_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns the lower bounds on the variables with indices between + begin and end, inclusive of end. Equivalent to + variables.get_lower_bounds(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(lb = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_lower_bounds(8) + 12.0 + >>> c.variables.get_lower_bounds("1",3) + [1.5, 3.0, 4.5] + >>> c.variables.get_lower_bounds([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.variables.get_lower_bounds() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getlb(a, b=self.get_num() - 1): + return CPX_PROC.getlb(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getlb, self._conv, args)
+ + +
+[docs] + def get_upper_bounds(self, *args): + """Returns the upper bounds on variables from the problem. + + There are four forms by which variables.get_upper_bounds may be called. + + variables.get_upper_bounds() + return the upper bounds on all variables from the problem. + + variables.get_upper_bounds(i) + i must be a variable name or index. Returns the upper + bound on the variable whose index or name is i. + + variables.get_upper_bounds(s) + s must be a sequence of variable names or indices. Returns + the upper bounds on the variables with indices the members + of s. Equivalent to + [variables.get_upper_bounds(i) for i in s] + + variables.get_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns the upper bounds on the variables with indices between + begin and end, inclusive of end. Equivalent to + variables.get_upper_bounds(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(ub = [(1.5 * i) + 1.0 for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_upper_bounds(8) + 13.0 + >>> c.variables.get_upper_bounds("1",3) + [2.5, 4.0, 5.5] + >>> c.variables.get_upper_bounds([2,"0",5]) + [4.0, 1.0, 8.5] + >>> c.variables.get_upper_bounds() + [1.0, 2.5, 4.0, 5.5, 7.0, 8.5, 10.0, 11.5, 13.0, 14.5] + """ + def getub(a, b=self.get_num() - 1): + return CPX_PROC.getub(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getub, self._conv, args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of variables from the problem. + + There are four forms by which variables.get_names may be called. + + variables.get_names() + return the names of all variables from the problem. + + variables.get_names(i) + i must be a variable index. Returns the name of variable i. + + variables.get_names(s) + s must be a sequence of variable indices. Returns the + names of the variables with indices the members of s. + Equivalent to [variables.get_names(i) for i in s] + + variables.get_names(begin, end) + begin and end must be variable indices. Returns the names of + the variables with indices between begin and end, inclusive of + end. Equivalent to variables.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x' + str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_names(8) + 'x8' + >>> c.variables.get_names(1,3) + ['x1', 'x2', 'x3'] + >>> c.variables.get_names([2,0,5]) + ['x2', 'x0', 'x5'] + >>> c.variables.get_names() + ['x0', 'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getcolname( + self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getname, self._conv, args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the types of variables from the problem. + + There are four forms by which variables.types may be called. + + variables.types() + return the types of all variables from the problem. + + variables.types(i) + i must be a variable name or index. Returns the type of + the variable whose index or name is i. + + variables.types(s) + s must be a sequence of variable names or indices. Returns + the types of the variables with indices the members of s. + Equivalent to [variables.get_types(i) for i in s] + + variables.types(begin, end) + begin and end must be variable indices or variable names. + Returns the types of the variables with indices between begin + and end, inclusive of end. Equivalent to + variables.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(names = [str(i) for i in range(5)], + types = [t.continuous, t.integer, + t.binary, t.semi_continuous, t.semi_integer]) + >>> c.variables.get_num() + 5 + >>> c.variables.get_types(3) + 'S' + >>> c.variables.get_types(1,3) + ['I', 'B', 'S'] + >>> c.variables.get_types([2,0,4]) + ['B', 'C', 'N'] + >>> c.variables.get_types() + ['C', 'I', 'B', 'S', 'N'] + """ + def gettype(a, b=self.get_num() - 1): + return CPX_PROC.getctype(self._env._e, self._cplex._lp, a, b) + t = [i for i in "".join(apply_freeform_two_args( + gettype, self._conv, args))] + return t[0] if len(t) == 1 else t
+ + +
+[docs] + def get_cols(self, *args): + """Returns a set of columns of the linear constraint matrix. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + There are four forms by which variables.get_cols may be called. + + variables.get_cols() + return the entire linear constraint matrix. + + variables.get_cols(i) + i must be a variable name or index. Returns the column of + the linear constraint matrix associated with variable i. + + variables.get_cols(s) + s must be a sequence of variable names or indices. Returns + the columns of the linear constraint matrix associated with + the variables with indices the members of s. Equivalent to + [variables.get_cols(i) for i in s] + + variables.get_cols(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the linear constraint matrix associated + with the variables with indices between begin and end, + inclusive of end. Equivalent to + variables.get_cols(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=['c1', 'c2']) + >>> indices = c.variables.add( + ... names=[str(i) for i in range(3)], + ... columns=[cplex.SparsePair(ind=['c1'], val=[1.0]), + ... cplex.SparsePair(ind=['c2'], val=[2.0]), + ... cplex.SparsePair(ind=['c1','c2'], val=[3.0, 4.0])]) + >>> c.variables.get_num() + 3 + >>> c.variables.get_cols(2) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + >>> for col in c.variables.get_cols(1, 2): + ... print(col) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + >>> for col in c.variables.get_cols([2, 0, 1]): + ... print(col) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + >>> for col in c.variables.get_cols(): + ... print(col) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + """ + def getcols(a, b=self.get_num() - 1): + mat = _HBMatrix() + t = CPX_PROC.getcols(self._env._e, self._cplex._lp, a, b) + mat.matbeg = t[0] + mat.matind = t[1] + mat.matval = t[2] + return [m for m in mat] + return apply_freeform_two_args(getcols, self._conv, args)
+ + +
+[docs] + def get_histogram(self): + """Returns a histogram of the columns of the linear constraint matrix. + + To access the number of columns with given nonzero counts, use + slice notation. If a negative nonzero count is queried in + this manner an IndexError will be raised. + + The __str__ method of the `Histogram` object returns a string + displaying the number of columns with given nonzeros counts in + human readable form. + + The data member "orientation" of the histogram object is + "column", indicating that the histogram shows the nonzero + counts for the columns of the linear constraint matrix. + + >>> import cplex + >>> c = cplex.Cplex("ind.lp") + >>> histogram = c.variables.get_histogram() + >>> print(histogram) + Column counts (excluding fixed variables): + <BLANKLINE> + Nonzero Count: 1 2 3 + Number of Columns: 1 6 36 + <BLANKLINE> + <BLANKLINE> + >>> histogram[2] + 6 + >>> histogram[0:4] + [0, 1, 6, 36] + """ + return Histogram(self._cplex, "column")
+
+ + + +
+[docs] +class AdvancedLinearConstraintInterface(BaseInterface): + """Methods for handling lazy cuts and user cuts. + + Lazy cuts are constraints not specified in the constraint + matrix of the MIP problem, but that must be not be violated + in a solution. Using lazy cuts makes sense when there are a + large number of constraints that must be satisfied at a solution, + but are unlikely to be violated if they are left out. When + you add lazy cuts to your model, set the CPLEX parameter + c.parameters.preprocessing.reduce to 0 (zero) or 1 (one) + in order to turn off dual reductions. + + User cuts are constraints that are implied by the constraint + matrix and integrality requirements. Adding user cuts is helpful + to tighten the MIP formulation. When you add user cuts, set + the CPLEX parameter cplex.parameters.preprocessing.reformulations to + cplex.parameters.preprocessing.reformulations.values.interfere_uncrush or + cplex.parameters.preprocessing.reformulations.values.none to make sure + that CPLEX makes only reductions that do not interfere with crushing + linear forms (cuts in this case). + """ + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedLinearConstraintInterface. + + The advanced linear constraints interface is exposed by the + top-level `Cplex` class as Cplex.linear_constraints.advanced. + This constructor is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_num_lazy_constraints(self): + """Returns the number of lazy cuts in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["lz1"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 1 + """ + return CPX_PROC._getnumlazyconstraints(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_user_cuts(self): + """Returns the number of user cuts in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["usr1"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 1 + """ + return CPX_PROC._getnumusercuts(self._env._e, self._cplex._lp)
+ + + def _add_lazy_constraints(self, lin_expr, senses, rhs, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + CPX_PROC.addlazyconstraints( + self._env._e, self._cplex._lp, rhs, senses, + lin_expr, names) + +
+[docs] + def add_lazy_constraints(self, lin_expr=None, senses="", rhs=None, + names=None): + """Adds lazy constraints to the problem. + + linear_constraints.advanced.add_lazy_constraints accepts the + keyword arguments lin_expr, senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + Returns an iterator containing the indices of the added lazy + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["lz1"]) + >>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0]) + >>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut2, cut3], + ... senses="EE", + ... rhs=[0.0, 0.0], + ... names=["lz2", "lz3"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 3 + """ + lin_expr, rhs, names = init_list_args(lin_expr, rhs, names) + return self._add_iter(self.get_num_lazy_constraints, + self._add_lazy_constraints, + lin_expr, senses, rhs, names)
+ + + def _add_user_cuts(self, lin_expr, senses, rhs, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + CPX_PROC.addusercuts( + self._env._e, self._cplex._lp, rhs, senses, + lin_expr, names) + +
+[docs] + def add_user_cuts(self, lin_expr=None, senses="", rhs=None, names=None): + """Adds user cuts to the problem. + + linear_constraints.advanced.add_user_cuts accepts the keyword + arguments lin_expr, senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... names=["usr1"], + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0]) + >>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0]) + >>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut2, cut3], + ... senses = "EE", + ... rhs=[0.0, 0.0], + ... names=["usr2", "usr3"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 3 + """ + lin_expr, senses, rhs, names = init_list_args( + lin_expr, senses, rhs, names) + return self._add_iter(self.get_num_user_cuts, self._add_user_cuts, + lin_expr, senses, rhs, names)
+ + +
+[docs] + def free_lazy_constraints(self): + """Removes all lazy constraints from the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr = [cut], + ... senses = "E", + ... rhs = [0.0], + ... names = ["lz1"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 1 + >>> c.linear_constraints.advanced.free_lazy_constraints() + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 0 + """ + CPX_PROC.freelazyconstraints(self._env._e, self._cplex._lp)
+ + +
+[docs] + def free_user_cuts(self): + """Removes all user cuts from the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["usr1"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 1 + >>> c.linear_constraints.advanced.free_user_cuts() + >>> c.linear_constraints.advanced.get_num_user_cuts() + 0 + """ + CPX_PROC.freeusercuts(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class LinearConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying linear constraints.""" + +
+[docs] + def __init__(self, cplex): + """Creates a new LinearConstraintInterface. + + The linear constraints interface is exposed by the top-level + `Cplex` class as `Cplex.linear_constraints`. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getrowindex) + self.advanced = AdvancedLinearConstraintInterface(self) + """See `AdvancedLinearConstraintInterface()` """
+ + +
+[docs] + def get_num(self): + """Returns the number of linear constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c1", "c2", "c3"]) + >>> c.linear_constraints.get_num() + 3 + """ + return CPX_PROC.getnumrows(self._env._e, self._cplex._lp)
+ + + def _add(self, lin_expr, senses, rhs, range_values, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, range_values, names, lin_expr] + num_new_rows = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": lin_expr, senses, rhs, range_values, names" + ) + num_old_rows = self.get_num() + if lin_expr: + with CPX_PROC.chbmatrix(lin_expr, self._cplex._env_lp_ptr, + 0) as (rmat, nnz): + CPX_PROC.addrows(self._env._e, self._cplex._lp, 0, + num_new_rows, nnz, rhs, senses, + rmat, [], names) + if range_values != []: + CPX_PROC.chgrngval( + self._env._e, self._cplex._lp, + list(range(num_old_rows, num_old_rows + num_new_rows)), + range_values) + else: + if senses.find('R') != -1 and not range_values: + range_values = [0.0] * len(senses) + CPX_PROC.newrows(self._env._e, self._cplex._lp, rhs, senses, + range_values, names) + +
+[docs] + def add(self, lin_expr=None, senses="", rhs=None, range_values=None, + names=None): + """Adds linear constraints to the problem. + + linear_constraints.add accepts the keyword arguments lin_expr, + senses, rhs, range_values, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + Each entry must + be one of 'G', 'L', 'E', and 'R', indicating + greater-than-or-equal-to (>=), less-than-or-equal-to (<=), + equality (=), and ranged constraints, respectively. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + range_values is a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + names is a list of strings. + + Returns an iterator containing the indices of the added linear + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + lin_expr = [cplex.SparsePair(ind = ["x1", "x3"], val = [1.0, -1.0]), + cplex.SparsePair(ind = ["x1", "x2"], val = [1.0, 1.0]), + cplex.SparsePair(ind = ["x1", "x2", "x3"], val = [-1.0] * 3), + cplex.SparsePair(ind = ["x2", "x3"], val = [10.0, -2.0])], + senses = ["E", "L", "G", "R"], + rhs = [0.0, 1.0, -1.0, 2.0], + range_values = [0.0, 0.0, 0.0, -10.0], + names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, -1.0, 2.0] + """ + lin_expr, senses, rhs, range_values, names = init_list_args( + lin_expr, senses, rhs, range_values, names) + return self._add_iter(self.get_num, self._add, + lin_expr, senses, rhs, range_values, names)
+ + +
+[docs] + def delete(self, *args): + """Removes linear constraints from the problem. + + There are four forms by which linear_constraints.delete may be + called. + + linear_constraints.delete() + deletes all linear constraints from the problem. + + linear_constraints.delete(i) + i must be a linear constraint name or index. Deletes the + linear constraint whose index or name is i. + + linear_constraints.delete(s) + s must be a sequence of linear constraint names or indices. + Deletes the linear constraints with names or indices contained + within s. Equivalent to [linear_constraints.delete(i) for i in s]. + + linear_constraints.delete(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Deletes the linear constraints with indices + between begin and end, inclusive of end. Equivalent to + linear_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of linear + constraints. + + See `CPXdelrows <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/delrows.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=[str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.delete(8) + >>> c.linear_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.linear_constraints.delete("1", 3) + >>> c.linear_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.linear_constraints.delete([2, "0", 5]) + >>> c.linear_constraints.get_names() + ['4', '6', '7'] + >>> c.linear_constraints.delete() + >>> c.linear_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delrows(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def set_rhs(self, *args): + """Sets the righthand side of a set of linear constraints. + + There are two forms by which linear_constraints.set_rhs may be + called. + + linear_constraints.set_rhs(i, rhs) + i must be a row name or index and rhs must be a real number. + Sets the righthand side of the row whose index or name is + i to rhs. + + linear_constraints.set_rhs(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, rhs) pairs, each + of which consists of a row name or index and a real + number. Sets the righthand side of the specified rows to + the corresponding values. Equivalent to + [linear_constraints.set_rhs(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_rhs() + [0.0, 0.0, 0.0, 0.0] + >>> c.linear_constraints.set_rhs("c1", 1.0) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, 0.0, 0.0] + >>> c.linear_constraints.set_rhs([("c3", 2.0), (2, -1.0)]) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, -1.0, 2.0] + """ + def chgrhs(a, b): + CPX_PROC.chgrhs(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgrhs, self._conv, *args)
+ + +
+[docs] + def set_names(self, *args): + """Sets the name of a linear constraint or set of linear constraints. + + There are two forms by which linear_constraints.set_names may be + called. + + linear_constraints.set_names(i, name) + i must be a linear constraint name or index and name must be a + string. + + linear_constraints.set_names(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, name) pairs, + each of which consists of a linear constraint name or index and a + string. Sets the name of the specified linear constraints to the + corresponding strings. Equivalent to + [linear_constraints.set_names(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.set_names("c1", "second") + >>> c.linear_constraints.get_names(1) + 'second' + >>> c.linear_constraints.set_names([("c3", "last"), (2, "middle")]) + >>> c.linear_constraints.get_names() + ['c0', 'second', 'middle', 'last'] + """ + def setnames(a, b): + CPX_PROC.chgrowname(self._env._e, self._cplex._lp, a, b) + apply_pairs(setnames, self._conv, *args)
+ + +
+[docs] + def set_senses(self, *args): + """Sets the sense of a linear constraint or set of linear constraints. + + There are two forms by which linear_constraints.set_senses may be + called. + + linear_constraints.set_senses(i, type) + i must be a row name or index and name must be a + single-character string. + + linear_constraints.set_senses(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, sense) pairs, + each of which consists of a row name or index and a + single-character string. Sets the sense of the specified + rows to the corresponding strings. Equivalent to + [linear_constraints.set_senses(pair[0], pair[1]) for pair in seq_of_pairs]. + + The senses of the constraints must be one of 'G', 'L', 'E', + and 'R', indicating greater-than-or-equal-to (>=), + less-than-or-equal-to (<=), equality (=), and ranged constraints, + respectively. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_senses() + ['E', 'E', 'E', 'E'] + >>> c.linear_constraints.set_senses("c1", "G") + >>> c.linear_constraints.get_senses(1) + 'G' + >>> c.linear_constraints.set_senses([("c3", "L"), (2, "R")]) + >>> c.linear_constraints.get_senses() + ['E', 'G', 'R', 'L'] + """ + if len(args) == 2: + indices = [self._conv(args[0])] + senses = args[1] + elif len(args) == 1: + indices, senses = unzip(args[0]) + indices = self._conv(indices) + senses = "".join(senses) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgsense(self._env._e, self._cplex._lp, + indices, senses)
+ + +
+[docs] + def set_linear_components(self, *args): + """Sets a linear constraint or set of linear constraints. + + There are two forms by which this method may be called: + + linear_constraints.set_linear_components(i, lin) + i must be a row name or index and lin must be either a + SparsePair or a pair of sequences, the first of which + consists of variable names or indices, the second of which + consists of floats. + + linear_constraints.set_linear_components(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lin) pairs, + each of which consists of a row name or index and a vector + as described above. Sets the specified rows + to the corresponding vector. Equivalent to + [linear_constraints.set_linear_components(pair[0], pair[1]) + for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=["c0", "c1", "c2", "c3"]) + >>> indices = c.variables.add(names=["x0", "x1"]) + >>> c.linear_constraints.set_linear_components("c0", [["x0"], [1.0]]) + >>> c.linear_constraints.get_rows("c0") + SparsePair(ind = [0], val = [1.0]) + >>> c.linear_constraints.set_linear_components([ + ... ("c3", cplex.SparsePair(ind=["x1"], val=[-1.0])), + ... (2, [[0, 1], [-2.0, 3.0]])]) + >>> c.linear_constraints.get_rows("c3") + SparsePair(ind = [1], val = [-1.0]) + >>> c.linear_constraints.get_rows(2) + SparsePair(ind = [0, 1], val = [-2.0, 3.0]) + """ + def setlin(cons, vars_): + validate_arg_lengths([cons, vars_]) + cons = convert_sequence(cons, self._get_index) + varcache = {} + for c, v in zip(cons, vars_): + ind, val = unpack_pair(v) + CPX_PROC.chgcoeflist( + self._env._e, + self._cplex._lp, + [c] * len(ind), + convert_sequence( + ind, + self._cplex.variables._get_index, + varcache + ), + val + ) + apply_pairs(setlin, self._conv, *args)
+ + +
+[docs] + def set_range_values(self, *args): + """Sets the range values for a set of linear constraints. + + That is, this method sets the lefthand side (lhs) for each ranged + constraint of the form lhs <= lin_expr <= rhs. + + The range values are a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + Note that changing the range values will not change the sense of a + constraint; you must call the method set_senses() of the class + LinearConstraintInterface to change the sense of a ranged row if + the previous range value was 0 (zero) and the constraint sense was not + 'R'. Similarly, changing the range coefficient from a nonzero value to + 0 (zero) will not change the constraint sense from 'R" to "E"; an + additional call of setsenses() is required to accomplish that. + + There are two forms by which linear_constraints.set_range_values may be + called. + + linear_constraints.set_range_values(i, range) + i must be a row name or index and range must be a real + number. Sets the range value of the row whose index or + name is i to range. + + linear_constraints.set_range_values(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, range) pairs, each + of which consists of a row name or index and a real + number. Sets the range values for the specified rows to + the corresponding values. Equivalent to + [linear_constraints.set_range_values(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.set_range_values("c1", 1.0) + >>> c.linear_constraints.get_range_values() + [0.0, 1.0, 0.0, 0.0] + >>> c.linear_constraints.set_range_values([("c3", 2.0), (2, -1.0)]) + >>> c.linear_constraints.get_range_values() + [0.0, 1.0, -1.0, 2.0] + """ + def chgrngval(a, b): + CPX_PROC.chgrngval(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgrngval, self._conv, *args)
+ + +
+[docs] + def set_coefficients(self, *args): + """Sets individual coefficients of the linear constraint matrix. + + There are two forms by which + linear_constraints.set_coefficients may be called. + + linear_constraints.set_coefficients(row, col, val) + row and col must be indices or names of a linear constraint + and variable, respectively. The corresponding coefficient + is set to val. + + linear_constraints.set_coefficients(coefficients) + coefficients must be a list of (row, col, val) triples as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> indices = c.variables.add(names = ["x0", "x1"]) + >>> c.linear_constraints.set_coefficients("c0", "x1", 1.0) + >>> c.linear_constraints.get_rows(0) + SparsePair(ind = [1], val = [1.0]) + >>> c.linear_constraints.set_coefficients([("c2", "x0", 2.0), + ("c2", "x1", -1.0)]) + >>> c.linear_constraints.get_rows("c2") + SparsePair(ind = [0, 1], val = [2.0, -1.0]) + """ + if len(args) == 3: + arg_list = [[arg] for arg in args] + elif len(args) == 1: + arg_list = unzip(args[0]) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgcoeflist( + self._env._e, self._cplex._lp, + self._conv(arg_list[0]), + self._cplex.variables._conv(arg_list[1]), + arg_list[2])
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of constraints from the problem. + + Can be called by four forms. + + linear_constraints.get_rhs() + return the righthand side of all linear constraints from + the problem. + + linear_constraints.get_rhs(i) + i must be a linear constraint name or index. Returns the + righthand side of the linear constraint whose index or + name is i. + + linear_constraints.get_rhs(s) + s must be a sequence of linear constraint names or indices. + Returns the righthand side of the linear constraints with + indices the members of s. Equivalent to + [linear_constraints.get_rhs(i) for i in s] + + linear_constraints.get_rhs(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the righthand side of the linear + constraints with indices between begin and end, inclusive + of end. Equivalent to + linear_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(rhs = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_rhs(8) + 12.0 + >>> c.linear_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.linear_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.linear_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(a, b=self.get_num() - 1): + return CPX_PROC.getrhs(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getrhs, self._conv, args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the senses of constraints from the problem. + + Can be called by four forms. + + linear_constraints.get_senses() + return the senses of all linear constraints from the + problem. + + linear_constraints.get_senses(i) + i must be a linear constraint name or index. Returns the + sense of the linear constraint whose index or name is i. + + linear_constraints.get_senses(s) + s must be a sequence of linear constraint names or indices. + Returns the senses of the linear constraints with indices + the members of s. Equivalent to + [linear_constraints.get_senses(i) for i in s] + + linear_constraints.get_senses(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the senses of the linear constraints + with indices between begin and end, inclusive of end. + Equivalent to + linear_constraints.get_senses(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add( + ... senses=["E", "G", "L", "R"], + ... names=[str(i) for i in range(4)]) + >>> c.linear_constraints.get_num() + 4 + >>> c.linear_constraints.get_senses(1) + 'G' + >>> c.linear_constraints.get_senses("1",3) + ['G', 'L', 'R'] + >>> c.linear_constraints.get_senses([2,"0",1]) + ['L', 'E', 'G'] + >>> c.linear_constraints.get_senses() + ['E', 'G', 'L', 'R'] + """ + def getsense(a, b=self.get_num() - 1): + return CPX_PROC.getsense(self._env._e, self._cplex._lp, a, b) + s = [i for i in "".join(apply_freeform_two_args( + getsense, self._conv, args))] + return s[0] if len(s) == 1 else s
+ + +
+[docs] + def get_range_values(self, *args): + """Returns the range values of linear constraints from the problem. + + That is, this method returns the lefthand side (lhs) for each + ranged constraint of the form lhs <= lin_expr <= rhs. This method + makes sense only for ranged constraints, that is, linear constraints + of sense 'R'. + + The range values are a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + Can be called by four forms. + + linear_constraints.get_range_values() + return the range values of all linear constraints from the + problem. + + linear_constraints.get_range_values(i) + i must be a linear constraint name or index. Returns the + range value of the linear constraint whose index or name is i. + + linear_constraints.get_range_values(s) + s must be a sequence of linear constraint names or indices. + Returns the range values of the linear constraints with + indices the members of s. Equivalent to + [linear_constraints.get_range_values(i) for i in s] + + linear_constraints.get_range_values(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the range values of the linear + constraints with indices between begin and end, inclusive + of end. Equivalent to + linear_constraints.get_range_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add( + range_values = [1.5 * i for i in range(10)], + senses = ["R"] * 10, + names = [str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_range_values(8) + 12.0 + >>> c.linear_constraints.get_range_values("1",3) + [1.5, 3.0, 4.5] + >>> c.linear_constraints.get_range_values([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.linear_constraints.get_range_values() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrngval(a, b=self.get_num() - 1): + return CPX_PROC.getrngval(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getrngval, self._conv, args)
+ + +
+[docs] + def get_coefficients(self, *args): + """Returns coefficients by row, column coordinates. + + There are two forms by which + linear_constraints.get_coefficients may be called. + + linear_constraints.get_coefficients(row, col) + returns the coefficient. + + linear_constraints.get_coefficients(sequence_of_pairs) + returns a list of coefficients. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1"]) + >>> indices = c.linear_constraints.add( + names = ["c0", "c1"], + lin_expr = [[[1], [1.0]], [[0, 1], [2.0, -1.0]]]) + >>> c.linear_constraints.get_coefficients("c0", "x1") + 1.0 + >>> c.linear_constraints.get_coefficients([("c1", "x0"), ("c1", "x1")]) + [2.0, -1.0] + """ + def getcoef(row, col): + return CPX_PROC.getcoef(self._env._e, self._cplex._lp, row, col) + if len(args) == 2: + return getcoef(self._conv(args[0]), + self._cplex.variables._conv(args[1])) + if len(args) == 1: + return [self.get_coefficients(*arg) for arg in args[0]] + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def get_rows(self, *args): + """Returns a set of rows of the linear constraint matrix. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + There are four forms by which linear_constraints.get_rows may be + called. + + linear_constraints.get_rows() + return the entire linear constraint matrix. + + linear_constraints.get_rows(i) + i must be a row name or index. Returns the ith row of + the linear constraint matrix. + + linear_constraints.get_rows(s) + s must be a sequence of row names or indices. Returns the + rows of the linear constraint matrix indexed by the members + of s. Equivalent to + [linear_constraints.get_rows(i) for i in s] + + linear_constraints.get_rows(begin, end) + begin and end must be row indices or row names. Returns the + rows of the linear constraint matrix with indices between begin + and end, inclusive of end. Equivalent to + linear_constraints.get_rows(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + ... names=["c0", "c1", "c2", "c3"], + ... lin_expr=[ + ... cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]), + ... cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]), + ... cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3), + ... cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0]) + ... ] + ... ) + >>> c.linear_constraints.get_rows(0) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + >>> for row in c.linear_constraints.get_rows(1,3): + ... print(row) + SparsePair(ind = [0, 1], val = [1.0, 1.0]) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [1, 2], val = [10.0, -2.0]) + >>> for row in c.linear_constraints.get_rows(["c2", 0]): + ... print(row) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + >>> for row in c.linear_constraints.get_rows(): + ... print(row) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + SparsePair(ind = [0, 1], val = [1.0, 1.0]) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [1, 2], val = [10.0, -2.0]) + """ + def getrows(begin, end=self.get_num() - 1): + mat = _HBMatrix() + t = CPX_PROC.getrows(self._env._e, self._cplex._lp, begin, end) + mat.matbeg = t[0] + mat.matind = t[1] + mat.matval = t[2] + return [m for m in mat] + return apply_freeform_two_args(getrows, self._conv, args)
+ + +
+[docs] + def get_num_nonzeros(self): + """Returns the number of nonzeros in the linear constraint + matrix. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + ... names=["c0", "c1", "c2", "c3"], + ... lin_expr=[ + ... cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]), + ... cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]), + ... cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3), + ... cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0]) + ... ] + ... ) + >>> c.linear_constraints.get_num_nonzeros() + 9 + """ + return CPX_PROC.getnumnz(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of linear constraints from the problem. + + There are four forms by which linear_constraints.get_names may be called. + + linear_constraints.get_names() + return the names of all linear constraints from the problem. + + linear_constraints.get_names(i) + i must be a linear constraint index. Returns the name of row i. + + linear_constraints.get_names(s) + s must be a sequence of row indices. Returns the names of + the linear constraints with indices the members of s. + Equivalent to [linear_constraints.get_names(i) for i in s] + + linear_constraints.get_names(begin, end) + begin and end must be linear constraint indices. Returns the + names of the linear constraints with indices between begin and + end, inclusive of end. Equivalent to + linear_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c" + str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_names(8) + 'c8' + >>> c.linear_constraints.get_names(1, 3) + ['c1', 'c2', 'c3'] + >>> c.linear_constraints.get_names([2, 0, 5]) + ['c2', 'c0', 'c5'] + >>> c.linear_constraints.get_names() + ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getrowname(self._env._e, self._cplex._lp, + a, b) + return apply_freeform_two_args(getname, self._conv, args)
+ + +
+[docs] + def get_histogram(self): + """Returns a histogram of the rows of the linear constraint matrix. + + To access the number of rows with given nonzero counts, use + slice notation. If a negative nonzero count is queried in + this manner an IndexError will be raised. + + The __str__ method of the `Histogram` object returns a string + displaying the number of rows with given nonzeros counts in + human readable form. + + The data member "orientation" of the histogram object is + "row", indicating that the histogram shows the nonzero + counts for the rows of the linear constraint matrix. + + >>> import cplex + >>> c = cplex.Cplex("ind.lp") + >>> histogram = c.linear_constraints.get_histogram() + >>> print(histogram) + Row counts (excluding fixed variables): + <BLANKLINE> + Nonzero Count: 3 4 5 10 37 + Number of Rows: 1 9 1 4 1 + <BLANKLINE> + <BLANKLINE> + >>> histogram[4] + 9 + >>> histogram[2:7] + [0, 1, 9, 1, 0] + """ + return Histogram(self._cplex, "row")
+
+ + + +
+[docs] +class IndicatorType(ConstantClass): + """Identifiers for types of indicator constraints.""" + if_ = _constants.CPX_INDICATOR_IF + """CPX_INDICATOR_IF ('->').""" + onlyif = _constants.CPX_INDICATOR_ONLYIF + """CPX_INDICATOR_ONLYIF ('<-')""" + iff = _constants.CPX_INDICATOR_IFANDONLYIF + """CPX_INDICATOR_IFANDONLYIF ('<->')"""
+ + + +
+[docs] +class IndicatorConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying indicator constraints.""" + + type_ = IndicatorType() + """See `IndicatorType()`""" + +
+[docs] + def __init__(self, cplex): + """Creates a new IndicatorConstraintInterface. + + The indicator constraints interface is exposed by the top-level + `Cplex` class as `Cplex.indicator_constraints`. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=cplex, + getindexfunc=CPX_PROC.getindconstrindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of indicator constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.indicator_constraints.add(name="ind1") + 0 + >>> c.indicator_constraints.get_num() + 1 + """ + return CPX_PROC.getnumindconstrs(self._env._e, self._cplex._lp)
+ + + def _add_batch(self, lin_expr, sense, rhs, indvar, complemented, name, + indtype): + if not isinstance(sense, str): + sense = "".join(sense) + arg_list = [lin_expr, sense, rhs, indvar, complemented, name, + indtype] + num_new_rows = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + ": lin_expr, sense, rhs, indvar, complemented, name, indtype" + ) + with CPX_PROC.chbmatrix(lin_expr, self._cplex._env_lp_ptr, + 0) as (linmat, nnz): + CPX_PROC.addindconstr(self._env._e, self._cplex._lp, + num_new_rows, + self._cplex.variables._conv(indvar), + complemented, rhs, sense, + linmat, indtype, name, nnz) + +
+[docs] + def add_batch(self, lin_expr=None, sense=None, rhs=None, indvar=None, + complemented=None, name=None, indtype=None): + """Adds indicator constraints to the problem. + + Takes up to eight keyword arguments. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr : either a list of SparsePair instances or a matrix in + list-of-lists format. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + sense : must be either a list of single-character strings or a + string containing the senses of the indicator constraints. + Each entry must be one of 'G', 'L', 'E', indicating + greater-than-or-equal-to (>=), less-than-or-equal-to (<=), and + equality (=), respectively. Left unspecified, the default is 'E'. + + rhs : a list of floats, specifying the righthand side of each + indicator constraint. + + indvar : a list of names or indices (or a mixture of the two), of + the variables that control whether the constraint is active or + not. + + complemented : a list of values (0 or 1). Default value of 0 + instructs CPLEX to interpret indicator constraint as active when + the indicator variable is 1. Set complemented to 1 to instruct + CPLEX that the indicator constraint is active when indvar = 0. + + name : a list of strings that determine the names of the + individual constraints. + + indtype : a list of the types of indicator constraints. Defaults + to CPX_INDICATOR_IF ('->'). See `IndicatorType()`. + + Returns an iterator containing the indices of the added indicator + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.indicator_constraints.add_batch( + ... lin_expr=[cplex.SparsePair(ind=["x2"], val=[2.0]), + ... cplex.SparsePair(ind=["x3"], val=[2.0])], + ... sense="LL", + ... rhs=[1.0, 1.0], + ... indvar=["x1", "x2"], + ... complemented=[0, 0], + ... name=["ind1", "ind2"], + ... indtype=[c.indicator_constraints.type_.if_, + ... c.indicator_constraints.type_.if_]) + >>> len(list(indices)) + 2 + """ + (lin_expr, sense, rhs, indvar, + complemented, name, indtype) = init_list_args( + lin_expr, sense, rhs, indvar, complemented, name, indtype) + return self._add_iter(self.get_num, self._add_batch, + lin_expr, sense, rhs, indvar, complemented, + name, indtype)
+ + + def _add(self, lin_expr, sense, rhs, indvar, complemented, name, + indtype): + """non-public""" + self._add_batch([lin_expr], sense, [rhs], [indvar], [complemented], + [name], [indtype]) + +
+[docs] + def add(self, lin_expr=None, sense="E", rhs=0.0, indvar=0, + complemented=0, name="", indtype=IndicatorType.if_): + """Adds an indicator constraint to the problem. + + Takes up to eight keyword arguments. + + lin_expr : either a SparsePair or a list of two lists, the first of + which contains variable indices or names, the second of which + contains values. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + sense : the sense of the constraint, may be "L", "G", or "E": + default is "E" + + rhs : a float defining the righthand side of the constraint + + indvar : the name or index of the variable that controls if + the constraint is active + + complemented : default value of 0 instructs CPLEX to interpret + indicator constraint as active when the indicator variable is 1. + Set complemented to 1 to instruct CPLEX that the indicator + constraint is active when indvar = 0. + + name : the name of the constraint. + + indtype : the type of indicator constraint. Defaults to + CPX_INDICATOR_IF ('->'). See `IndicatorType()`. + + Returns the index of the added indicator constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x1", "x2"]) + >>> c.indicator_constraints.add( + ... indvar="x1", + ... complemented=0, + ... rhs=1.0, + ... sense="G", + ... lin_expr=cplex.SparsePair(ind=["x2"], val=[2.0]), + ... name="ind1", + ... indtype=c.indicator_constraints.type_.if_) + 0 + """ + if lin_expr is None: + lin_expr = SparsePair() + # We only ever create one indicator constraint at a time. + return self._add_single(self.get_num, self._add, lin_expr, + sense, rhs, indvar, complemented, + name, indtype)
+ + +
+[docs] + def delete(self, *args): + """Deletes indicator constraints from the problem. + + There are four forms by which indicator_constraints.delete may be + called. + + indicator_constraints.delete() + deletes all indicator constraints from the problem. + + indicator_constraints.delete(i) + i must be an indicator constraint name or index. Deletes + the indicator constraint whose index or name is i. + + indicator_constraints.delete(s) + s must be a sequence of indicator constraint names or + indices. Deletes the indicator constraints with names or + indices contained within s. Equivalent to + [indicator_constraints.delete(i) for i in s]. + + indicator_constraints.delete(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Deletes the indicator constraints with + indices between begin and end, inclusive of end. Equivalent to + indicator_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of indicator + constraints. + + See `CPXdelindconstrs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delindconstrs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name=str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.delete(8) + >>> c.indicator_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.indicator_constraints.delete("1", 3) + >>> c.indicator_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.indicator_constraints.delete([2, "0", 5]) + >>> c.indicator_constraints.get_names() + ['4', '6', '7'] + >>> c.indicator_constraints.delete() + >>> c.indicator_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delindconstrs(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_indicator_variables(self, *args): + """Returns the indicator variables of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_indicator_variables() + return the indicator variables of all indicator constraints + from the problem. + + indicator_constraints.get_indicator_variables(i) + i must be an indicator constraint name or index. Returns the + indicator variables of the indicator constraint whose index + or name is i. + + indicator_constraints.get_indicator_variables(s) + s must be a sequence of indicator constraint names or + indices. Returns the indicator variables of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_indicator_variables(i) for i in s] + + indicator_constraints.get_indicator_variables(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the indicator variables of the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_indicator_variables(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=i, + ... lin_expr=cplex.SparsePair(ind=[i+1], val=[1.0])) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_indicator_variables(8) + 8 + >>> c.indicator_constraints.get_indicator_variables("1",3) + [1, 2, 3] + >>> c.indicator_constraints.get_indicator_variables([2,"0",5]) + [2, 0, 5] + >>> c.indicator_constraints.get_indicator_variables() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getindvar(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[1] + return apply_freeform_two_args(getindvar, self._conv, args)
+ + +
+[docs] + def get_complemented(self, *args): + """Returns whether a set of indicator constraints is complemented. + + May be called by four forms. + + indicator_constraints.get_complemented() + return whether or not all indicator constraints from the + problem are complemented. + + indicator_constraints.get_complemented(i) + i must be an indicator constraint name or index. Returns + whether or not the indicator constraint whose index or name + is i is complemented. + + indicator_constraints.get_complemented(s) + s must be a sequence of indicator constraint names or + indices. Returns whether or not the indicator constraints + with indices the members of s are complemented. Equivalent + to [indicator_constraints.get_complemented(i) for i in s] + + indicator_constraints.get_complemented(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns whether or not the indicator + constraints with indices between begin and end, inclusive of + end, are complemented. Equivalent to + indicator_constraints.get_complemented(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=10, + ... complemented=i % 2) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_complemented(8) + 0 + >>> c.indicator_constraints.get_complemented("1",3) + [1, 0, 1] + >>> c.indicator_constraints.get_complemented([2,"0",5]) + [0, 0, 1] + >>> c.indicator_constraints.get_complemented() + [0, 1, 0, 1, 0, 1, 0, 1, 0, 1] + """ + def getcomp(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[2] + return apply_freeform_two_args(getcomp, self._conv, args)
+ + +
+[docs] + def get_num_nonzeros(self, *args): + """Returns the number of nonzeros in a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_num_nonzeros() + return the number of nonzeros in all indicator constraints + from the problem. + + indicator_constraints.get_num_nonzeros(i) + i must be an indicator constraint name or index. Returns the + number of nonzeros in the indicator constraint whose index + or name is i. + + indicator_constraints.get_num_nonzeros(s) + s must be a sequence of indicator constraint names or + indices. Returns the number of nonzeros in the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_num_nonzeros(i) for i in s] + + indicator_constraints.get_num_nonzeros(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the number of nonzeros in the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=10, + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_num_nonzeros(8) + 8 + >>> c.indicator_constraints.get_num_nonzeros("1",3) + [1, 2, 3] + >>> c.indicator_constraints.get_num_nonzeros([2,"0",5]) + [2, 0, 5] + >>> c.indicator_constraints.get_num_nonzeros() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getnnz(a): + # NB: We return surplus here for nzcnt (this is on purpose). + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, a, a)[5] + return apply_freeform_one_arg( + getnnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_rhs() + return the righthand side of all indicator constraints + from the problem. + + indicator_constraints.get_rhs(i) + i must be an indicator constraint name or index. Returns the + righthand side of the indicator constraint whose index or + name is i. + + indicator_constraints.get_rhs(s) + s must be a sequence of indicator constraint names or + indices. Returns the righthand side of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_rhs(i) for i in s] + + indicator_constraints.get_rhs(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the righthand side of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(rhs=1.5 * i, name=str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_rhs(8) + 12.0 + >>> c.indicator_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.indicator_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.indicator_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[3] + return apply_freeform_two_args(getrhs, self._conv, args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the sense of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_senses() + return the senses of all indicator constraints from the + problem. + + indicator_constraints.get_senses(i) + i must be an indicator constraint name or index. Returns the + sense of the indicator constraint whose index or name is i. + + indicator_constraints.get_senses(s) + s must be a sequence of indicator constraint names or + indices. Returns the senses of the indicator constraints + with indices the members of s. Equivalent to + [indicator_constraints.get_senses(i) for i in s] + + indicator_constraints.get_senses(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the senses of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_senses(range(begin, end + 1)). + + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name=str(i), sense=j) + ... for i, j in enumerate("EGLE")] + [0, 1, 2, 3] + >>> c.indicator_constraints.get_num() + 4 + >>> c.indicator_constraints.get_senses(1) + 'G' + >>> c.indicator_constraints.get_senses("1",3) + ['G', 'L', 'E'] + >>> c.indicator_constraints.get_senses([2,"0",1]) + ['L', 'E', 'G'] + >>> c.indicator_constraints.get_senses() + ['E', 'G', 'L', 'E'] + """ + def getsense(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[4] + result = apply_freeform_two_args(getsense, self._conv, args) + s = [i for i in "".join(result)] + return s[0] if len(s) == 1 else s
+ + +
+[docs] + def get_types(self, *args): + """Returns the type of a set of indicator constraints. + + See `IndicatorType()`. + + May be called by four forms. + + indicator_constraints.get_types() + return the types of all indicator constraints from the + problem. + + indicator_constraints.get_types(i) + i must be an indicator constraint name or index. Returns the + type of the indicator constraint whose index or name is i. + + indicator_constraints.get_types(s) + s must be a sequence of indicator constraint names or + indices. Returns the types of the indicator constraints + with indices the members of s. Equivalent to + [indicator_constraints.get_types(i) for i in s] + + indicator_constraints.get_types(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the types of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.indicator_constraints.add(name='i1') + >>> c.indicator_constraints.get_types(idx) + 1 + >>> c.indicator_constraints.type_[1] + 'if_' + """ + def gettype(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[0] + return apply_freeform_two_args(gettype, self._conv, args)
+ + +
+[docs] + def get_linear_components(self, *args): + """Returns the linear constraint of a set of indicator + constraints. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + May be called by four forms. + + indicator_constraints.get_linear_components() + return the linear components of all indicator constraints + from the problem. + + indicator_constraints.get_linear_components(i) + i must be an indicator constraint name or index. Returns the + linear component of the indicator constraint whose index or + name is i. + + indicator_constraints.get_linear_components(s) + s must be a sequence of indicator constraint names or + indices. Returns the linear components of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_linear_components(i) for i in s] + + indicator_constraints.get_linear_components(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the linear components of the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_linear_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=3, + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(3)] + [0, 1, 2] + >>> c.indicator_constraints.get_num() + 3 + >>> c.indicator_constraints.get_linear_components(2) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for row in c.indicator_constraints.get_linear_components("0", 1): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + >>> for row in c.indicator_constraints.get_linear_components([1, "0"]): + ... print(row) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> for row in c.indicator_constraints.get_linear_components(): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getlin(begin, end=self.get_num() - 1): + mat = _HBMatrix() + mat.matbeg, mat.matind, mat.matval = CPX_PROC.getindconstr( + self._env._e, self._cplex._lp, begin, end) + return [m for m in mat] + return apply_freeform_two_args(getlin, self._conv, args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_names() + return the names of all indicator constraints from the + problem. + + indicator_constraints.get_names(i) + i must be an indicator constraint index. Returns the name + of constraint i. + + indicator_constraints.get_names(s) + s must be a sequence of indicator constraint indices. + Returns the names of the indicator constraints with indices + the members of s. Equivalent to + [indicator_constraints.get_names(i) for i in s] + + indicator_constraints.get_names(begin, end) + begin and end must be indicator constraint indices. Returns the + names of the indicator constraints with indices between begin + and end, inclusive of end. Equivalent to + indicator_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name="i" + str(i)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_names(8) + 'i8' + >>> c.indicator_constraints.get_names(1, 3) + ['i1', 'i2', 'i3'] + >>> c.indicator_constraints.get_names([2, 0, 5]) + ['i2', 'i0', 'i5'] + >>> c.indicator_constraints.get_names() + ['i0', 'i1', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9'] + """ + def getname(a): + return CPX_PROC.getindconstrname( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+
+ + + +
+[docs] +class QuadraticConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying quadratic constraints.""" + +
+[docs] + def __init__(self, cplex): + """Creates a new QuadraticConstraintInterface. + + The quadratic constraints interface is exposed by the top-level + `Cplex` class as `Cplex.quadratic_constraints`. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getqconstrindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of quadratic constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y']) + >>> l = cplex.SparsePair(ind = ['x'], val = [1.0]) + >>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0]) + >>> [c.quadratic_constraints.add(name=str(i), lin_expr=l, quad_expr=q) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + """ + return CPX_PROC.getnumqconstrs(self._env._e, self._cplex._lp)
+ + + def _add(self, lin_expr, quad_expr, sense, rhs, name): + """non-public""" + ind, val = unpack_pair(lin_expr) + if len(val) == 1 and val[0] == 0.0: + ind = [] + val = [] + ind1, ind2, qval = unpack_triple(quad_expr) + varcache = {} + CPX_PROC.addqconstr(self._env._e, self._cplex._lp, rhs, sense, + self._cplex.variables._conv(ind, varcache), + val, + self._cplex.variables._conv(ind1, varcache), + self._cplex.variables._conv(ind2, varcache), + qval, name) + +
+[docs] + def add(self, lin_expr=None, quad_expr=None, sense="L", rhs=0.0, name=""): + """Adds a quadratic constraint to the problem. + + Takes up to five keyword arguments: + + lin_expr : either a SparsePair or a list of two lists specifying + the linear component of the constraint. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + quad_expr : either a SparseTriple or a list of three lists + specifying the quadratic component of the constraint. + + Note + quad_expr must not contain duplicate indices. If quad_expr + references a matrix entry more than once, either by indices, + names, or a combination of indices and names, an exception + will be raised. + + sense : either "L", "G", or "E" + + rhs : a float specifying the righthand side of the constraint. + + name : the name of the constraint. + + Returns the index of the added quadratic constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y']) + >>> l = cplex.SparsePair(ind = ['x'], val = [1.0]) + >>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0]) + >>> c.quadratic_constraints.add(name = "my_quad", + ... lin_expr = l, + ... quad_expr = q, + ... rhs = 1.0, + ... sense = "G") + 0 + """ + if lin_expr is None: + lin_expr = SparsePair([0], [0.0]) + if quad_expr is None: + quad_expr = SparseTriple([0], [0], [0.0]) + # We only ever create one quadratic constraint at a time. + return self._add_single(self.get_num, self._add, + lin_expr, quad_expr, sense, rhs, name)
+ + +
+[docs] + def delete(self, *args): + """Deletes quadratic constraints from the problem. + + There are four forms by which quadratic_constraints.delete may be + called. + + quadratic_constraints.delete() + deletes all quadratic constraints from the problem. + + quadratic_constraints.delete(i) + i must be a quadratic constraint name or index. Deletes + the quadratic constraint whose index or name is i. + + quadratic_constraints.delete(s) + s must be a sequence of quadratic constraint names or + indices. Deletes the quadratic constraints with names or + indices contained within s. Equivalent to + [quadratic_constraints.delete(i) for i in s]. + + quadratic_constraints.delete(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Deletes the quadratic constraints with + indices between begin and end, inclusive of end. Equivalent to + quadratic_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of quadratic + constraints. + + See `CPXdelqconstrs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/socpapi/delqconstrs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y']) + >>> l = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> q = cplex.SparseTriple(ind1=['x'], ind2=['y'], val=[1.0]) + >>> [c.quadratic_constraints.add( + ... name=str(i), lin_expr=l, quad_expr=q) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.delete(8) + >>> c.quadratic_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.quadratic_constraints.delete("1", 3) + >>> c.quadratic_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.quadratic_constraints.delete([2, "0", 5]) + >>> c.quadratic_constraints.get_names() + ['4', '6', '7'] + >>> c.quadratic_constraints.delete() + >>> c.quadratic_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delqconstrs(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_rhs() + return the righthand side of all quadratic constraints + from the problem. + + quadratic_constraints.get_rhs(i) + i must be a quadratic constraint name or index. Returns the + righthand side of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_rhs(s) + s must be a sequence of quadratic constraint names or + indices. Returns the righthand side of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_rhs(i) for i in s] + + quadratic_constraints.get_rhs(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the righthand side of the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + quadratic_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(10)]) + >>> [c.quadratic_constraints.add(rhs=1.5 * i, name=str(i)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_rhs(8) + 12.0 + >>> c.quadratic_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.quadratic_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.quadratic_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[0] + return apply_freeform_one_arg( + getrhs, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the senses of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_senses() + return the senses of all quadratic constraints from the + problem. + + quadratic_constraints.get_senses(i) + i must be a quadratic constraint name or index. Returns the + sense of the quadratic constraint whose index or name is i. + + quadratic_constraints.get_senses(s) + s must be a sequence of quadratic constraint names or + indices. Returns the senses of the quadratic constraints + with indices the members of s. Equivalent to + [quadratic_constraints.get_senses(i) for i in s] + + quadratic_constraints.get_senses(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the senses of the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + quadratic_constraints.get_senses(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0"]) + >>> [c.quadratic_constraints.add(name=str(i), sense=j) + ... for i, j in enumerate("GGLL")] + [0, 1, 2, 3] + >>> c.quadratic_constraints.get_num() + 4 + >>> c.quadratic_constraints.get_senses(1) + 'G' + >>> c.quadratic_constraints.get_senses("1",3) + ['G', 'L', 'L'] + >>> c.quadratic_constraints.get_senses([2,"0",1]) + ['L', 'G', 'G'] + >>> c.quadratic_constraints.get_senses() + ['G', 'G', 'L', 'L'] + """ + def getsense(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[1] + return apply_freeform_one_arg( + getsense, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_linear_num_nonzeros(self, *args): + """Returns the number of nonzeros in the linear part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_linear_num_nonzeros() + return the number of nonzeros in all quadratic constraints + from the problem. + + quadratic_constraints.get_linear_num_nonzeros(i) + i must be a quadratic constraint name or index. Returns the + number of nonzeros in the quadratic constraint whose index + or name is i. + + quadratic_constraints.get_linear_num_nonzeros(s) + s must be a sequence of quadratic constraint names or + indices. Returns the number of nonzeros in the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_linear_num_nonzeros(i) for i in s] + + quadratic_constraints.get_linear_num_nonzeros(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the number of nonzeros in the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_linear_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.quadratic_constraints.add( + ... name = str(i), + ... lin_expr = [range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_linear_num_nonzeros(8) + 8 + >>> c.quadratic_constraints.get_linear_num_nonzeros("1",3) + [1, 2, 3] + >>> c.quadratic_constraints.get_linear_num_nonzeros([2,"0",5]) + [2, 0, 5] + >>> c.quadratic_constraints.get_linear_num_nonzeros() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getlinnz(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[2] + return apply_freeform_one_arg( + getlinnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_linear_components(self, *args): + """Returns the linear part of a set of quadratic constraints. + + Returns a list of SparsePair instances or one SparsePair + instance. + + Can be called by four forms. + + quadratic_constraints.get_linear_components() + return the linear components of all quadratic constraints + from the problem. + + quadratic_constraints.get_linear_components(i) + i must be a quadratic constraint name or index. Returns the + linear component of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_linear_components(s) + s must be a sequence of quadratic constraint names or + indices. Returns the linear components of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_linear_components(i) for i in s] + + quadratic_constraints.get_linear_components(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the linear components of the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_linear_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.quadratic_constraints.add( + ... name=str(i), + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(3)] + [0, 1, 2] + >>> c.quadratic_constraints.get_num() + 3 + >>> c.quadratic_constraints.get_linear_components(2) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for row in c.quadratic_constraints.get_linear_components("0", 1): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + >>> for row in c.quadratic_constraints.get_linear_components([1, "0"]): + ... print(row) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> for row in c.quadratic_constraints.get_linear_components(): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getlin(a): + return SparsePair(*CPX_PROC.getqconstr_lin( + self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getlin, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_quad_num_nonzeros(self, *args): + """Returns the number of nonzeros in the quadratic part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_quad_num_nonzeros() + Returns the number of nonzeros in all quadratic constraints + from the problem. + + quadratic_constraints.get_quad_num_nonzeros(i) + i must be a quadratic constraint name or index. Returns the + number of nonzeros in the quadratic constraint whose index + or name is i. + + quadratic_constraints.get_quad_num_nonzeros(s) + s must be a sequence of quadratic constraint names or + indices. Returns the number of nonzeros in the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_quad_num_nonzeros(i) for i in s] + + quadratic_constraints.get_quad_num_nonzeros(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the number of nonzeros in the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_quad_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)]) + >>> [c.quadratic_constraints.add( + ... name = str(i), + ... quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_quad_num_nonzeros(8) + 9 + >>> c.quadratic_constraints.get_quad_num_nonzeros("1",2) + [1, 2, 3] + >>> c.quadratic_constraints.get_quad_num_nonzeros([2,"1",5]) + [3, 1, 6] + >>> c.quadratic_constraints.get_quad_num_nonzeros() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getquadnz(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[3] + return apply_freeform_one_arg( + getquadnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_quadratic_components(self, *args): + """Returns the quadratic part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_quadratic_components() + return the quadratic components of all quadratic constraints + from the problem. + + quadratic_constraints.get_quadratic_components(i) + i must be a quadratic constraint name or index. Returns the + quadratic component of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_quadratic_components(s) + s must be a sequence of quadratic constraint names or + indices. Returns the quadratic components of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_quadratic_components(i) for i in s] + + quadratic_constraints.get_quadratic_components(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the quadratic components of the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_quadratic_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)] + ... ) + >>> [c.quadratic_constraints.add( + ... name="q{0}".format(i), + ... quad_expr=[range(i), range(i), + ... [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 3)] + [0, 1] + >>> c.quadratic_constraints.get_num() + 2 + >>> c.quadratic_constraints.get_quadratic_components(1) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components("q1", 1): + ... print(quad) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components(["q2", 0]): + ... print(quad) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components(): + ... print(quad) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + """ + def getquad(a): + return SparseTriple(*CPX_PROC.getqconstr_quad( + self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getquad, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_names() + return the names of all quadratic constraints from the + problem. + + quadratic_constraints.get_names(i) + i must be a quadratic constraint index. Returns the name + of constraint i. + + quadratic_constraints.get_names(s) + s must be a sequence of quadratic constraint indices. + Returns the names of the quadratic constraints with indices + the members of s. Equivalent to + [quadratic_constraints.get_names(i) for i in s] + + quadratic_constraints.get_names(begin, end) + begin and end must be quadratic constraint indices. Returns + the names of the quadratic constraints with indices between + begin and end, inclusive of end. Equivalent to + quadratic_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)]) + >>> [c.quadratic_constraints.add( + ... name = "q" + str(i), + ... quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_names(8) + 'q9' + >>> c.quadratic_constraints.get_names(1, 3) + ['q2', 'q3', 'q4'] + >>> c.quadratic_constraints.get_names([2, 0, 5]) + ['q3', 'q1', 'q6'] + >>> c.quadratic_constraints.get_names() + ['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9', 'q10'] + """ + def getname(a): + return CPX_PROC.getqconstrname( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+
+ + + +
+[docs] +class SOSType(ConstantClass): + """Constants defining the type of special ordered sets. + + For a definition of SOS type 1 and 2, see those topics in the CPLEX + User's Manual. + """ + SOS1 = _constants.CPX_TYPE_SOS1 + SOS2 = _constants.CPX_TYPE_SOS2
+ + + +
+[docs] +class SOSInterface(BaseInterface): + """Class containing methods for Special Ordered Sets (SOS).""" + + type = SOSType() + """See `SOSType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new SOSInterface. + + The SOS interface is exposed by the top-level `Cplex` class as + `Cplex.SOS`. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getsosindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of special ordered sets.""" + return CPX_PROC.getnumsos(self._env._e, self._cplex._lp)
+ + + # FIXME: 'type' and 'SOS' are bad variable names. type is a "reserved" + # word and SOS should be lowercased. + def _add(self, type, SOS, name): + """non-public""" + indices, weights = unpack_pair(SOS) + CPX_PROC.addsos(self._env._e, self._cplex._lp, type, [0], + self._cplex.variables._conv(indices), + weights, [name]) + +
+[docs] + def add(self, type="1", SOS=None, name=""): + """Adds a special ordered set constraint to the problem. + + Takes three keyword arguments. + + type : can be either SOS.type.SOS1 or SOS.type.SOS2 + + SOS : either a SparsePair or a list of two lists, the first of + which contains variable indices or names, the second of which + contains the weights to assign to those variables. + + name: the name of the SOS + + Returns the index of the added SOS constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(10)]) + >>> c.SOS.add(type = "1", name = "type_one", + ... SOS = cplex.SparsePair(ind = ["2", "3"], + ... val = [25.0, 18.0])) + 0 + >>> c.SOS.add(type = "2", name = "type_two", + ... SOS = cplex.SparsePair(ind = ["2", "4", "7", "3"], + ... val = [1.0, 3.0, 25.0, 18.0])) + 1 + """ + if SOS is None: + SOS = SparsePair([0], [0.0]) + # We only ever create one sos constraint at a time. + return self._add_single(self.get_num, self._add, + type, SOS, name)
+ + +
+[docs] + def delete(self, *args): + """Deletes special ordered sets from the problem. + + There are four forms by which SOS.delete may be called. + + SOS.delete() + deletes all SOS constraints from the problem. + + SOS.delete(i) + i must be a SOS constraint name or index. Deletes the SOS + constraint indexed as i or named i. + + SOS.delete(s) + s must be a sequence of SOS constraint names or indices. + Deletes the SOS constraints with names or indices contained + within s. Equivalent to [SOS.delete(i) for i in s]. + + SOS.delete(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Deletes the SOS constraints with indices between begin + and end, inclusive of end. Equivalent to + SOS.delete(range(begin, end + 1)). This will give the best + performance when deleting batches of SOS constraints. + + See `CPXdelsos <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsos.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y']) + >>> l = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.SOS.add(name=str(i), SOS=l) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.delete(8) + >>> c.SOS.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.SOS.delete("1", 3) + >>> c.SOS.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.SOS.delete([2, "0", 5]) + >>> c.SOS.get_names() + ['4', '6', '7'] + >>> c.SOS.delete() + >>> c.SOS.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsos(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_sets(self, *args): + """Returns the sets of variables and their corresponding weights. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + SOS.get_sets() + return the set of variables and weights of all SOS + constraints from the problem. + + SOS.get_sets(i) + i must be a SOS constraint name or index. Returns the set + of variables and weights of the SOS constraint whose index + or name is i. + + SOS.get_sets(s) + s must be a sequence of SOS constraint names or indices. + Returns the variables and weights of the SOS constraints + with indices the members of s. Equivalent to + [SOS.get_sets(i) for i in s] + + SOS.get_sets(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the variables and weights of the SOS constraints + with indices between begin and end, inclusive of end. + Equivalent to SOS.get_sets(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.SOS.add( + ... name="s{0}".format(i), + ... SOS=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 3)] + [0, 1] + >>> c.SOS.get_num() + 2 + >>> c.SOS.get_sets(1) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for s in c.SOS.get_sets("s1", 1): + ... print(s) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for s in c.SOS.get_sets(["s2", 0]): + ... print(s) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + SparsePair(ind = [0], val = [1.0]) + >>> for s in c.SOS.get_sets(): + ... print(s) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getsos(a, b=self.get_num() - 1): + ret = CPX_PROC.getsos(self._env._e, self._cplex._lp, a, b) + mat = _HBMatrix() + mat.matbeg = ret[0] + mat.matind = ret[1] + mat.matval = ret[2] + return [m for m in mat] + return apply_freeform_two_args(getsos, self._conv, args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the type of a set of special ordered sets. + + Return values are attributes of Cplex.SOS.type. + + Can be called by four forms. + + SOS.get_types() + return the type of all SOS constraints. + + SOS.get_types(i) + i must be a SOS constraint name or index. Returns the type + of the SOS constraint whose index or name is i. + + SOS.get_types(s) + s must be a sequence of SOS constraint names or indices. + Returns the type of the SOS constraints with indices the + members of s. Equivalent to [SOS.get_types(i) for i in s] + + SOS.get_types(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the type of the SOS constraints with indices + between begin and end, inclusive of end. Equivalent to + SOS.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.SOS.add(name = str(i), type = str(i % 2 + 1)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_types(8) + '1' + >>> c.SOS.get_types("1",3) + ['2', '1', '2'] + >>> c.SOS.get_types([2,"0",5]) + ['1', '1', '2'] + >>> c.SOS.get_types() + ['1', '2', '1', '2', '1', '2', '1', '2', '1', '2'] + """ + def gettype(a, b=self.get_num() - 1): + return CPX_PROC.getsos_info(self._env._e, self._cplex._lp, a, b)[0] + t = [i for i in "".join(apply_freeform_two_args( + gettype, self._conv, args))] + return t[0] if len(t) == 1 else t
+ + +
+[docs] + def get_num_members(self, *args): + """Returns the size of a set of special ordered sets. + + Can be called by four forms. + + SOS.get_num_members() + return the number of variables in all SOS constraints from + the problem. + + SOS.get_num_members(i) + i must be a SOS constraint name or index. Returns the + number of variables in the SOS constraint whose index or + name is i. + + SOS.get_num_members(s) + s must be a sequence of SOS constraint names or indices. + Returns the number of variables in the SOS constraints with + indices the members of s. Equivalent to + [SOS.get_num_members(i) for i in s] + + SOS.get_num_members(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the number of variables in the SOS constraints + with indices between begin and end, inclusive of end. + Equivalent to SOS.get_num_members(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.SOS.add(name = str(i), + ... SOS = [range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1,11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_num_members(7) + 8 + >>> c.SOS.get_num_members("1",2) + [1, 2, 3] + >>> c.SOS.get_num_members([3,"1",4]) + [4, 1, 5] + >>> c.SOS.get_num_members() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getsize(a): + return CPX_PROC.getsos_info(self._env._e, self._cplex._lp, a, a)[1] + return apply_freeform_one_arg( + getsize, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of special ordered sets. + + Can be called by four forms. + + SOS.get_names() + return the names of all SOS constraints from the problem. + + SOS.get_names(i) + i must be an SOS constraint index. Returns the name of + SOS constraint i. + + SOS.get_names(s) + s must be a sequence of SOS constraint indices. Returns + the names of the SOS constraints with indices the members + of s. Equivalent to [SOS.get_names(i) for i in s] + + SOS.get_names(begin, end) + begin and end must be SOS constraint indices. Returns the names + of the SOS constraints with indices between begin and end, + inclusive of end. Equivalent to + SOS.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0"]) + >>> [c.SOS.add(name = "sos" + str(i)) for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_names(8) + 'sos9' + >>> c.SOS.get_names(1, 3) + ['sos2', 'sos3', 'sos4'] + >>> c.SOS.get_names([2, 0, 5]) + ['sos3', 'sos1', 'sos6'] + >>> c.SOS.get_names() + ['sos1', 'sos2', 'sos3', 'sos4', 'sos5', 'sos6', 'sos7', 'sos8', 'sos9', 'sos10'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getsosname(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getname, self._conv, args)
+
+ + + +
+[docs] +class EffortLevel(ConstantClass): + """Effort levels associated with a MIP start""" + auto = _constants.CPX_MIPSTART_AUTO + check_feasibility = _constants.CPX_MIPSTART_CHECKFEAS + solve_fixed = _constants.CPX_MIPSTART_SOLVEFIXED + solve_MIP = _constants.CPX_MIPSTART_SOLVEMIP + repair = _constants.CPX_MIPSTART_REPAIR + no_check = _constants.CPX_MIPSTART_NOCHECK
+ + + +
+[docs] +class MIPStartsInterface(BaseInterface): + """Contains methods pertaining to MIP starts.""" + + effort_level = EffortLevel() + """See `EffortLevel()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new MIPStartsInterface. + + The MIP starts interface is exposed by the top-level `Cplex` + class as `Cplex.MIP_starts`. This constructor is not meant to be + used externally. + """ + super().__init__(cplex=cplex, + getindexfunc=CPX_PROC.getmipstartindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of MIP starts currently stored. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(5)]) + >>> c.MIP_starts.get_num() + 5 + """ + return CPX_PROC.getnummipstarts(self._env._e, self._cplex._lp)
+ + +
+[docs] + def read(self, filename): + """Reads MIP starts from a file. + + This method reads a file in the format MST and copies the + information of all the MIP starts contained in that file into a + CPLEX problem object. The parameter cplex.parameters.advance + must be set to cplex.parameters.advance.values.standard, its + default value, or cplex.parameters.advance.values.alternate + in order for the MIP starts to be used. + + Note + If the MIP start file is successfully read, then any + previously existing MIP starts will be deleted. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.MIP_starts.write("test_all.mst") + >>> c.MIP_starts.read("test_all.mst") + """ + CPX_PROC.readcopymipstarts(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def write(self, filename, begin=-1, end=-1): + """Writes a set of MIP starts to a file. + + If called with only a filename, writes all MIP starts to that + file. + + If called with a filename and one index or name of a MIP + start, writes only that MIP start to the file. + + If called with a filename and two indices or names of MIP + starts, writes all MIP starts between the first and second + index or name, inclusive of begin and end, to the file. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(5)]) + >>> c.MIP_starts.write("test_all.mst") + >>> c.MIP_starts.write("test_one.mst", 1) + >>> c.MIP_starts.write("test_four.mst", 1, 4) + """ + if begin == -1 and end == -1: + begin = 0 + end = self.get_num() - 1 + if end == -1: + end = begin + CPX_PROC.writemipstarts(self._env._e, self._cplex._lp, filename, + begin, end)
+ + + def _add(self, *args): + """non-public""" + if len(args) == 1: + for arg in args[0]: + self._add(*arg) + else: + if len(args) == 2: + name = "" + elif len(args) == 3: + name = args[2] + else: + raise WrongNumberOfArgumentsError() + ind, val = unpack_pair(args[0]) + CPX_PROC.addmipstarts( + self._env._e, self._cplex._lp, [0], + self._cplex.variables._conv(ind), + val, [args[1]], [name]) + +
+[docs] + def add(self, *args): + """Adds MIP starts to the problem. + + To add a single MIP start, call this method as + + cpx.MIP_starts.add(start, effort_level, name) + + The first argument, start, must be either a SparsePair + instance or a list of two lists, the first of which contains + variable indices or names, the second of which contains the + values that those variables take. + + The second argument, effort_level, must be an attribute of + MIP_starts.effort_level. + + The third optional argument is the name of the MIP start. + + To add a set of MIP starts, call this method as + + cpx.MIP_starts.add(sequence) + + where sequence is a list or tuple of pairs (start, + effort_level) or triples (start, effort_level, name) as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], + ... types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... cplex.SparsePair(ind = [0], val = [0.0]), + ... c.MIP_starts.effort_level.repair, "first") + >>> indices = c.MIP_starts.add( + ... cplex.SparsePair(ind = [1], val = [0.0]), + ... c.MIP_starts.effort_level.solve_MIP) + >>> indices = c.MIP_starts.add( + ... [([[2, 4], [0.0, 1.0]], + ... c.MIP_starts.effort_level.auto, "third"), + ... ([[3, 4], [1.0, 3.0]], + ... c.MIP_starts.effort_level.check_feasibility)]) + >>> c.MIP_starts.get_num() + 4 + >>> c.MIP_starts.get_names() + ['first', 'm2', 'third', 'm4'] + """ + return self._add_iter(self.get_num, self._add, *args)
+ + +
+[docs] + def change(self, *args): + """Changes a MIP start or set of MIP starts. + + To change a single MIP start, call this method as + + cpx.MIP_starts.change(ID, start, effort_level) + + The first argument, ID, must be an index or name of an + existing MIP start. + + The second argument, start, must be either a SparsePair + instance or a list of two lists, the first of which contains + variable indices or names, the second of which contains the + values that those variables take. If the MIP start identified + by ID already has a value for a variable specified by start, + that value is replaced. + + The third argument, effort_level, must be an attribute of + MIP_starts.effort_level. + + To change multiple MIP starts, call this method as + + cpx.MIP_starts.change(sequence) + + where sequence is a list of tuple of triples (ID, start, + effort_level) as described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = ["x{0}".format(i) for i in range(4)], + ... types = "I" * 4 + ... ) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(3)]) + >>> for s in c.MIP_starts.get_starts(): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [0.0]), 0) + (SparsePair(ind = [2], val = [0.0]), 0) + >>> c.MIP_starts.get_names() + ['m1', 'm2', 'm3'] + >>> check = c.MIP_starts.effort_level.check_feasibility + >>> repair = c.MIP_starts.effort_level.repair + >>> c.MIP_starts.change("m1", [["x0", "x1"], [1.0, 2.0]], check) + >>> c.MIP_starts.get_starts("m1") + (SparsePair(ind = [0, 1], val = [1.0, 2.0]), 1) + >>> c.MIP_starts.change(1, [[1, 2], [-1.0, -2.0]], repair) + >>> c.MIP_starts.get_starts("m2") + (SparsePair(ind = [1, 2], val = [-1.0, -2.0]), 4) + >>> c.MIP_starts.change([(1, [[0, 2], [-1.0, 2.0]], check), + ... ("m3", [["x0", 2], [3.0, 2.0]], repair)]) + >>> for s in c.MIP_starts.get_starts(["m2", "m3"]): + ... print(s) + (SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, 2.0]), 1) + (SparsePair(ind = [0, 2], val = [3.0, 2.0]), 4) + """ + if len(args) == 3: + ind, val = unpack_pair(args[1]) + CPX_PROC.chgmipstarts( + self._env._e, self._cplex._lp, [self._conv(args[0])], [0], + self._cplex.variables._conv(ind), + val, [args[2]]) + elif len(args) == 1: + for arg in args[0]: + self.change(arg[0], arg[1], arg[2]) + else: + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def delete(self, *args): + """Deletes MIP starts from the problem. + + There are four forms by which MIP_starts.delete may be called. + + MIP_starts.delete() + deletes all MIP starts from the problem. + + MIP_starts.delete(i) + i must be a MIP start name or index. Deletes the MIP start + whose index or name is i. + + MIP_starts.delete(s) + s must be a sequence of MIP start names or indices. + Deletes the MIP starts with names or indices contained within + s. Equivalent to [MIP_starts.delete(i) for i in s]. + + MIP_starts.delete(begin, end) + begin and end must be MIP start indices or MIP start names. + Deletes the MIP starts with indices between begin and end, + inclusive of end. Equivalent to + MIP_starts.delete(range(begin, end + 1)). This will give the + best performance when deleting batches of MIP starts. + + See `CPXdelmipstarts <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delmipstarts.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["II"]) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind=['x'], val=[1.0]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.delete(8) + >>> c.MIP_starts.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.MIP_starts.delete("1", 3) + >>> c.MIP_starts.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.MIP_starts.delete([2, "0", 5]) + >>> c.MIP_starts.get_names() + ['4', '6', '7'] + >>> c.MIP_starts.delete() + >>> c.MIP_starts.get_names() + [] + """ + + def _delete(begin, end=None): + CPX_PROC.delmipstarts(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_starts(self, *args): + """Returns a set of MIP starts. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + MIP_starts.get_starts() + return the starting vector for all MIP starts from the + problem. + + MIP_starts.get_starts(i) + i must be a MIP start name or index. Returns the starting + vector for the MIP start whose index or name is i. + + MIP_starts.get_starts(s) + s must be a sequence of MIP start names or indices. + Returns the starting vector for the MIP starts with indices + the members of s. Equivalent to [MIP_starts.get_starts(i) + for i in s] + + MIP_starts.get_starts(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the starting vector for the MIP starts with indices + between begin and end, inclusive of end. Equivalent to + MIP_starts.get_starts(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(11)], + ... types="B" * 11) + >>> indices =c.MIP_starts.add( + ... [(cplex.SparsePair(ind=[i], val=[1.0 * i]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_starts(7) + (SparsePair(ind = [7], val = [7.0]), 0) + >>> for s in c.MIP_starts.get_starts("0", 2): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [1.0]), 0) + (SparsePair(ind = [2], val = [2.0]), 0) + >>> for s in c.MIP_starts.get_starts([2, "0", 5]): + ... print(s) + (SparsePair(ind = [2], val = [2.0]), 0) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [5], val = [5.0]), 0) + >>> c.MIP_starts.delete(3,9) + >>> for s in c.MIP_starts.get_starts(): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [1.0]), 0) + (SparsePair(ind = [2], val = [2.0]), 0) + >>> c.MIP_starts.effort_level[0] + 'auto' + """ + def getmst(a, b=self.get_num() - 1): + ret = CPX_PROC.getmipstarts(self._env._e, self._cplex._lp, a, b) + mat = _HBMatrix() + mat.matbeg = ret[0] + mat.matind = ret[1] + mat.matval = ret[2] + return [(m, ret[3][i]) for (i, m) in enumerate(mat)] + return apply_freeform_two_args(getmst, self._conv, args)
+ + +
+[docs] + def get_effort_levels(self, *args): + """Returns the effort levels for a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_effort_levels() + return the effort level for all MIP starts from the + problem. + + MIP_starts.get_effort_levels(i) + i must be a MIP start name or index. Returns the effort + level for the MIP start whose index or name is i. + + MIP_starts.get_effort_levels(s) + s must be a sequence of MIP start names or indices. + Returns the effort level for the MIP starts with indices + the members of s. Equivalent to + [MIP_starts.get_effort_levels(i) for i in s] + + MIP_starts.get_effort_levels(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the effort level for the MIP starts with indices + between begin and end, inclusive of end. Equivalent to + MIP_starts.get_effort_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(10)], + ... types = "B" * 10) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [1.0 * i]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.change([(1, [[0], [0.0]], c.MIP_starts.effort_level.check_feasibility), + (2, [[0], [0.0]], c.MIP_starts.effort_level.solve_fixed), + (3, [[0], [0.0]], c.MIP_starts.effort_level.solve_MIP), + (4, [[0], [0.0]], c.MIP_starts.effort_level.repair), + (5, [[0], [0.0]], c.MIP_starts.effort_level.no_check)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.effort_level[c.MIP_starts.get_effort_levels(3)] + 'solve_MIP' + >>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels("0",2)] + ['auto', 'check_feasibility', 'solve_fixed'] + >>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels([2,"0",5])] + ['solve_fixed', 'auto', 'no_check'] + >>> c.MIP_starts.get_effort_levels() + [0, 1, 2, 3, 4, 5, 0, 0, 0, 0] + """ + def geteffort(a, b=self.get_num() - 1): + return CPX_PROC.getmipstarts_effort(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(geteffort, self._conv, args)
+ + +
+[docs] + def get_num_entries(self, *args): + """Returns the number of variables specified by a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_num_entries() + return the length of the starting vector for all MIP starts + from the problem. + + MIP_starts.get_num_entries(i) + i must be a MIP start name or index. Returns the length of + the starting vector for the MIP start whose index or name + is i. + + MIP_starts.get_num_entries(s) + s must be a sequence of MIP start names or indices. + Returns the length of the starting vector for the MIP + starts with indices the members of s. Equivalent to + [MIP_starts.get_num_entries(i) for i in s] + + MIP_starts.get_num_entries(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the length of the starting vector for the MIP starts + with indices between begin and end, inclusive of end. + Equivalent to + MIP_starts.get_num_entries(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "B" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = range(i), val = [0.0] * i), + ... c.MIP_starts.effort_level.auto, str(i - 1)) + ... for i in range(1, 11)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_num_entries(3) + 4 + >>> c.MIP_starts.get_num_entries("0",2) + [1, 2, 3] + >>> c.MIP_starts.get_num_entries([2,"0",5]) + [3, 1, 6] + >>> c.MIP_starts.get_num_entries() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getmstsize(a): + return CPX_PROC.getmipstarts_size(self._env._e, self._cplex._lp, a, a) + return apply_freeform_one_arg( + getmstsize, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_names() + return the names of all MIP starts from the problem. + + MIP_starts.get_names(i) + i must be a MIP start index. Returns the name of MIP start i. + + MIP_starts.get_names(s) + s must be a sequence of MIP start indices. Returns the + names of the MIP starts with indices the members of s. + Equivalent to [MIP_starts.get_names(i) for i in s] + + MIP_starts.get_names(begin, end) + begin and end must be MIP start indices. Returns the names of + the MIP starts with indices between begin and end, inclusive of + end. Equivalent to MIP_starts.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "B" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = range(i), val = [0.0] * i), + ... c.MIP_starts.effort_level.auto, "mst" + str(i - 1)) + ... for i in range(1, 11)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_names(8) + 'mst8' + >>> c.MIP_starts.get_names(1, 3) + ['mst1', 'mst2', 'mst3'] + >>> c.MIP_starts.get_names([2, 0, 5]) + ['mst2', 'mst0', 'mst5'] + >>> c.MIP_starts.get_names() + ['mst0', 'mst1', 'mst2', 'mst3', 'mst4', 'mst5', 'mst6', 'mst7', 'mst8', 'mst9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getmipstartname(self._env._e, self._cplex._lp, + a, b) + return apply_freeform_two_args(getname, self._conv, args)
+
+ + + +
+[docs] +class ObjSense(ConstantClass): + """Constants defining the sense of the objective function. + + See `CPXgetobjsen <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getobjsen.html>`_ in the Callable Library Reference + Manual for more detail. + """ + maximize = _constants.CPX_MAX + """See CPX_MAX in the C API.""" + + minimize = _constants.CPX_MIN + """See CPX_MIN in the C API."""
+ + + +
+[docs] +class ObjectiveInterface(BaseInterface): + """Contains methods for querying and modifying the objective function.""" + + sense = ObjSense() + """See `ObjSense()` """ + +
+[docs] + def set_linear(self, *args): + """Changes the linear part of the objective function. + + Can be called by two forms: + + objective.set_linear(var, value) + var must be a variable index or name and value must be a + float. Changes the coefficient of the variable identified + by var to value. + + objective.set_linear(sequence) + sequence is a sequence of pairs (var, value) as described + above. Changes the coefficients for the specified + variables to the given values. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(4)]) + >>> c.objective.get_linear() + [0.0, 0.0, 0.0, 0.0] + >>> c.objective.set_linear(0, 1.0) + >>> c.objective.get_linear() + [1.0, 0.0, 0.0, 0.0] + >>> c.objective.set_linear("3", -1.0) + >>> c.objective.get_linear() + [1.0, 0.0, 0.0, -1.0] + >>> c.objective.set_linear([("2", 2.0), (1, 0.5)]) + >>> c.objective.get_linear() + [1.0, 0.5, 2.0, -1.0] + """ + + def chgobj(a, b): + CPX_PROC.chgobj(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgobj, self._cplex.variables._conv, *args)
+ + +
+[docs] + def set_quadratic(self, *args): + """Sets the quadratic part of the objective function. + + Call this method with a list with length equal to the number + of variables in the problem. + + If the quadratic objective function is separable, the entries + of the list must all be of type float or int. + + If the quadratic objective function is not separable, the + entries of the list must be either SparsePair instances or + lists of two lists, the first of which contains variable + indices or names, the second of which contains the values that + those variables take. + + Note + Successive calls to set_quadratic will overwrite any previous + quadratic objective function. To modify only part of the + quadratic objective function, use the method + set_quadratic_coefficients. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(3)]) + >>> c.objective.set_quadratic( + ... [cplex.SparsePair(ind=[0, 1, 2], val=[1.0, -2.0, 0.5]), + ... cplex.SparsePair(ind=[0, 1], val=[-2.0, -1.0]), + ... cplex.SparsePair(ind=[0, 2], val=[0.5, -3.0])] + ... ) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [0, 1, 2], val = [1.0, -2.0, 0.5]) + SparsePair(ind = [0, 1], val = [-2.0, -1.0]) + SparsePair(ind = [0, 2], val = [0.5, -3.0]) + >>> c.objective.set_quadratic([1.0, 2.0, 3.0]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [2], val = [3.0]) + """ + if len(args) != 1: + raise WrongNumberOfArgumentsError() + if isinstance(args[0], _HBMatrix): + CPX_PROC.copyquad( + self._env._e, self._cplex._lp, args[0].matbeg, + self._cplex.variables._conv(args[0].matind), + args[0].matval) + elif isinstance(args[0][0], numbers.Number): + CPX_PROC.copyqpsep(self._env._e, self._cplex._lp, args[0]) + else: + self.set_quadratic(_HBMatrix(args[0]))
+ + +
+[docs] + def set_quadratic_coefficients(self, *args): + """Sets coefficients of the quadratic component of the objective + function. + + To set a single coefficient, call this method as + + objective.set_quadratic_coefficients(v1, v2, val) + + where v1 and v2 are names or indices of variables and val is + the value for the coefficient. + + To set multiple coefficients, call this method as + + objective.set_quadratic_coefficients(sequence) + + where sequence is a list or tuple of triples (v1, v2, val) as + described above. + + Note + Since the quadratic objective function must be symmetric, each + triple in which v1 is different from v2 is used to set both + the (v1, v2) coefficient and the (v2, v1) coefficient. If + (v1, v2) and (v2, v1) are set with a single call, the second + value is stored. + + Note + Attempting to set many coefficients with set_quadratic_coefficients + can be time consuming. Instead, use the method set_quadratic to set + the quadratic part of the objective efficiently. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1], val = [1.0]) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), + ... (0, 2, 3.0)]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1, 2], val = [1.0, 3.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + SparsePair(ind = [0], val = [3.0]) + >>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), + ... (1, 0, 5.0)]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1, 2], val = [5.0, 3.0]) + SparsePair(ind = [0, 1], val = [5.0, 2.0]) + SparsePair(ind = [0], val = [3.0]) + """ + if len(args) not in (3, 1): + raise WrongNumberOfArgumentsError() + if isinstance(args[0], (str, int)): + arg_list = [args] + else: + arg_list = args[0] + varcache = {} + for i, j, val in arg_list: + CPX_PROC.chgqpcoef(self._env._e, self._cplex._lp, + self._cplex.variables._conv(i, varcache), + self._cplex.variables._conv(j, varcache), + val)
+ + +
+[docs] + def set_sense(self, sense): + """Sets the sense of the objective function. + + The argument to this method must be either + objective.sense.minimize or objective.sense.maximize. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + >>> c.objective.set_sense(c.objective.sense.maximize) + >>> c.objective.sense[c.objective.get_sense()] + 'maximize' + >>> c.objective.set_sense(c.objective.sense.minimize) + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + """ + CPX_PROC.chgobjsen(self._env._e, self._cplex._lp, sense)
+ + +
+[docs] + def set_name(self, name): + """Sets the name of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_name("cost") + >>> c.objective.get_name() + 'cost' + """ + CPX_PROC.copyobjname(self._env._e, self._cplex._lp, name)
+ + +
+[docs] + def get_linear(self, *args): + """Returns the linear coefficients of a set of variables. + + Can be called by four forms. + + objective.get_linear() + return the linear objective coefficients of all variables + from the problem. + + objective.get_linear(i) + i must be a variable name or index. Returns the linear + objective coefficient of the variable whose index or name + is i. + + objective.get_linear(s) + s must be a sequence of variable names or indices. Returns + the linear objective coefficient of the variables with + indices the members of s. Equivalent to + [objective.get_linear(i) for i in s] + + objective.get_linear(begin, end) + begin and end must be variable indices or variable names. + Returns the linear objective coefficient of the variables with + indices between begin and end, inclusive of end. Equivalent to + objective.get_linear(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.objective.get_linear(8) + 12.0 + >>> c.objective.get_linear("1",3) + [1.5, 3.0, 4.5] + >>> c.objective.get_linear([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.objective.get_linear() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getobj(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getobj(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getobj, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_quadratic(self, *args): + """Returns a set of columns of the quadratic component of the + objective function. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + objective.get_quadratic() + return the entire quadratic objective function. + + objective.get_quadratic(i) + i must be a variable name or index. Returns the column of + the quadratic objective function associated with the + variable whose index or name is i. + + objective.get_quadratic(s) + s must be a sequence of variable names or indices. Returns + the columns of the quadratic objective function associated + with the variables with indices the members of s. + Equivalent to [objective.get_quadratic(i) for i in s] + + objective.get_quadratic(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the quadratic objective function + associated with the variables with indices between begin and + end, inclusive of end. Equivalent to + objective.get_quadratic(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.objective.set_quadratic([1.5 * i for i in range(10)]) + >>> c.objective.get_quadratic(8) + SparsePair(ind = [8], val = [12.0]) + >>> for q in c.objective.get_quadratic("1", 3): + ... print(q) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [2], val = [3.0]) + SparsePair(ind = [3], val = [4.5]) + >>> for q in c.objective.get_quadratic([3, "1", 5]): + ... print(q) + SparsePair(ind = [3], val = [4.5]) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [5], val = [7.5]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [], val = []) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [2], val = [3.0]) + SparsePair(ind = [3], val = [4.5]) + SparsePair(ind = [4], val = [6.0]) + SparsePair(ind = [5], val = [7.5]) + SparsePair(ind = [6], val = [9.0]) + SparsePair(ind = [7], val = [10.5]) + SparsePair(ind = [8], val = [12.0]) + SparsePair(ind = [9], val = [13.5]) + """ + num = self._cplex.variables.get_num() + + def getquad(begin, end=num - 1): + mat = _HBMatrix() + t = CPX_PROC.getquad(self._env._e, self._cplex._lp, begin, end) + mat.matbeg, mat.matind, mat.matval = t + return [m for m in mat] + return apply_freeform_two_args( + getquad, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_quadratic_coefficients(self, *args): + """Returns individual coefficients from the quadratic objective function. + + To query a single coefficient, call this as + + objective.get_quadratic_coefficients(v1, v2) + + where v1 and v2 are indices or names of variables. + + To query multiple coefficients, call this method as + + objective.get_quadratic_coefficients(sequence) + + where sequence is a list or tuple of pairs (v1, v2) as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_quadratic_coefficients("1", 0) + 1.0 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0), (1, 0, 5.0)]) + >>> c.objective.get_quadratic_coefficients([(1, 0), (1, "1"), (2, "0")]) + [5.0, 2.0, 3.0] + """ + def getqpcoef(v1, v2): + return CPX_PROC.getqpcoef(self._env._e, self._cplex._lp, v1, v2) + if len(args) == 2: + indices = self._cplex.variables._conv(args) + return getqpcoef(indices[0], indices[1]) + if len(args) == 1: + return [self.get_quadratic_coefficients(*arg) for arg in args[0]] + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def get_sense(self): + """Returns the sense of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + >>> c.objective.set_sense(c.objective.sense.maximize) + >>> c.objective.sense[c.objective.get_sense()] + 'maximize' + >>> c.objective.set_sense(c.objective.sense.minimize) + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + """ + return CPX_PROC.getobjsen(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_name(self): + """Returns the name of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_name("cost") + >>> c.objective.get_name() + 'cost' + """ + return CPX_PROC.getobjname(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_quadratic_variables(self): + """Returns the number of variables with quadratic coefficients. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_num_quadratic_variables() + 2 + >>> c.objective.set_quadratic([1.0, 0.0, 0.0]) + >>> c.objective.get_num_quadratic_variables() + 1 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)]) + >>> c.objective.get_num_quadratic_variables() + 3 + """ + return CPX_PROC.getnumquad(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_quadratic_nonzeros(self): + """Returns the number of nonzeros in the quadratic objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_num_quadratic_nonzeros() + 2 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)]) + >>> c.objective.get_num_quadratic_nonzeros() + 5 + >>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), (1, 0, 0.0)]) + >>> c.objective.get_num_quadratic_nonzeros() + 3 + """ + return CPX_PROC.getnumqpnz(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_offset(self): + """Returns the constant offset of the objective function for a problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> offset = c.objective.get_offset() + >>> abs(offset - 0.0) < 1e-6 + True + """ + return CPX_PROC.getobjoffset(self._env._e, self._cplex._lp)
+ + +
+[docs] + def set_offset(self, offset): + """Sets the constant offset of the objective function for a problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_offset(3.14) + >>> offset = c.objective.get_offset() + >>> abs(offset - 3.14) < 1e-6 + True + """ + return CPX_PROC.chgobjoffset(self._env._e, self._cplex._lp, offset)
+
+ + + +
+[docs] +class ProgressInterface(BaseInterface): + """Methods to query the progress of optimization.""" + +
+[docs] + def __init__(self, parent): + """Creates a new ProgressInterface. + + The progress interface is exposed by the top-level `Cplex` + class as Cplex.solution.progress. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations executed so far. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_iterations() + """ + if self._cplex._is_MIP(): + return CPX_PROC.getmipitcnt(self._env._e, self._cplex._lp) + siftcnt = CPX_PROC.getsiftitcnt(self._env._e, self._cplex._lp) + if siftcnt > 0: + return siftcnt + baritcnt = CPX_PROC.getbaritcnt(self._env._e, self._cplex._lp) + if baritcnt > 0: + return baritcnt + return CPX_PROC.getitcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_barrier_iterations(self): + """Returns the number of barrier iterations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_barrier_iterations() + """ + return CPX_PROC.getbaritcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_sifting_iterations(self): + """Returns the number of sifting iterations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting) + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_sifting_iterations() + """ + return CPX_PROC.getsiftitcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_phase_one_iterations(self): + """Returns the number of iterations to find a feasible solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_phase_one_iterations() + """ + return CPX_PROC.getphase1cnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_sifting_phase_one_iterations(self): + """Returns the number of sifting iterations to find a feasible solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting) + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_sifting_phase_one_iterations() + """ + return CPX_PROC.getsiftphase1cnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_nodes_processed(self): + """Returns the number of nodes processed. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num_nodes = c.solution.progress.get_num_nodes_processed() + """ + return CPX_PROC.getnodecnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_nodes_remaining(self): + """Returns the number of nodes left to process. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num_nodes = c.solution.progress.get_num_nodes_remaining() + """ + return CPX_PROC.getnodeleftcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_push(self): + """Returns the number of primal push operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_push = c.solution.progress.get_num_primal_push() + """ + return CPX_PROC.getcrossppushcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_exchange(self): + """Returns the number of primal exchange operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_exch = c.solution.progress.get_num_primal_exchange() + """ + return CPX_PROC.getcrosspexchcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_push(self): + """Returns the number of dual push operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_push = c.solution.progress.get_num_dual_push() + """ + return CPX_PROC.getcrossdpushcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_exchange(self): + """Returns the number of dual exchange operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_exch = c.solution.progress.get_num_dual_exchange() + """ + return CPX_PROC.getcrossdexchcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_conflict_passes(self): + """Returns the number of passes performed by the conflict + refiner. + + See `CPXgetconflictnumpasses <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictnumpasses.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine() + >>> c.solution.progress.get_num_conflict_passes() + 5 + """ + return CPX_PROC.getconflictnumpasses(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class InfeasibilityInterface(BaseInterface): + """Methods for computing degree of infeasibility in a solution vector. + + Each of these methods takes one required argument, x, which must + be a list of floats with length equal to the number of variables. + + If no other arguments are provided, the methods return the + violation for all constraints of the given type. + + If one string or integer is provided, it is taken to be the name + or index of a constraint of the given type. The methods return + the violation of that constraint. + + If two strings or integers are provided, they are taken to be the + names or indices of constraints of the given type. All violations + for constraints between the first and second, inclusive, are + returned in a list. + + If a sequence of strings or integers are provided, they are taken + to be the names or indices of constraints of the given type. All + violations for constraints identified in the sequence are returned + in a list. + """ + +
+[docs] + def __init__(self, parent): + """Creates a new InfeasibilityInterface. + + The infeasibility interface is exposed by the top-level `Cplex` + class as Cplex.solution.infeasibility. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def bound_constraints(self, x, *args): + """Returns the amount by which variable bounds are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), 2) + 0.0 + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), "x10") + 0.0 + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), ["x10", 8]) + [0.0, 0.0] + >>> bd = c.solution.infeasibility.bound_constraints(c.solution.get_values()) + >>> bd[15] + 0.0 + """ + def getinfeas(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getcolinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.variables._conv, args)
+ + +
+[docs] + def linear_constraints(self, x, *args): + """Returns the amount by which a set of linear constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> sol_vals = c.solution.get_values() + >>> getrowinfeas = c.solution.infeasibility.linear_constraints + >>> abs(getrowinfeas(sol_vals, "c10")) + 0.0 + >>> abs(getrowinfeas(sol_vals, 7)) + 0.0 + >>> [abs(x) for x in getrowinfeas(sol_vals, ["c13", 4])] + [0.0, 0.0] + >>> lconstraint = getrowinfeas(sol_vals) + >>> abs(lconstraint[5]) + 0.0 + + """ + def getinfeas(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getrowinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def quadratic_constraints(self, x, *args): + """Returns the amount by which a set of quadratic constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> getqconstrinfeas = c.solution.infeasibility.quadratic_constraints + >>> abs(getqconstrinfeas(c.solution.get_values(), 2)) < 1e-6 + True + >>> abs(getqconstrinfeas(c.solution.get_values(), "QC3")) < 1e-6 + True + >>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values(), [1, "QC1"])] + [True, True] + >>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values())] + [True, True, True, True] + + """ + def getinfeas(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getqconstrinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def indicator_constraints(self, x, *args): + """Returns the amount by which indicator constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), 3) + 0.0 + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), "c21") + 0.0 + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), ["c21", 10]) + [0.0, 0.0] + >>> iconstraint = c.solution.infeasibility.indicator_constraints(c.solution.get_values()) + >>> iconstraint[5] + 0.0 + """ + def getinfeas(a, b=self._cplex.indicator_constraints.get_num() - 1): + return CPX_PROC.getindconstrinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.indicator_constraints._conv, args)
+ + +
+[docs] + def SOS_constraints(self, x, *args): + """Returns the amount by which SOS constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), 0) + 0.0 + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), "set1") + 0.0 + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), ["set1", 0]) + [0.0, 0.0] + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values()) + [0.0] + """ + def getinfeas(a, b=self._cplex.SOS.get_num() - 1): + return CPX_PROC.getsosinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.SOS._conv, args)
+
+ + + +
+[docs] +class CutType(ConstantClass): + """Identifiers for types of cuts.""" + # NB: If you edit these, look at MIPInfoCallback.cut_type too! + cover = _constants.CPX_CUT_COVER + GUB_cover = _constants.CPX_CUT_GUBCOVER + flow_cover = _constants.CPX_CUT_FLOWCOVER + clique = _constants.CPX_CUT_CLIQUE + fractional = _constants.CPX_CUT_FRAC + MIR = _constants.CPX_CUT_MIR + flow_path = _constants.CPX_CUT_FLOWPATH + disjunctive = _constants.CPX_CUT_DISJ + implied_bound = _constants.CPX_CUT_IMPLBD + zero_half = _constants.CPX_CUT_ZEROHALF + multi_commodity_flow = _constants.CPX_CUT_MCF + _local_cover = _constants.CPX_CUT_LOCALCOVER + _tighten = _constants.CPX_CUT_TIGHTEN + _objective_disjunctive = _constants.CPX_CUT_OBJDISJ + lift_and_project = _constants.CPX_CUT_LANDP + user = _constants.CPX_CUT_USER + table = _constants.CPX_CUT_TABLE + solution_pool = _constants.CPX_CUT_SOLNPOOL + local_implied_bound = _constants.CPX_CUT_LOCALIMPLBD + BQP = _constants.CPX_CUT_BQP + RLT = _constants.CPX_CUT_RLT + benders = _constants.CPX_CUT_BENDERS + __num_types = _constants.CPX_CUT_NUM_TYPES
+ + + +
+[docs] +class MIPSolutionInterface(BaseInterface): + """Methods for accessing solutions to a MIP.""" + + cut_type = CutType() + """See `CutType()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new MIPSolutionInterface. + + The MIP solution interface is exposed by the top-level `Cplex` + class as Cplex.solution.MIP. This constructor is not meant to + be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_best_objective(self): + """Returns the currently best known bound of all the remaining + open nodes in a branch-and-cut tree. + + It is computed for a minimization problem as the minimum + objective function value of all remaining unexplored nodes. + Similarly, it is computed for a maximization problem as the + maximum objective function value of all remaining unexplored + nodes. + + For a regular MIP optimization, this value is also the best known + bound on the optimal solution value of the MIP problem. In fact, + when a problem has been solved to optimality, this value matches + the optimal solution value. + + However, for the populate method, the value can also exceed the + optimal solution value if CPLEX has already solved the model to + optimality but continues to search for additional solutions. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> best_obj = c.solution.MIP.get_best_objective() + >>> abs(best_obj - 499.0) < 1e-6 + True + """ + return CPX_PROC.getbestobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_cutoff(self): + """Returns the MIP cutoff value. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> cutoff = c.solution.MIP.get_cutoff() + >>> abs(cutoff - 499.0) < 1e-6 + True + """ + return CPX_PROC.getcutoff(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_mip_relative_gap(self): + """Returns the MIP relative gap. + + See `CPXgetmiprelgap <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/getmiprelgap.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.MIP.get_mip_relative_gap() + 0.0 + """ + return CPX_PROC.getmiprelgap(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_incumbent_node(self): + """Returns the node number of the best solution found. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.threads.set(1) + >>> c.solve() + >>> c.solution.MIP.get_incumbent_node() >= 0 + True + + """ + return CPX_PROC.getnodeint(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_cuts(self, cut_type): + """Returns the number of cuts of the specified type. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> ncuts = c.solution.MIP.get_num_cuts( + ... c.solution.MIP.cut_type.zero_half) + + """ + return CPX_PROC.getnumcuts(self._env._e, self._cplex._lp, cut_type)
+ + +
+[docs] + def get_subproblem_status(self): + """Returns the solution status of the last subproblem optimization. + + Returns an attribute of Cplex.solution.status if there was an + error termination where a subproblem could not be solved to + completion during mixed integer optimization. Otherwise 0 + (zero) is returned if no error occurred. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.MIP.get_subproblem_status() + 0 + """ + return CPX_PROC.getsubstat(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class BasisVarStatus(ConstantClass): + """Status values returned by basis query methods.""" + at_lower_bound = _constants.CPX_AT_LOWER + basic = _constants.CPX_BASIC + at_upper_bound = _constants.CPX_AT_UPPER + free_nonbasic = _constants.CPX_FREE_SUPER
+ + + +
+[docs] +class BasisInterface(BaseInterface): + """Methods for accessing the basis of a solution.""" + + status = BasisVarStatus() + """See `BasisVarStatus()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new BasisInterface. + + The basis interface is exposed by the top-level `Cplex` class as + Cplex.solution.basis. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_basis(self): + """Returns the status of structural and slack variables. + + Returns a pair of lists of attributes of solution.basis.status. + The first lists the status of the structural variables (of length + equal to the number of variables), the second lists the status of + the slack variables (of length equal to the number of linear + constraints). + + See `CPXgetbase <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getbase.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> pair_of_lists = c.solution.basis.get_basis() + """ + return CPX_PROC.getbase(self._env._e, self._cplex._lp)
+ + +
+[docs] + def write(self, filename): + """Writes the basis to a file. + + See `CPXmbasewrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/mbasewrite.html>`_ in the Callable Library Reference + Manual and also `InitialInterface.read_basis()`. + + Example: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.basis.write("lpex.bas") + """ + CPX_PROC.mbasewrite(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def get_header(self): + """Returns the basis header. + + Returns a pair (head, x), where head is a list of variable + indices and x is a list of floats indicating the values of + those variables. Indices of basic slacks are specified by + -rowindex - 1. + """ + return CPX_PROC.getbhead(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_basic_row_index(self, row): + """Returns the position of a basic slack variable in the basis header. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.basis.get_basic_row_index(2) + 3 + """ + return CPX_PROC.getijrow(self._env._e, self._cplex._lp, row, True)
+ + +
+[docs] + def get_basic_col_index(self, col): + """Returns the position of a basic structural variable in the basis header. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.basis.get_basic_col_index(2) + 1 + """ + return CPX_PROC.getijrow(self._env._e, self._cplex._lp, col, False)
+ + +
+[docs] + def get_primal_norms(self): + """Returns norms from the primal steepest edge. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.parameters.simplex.pgradient.set(c.parameters.simplex.pgradient.values.steep) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal) + >>> c.solve() + >>> pnorm = c.solution.basis.get_primal_norms() + >>> for i, j in zip(pnorm[1], [1.722656, 1.691406, 2.0, 1.062499]): + ... abs(i - j) < 1e-6 + ... + True + True + True + True + """ + return CPX_PROC.getpnorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_dual_norms(self): + """Returns norms from the dual steepest edge. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.solve() + >>> c.solution.basis.get_dual_norms() + ([1.0, 1.0, 1.0, 1.0], [1, 2, 3, -3]) + """ + return CPX_PROC.getdnorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_basis_dual_norms(self): + """Returns basis and dual norms. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.solve() + >>> c.solution.basis.get_basis_dual_norms() + ([2, 1, 1, 1], [0, 0, 1, 0], [1.0, 1.0, 1.0, 1.0]) + """ + return CPX_PROC.getbasednorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_superbasic(self): + """Returns the number of primal superbasic variables. + + """ + return CPX_PROC.getpsbcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_superbasic(self): + """Returns the number of primal superbasic variables. + + """ + return CPX_PROC.getdsbcnt(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class SensitivityInterface(BaseInterface): + """Methods for sensitivity analysis.""" + +
+[docs] + def __init__(self, parent): + """Creates a new SensitivityInterface. + + The sensitivity interface is exposed by the top-level `Cplex` + class as Cplex.solution.sensitivity. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def lower_bounds(self, *args): + """Returns the sensitivity of a set of lower bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.lower_bounds(1) + (-1e+20, 17.5) + >>> c.solution.sensitivity.lower_bounds('x3') + (-1e+20, 42.5) + >>> c.solution.sensitivity.lower_bounds(["x3", 0]) + [(-1e+20, 42.5), (-1e+20, 40.0)] + >>> c.solution.sensitivity.lower_bounds() + [(-1e+20, 40.0), (-1e+20, 17.5), (-1e+20, 42.5), (-1e+20, 0.625)] + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa_lower(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def upper_bounds(self, *args): + """Returns the sensitivity of a set of upper bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.upper_bounds(1) + (17.5, 1e+20) + >>> c.solution.sensitivity.upper_bounds("x3") + (42.5, 1e+20) + >>> bupper = c.solution.sensitivity.upper_bounds(["x3", 0]) + >>> for i, j in zip(bupper, [(42.5, 1e+20), (36.428571, 155.0)]): + ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 + ... + True + True + >>> bupper = c.solution.sensitivity.upper_bounds() + >>> for i, j in zip(bupper[3], (0.625, 1e+20)): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa_upper(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def bounds(self, *args): + """Returns the sensitivity of a set of both lower and upper bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.bounds(1) + (-1e+20, 17.5, 17.5, 1e+20) + >>> c.solution.sensitivity.bounds("x3") + (-1e+20, 42.5, 42.5, 1e+20) + >>> c.solution.sensitivity.bounds(["x3", 1]) + [(-1e+20, 42.5, 42.5, 1e+20), (-1e+20, 17.5, 17.5, 1e+20)] + >>> bd = c.solution.sensitivity.bounds() + >>> bd[1] + (-1e+20, 17.5, 17.5, 1e+20) + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def objective(self, *args): + """Returns the sensitivity of part of the objective function. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.objective(1) + (-3.0, 5.0) + >>> c.solution.sensitivity.objective("x3") + (-1e+20, -2.0) + >>> c.solution.sensitivity.objective(["x3", 1]) + [(-1e+20, -2.0), (-3.0, 5.0)] + >>> c.solution.sensitivity.objective() + [(-1e+20, 2.5), (-3.0, 5.0), (-1e+20, -2.0), (0.0, 4.0)] + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.objsa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def rhs(self, *args): + """Returns the sensitivity of the righthand side of a set of linear constraints. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> rhssa = c.solution.sensitivity.rhs(1) + >>> for i, j in zip(rhssa, (20.0, 46.666666)): + ... abs(i - j) < 1e-6 + ... + True + True + >>> c.solution.sensitivity.rhs("c3") + (-1e+20, 112.5) + >>> rhssa = c.solution.sensitivity.rhs(["c3", 1]) + >>> for i, j in zip(rhssa, [(-1e+20, 112.5), (20.0, 46.666666)]): + ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 + ... + True + True + >>> rhssa = c.solution.sensitivity.rhs() + >>> for i, j in zip(rhssa[3], (-1e+20, 42.5)): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def sa(a, b=self._cplex.linear_constraints.get_num() - 1): + return unzip(CPX_PROC.rhssa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.linear_constraints._conv, args)
+
+ + + +
+[docs] +class FilterType(ConstantClass): + """Attributes define the filter types.""" + diversity = _constants.CPX_SOLNPOOL_FILTER_DIVERSITY + range = _constants.CPX_SOLNPOOL_FILTER_RANGE
+ + + +
+[docs] +class SolnPoolFilterInterface(BaseInterface): + """Methods for solution pool filters.""" + + type = FilterType() + """See `FilterType()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new SolnPoolFilterInterface. + + The solution pool filter interface is exposed by the top-level + `Cplex` class as Cplex.solution.pool.filter. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True, + getindexfunc=CPX_PROC.getsolnpoolfilterindex)
+ + + def _add_diversity_filter(self, lb, ub, expression, weights, name): + """non-public""" + ind, val = unpack_pair(expression) + validate_arg_lengths( + [ind, val, weights], + extra_msg=": expression, weights" + ) + CPX_PROC.addsolnpooldivfilter( + self._env._e, self._cplex._lp, lb, ub, + self._cplex.variables._conv(ind), + weights, val, name) + +
+[docs] + def add_diversity_filter(self, lb, ub, expression, weights=None, + name=''): + """Adds a diversity filter to the solution pool. + + The arguments determine, in order, + + the lower bound (float) + + the upper bound (float) + + the variables and values it takes as either a SparsePair or a + list of two lists. + + a set of weights (a list of floats with the same length as + expression). If an empty list is given, then weights of 1.0 + (one) will be used. + + name (string) + + Returns the index of the added diversity filter. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_diversity_filter( + ... 300, 600, [['x1','x2'], [1,1]], [2,1], "") + 0 + """ + (weights,) = init_list_args(weights) + return self._add_single(self.get_num, self._add_diversity_filter, + lb, ub, expression, weights, name)
+ + + def _add_range_filter(self, lb, ub, expression, name): + """non-public""" + ind, val = unpack_pair(expression) + CPX_PROC.addsolnpoolrngfilter( + self._env._e, self._cplex._lp, lb, ub, + self._cplex.variables._conv(ind), + val, name) + +
+[docs] + def add_range_filter(self, lb, ub, expression, name=''): + """Adds a range filter to the solution pool. + + The arguments determine, in order, + + the lower bound (float) + + the upper bound (float) + + the variables and values it takes as either a SparsePair or a + list of two lists. + + name (string) + + Returns the index of the added range filter. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + """ + return self._add_single(self.get_num, self._add_range_filter, + lb, ub, expression, name)
+ + +
+[docs] + def get_diversity_filters(self, *args): + """Returns a set of diversity filters. + + Returns filters as pairs of (SparsePair, weights), where + weights is a list of floats. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["BB"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], str(i)) + ... for i in range(2)] + [0, 1] + >>> c.solution.pool.filter.get_diversity_filters(0) + (SparsePair(ind = [0], val = [1.0]), [1.0]) + >>> c.solution.pool.filter.get_diversity_filters("1") + (SparsePair(ind = [0], val = [1.0]), [1.0]) + >>> c.solution.pool.filter.get_diversity_filters([0, "1"]) + [(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])] + >>> c.solution.pool.filter.get_diversity_filters() + [(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])] + """ + def getflt(a): + ret = CPX_PROC.getsolnpooldivfilter( + self._env._e, self._cplex._lp, a) + return (SparsePair(ret[2], ret[4]), ret[3]) + return apply_freeform_one_arg( + getflt, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_range_filters(self, *args): + """Returns a set of range filters. + + Returns filters as SparsePair instances. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(2)] + [0, 1] + >>> c.solution.pool.filter.get_range_filters(0) + SparsePair(ind = [0], val = [1.0]) + >>> c.solution.pool.filter.get_range_filters("1") + SparsePair(ind = [0], val = [1.0]) + >>> c.solution.pool.filter.get_range_filters([0, "1"]) + [SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])] + >>> c.solution.pool.filter.get_range_filters() + [SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])] + """ + def getflt(a): + ret = CPX_PROC.getsolnpoolrngfilter( + self._env._e, self._cplex._lp, a) + return SparsePair(ret[2], ret[3]) + return apply_freeform_one_arg( + getflt, self._conv, self.get_num(), args)
+ + + def _getfilter_constant(self, which): + filter_type = self.get_types(which) + if filter_type == self.type.diversity: + func = CPX_PROC.getsolnpooldivfilter_constant + else: + assert filter_type == self.type.range + func = CPX_PROC.getsolnpoolrngfilter_constant + return func(self._env._e, self._cplex._lp, which) + +
+[docs] + def get_bounds(self, *args): + """Returns (lb, ub) pairs for a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["BB"]) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], "div{0}".format(i)) for i in range(2)] + [0, 1] + >>> [c.solution.pool.filter.add_range_filter( + ... 0, 1, f, "rng{0}".format(i)) for i in range(2)] + [2, 3] + >>> c.solution.pool.filter.get_bounds(0) + (0.0, 1.0) + >>> c.solution.pool.filter.get_bounds("rng0") + (0.0, 1.0) + >>> c.solution.pool.filter.get_bounds(["div0", 2]) + [(0.0, 1.0), (0.0, 1.0)] + >>> c.solution.pool.filter.get_bounds() + [(0.0, 1.0), (0.0, 1.0), (0.0, 1.0), (0.0, 1.0)] + """ + def getbds(which): + lb, ub, _ = self._getfilter_constant(which) + return (lb, ub) + return apply_freeform_one_arg( + getbds, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_num_nonzeros(self, *args): + """Returns the number of variables specified by a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["BB"]) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], "div{0}".format(i)) for i in range(2)] + [0, 1] + >>> [c.solution.pool.filter.add_range_filter( + ... 0, 1, f, "rng{0}".format(i)) for i in range(2)] + [2, 3] + >>> c.solution.pool.filter.get_num_nonzeros(0) + 1 + >>> c.solution.pool.filter.get_num_nonzeros("rng0") + 1 + >>> c.solution.pool.filter.get_num_nonzeros(["div0", 2]) + [1, 1] + >>> c.solution.pool.filter.get_num_nonzeros() + [1, 1, 1, 1] + """ + def getnnz(which): + _, _, nnz = self._getfilter_constant(which) + return nnz + return apply_freeform_one_arg( + getnnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def delete(self, *args): + """Deletes filters from the problem. + + There are four forms by which filters.delete may be called. + + filters.delete() + deletes all filters from the problem. + + filters.delete(i) + i must be a filter name or index. Deletes the filter whose + index or name is i. + + filters.delete(s) + s must be a sequence of filter names or indices. Deletes + the filters with names or indices contained within s. + Equivalent to [filters.delete(i) for i in s]. + + filters.delete(begin, end) + begin and end must be filter indices or filter names. Deletes + the filters with indices between begin and end, inclusive of + end. Equivalent to filters.delete(range(begin, end + 1)). This + will give the best performance when deleting batches of + filters. + + See `CPXdelsolnpoolfilters <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsolnpoolfilters.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=['II']) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_num() + 10 + >>> c.solution.pool.filter.delete(8) + >>> c.solution.pool.filter.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.solution.pool.filter.delete('1', 3) + >>> c.solution.pool.filter.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.solution.pool.filter.delete([2, '0', 5]) + >>> c.solution.pool.filter.get_names() + ['4', '6', '7'] + >>> c.solution.pool.filter.delete() + >>> c.solution.pool.filter.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsolnpoolfilters(self._env._e, self._cplex._lp, + begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the types of a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_types(3) + 2 + >>> c.solution.pool.filter.get_types("5") + 2 + >>> c.solution.pool.filter.get_types([2, "8"]) + [2, 2] + >>> c.solution.pool.filter.get_types() + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] + """ + def gettype(a): + return CPX_PROC.getsolnpoolfiltertype(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + gettype, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of filters, given their indices. + + There are four forms by which solution.pool.filter.get_names may be called. + + solution.pool.filter.get_names() + return the names of all solution pool filters from the problem. + + solution.pool.filter.get_names(i) + i must be a solution filter index. Returns the name of row i. + + solution.pool.filter.get_names(s) + s must be a sequence of row indices. Returns the names of + the solution pool filters with indices the members of s. + Equivalent to [solution.pool.filter.get_names(i) for i in s] + + solution.pool.filter.get_names(begin, end) + begin and end must be solution filter indices. Returns the + names of the solution pool filter with indices between begin + and end, inclusive of end. Equivalent to + solution.pool.filter.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + >>> c.solution.pool.filter.get_names(6) + '6' + >>> c.solution.pool.filter.get_names([5, 3]) + ['5', '3'] + >>> c.solution.pool.filter.get_names(3, 5) + ['3', '4', '5'] + """ + def getname(a): + return CPX_PROC.getsolnpoolfiltername( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+ + +
+[docs] + def write(self, filename): + """Writes the filters to a file. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.write("ind.flt") + """ + CPX_PROC.fltwrite(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def read(self, filename): + """Reads filters from a file. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.write("ind.flt") + >>> c.solution.pool.filter.read("ind.flt") + """ + CPX_PROC.readcopysolnpoolfilters(self._env._e, self._cplex._lp, + filename)
+ + +
+[docs] + def get_num(self): + """Returns the number of filters in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.get_num() + 1 + """ + return CPX_PROC.getsolnpoolnumfilters(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class QualityMetric(ConstantClass): + """Measures of solution quality.""" + max_primal_infeasibility = _constants.CPX_MAX_PRIMAL_INFEAS + max_scaled_primal_infeasibility = _constants.CPX_MAX_SCALED_PRIMAL_INFEAS + sum_primal_infeasibilities = _constants.CPX_SUM_PRIMAL_INFEAS + sum_scaled_primal_infeasibilities = _constants.CPX_SUM_SCALED_PRIMAL_INFEAS + max_dual_infeasibility = _constants.CPX_MAX_DUAL_INFEAS + max_scaled_dual_infeasibility = _constants.CPX_MAX_SCALED_DUAL_INFEAS + sum_dual_infeasibilities = _constants.CPX_SUM_DUAL_INFEAS + sum_scaled_dual_infeasibilities = _constants.CPX_SUM_SCALED_DUAL_INFEAS + max_int_infeasibility = _constants.CPX_MAX_INT_INFEAS + sum_integer_infeasibilities = _constants.CPX_SUM_INT_INFEAS + max_primal_residual = _constants.CPX_MAX_PRIMAL_RESIDUAL + max_scaled_primal_residual = _constants.CPX_MAX_SCALED_PRIMAL_RESIDUAL + sum_primal_residual = _constants.CPX_SUM_PRIMAL_RESIDUAL + sum_scaled_primal_residual = _constants.CPX_SUM_SCALED_PRIMAL_RESIDUAL + max_dual_residual = _constants.CPX_MAX_DUAL_RESIDUAL + max_scaled_dual_residual = _constants.CPX_MAX_SCALED_DUAL_RESIDUAL + sum_dual_residual = _constants.CPX_SUM_DUAL_RESIDUAL + sum_scaled_dual_residual = _constants.CPX_SUM_SCALED_DUAL_RESIDUAL + max_comp_slack = _constants.CPX_MAX_COMP_SLACK + sum_comp_slack = _constants.CPX_SUM_COMP_SLACK + max_x = _constants.CPX_MAX_X + max_scaled_x = _constants.CPX_MAX_SCALED_X + max_pi = _constants.CPX_MAX_PI + max_scaled_pi = _constants.CPX_MAX_SCALED_PI + max_slack = _constants.CPX_MAX_SLACK + max_scaled_slack = _constants.CPX_MAX_SCALED_SLACK + max_reduced_cost = _constants.CPX_MAX_RED_COST + max_scaled_reduced_cost = _constants.CPX_MAX_SCALED_RED_COST + sum_x = _constants.CPX_SUM_X + sum_scaled_x = _constants.CPX_SUM_SCALED_X + sum_pi = _constants.CPX_SUM_PI + sum_scaled_pi = _constants.CPX_SUM_SCALED_PI + sum_slack = _constants.CPX_SUM_SLACK + sum_scaled_slack = _constants.CPX_SUM_SCALED_SLACK + sum_reduced_cost = _constants.CPX_SUM_RED_COST + sum_scaled_reduced_cost = _constants.CPX_SUM_SCALED_RED_COST + kappa = _constants.CPX_KAPPA + objective_gap = _constants.CPX_OBJ_GAP + dual_objective = _constants.CPX_DUAL_OBJ + primal_objective = _constants.CPX_PRIMAL_OBJ + max_quadratic_primal_residual = _constants.CPX_MAX_QCPRIMAL_RESIDUAL + sum_quadratic_primal_residual = _constants.CPX_SUM_QCPRIMAL_RESIDUAL + max_quadratic_slack_infeasibility = _constants.CPX_MAX_QCSLACK_INFEAS + sum_quadratic_slack_infeasibility = _constants.CPX_SUM_QCSLACK_INFEAS + max_quadratic_slack = _constants.CPX_MAX_QCSLACK + sum_quadratic_slack = _constants.CPX_SUM_QCSLACK + max_indicator_slack_infeasibility = _constants.CPX_MAX_INDSLACK_INFEAS + sum_indicator_slack_infeasibility = _constants.CPX_SUM_INDSLACK_INFEAS + max_pwl_slack_infeasibility = _constants.CPX_MAX_PWLSLACK_INFEAS + sum_pwl_slack_infeasibility = _constants.CPX_SUM_PWLSLACK_INFEAS + exact_kappa = _constants.CPX_EXACT_KAPPA + kappa_stable = _constants.CPX_KAPPA_STABLE + kappa_suspicious = _constants.CPX_KAPPA_SUSPICIOUS + kappa_unstable = _constants.CPX_KAPPA_UNSTABLE + kappa_illposed = _constants.CPX_KAPPA_ILLPOSED + kappa_max = _constants.CPX_KAPPA_MAX + kappa_attention = _constants.CPX_KAPPA_ATTENTION
+ + + +@contextmanager +def _temp_results_stream(cpx, temp_stream): + old_results_stream = cpx._env._get_results_stream() + try: + yield cpx._env.set_results_stream(temp_stream) + finally: + cpx._env.set_results_stream(old_results_stream._file) + + +
+[docs] +class QualityMetrics(): + """A class containing measures of the quality of a solution. + + The __str__ method of this class prints all available measures of + the quality of the solution in human readable form. + + This class may have a different set of data members depending on + the optimization algorithm used and the quality metrics that are + available. + + An instance of this class always has the member quality_type, + which is one of the following strings: + + * "feasopt" + * "simplex" + * "quadratically_constrained" + * "barrier" + * "MIP" + + If self.quality_type is "feasopt" this instance has the following + members: + + * scaled + * max_x + * max_bound_infeas + * max_Ax_minus_b + * max_slack + + If self.scaled is 1, this instance also has the members: + + * max_scaled_x + * max_scaled_bound_infeas + * max_scaled_Ax_minus_b + * max_scaled_slack + + If self.quality_type is "simplex" this instance has the following + members: + + * scaled + * max_x + * max_pi + * max_reduced_cost + * max_bound_infeas + * max_reduced_cost_infeas + * max_Ax_minus_b + * max_c_minus_Bpi + * max_slack + + If self.scaled is 1, this instance also has the members: + + * max_scaled_x + * max_scaled_pi + * max_scaled_reduced_cost + * max_scaled_bound_infeas + * max_scaled_reduced_cost_infeas + * max_scaled_Ax_minus_b + * max_scaled_c_minus_Bpi + * max_scaled_slack + + If the condition number of the final basis is available, this + instance has the member: + + * kappa + + If self.quality_type is "quadratically_constrained" this instance + has the following members: + + * objective + * norm_total + * norm_max + * error_Ax_b_total + * error_Ax_b_max + * error_xQx_dx_f_total + * error_xQx_dx_f_max + * x_bound_error_total + * x_bound_error_max + * slack_bound_error_total + * slack_bound_error_max + * quadratic_slack_bound_error_total + * quadratic_slack_bound_error_max + * normalized_error_max + + If self.quality_type is "barrier" this instance has the following + members: + + * primal_objective + * dual_objective + * duality_gap + * complementarity_total + * column_complementarity_total + * column_complementarity_max + * row_complementarity_total + * row_complementarity_max + * primal_norm_total + * primal_norm_max + * dual_norm_total + * dual_norm_max + * primal_error_total + * primal_error_max + * dual_error_total + * dual_error_max + * primal_x_bound_error_total + * primal_x_bound_error_max + * primal_slack_bound_error_total + * primal_slack_bound_error_max + * dual_pi_bound_error_total + * dual_pi_bound_error_max + * dual_reduced_cost_bound_error_total + * dual_reduced_cost_bound_error_max + * primal_normalized_error + * dual_normalized_error + + If self.quality_type is "MIP" and this instance was generated for + a specific member of the solution pool, it has the members: + + * solution_name + * num_solutions + + If self.quality_type is "MIP", this instance was not generated for + a specific member of the solution pool, and kappa statistics are + available, it has the members: + + * max_kappa + * pct_kappa_stable + * pct_kappa_suspicious + * pct_kappa_unstable + * pct_kappa_illposed + * kappa_attention + + If self.quality_type is "MIP" and this instance was generated for + the incumbent solution, it has the members: + + * solver + * objective + * x_norm_total + * x_norm_max + * error_Ax_b_total + * error_Ax_b_max + * x_bound_error_total + * x_bound_error_max + * integrality_error_total + * integrality_error_max + * slack_bound_error_total + * slack_bound_error_max + + If in addition the problem this instance was generated for has + indicator constraints, it has the members: + + * indicator_slack_bound_error_total + * indicator_slack_bound_error_max + + if in addition the problem this instance was generated for has + piecewise linear constraints, it has the members: + + * piecewise_linear_error_total + * piecewise_linear_error_max + + If solver is "MIQCP" this instance also has the members: + + * error_xQx_dx_f_total + * error_xQx_dx_f_max + * quadratic_slack_bound_error_total + * quadratic_slack_bound_error_max + + See also `SolutionInterface.get_quality_metrics` and + `SolnPoolInterface.get_quality_metrics`. + """ + +
+[docs] + def __init__(self, c, soln=-1): + idata, data = CPX_PROC.getqualitymetrics(c._env._e, c._lp, soln) + # We get the "to string" from showquality by temporarily + # hijacking the results stream. + with closing(StringIO()) as output, \ + _temp_results_stream(c, output): # noqa: E127 + CPX_PROC.showquality(c._env._e, c._lp, soln) + self._tostring = output.getvalue() + if idata[0] == 0: + self.quality_type = "feasopt" + self.scaled = idata[1] == 1 + if idata[2] == 1: + self.max_bound_infeas = data[0] + if self.scaled: + self.max_scaled_bound_infeas = data[1] + else: + self.max_bound_infeas = 0.0 + if self.scaled: + self.max_scaled_bound_infeas = 0.0 + if idata[3] == 1: + self.max_Ax_minus_b = data[2] + if self.scaled: + self.max_scaled_Ax_minus_b = data[3] + else: + self.max_Ax_minus_b = 0.0 + if self.scaled: + self.max_scaled_Ax_minus_b = 0.0 + self.max_x = data[4] + if self.scaled: + self.max_scaled_x = data[5] + if idata[4] == 1: + self.max_slack = data[6] + if self.scaled: + self.max_scaled_slack = data[7] + else: + self.max_slack = 0.0 + if self.scaled: + self.max_scaled_slack = 0.0 + elif idata[0] == 1: + self.quality_type = "simplex" + self.scaled = idata[1] == 1 + if idata[2] == 1: + self.max_bound_infeas = data[0] + if self.scaled: + self.max_scaled_bound_infeas = data[1] + else: + self.max_bound_infeas = 0.0 + if self.scaled: + self.max_scaled_bound_infeas = 0.0 + if idata[3] == 1: + self.max_reduced_cost_infeas = data[2] + if self.scaled: + self.max_scaled_reduced_cost_infeas = data[3] + else: + self.max_reduced_cost_infeas = 0.0 + if self.scaled: + self.max_scaled_reduced_cost_infeas = 0.0 + if idata[6] == 1: + self.max_Ax_minus_b = data[4] + if self.scaled: + self.max_scaled_Ax_minus_b = data[5] + else: + self.max_Ax_minus_b = 0.0 + if self.scaled: + self.max_scaled_Ax_minus_b = 0.0 + if idata[7] == 1: + self.max_c_minus_Bpi = data[6] + if self.scaled: + self.max_scaled_c_minus_Bpi = data[7] + else: + self.max_c_minus_Bpi = 0.0 + if self.scaled: + self.max_scaled_c_minus_Bpi = 0.0 + self.max_x = data[8] + if self.scaled: + self.max_scaled_x = data[9] + if idata[8] == 1: + self.max_slack = data[10] + if self.scaled: + self.max_scaled_slack = data[11] + else: + self.max_slack = 0.0 + if self.scaled: + self.max_scaled_slack = 0.0 + self.max_pi = data[12] + if self.scaled: + self.max_scaled_pi = data[13] + self.max_reduced_cost = data[14] + if self.scaled: + self.max_scaled_reduced_cost = data[15] + if idata[9] == 1: + self.kappa = data[16] + elif idata[0] == 2: + self.quality_type = "quadratically_constrained" + self.objective = data[0] + self.norm_total = data[1] + self.norm_max = data[2] + self.error_Ax_b_total = data[3] + self.error_Ax_b_max = data[4] + self.error_xQx_dx_f_total = data[5] + self.error_xQx_dx_f_max = data[6] + self.x_bound_error_total = data[7] + self.x_bound_error_max = data[8] + self.slack_bound_error_total = data[9] + self.slack_bound_error_max = data[10] + self.quadratic_slack_bound_error_total = data[11] + self.quadratic_slack_bound_error_max = data[12] + self.normalized_error_max = data[13] + elif idata[0] == 3: + self.quality_type = "barrier" + self.primal_objective = data[0] + self.dual_objective = data[1] + self.duality_gap = data[2] + self.complementarity_total = data[3] + self.column_complementarity_total = data[4] + self.column_complementarity_max = data[5] + self.row_complementarity_total = data[6] + self.row_complementarity_max = data[7] + self.primal_norm_total = data[8] + self.primal_norm_max = data[9] + self.dual_norm_total = data[10] + self.dual_norm_max = data[11] + self.primal_error_total = data[12] + self.primal_error_max = data[13] + self.dual_error_total = data[14] + self.dual_error_max = data[15] + self.primal_x_bound_error_total = data[16] + self.primal_x_bound_error_max = data[17] + self.primal_slack_bound_error_total = data[18] + self.primal_slack_bound_error_max = data[19] + self.dual_pi_bound_error_total = data[20] + self.dual_pi_bound_error_max = data[21] + self.dual_reduced_cost_bound_error_total = data[22] + self.dual_reduced_cost_bound_error_max = data[23] + self.primal_normalized_error = data[24] + self.dual_normalized_error = data[25] + elif idata[0] == 4: + self.quality_type = "MIP" + if soln >= 0: + self.solution_name = c.solution.pool.get_names(soln) + self.num_solutions = c.solution.pool.get_num() + if idata[4] == 1: + if idata[2] == 0: + self.solver = "MILP" + elif idata[2] == 1: + self.solver = "MIQP" + elif idata[2] == 2: + self.solver = "MIQCP" + self.error_xQx_dx_f_total = data[6] + self.error_xQx_dx_f_max = data[7] + self.quadratic_slack_bound_error_total = data[14] + self.quadratic_slack_bound_error_max = data[15] + self.objective = data[1] + self.x_norm_total = data[2] + self.x_norm_max = data[3] + self.error_Ax_b_total = data[4] + self.error_Ax_b_max = data[5] + self.x_bound_error_total = data[8] + self.x_bound_error_max = data[9] + self.integrality_error_total = data[10] + self.integrality_error_max = data[11] + self.slack_bound_error_total = data[12] + self.slack_bound_error_max = data[13] + if idata[3] == 1: + self.indicator_slack_bound_error_total = data[16] + self.indicator_slack_bound_error_max = data[17] + if idata[5] == 1: + self.piecewise_linear_error_total = data[24] + self.piecewise_linear_error_max = data[25] + if idata[1] == 1: + self.max_kappa = data[18] + self.pct_kappa_stable = data[19] + self.pct_kappa_suspicious = data[20] + self.pct_kappa_unstable = data[21] + self.pct_kappa_illposed = data[22] + self.kappa_attention = data[23]
+ + +
+[docs] + def __str__(self): + """Returns a string containing quality metrics in human readable form.""" + # See __init__ (above) to see how this is constructed. + return self._tostring
+
+ + + +
+[docs] +class SolnPoolInterface(BaseInterface): + """Methods for accessing the solution pool.""" + + incumbent = _constants.CPX_INCUMBENT_ID + """See `_constants.CPX_INCUMBENT_ID` """ + + quality_metric = QualityMetric() + """See `QualityMetric()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new SolnPoolInterface. + + The solution pool interface is exposed by the top-level `Cplex` + class as Cplex.solution.pool. This constructor is not meant to + be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True, + getindexfunc=CPX_PROC.getsolnpoolsolnindex) + self.filter = SolnPoolFilterInterface(self) + """See `SolnPoolFilterInterface()` """
+ + +
+[docs] + def get_objective_value(self, soln): + """Returns the objective value for a member of the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> obj_val = c.solution.pool.get_objective_value(0) + >>> abs(obj_val - 499.0) < 1e-6 + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + return CPX_PROC.getsolnpoolobjval(self._env._e, self._cplex._lp, soln)
+ + +
+[docs] + def get_values(self, soln, *args): + """Returns the values of a set of variables for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> v1 = c.solution.pool.get_values(1, 2) + >>> v2 = c.solution.pool.get_values(1, "x2") + >>> somevals = c.solution.pool.get_values(1, [2, "x2"]) + >>> v1 == somevals[0], v2 == somevals[1] + (True, True) + >>> allvals = c.solution.pool.get_values(1) + >>> v1 == allvals[2] + True + """ + + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getx(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getsolnpoolx(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getx, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_linear_slacks(self, soln, *args): + """Returns a set of linear slacks for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> s1 = c.solution.pool.get_linear_slacks(1, 1) + >>> s2 = c.solution.pool.get_linear_slacks(1, "c2") + >>> someslacks = c.solution.pool.get_linear_slacks(1, [1, "c2"]) + >>> s1 == someslacks[0], s2 == someslacks[1] + (True, True) + >>> allslacks = c.solution.pool.get_linear_slacks(1) + >>> s1 == allslacks[1] + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getslacks(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getsolnpoolslack(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getslacks, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_slacks(self, soln, *args): + """Returns a set of quadratic slacks for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> var = c.solution.pool.get_quadratic_slacks(1, 1) + >>> var = c.solution.pool.get_quadratic_slacks(1, "QC3") + >>> vars = c.solution.pool.get_quadratic_slacks(1, ["QC3", 1]) + >>> vars = c.solution.pool.get_quadratic_slacks(1) + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getqslacks(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getsolnpoolqconstrslack(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getqslacks, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_integer_quality(self, soln, which): + """Returns the integer quality of a given solution. + + The integer quality of a solution can either be a single attribute of + solution.pool.quality_metrics or a sequence of such + attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetsolnpoolintquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> quality_metric = c.solution.pool.quality_metric + >>> misi = quality_metric.max_indicator_slack_infeasibility + >>> c.solution.pool.get_integer_quality(1, misi) + 0 + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + if isinstance(which, int): + return CPX_PROC.getsolnpoolintquality( + self._env._e, self._cplex._lp, soln, which) + return [CPX_PROC.getsolnpoolintquality(self._env._e, + self._cplex._lp, soln, a) + for a in which]
+ + +
+[docs] + def get_float_quality(self, soln, which): + """Returns the float quality of a given solution. + + The float quality of a solution can either be a single attribute of + solution.pool.quality_metrics or a sequence of such + attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetsolnpooldblquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> qual = c.solution.pool.get_float_quality(1, + c.solution.pool.quality_metric.max_indicator_slack_infeasibility) + >>> abs(qual) < 1.e-6 + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + if isinstance(which, int): + return CPX_PROC.getsolnpooldblquality( + self._env._e, self._cplex._lp, soln, which) + return [CPX_PROC.getsolnpooldblquality(self._env._e, + self._cplex._lp, soln, a) + for a in which]
+ + +
+[docs] + def get_mean_objective_value(self): + """Returns the average among the objective values in the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> mov = c.solution.pool.get_mean_objective_value() + """ + return CPX_PROC.getsolnpoolmeanobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def delete(self, *args): + """Deletes solutions from the solution pool. + + There are four forms by which pool.delete may be called. + + pool.delete() + deletes all solutions from the problem. + + pool.delete(i) + i must be a solution name or index. Deletes the solution + whose index or name is i. + + pool.delete(s) + s must be a sequence of solution names or indices. Deletes + the solutions with names or indices contained within s. + Equivalent to [pool.delete(i) for i in s]. + + pool.delete(begin, end) + begin and end must be solution indices or solution names. + Deletes the solutions with indices between begin and end, + inclusive of end. Equivalent to + pool.delete(range(begin, end + 1)). This will give the best + performance when deleting batches of solutions from the + solution pool. + + See `CPXdelsolnpoolsolns <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsolnpoolsolns.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(5) + >>> c.populate_solution_pool() + >>> names = c.solution.pool.get_names() + >>> c.solution.pool.delete(1) + >>> n = c.solution.pool.get_names() + >>> del names[1] + >>> n == names + True + >>> c.solution.pool.delete(names[1]) + >>> n = c.solution.pool.get_names() + >>> names.remove(names[1]) + >>> n == names + True + >>> c.solution.pool.delete([names[1], 0]) + >>> n = c.solution.pool.get_names() + >>> names.remove(names[1]) + >>> del names[0] + >>> n == names + True + >>> c.solution.pool.delete() + >>> c.solution.pool.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsolnpoolsolns(self._env._e, self._cplex._lp, + begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of solutions. + + There are four forms by which solution.pool.get_names may be called. + + solution.pool.get_names() + return the names of all solutions from the problem. + + solution.pool.get_names(i) + i must be a solution index. Returns the name of row i. + + solution.pool.get_names(s) + s must be a sequence of row indices. Returns the names of + the solutions with indices the members of s. + Equivalent to [solution.pool.get_names(i) for i in s] + + solution.pool.get_names(begin, end) + begin and end must be solution indices. Returns the names of + the solutions with indices between begin and end, inclusive of + end. Equivalent to + solution.pool.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(10) + >>> c.populate_solution_pool() + >>> names = c.solution.pool.get_names() + >>> names[1] == c.solution.pool.get_names(1) + True + >>> [names[i] for i in [1,2]] == c.solution.pool.get_names([1,2]) + True + >>> names[1:5] == c.solution.pool.get_names(1, 4) + True + """ + def getname(a): + return CPX_PROC.getsolnpoolsolnname(self._env._e, + self._cplex._lp, + a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_num_replaced(self): + """Returns the number of solution pool members that have been replaced. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.get_num_replaced() + 0 + """ + return CPX_PROC.getsolnpoolnumreplaced(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num(self): + """Returns the number of solutions in the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num = c.solution.pool.get_num() + """ + return CPX_PROC.getsolnpoolnumsolns(self._env._e, self._cplex._lp)
+ + +
+[docs] + def write(self, filename, which=None): + """Writes solutions to a file. + + If no second argument is provided, all solutions are written + to file. + + If a second argument is provided, it is the index of a + solution in the solution pool. Only that solution will be + written to file. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(10) + >>> c.populate_solution_pool() + >>> c.solution.pool.write("ind.sol",4) + """ + if which is None: + CPX_PROC.solwritesolnpoolall(self._env._e, self._cplex._lp, + filename) + else: + CPX_PROC.solwritesolnpool(self._env._e, self._cplex._lp, + which, filename)
+ + +
+[docs] + def get_quality_metrics(self, soln): + """Returns an object containing measures of the quality of the + specified solution. + + See `QualityMetrics`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> qm = c.solution.pool.get_quality_metrics(0) + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + return QualityMetrics(self._cplex, soln)
+
+ + + +
+[docs] +class AdvancedSolutionInterface(BaseInterface): + """Advanced methods for accessing solution information. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvcol = c.solution.advanced.binvcol() + >>> binvrow = c.solution.advanced.binvrow() + >>> binvacol = c.solution.advanced.binvacol() + >>> binvarow = c.solution.advanced.binvarow() + >>> binvcol[0][24], binvcol[1][6] + (-0.215, 1.0) + >>> binvrow[24][0], binvrow[6][1] + (-0.215, 1.0) + >>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)] + ([1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) + >>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)] + ([1.0, 0.0], [0.0, 1.0], [0.0, 0.0]) + >>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num()) + >>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)] + >>> [x if x else 0.0 for x in bbtran] + [0.0, 2.0, 1.0] + >>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num()) + >>> ftran[0] + 2.891 + """ + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedSolutionInterface. + + The advanced solution interface is exposed by the top-level + `Cplex` class as Cplex.solution.advanced. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def binvcol(self, *args): + """Returns a set of columns of the inverted basis matrix. + + Can be called by four forms. + + solution.advanced.binvcol() + returns the inverted basis matrix as a list of columns. + + solution.advanced.binvcol(i) + i must be a linear constraint name or index. Returns the + column of the inverted basis matrix associated with i. + + solution.advanced.binvcol(s) + s must be a sequence of linear constraint names or indices. + Returns the columns of the inverted basis matrix associated + with the members of s. Equivalent to + [solution.advanced.binvcol(i) for i in s] + + solution.advanced.binvcol(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the columns of the inverted basis + matrix associated with the linear constraints between begin + and end, inclusive of end. Equivalent to + solution.advanced.binvcol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvcol = c.solution.advanced.binvcol() + >>> binvcol[0][24], binvcol[1][6] + (-0.215, 1.0) + """ + def inv(a): + return CPX_PROC.binvcol(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def binvrow(self, *args): + """Returns a set of rows of the inverted basis matrix. + + Can be called by four forms. + + solution.advanced.binvrow() + returns the inverted basis matrix as a list of rows. + + solution.advanced.binvrow(i) + i must be a linear constraint name or index. Returns the + row of the inverted basis matrix associated with i. + + solution.advanced.binvrow(s) + s must be a sequence of linear constraint names or indices. + Returns the rows of the inverted basis matrix associated + with the members of s. Equivalent to + [solution.advanced.binvrow(i) for i in s] + + solution.advanced.binvrow(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the rows of the inverted basis matrix + associated with the linear constraints between begin and end, + inclusive of end. Equivalent to + solution.advanced.binvrow(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvrow = c.solution.advanced.binvrow() + >>> binvrow[24][0], binvrow[6][1] + (-0.215, 1.0) + """ + def inv(a): + return CPX_PROC.binvrow(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def binvacol(self, *args): + """Returns a set of columns of the tableau. + + Can be called by four forms. + + solution.advanced.binvacol() + returns the tableau as a list of columns. + + solution.advanced.binvacol(i) + i must be a variable name or index. Returns the column of + the tableau associated with i. + + solution.advanced.binvacol(s) + s must be a sequence of variable names or indices. Returns + the columns of the tableau associated with the members of s. + Equivalent to [solution.advanced.binvacol(i) for i in s] + + solution.advanced.binvacol(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the tableau associated with the + variables between begin and end, inclusive of end. Equivalent + to solution.advanced.binvacol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvacol = c.solution.advanced.binvacol() + >>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)] + ([1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) + """ + def inv(a): + return CPX_PROC.binvacol(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.variables._conv, + self._cplex.variables.get_num(), args)
+ + +
+[docs] + def binvarow(self, *args): + """Returns a set of rows of the tableau. + + Can be called by four forms. + + solution.advanced.binvacol() + returns the tableau as a list of rows. + + solution.advanced.binvacol(i) + i must be a linear constraint name or index. Returns the + row of the tableau associated with i. + + solution.advanced.binvacol(s) + s must be a sequence of linear constraint names or indices. + Returns the rows of the tableau associated with the members + of s. Equivalent to [solution.advanced.binvacol(i) + for i in s] + + solution.advanced.binvacol(begin, end) + begin and end must be linear constraint indices or variable + names. Returns the rows of the tableau associated with the + variables between begin and end, inclusive of end. Equivalent + to solution.advanced.binvacol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvarow = c.solution.advanced.binvarow() + >>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)] + ([1.0, 0.0], [0.0, 1.0], [0.0, 0.0]) + """ + def inv(a): + return CPX_PROC.binvarow(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def btran(self, y): + """Performs a backward linear solve using the basis matrix. + + Returns the solution to the linear system + + x^T B = y^T + + y must be a list of floats with length equal to the number of + linear constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num()) + >>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)] + >>> [x if x else 0.0 for x in bbtran] + [0.0, 2.0, 1.0] + """ + return CPX_PROC.btran(self._env._e, self._cplex._lp, y)
+ + +
+[docs] + def ftran(self, x): + """Performs a linear solve using the basis matrix. + + Returns the solution to the linear system + + B x = y + + y must be a list of floats with length equal to the number of + linear constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num()) + >>> ftran[0] + 2.891 + """ + return CPX_PROC.ftran(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_gradients(self, *args): + """Returns information useful in post-solution analysis after an + LP has been solved and a basis is available. + + See `CPXgetgrad <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getgrad.html>`_ in the Callable Library Reference Manual + for more detail. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> grad = c.solution.advanced.get_gradients(1) + >>> grad.ind[1] + 1 + >>> grad.val[1] + 1.0 + """ + def getgrad(a): + return SparsePair(*CPX_PROC.getgrad(self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getgrad, self._cplex.variables._conv, + self._cplex.variables.get_num(), args)
+ + +
+[docs] + def get_linear_slacks_from_x(self, x): + """Computes the slack values from the given solution x + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> slack = c.solution.advanced.get_linear_slacks_from_x(c.solution.get_values()) + >>> abs(slack[3]) < 1e-6 + True + """ + return CPX_PROC.slackfromx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_quadratic_slacks_from_x(self, x): + """Computes the slack values for quadratic constraints from the given solution x + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> qslack = c.solution.advanced.get_quadratic_slacks_from_x(c.solution.get_values()) + >>> abs(qslack[0]) < 1e-6 + True + """ + return CPX_PROC.qconstrslackfromx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_linear_reduced_costs_from_pi(self, pi): + """Computes the reduced costs from the given dual solution pi + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> reducedcost = c.solution.advanced.get_linear_reduced_costs_from_pi( + c.solution.get_dual_values()) + >>> abs(reducedcost[0]) < 1e-6 + True + """ + return CPX_PROC.djfrompi(self._env._e, self._cplex._lp, pi)
+ + +
+[docs] + def get_quadratic_reduced_costs_from_pi(self, pi, x): + """Computes the reduced costs for QP from the given solution (pi, x) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qp.lp") + >>> c.solve() + >>> qreducedcost = c.solution.advanced.get_quadratic_reduced_costs_from_pi( + c.solution.get_dual_values(), + c.solution.get_values()) + >>> abs(qreducedcost[0]) < 1e-6 + True + """ + return CPX_PROC.qpdjfrompi(self._env._e, self._cplex._lp, pi, x)
+ + +
+[docs] + def get_Driebeek_penalties(self, basic_variables): + """Returns values known as Driebeek penalties for a sequence of basic variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c_stat, _ = c.solution.basis.get_basis() + >>> b = [i for i, v in enumerate(c_stat) if v == c.solution.basis.status.basic] + >>> penalties = c.solution.advanced.get_Driebeek_penalties(b) + >>> penalties[0] + (0.34477142857142856, 8.021494102228047) + """ + return unzip(CPX_PROC.mdleave( + self._env._e, self._cplex._lp, + self._cplex.variables._conv(basic_variables)))
+ + +
+[docs] + def get_quadratic_indefinite_certificate(self): + """Compute a vector x that satisfies x'Qx < 0 + + Such a vector demonstrates that the matrix Q violates the + assumption of positive semi-definiteness, and can be an aid in + debugging a user's program if indefiniteness is an unexpected + outcome. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qpindef.lp") + >>> x = c.solution.advanced.get_quadratic_indefinite_certificate() + >>> abs(-0.5547001 - x[1]) < 1e-6 + True + """ + return CPX_PROC.qpindefcertificate(self._env._e, self._cplex._lp)
+ + +
+[docs] + def dual_farkas(self): + """Returns Farkas proof of infeasibility for the active LP model after proven infeasibility. + + See `CPXdualfarkas <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dualfarkas.html>`_ in the Callable Library Reference + Manual for more detail. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.linear_constraints.add(senses="L", rhs=[-1]) + >>> indices = c.variables.add(lb=[1], ub=[2],columns=[[[0],[1]]]) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> y = c.solution.advanced.dual_farkas() + >>> y[1] + 2.0 + """ + return CPX_PROC.dualfarkas(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_diverging_index(self): + """Returns the index of the diverging row or column + + if the problem is not unbounded, get_diverging_index returns -1. + + If the problem is unbounded, get_diverging_index returns the + index of the diverging variable in the augmented form of the + constraint matrix. In other words, if the diverging variable + is a structural variable, get_diverging_index returns its + index; if the diverging variable is a slack or ranged + variable, get_diverging_index returns the sum of the number of + structural variables and the index of the corresponding + constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.variables.add(obj=[1,1],lb=[1,-cplex.infinity],ub=[2,cplex.infinity]) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> idx = c.solution.advanced.get_diverging_index() + >>> idx + 1 + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.variables.add(obj=[-1,-1],lb=[1,1],ub=[2,2]) + >>> indices = c.linear_constraints.add(lin_expr = [[[0,1],[-1,-1]]], rhs=[-10], senses="L") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> idx = c.solution.advanced.get_diverging_index() + >>> idx + 2 + """ + return CPX_PROC.getijdiv(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_ray(self): + """Returns an unbounded direction, i.e., ray, if a LP model is unbounded + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("unblp.lp") + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> ray = c.solution.advanced.get_ray() + >>> ray[0] + -1.0 + """ + return CPX_PROC.getray(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class SolutionMethod(ConstantClass): + """Solution methods.""" + none = _constants.CPX_ALG_NONE + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + feasopt = _constants.CPX_ALG_FEASOPT + MIP = _constants.CPX_ALG_MIP + pivot = _constants.CPX_ALG_PIVOT + pivot_in = _constants.CPX_ALG_PIVOTIN + pivot_out = _constants.CPX_ALG_PIVOTOUT
+ + + +
+[docs] +class SolutionStatus(ConstantClass): + """Solution status codes. + + For documentation of each status code, see the reference manual + of the CPLEX Callable Library, especially the group + optim.cplex.callable.solutionstatus. + """ + unknown = 0 # There is no constant for this. + optimal = _constants.CPX_STAT_OPTIMAL + unbounded = _constants.CPX_STAT_UNBOUNDED + infeasible = _constants.CPX_STAT_INFEASIBLE + feasible = _constants.CPX_STAT_FEASIBLE + infeasible_or_unbounded = _constants.CPX_STAT_INForUNBD + optimal_infeasible = _constants.CPX_STAT_OPTIMAL_INFEAS + num_best = _constants.CPX_STAT_NUM_BEST + feasible_relaxed_sum = _constants.CPX_STAT_FEASIBLE_RELAXED_SUM + optimal_relaxed_sum = _constants.CPX_STAT_OPTIMAL_RELAXED_SUM + feasible_relaxed_inf = _constants.CPX_STAT_FEASIBLE_RELAXED_INF + optimal_relaxed_inf = _constants.CPX_STAT_OPTIMAL_RELAXED_INF + feasible_relaxed_quad = _constants.CPX_STAT_FEASIBLE_RELAXED_QUAD + optimal_relaxed_quad = _constants.CPX_STAT_OPTIMAL_RELAXED_QUAD + abort_obj_limit = _constants.CPX_STAT_ABORT_OBJ_LIM + abort_primal_obj_limit = _constants.CPX_STAT_ABORT_PRIM_OBJ_LIM + abort_dual_obj_limit = _constants.CPX_STAT_ABORT_DUAL_OBJ_LIM + first_order = _constants.CPX_STAT_FIRSTORDER + abort_iteration_limit = _constants.CPX_STAT_ABORT_IT_LIM + abort_time_limit = _constants.CPX_STAT_ABORT_TIME_LIM + abort_dettime_limit = _constants.CPX_STAT_ABORT_DETTIME_LIM + abort_user = _constants.CPX_STAT_ABORT_USER + optimal_face_unbounded = _constants.CPX_STAT_OPTIMAL_FACE_UNBOUNDED + conflict_feasible = _constants.CPX_STAT_CONFLICT_FEASIBLE + conflict_minimal = _constants.CPX_STAT_CONFLICT_MINIMAL + conflict_abort_contradiction = _constants.CPX_STAT_CONFLICT_ABORT_CONTRADICTION + conflict_abort_time_limit = _constants.CPX_STAT_CONFLICT_ABORT_TIME_LIM + conflict_abort_dettime_limit = _constants.CPX_STAT_CONFLICT_ABORT_DETTIME_LIM + conflict_abort_iteration_limit = _constants.CPX_STAT_CONFLICT_ABORT_IT_LIM + conflict_abort_node_limit = _constants.CPX_STAT_CONFLICT_ABORT_NODE_LIM + conflict_abort_obj_limit = _constants.CPX_STAT_CONFLICT_ABORT_OBJ_LIM + conflict_abort_memory_limit = _constants.CPX_STAT_CONFLICT_ABORT_MEM_LIM + conflict_abort_user = _constants.CPX_STAT_CONFLICT_ABORT_USER + relaxation_unbounded = _constants.CPXMIP_ABORT_RELAXATION_UNBOUNDED + abort_relaxed = _constants.CPXMIP_ABORT_RELAXED + optimal_tolerance = _constants.CPXMIP_OPTIMAL_TOL + solution_limit = _constants.CPXMIP_SOL_LIM + populate_solution_limit = _constants.CPXMIP_POPULATESOL_LIM + node_limit_feasible = _constants.CPXMIP_NODE_LIM_FEAS + node_limit_infeasible = _constants.CPXMIP_NODE_LIM_INFEAS + fail_feasible = _constants.CPXMIP_FAIL_FEAS + fail_infeasible = _constants.CPXMIP_FAIL_INFEAS + mem_limit_feasible = _constants.CPXMIP_MEM_LIM_FEAS + mem_limit_infeasible = _constants.CPXMIP_MEM_LIM_INFEAS + fail_feasible_no_tree = _constants.CPXMIP_FAIL_FEAS_NO_TREE + fail_infeasible_no_tree = _constants.CPXMIP_FAIL_INFEAS_NO_TREE + optimal_populated = _constants.CPXMIP_OPTIMAL_POPULATED + optimal_populated_tolerance = _constants.CPXMIP_OPTIMAL_POPULATED_TOL + benders_num_best = _constants.CPX_STAT_BENDERS_NUM_BEST + + MIP_optimal = _constants.CPXMIP_OPTIMAL + MIP_infeasible = _constants.CPXMIP_INFEASIBLE + MIP_time_limit_feasible = _constants.CPXMIP_TIME_LIM_FEAS + MIP_time_limit_infeasible = _constants.CPXMIP_TIME_LIM_INFEAS + MIP_dettime_limit_feasible = _constants.CPXMIP_DETTIME_LIM_FEAS + MIP_dettime_limit_infeasible = _constants.CPXMIP_DETTIME_LIM_INFEAS + MIP_abort_feasible = _constants.CPXMIP_ABORT_FEAS + MIP_abort_infeasible = _constants.CPXMIP_ABORT_INFEAS + MIP_optimal_infeasible = _constants.CPXMIP_OPTIMAL_INFEAS + MIP_unbounded = _constants.CPXMIP_UNBOUNDED + MIP_infeasible_or_unbounded = _constants.CPXMIP_INForUNBD + MIP_feasible_relaxed_sum = _constants.CPXMIP_FEASIBLE_RELAXED_SUM + MIP_optimal_relaxed_sum = _constants.CPXMIP_OPTIMAL_RELAXED_SUM + MIP_feasible_relaxed_inf = _constants.CPXMIP_FEASIBLE_RELAXED_INF + MIP_optimal_relaxed_inf = _constants.CPXMIP_OPTIMAL_RELAXED_INF + MIP_feasible_relaxed_quad = _constants.CPXMIP_FEASIBLE_RELAXED_QUAD + MIP_optimal_relaxed_quad = _constants.CPXMIP_OPTIMAL_RELAXED_QUAD + MIP_feasible = _constants.CPXMIP_FEASIBLE + + multiobj_optimal = _constants.CPX_STAT_MULTIOBJ_OPTIMAL + multiobj_infeasible = _constants.CPX_STAT_MULTIOBJ_INFEASIBLE + multiobj_inforunbd = _constants.CPX_STAT_MULTIOBJ_INForUNBD + multiobj_non_optimal = _constants.CPX_STAT_MULTIOBJ_NON_OPTIMAL + multiobj_stopped = _constants.CPX_STAT_MULTIOBJ_STOPPED + multiobj_unbounded = _constants.CPX_STAT_MULTIOBJ_UNBOUNDED
+ + + +
+[docs] +class SolutionType(ConstantClass): + """Solution types""" + none = _constants.CPX_NO_SOLN + basic = _constants.CPX_BASIC_SOLN + nonbasic = _constants.CPX_NONBASIC_SOLN + primal = _constants.CPX_PRIMAL_SOLN
+ + + +
+[docs] +class SolutionInterface(BaseInterface): + """Methods for querying the solution to an optimization problem.""" + + method = SolutionMethod() + """See `SolutionMethod()` """ + quality_metric = QualityMetric() + """See `QualityMetric()` """ + status = SolutionStatus() + """See `SolutionStatus()` """ + type = SolutionType() + """See `SolutionType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new SolutionInterface. + + The solution interface is exposed by the top-level `Cplex` class + as Cplex.solution. This constructor is not meant to be used + externally. + """ + super().__init__(cplex) + self.progress = ProgressInterface(self) + """See `ProgressInterface()` """ + self.infeasibility = InfeasibilityInterface(self) + """See `InfeasibilityInterface()` """ + self.MIP = MIPSolutionInterface(self) + """See `MIPSolutionInterface()` """ + self.basis = BasisInterface(self) + """See `BasisInterface()` """ + self.sensitivity = SensitivityInterface(self) + """See `SensitivityInterface()` """ + self.pool = SolnPoolInterface(self) + """See `SolnPoolInterface()` """ + self.advanced = AdvancedSolutionInterface(self) + """See `AdvancedSolutionInterface()` """ + self.multiobj = MultiObjSolnInterface(self) + """See `MultiObjSolnInterface()` """
+ + +
+[docs] + def get_status(self): + """Returns the status of the solution. + + Returns an attribute of Cplex.solution.status. + For interpretations of the status codes, see the + reference manual of the CPLEX Callable Library, + especially the group optim.cplex.callable.solutionstatus + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_status() + 1 + """ + return CPX_PROC.getstat(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_method(self): + """Returns the method used to solve the problem. + + Returns an attribute of Cplex.solution.method. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_method() + 2 + """ + return CPX_PROC.getmethod(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_status_string(self, status_code=None): + """Returns a string describing the status of the solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_status_string() + 'optimal' + """ + if status_code is None: + status_code = self.get_status() + return CPX_PROC.getstatstring(self._env._e, status_code)
+ + +
+[docs] + def get_objective_value(self): + """Returns the value of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_objective_value() + -202.5 + """ + return CPX_PROC.getobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_values(self, *args): + """Returns the values of a set of variables at the solution. + + Can be called by four forms. + + solution.get_values() + return the values of all variables from the problem. + + solution.get_values(i) + i must be a variable name or index. Returns the value of + the variable whose index or name is i. + + solution.get_values(s) + s must be a sequence of variable names or indices. Returns + the values of the variables with indices the members of s. + Equivalent to [solution.get_values(i) for i in s] + + solution.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns the values of the variables with indices between begin + and end, inclusive of end. Equivalent to + solution.get_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_values([0, 4, 5]) + [25.5, 0.0, 80.0] + """ + def getx(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getx(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getx, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_reduced_costs(self, *args): + """Returns the reduced costs of a set of variables. + + The values returned by this method are defined to be the dual + multipliers for bound constraints on the specified variables. + + Can be called by four forms. + + solution.get_reduced_costs() + return the reduced costs of all variables from the problem. + + solution.get_reduced_costs(i) + i must be a variable name or index. Returns the reduced + cost of the variable whose index or name is i. + + solution.get_reduced_costs(s) + s must be a sequence of variable names or indices. Returns + the reduced costs of the variables with indices the members + of s. Equivalent to [solution.get_reduced_costs(i) for i + in s] + + solution.get_reduced_costs(begin, end) + begin and end must be variable indices or variable names. + Returns the reduced costs of the variables with indices between + begin and end, inclusive of end. Equivalent to + solution.get_reduced_costs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_reduced_costs([0, 4, 5]) + [0.0, 10.0, 0.0] + """ + def getdj(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getdj(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getdj, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_dual_values(self, *args): + """Returns a set of dual values. + + Note that the values returned by this function are not only + meaningful for linear programs. Also for second order cone + programs, they provide information about the dual solution. + Refer to the user manual to see how to use the values returned by + this function for second order cone programs. + + Can be called by four forms. + + solution.get_dual_values() + return all dual values from the problem. + + solution.get_dual_values(i) + i must be a linear constraint name or index. Returns the + dual value associated with the linear constraint whose + index or name is i. + + solution.get_dual_values(s) + s must be a sequence of linear constraint names or indices. + Returns the dual values associated with the linear + constraints with indices the members of s. Equivalent to + [solution.get_dual_values(i) for i in s] + + solution.get_dual_values(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the dual values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_dual_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> pi = c.solution.get_dual_values([0, 1]) + >>> for i, j in zip(pi, [-0.628571, 0.0]): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def getpi(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getpi(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getpi, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_dualslack(self, *args): + """Returns the dual slack for a quadratic constraint. + + The function returns the dual slack vector of its arguments as a + SparsePair. + The function argument may be either the index or the name of a + quadratic constraint. + """ + def getqconstrdslack(q): + res = CPX_PROC.getqconstrdslack(self._env._e, self._cplex._lp, q) + if res: + return SparsePair(res[0], res[1]) + return SparsePair() + return apply_freeform_one_arg( + getqconstrdslack, + self._cplex.quadratic_constraints._conv, + CPX_PROC.getnumqconstrs(self._env._e, self._cplex._lp), + args)
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks. + + Can be called by four forms. + + solution.get_linear_slacks() + return all linear slack values from the problem. + + solution.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + solution.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [solution.get_linear_slacks(i) for i in s] + + solution.get_linear_slacks(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_linear_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> abs(c.solution.get_linear_slacks(5)) < 1e-6 + True + """ + def getslack(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getslack, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_indicator_slacks(self, *args): + """Returns a set of indicator slacks. + + Can be called by four forms. + + solution.get_indicator_slacks() + return all indicator slack values from the problem. + + solution.get_indicator_slacks(i) + i must be a indicator constraint name or index. Returns + the slack values associated with the indicator constraint + whose index or name is i. + + solution.get_indicator_slacks(s) + s must be a sequence of indicator constraint names or + indices. Returns the slack values associated with the + indicator constraints with indices the members of s. + Equivalent to [solution.get_indicator_slacks(i) for i in s] + + solution.get_indicator_slacks(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the slack values associated with the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_indicator_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.get_indicator_slacks([0, 18]) + [1e+20, 0.0] + """ + def getindslack(a, b=self._cplex.indicator_constraints.get_num() - 1): + return CPX_PROC.getindconstrslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getindslack, self._cplex.indicator_constraints._conv, + args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks. + + Can be called by four forms. + + solution.get_quadratic_slacks() + return all quadratic slack values from the problem. + + solution.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + solution.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [solution.get_quadratic_slacks(i) for i in s] + + solution.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_quadratic_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> slack = c.solution.get_quadratic_slacks(0) + >>> abs(slack) < 1e-6 + True + """ + def getqslack(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getqconstrslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getqslack, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_integer_quality(self, which): + """Returns a measure of the quality of the solution. + + The measure of the quality of a solution can be a single attribute of + solution.quality_metrics or a sequence of such + attributes. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> m = c.solution.quality_metric + >>> c.solution.get_integer_quality([m.max_x, m.max_dual_infeasibility]) + [18, -1] + """ + if isinstance(which, int): + return CPX_PROC.getintquality(self._env._e, self._cplex._lp, which) + return [CPX_PROC.getintquality(self._env._e, self._cplex._lp, a) + for a in which]
+ + +
+[docs] + def get_float_quality(self, which): + """Returns a measure of the quality of the solution. + + The measure of the quality of a solution can be a single attribute of + solution.quality_metrics or a sequence of such attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetdblquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> m = c.solution.quality_metric + >>> c.solution.get_float_quality([m.max_x, m.max_dual_infeasibility]) + [500.0, 0.0] + """ + if isinstance(which, int): + return CPX_PROC.getdblquality(self._env._e, self._cplex._lp, which) + return [CPX_PROC.getdblquality(self._env._e, self._cplex._lp, a) + for a in which]
+ + +
+[docs] + def get_solution_type(self): + """Returns the type of the solution. + + Returns an attribute of Cplex.solution.type. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_solution_type() + 1 + """ + return CPX_PROC.solninfo(self._env._e, self._cplex._lp)[1]
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether or not the solution is known to be primal feasible. + + Note + Returning False does not necessarily mean that the problem is + not primal feasible, only that it is not proved to be primal + feasible. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.is_primal_feasible() + True + """ + return bool(CPX_PROC.solninfo(self._env._e, self._cplex._lp)[2])
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether or not the solution is known to be dual feasible. + + Note + Returning False does not necessarily mean that the problem is + not dual feasible, only that it is not proved to be dual + feasible. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.is_dual_feasible() + True + """ + return bool(CPX_PROC.solninfo(self._env._e, self._cplex._lp)[3])
+ + +
+[docs] + def get_activity_levels(self, *args): + """Returns the activity levels for set of linear constraints. + + Can be called by four forms. + + solution.get_activity_levels() + return the activity levels for all linear constraints from + the problem. + + solution.get_activity_levels(i) + i must be a linear constraint name or index. Returns the + activity levels for the linear constraint whose index or + name is i. + + solution.get_activity_levels(s) + s must be a sequence of linear constraint names or indices. + Returns the activity levels for the linear constraints with + indices the members of s. Equivalent to + [solution.get_activity_levels(i) for i in s] + + solution.get_activity_levels(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the activity levels for the linear + constraints with indices between begin and end, inclusive of + end. Equivalent to + solution.get_activity_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_activity_levels([2, 3, 12]) + [80.0, 0.0, 500.0] + """ + def getax(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getax(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getax, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_activity_levels(self, *args): + """Returns the activity levels for set of quadratic constraints. + + Can be called by four forms. + + solution.get_quadratic_activity_levels() + return the activity levels for all quadratic constraints + from the problem. + + solution.get_quadratic_activity_levels(i) + i must be a quadratic constraint name or index. Returns + the activity levels for the quadratic constraint whose + index or name is i. + + solution.get_quadratic_activity_levels(s) + s must be a sequence of quadratic constraint names or + indices. Returns the activity levels for the quadratic + constraints with indices the members of s. Equivalent to + [solution.get_quadratic_activity_levels(i) for i in s] + + solution.get_quadratic_activity_levels(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the activity levels for the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + solution.get_quadratic_activity_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> xqxax = c.solution.get_quadratic_activity_levels() + >>> abs(xqxax[0] - 2.015616) < 1e-6 + True + """ + def getxqxax(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getxqxax(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getxqxax, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_quality_metrics(self): + """Returns an object containing measures of the solution quality. + + See `QualityMetrics`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> qm = c.solution.get_quality_metrics() + """ + return QualityMetrics(self._cplex)
+ + +
+[docs] + def write(self, filename): + """Writes the incumbent solution to a file. + + See `CPXsolwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/solwrite.html>`_ in the Callable Library Reference + Manual and also `InitialInterface.read_start()`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.write("lpex.sol") + """ + CPX_PROC.solwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class PresolveStatus(ConstantClass): + """Presolve status codes""" + no_reductions = 0 + has_problem = 1 + empty_problem = 2
+ + + +
+[docs] +class PresolveMethod(ConstantClass): + """Presolve solution methods""" + none = _constants.CPX_ALG_NONE + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER
+ + + +
+[docs] +class PresolveColStatus(ConstantClass): + """Presolve variable status codes""" + lower_bound = _constants.CPX_PRECOL_LOW + upper_bound = _constants.CPX_PRECOL_UP + fixed = _constants.CPX_PRECOL_FIX + aggregated = _constants.CPX_PRECOL_AGG + other = _constants.CPX_PRECOL_OTHER
+ + + +
+[docs] +class PresolveRowStatus(ConstantClass): + """Presolve linear constraint status codes""" + reduced = _constants.CPX_PREROW_RED + aggregated = _constants.CPX_PREROW_AGG + other = _constants.CPX_PREROW_OTHER
+ + + +
+[docs] +class PresolveInterface(BaseInterface): + """Methods for dealing with the presolved problem.""" + + status = PresolveStatus() + """See `PresolveStatus()` """ + method = PresolveMethod() + """See `PresolveMethod()` """ + col_status = PresolveColStatus() + """See `PresolveColStatus()` """ + row_status = PresolveRowStatus() + """See `PresolveRowStatus()` """ + +
+[docs] + def crush_formula(self, formula): + """Crushes a linear formula down into the presolved space. + + formula may either be an instance of the SparsePair class or a + sequence of length two, the first entry of which contains + variable names or indices, the second entry of which contains + the float values associated with those variables. + + Returns a (crushed_formula, offset) pair, where + crushed_formula is a SparsePair object containing the crushed + formula in terms of the presolved variables and offset is the + value of the linear formula corresponding to variables that + have been removed in the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2)) + (SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0) + """ + ind, val = unpack_pair(formula) + ret = CPX_PROC.crushform(self._env._e, self._cplex._lp, ind, val) + return (SparsePair(ret[1], ret[2]), ret[0])
+ + +
+[docs] + def crush_x(self, x): + """Projects a primal solution down to the presolved space. + + x must be a list of floats with length equal to the number of + variables in the original problem. Returns a list of floats + with length equal to the number of variables in the presolved + problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_x([1.0] * 4) + [1.0, 1.0, 1.0] + """ + return CPX_PROC.crushx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def crush_pi(self, pi): + """Projects a dual solution down to the presolved space. + + pi must be a list of floats with length equal to the number of + linear constraints in the original problem. Returns a list of + floats with length equal to the number of linear constraints + in the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_pi([1.0] * 4) + [1.0, 1.0, 1.0] + """ + return CPX_PROC.crushpi(self._env._e, self._cplex._lp, pi)
+ + +
+[docs] + def uncrush_formula(self, pre_formula): + """Uncrushes a linear formula up from the presolved space. + + formula may either be an instance of the SparsePair class or a + sequence of length two, the first entry of which contains + variable names or indices, the second entry of which contains + the float values associated with those variables. + + Returns a (formula, offset) pair, where formula is a + SparsePair object containing the formula in terms of variables + in the original problem and offset is the value of the linear + formula corresponding to variables that have been removed in + the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2)) + (SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0) + """ + ind, val = unpack_pair(pre_formula) + ret = CPX_PROC.uncrushform(self._env._e, self._cplex._lp, ind, val) + return (SparsePair(ret[1], ret[2]), ret[0])
+ + +
+[docs] + def uncrush_x(self, pre_x): + """Projects a primal presolved solution up to the original space. + + x must be a list of floats with length equal to the number of + variables in the presolved problem. Returns a list of floats + with length equal to the number of variables in the original + problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_x([1.0] * 3) + [1.0, 1.0, 1.0, 0.0] + """ + return CPX_PROC.uncrushx(self._env._e, self._cplex._lp, pre_x)
+ + +
+[docs] + def uncrush_pi(self, pre_pi): + """Projects a dual presolved solution up to the presolved space. + + pi must be a list of floats with length equal to the number of + linear constraints in the presolved problem. Returns a list + of floats with length equal to the number of linear + constraints in the original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_pi([1.0] * 3) + [1.0, 1.0, 1.0, 0.0] + """ + return CPX_PROC.uncrushpi(self._env._e, self._cplex._lp, pre_pi)
+ + +
+[docs] + def free(self): + """Frees the presolved problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.free() + """ + CPX_PROC.freepresolve(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_status(self): + """Returns the status of presolve. + + Returns an attribute of Cplex.presolve.status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_status() + 1 + """ + return CPX_PROC.getprestat_status(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_row_status(self): + """Returns the status of the original linear constraints. + + Returns a list of integers with length equal to the number of + linear constraints in the original problem. Each entry of + this list is an attribute of Cplex.presolve.row_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_row_status() + [-3, 1, 2, -3] + """ + return CPX_PROC.getprestat_r(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_col_status(self): + """Returns the status of the original variables. + + Returns a list of integers with length equal to the number of + variables in the original problem. Each entry of this list + is an attribute of Cplex.presolve.col_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_col_status() + [0, 1, 2, -5] + """ + return CPX_PROC.getprestat_c(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_presolved_row_status(self): + """Returns the status of the presolved linear constraints. + + Returns a list of integers with length equal to the number of + linear constraints in the presolved problem. -1 indicates + that the presolved linear constraint corresponds to more than + one linear constraint in the original problem. Otherwise the + value is the index of the corresponding linear constraint in + the original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_presolved_row_status() + [-1, 1, 2] + """ + return CPX_PROC.getprestat_or(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_presolved_col_status(self): + """Returns the status of the presolved variables. + + Returns a list of integers with length equal to the number of + variables in the presolved problem. -1 indicates that the + presolved variable corresponds to a linear combination of more + than one variable in the original problem. Otherwise the + value is the index of the corresponding variable in the + original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_presolved_col_status() + [0, 1, 2] + """ + return CPX_PROC.getprestat_oc(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add_rows(self, lin_expr=None, senses="", rhs=None, names=None): + """Adds linear constraints to the presolved problem. + + presolve.add_rows accepts the keyword arguments lin_expr, + senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the types of the variables. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + The specified constraints are added to both the original + problem and the presolved problem. + """ + lin_expr, senses, rhs, names = init_list_args( + lin_expr, senses, rhs, names) + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + if isinstance(lin_expr, list): + rmat = _HBMatrix(lin_expr) + CPX_PROC.preaddrows(self._env._e, self._cplex._lp, rhs, senses, + rmat.matbeg, rmat.matind, rmat.matval, names)
+ + # TODO: We don't return an iterator here because there's no way to + # get indices of presolve rows from names. + +
+[docs] + def set_objective(self, objective): + """Sets the linear objective function of the presolved problem. + + objective must be either a SparsePair instance or a list of + two lists, the first of which contains variable indices or + names, the second of which contains floats. + + The objective function of both the original problem and the + presolved problem are changed. + + """ + ind, val = unpack_pair(objective) + CPX_PROC.prechgobj(self._env._e, self._cplex._lp, ind, val)
+ + +
+[docs] + def presolve(self, method): + """Solves the presolved problem. + + method must be an attribute of Cplex.presolve.method. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + """ + CPX_PROC.presolve(self._env._e, self._cplex._lp, method)
+ + +
+[docs] + def write(self, filename): + """Writes the presolved problem to a file.""" + return CPX_PROC.preslvwrite(self._env._e, self._cplex._lp, + filename)
+
+ + + +
+[docs] +class FeasoptConstraintType(ConstantClass): + """Types of constraints""" + lower_bound = _constants.CPX_CON_LOWER_BOUND + upper_bound = _constants.CPX_CON_UPPER_BOUND + linear = _constants.CPX_CON_LINEAR + quadratic = _constants.CPX_CON_QUADRATIC + indicator = _constants.CPX_CON_INDICATOR
+ + + +
+[docs] +class FeasoptInterface(BaseInterface): + """Finds a minimal relaxation of the problem that is feasible. + + This is a callable class. To find a feasible relaxation of a problem, + invoke the `__call__` method of this class. + """ + + constraint_type = FeasoptConstraintType() + """See `FeasoptConstraintType()` """ + +
+[docs] + def all_constraints(self): + """Returns an object instructing feasopt to relax all constraints. + + Calling Cplex.feasopt(Cplex.feasopt.all_constraints()) will + result in every constraint being relaxed independently with + equal weight. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.all_constraints() + """ + gp = self.upper_bound_constraints()._gp + gp += self.lower_bound_constraints()._gp + gp += self.linear_constraints()._gp + gp += self.quadratic_constraints()._gp + gp += self.indicator_constraints()._gp + return _group(gp)
+ + +
+[docs] + def upper_bound_constraints(self, *args): + """Returns an object instructing feasopt to relax all upper bounds. + + If called with no arguments, every upper bound is assigned + weight 1.0. + + If called with one or more arguments, every upper bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of upper bounds to be relaxed. If one variable index or name + is specified, it is the only upper bound that can be relaxed. + If two variable indices or names are specified, then upper + bounds of all variables between the first and the second, + inclusive, can be relaxed. If a sequence of variable names or + indices is passed in, all of their upper bounds can be + relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.upper_bound_constraints() + """ + return self._make_group(self.constraint_type.upper_bound, *args)
+ + +
+[docs] + def lower_bound_constraints(self, *args): + """Returns an object instructing feasopt to relax all lower bounds. + + If called with no arguments, every lower bound is assigned + weight 1.0. + + If called with one or more arguments, every lower bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of lower bounds to be relaxed. If one variable index or name + is specified, it is the only lower bound that can be relaxed. + If two variable indices or names are specified, then lower + bounds of all variables between the first and the second, + inclusive, can be relaxed. If a sequence of variable names or + indices is passed in, all of their lower bounds can be + relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.lower_bound_constraints() + """ + return self._make_group(self.constraint_type.lower_bound, *args)
+ + +
+[docs] + def linear_constraints(self, *args): + """Returns an object instructing feasopt to relax all linear constraints. + + If called with no arguments, every linear constraint is + assigned weight 1.0. + + If called with one or more arguments, every linear constraint + is assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of linear constraints to be relaxed. If one linear constraint + index or name is specified, it is the only linear constraint + that can be relaxed. If two linear constraint indices or + names are specified, then all linear constraints between the + first and the second, inclusive, can be relaxed. If a sequence + of linear constraint names or indices is passed in, all of their + linear constraints can be relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.linear_constraints() + """ + return self._make_group(self.constraint_type.linear, *args)
+ + +
+[docs] + def quadratic_constraints(self, *args): + """Returns an object instructing feasopt to relax all quadratic constraints. + + If called with no arguments, every quadratic constraint is + assigned weight 1.0. + + If called with one or more arguments, every quadratic + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of quadratic constraints to be relaxed. If one quadratic + constraint index or name is specified, it is the only + quadratic constraint that can be relaxed. If two quadratic + constraint indices or names are specified, then all quadratic + constraints between the first and the second, inclusive, can be + relaxed. If a sequence of quadratic constraint names or indices + is passed in, all of their quadratic constraints can be relaxed. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.quadratic_constraints() + """ + return self._make_group(self.constraint_type.quadratic, *args)
+ + +
+[docs] + def indicator_constraints(self, *args): + """Returns an object instructing feasopt to relax all indicator constraints. + + If called with no arguments, every indicator constraint is + assigned weight 1.0. + + If called with one or more arguments, every indicator + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of indicator constraints to be relaxed. If one indicator + constraint index or name is specified, it is the only + indicator constraint that can be relaxed. If two indicator + constraint indices or names are specified, then all indicator + constraints between the first and the second, inclusive, can be + relaxed. If a sequence of indicator constraint names or indices + is passed in, all of their indicator constraints can be relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.indicator_constraints() + """ + return self._make_group(self.constraint_type.indicator, *args)
+ + +
+[docs] + def __call__(self, *args): + """Finds a minimal relaxation of the problem that is feasible. + + This method can take arbitrarily many arguments. Either the + object returned by feasopt.all_constraints() or any combination + of constraint groups and objects returned by + `upper_bound_constraints()`, `lower_bound_constraints()`, + `linear_constraints()`, `quadratic_constraints()`, or + `indicator_constraints()` may be used to specify the constraints + to consider. + + Constraint groups are sequences of length two, the first entry of + which is the preference for the group (a float), the second of + which is a sequence of pairs (type, id), where type is an + attribute of self.constraint_type and id is either an index or a + valid name for the type. + + See `CPXfeasoptext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/feasoptext.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("infeasible.lp") + >>> c.feasopt(c.feasopt.all_constraints()) + >>> c.solution.get_objective_value() + 2.0 + >>> c.solution.get_values() + [3.0, 2.0, 3.0, 2.0] + """ + if not args: + raise WrongNumberOfArgumentsError( + "Requires at least one argument") + gpref, gbeg, ind, indt = [], [], [], [] + args = list(args) # so we can call extend() below + for group in args: + if isinstance(group, _group): + args.extend(group._gp) + continue + gpref.append(group[0]) + gbeg.append(len(ind)) + for con in group[1]: + tran = self._getconvfunc(con[0]) + indt.append(con[0]) + ind.append(tran(con[1])) + self._cplex._setup_callbacks() + CPX_PROC.feasoptext(self._env._e, self._cplex._lp, + gpref, gbeg, ind, indt)
+ + + def _make_group(self, which, *args): + conv = self._getconvfunc(which) + max_num = self._getnum(which) + return make_group(conv, max_num, which, *args) + + def _getinterface(self, which): + contype = self.constraint_type + switcher = { + contype.lower_bound: self._cplex.variables, + contype.upper_bound: self._cplex.variables, + contype.linear: self._cplex.linear_constraints, + contype.quadratic: self._cplex.quadratic_constraints, + contype.indicator: self._cplex.indicator_constraints + } + return switcher[which] + + def _getnum(self, which): + interface = self._getinterface(which) + return interface.get_num() + + def _getconvfunc(self, which): + interface = self._getinterface(which) + return interface._conv
+ + + +
+[docs] +class ConflictStatus(ConstantClass): + """Status codes returned by conflict.get""" + excluded = _constants.CPX_CONFLICT_EXCLUDED + possible_member = _constants.CPX_CONFLICT_POSSIBLE_MEMBER + member = _constants.CPX_CONFLICT_MEMBER
+ + + +
+[docs] +class ConflictConstraintType(ConstantClass): + """Types of constraints""" + lower_bound = _constants.CPX_CON_LOWER_BOUND + upper_bound = _constants.CPX_CON_UPPER_BOUND + linear = _constants.CPX_CON_LINEAR + quadratic = _constants.CPX_CON_QUADRATIC + indicator = _constants.CPX_CON_INDICATOR + SOS = _constants.CPX_CON_SOS + pwl = _constants.CPX_CON_PWL
+ + + +
+[docs] +class ConflictInterface(BaseInterface): + """Methods for identifying conflicts among constraints.""" + + group_status = ConflictStatus() + """See `ConflictStatus()` """ + constraint_type = ConflictConstraintType() + """See `ConflictConstraintType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new ConflictInterface. + + The conflict interface is exposed by the top-level `Cplex` class + as Cplex.conflict. This constructor is not meant to be used + externally. + """ + super().__init__(cplex)
+ + +
+[docs] + def all_constraints(self): + """Returns an object instructing the conflict refiner to include + all constraints. + + Calling + Cplex.conflict.refine(Cplex.conflict.all_constraints()) or + Cplex.conflict.refine_MIP_start(Cplex.conflict.all_constraints()) + will result in every constraint being included in the search + for conflicts with equal preference. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.all_constraints() + """ + gp = self.upper_bound_constraints()._gp + gp += self.lower_bound_constraints()._gp + gp += self.linear_constraints()._gp + gp += self.quadratic_constraints()._gp + gp += self.SOS_constraints()._gp + gp += self.indicator_constraints()._gp + gp += self.pwl_constraints()._gp + return _group(gp)
+ + +
+[docs] + def upper_bound_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all upper bounds. + + If called with no arguments, every upper bound is assigned + weight 1.0. + + If called with one or more arguments, every upper bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of upper bounds to be included. If one variable index or name + is specified, it is the only upper bound that will be + included. If two variable indices or names are specified, then + upper bounds of all variables between the first and the + second, inclusive, will be included. If a sequence of + variable names or indices is passed in, all of their upper + bounds will be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.upper_bound_constraints() + """ + return self._make_group(self.constraint_type.upper_bound, *args)
+ + +
+[docs] + def lower_bound_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all lower bounds. + + If called with no arguments, every lower bound is assigned + weight 1.0. + + If called with one or more arguments, every lower bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of lower bounds to be included. If one variable index or name + is specified, it is the only lower bound that will be + included. If two variable indices or names are specified, then + lower bounds of all variables between the first and the + second, inclusive, will be included. If a sequence of + variable names or indices is passed in, all of their lower + bounds will be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.lower_bound_constraints() + """ + return self._make_group(self.constraint_type.lower_bound, *args)
+ + +
+[docs] + def linear_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all linear constraints. + + If called with no arguments, every linear constraint is + assigned weight 1.0. + + If called with one or more arguments, every linear constraint + is assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of linear constraints to be included. If one linear + constraint index or name is specified, it is the only linear + constraint that will be included. If two linear constraint + indices or names are specified, then all linear constraints + between the first and the second, inclusive, will be included. + If a sequence of linear constraint names or indices is passed + in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.linear_constraints() + """ + return self._make_group(self.constraint_type.linear, *args)
+ + +
+[docs] + def quadratic_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all quadratic constraints. + + If called with no arguments, every quadratic constraint is + assigned weight 1.0. + + If called with one or more arguments, every quadratic + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of quadratic constraints to be included. If one quadratic + constraint index or name is specified, it is the only + quadratic constraint that will be included. If two quadratic + constraint indices or names are specified, then all quadratic + constraints between the first and the second, inclusive, will + be included. If a sequence of quadratic constraint names or + indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.quadratic_constraints() + """ + return self._make_group(self.constraint_type.quadratic, *args)
+ + +
+[docs] + def indicator_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all indicator constraints. + + If called with no arguments, every indicator constraint is + assigned weight 1.0. + + If called with one or more arguments, every indicator + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of indicator constraints to be included. If one indicator + constraint index or name is specified, it is the only + indicator constraint that will be included. If two indicator + constraint indices or names are specified, the all indicator + constraints between the first and the second, inclusive, will + be included. If a sequence of indicator constraint names or + indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.indicator_constraints() + """ + return self._make_group(self.constraint_type.indicator, *args)
+ + +
+[docs] + def pwl_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all PWL constraints. + + If called with no arguments, every PWL constraint is assigned + weight 1.0. + + If called with one or more arguments, every PWL constraint is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of PWL constraints to be included. If one PWL constraint index or + name is specified, it is the only PWL constraint that will be + included. If two PWL constraint indices or names are specified, + then all PWL constraints between the first and the second, + inclusive, will be included. If a sequence of PWL constraint + names or indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.pwl_constraints() + """ + return self._make_group(self.constraint_type.pwl, *args)
+ + +
+[docs] + def SOS_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all SOS constraints. + + If called with no arguments, every SOS constraint is assigned + weight 1.0. + + If called with one or more arguments, every SOS constraint is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of SOS constraints to be included. If one SOS constraint + index or name is specified, it is the only SOS constraint that + will be included. If two SOS constraint indices or names are + specified, then all SOS constraints between the first and the + second, inclusive, will be included. If a sequence of SOS + constraint names or indices is passed in, they will all be + included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.SOS_constraints() + """ + return self._make_group(self.constraint_type.SOS, *args)
+ + + @staticmethod + def _expand_groups(args): + """Expands group arguments passed to the refine methods + + These should be either _group objects or tuples of length two + (the first entry of which is the preference for the group (a + float), the second of which is a tuple of pairs (type, id), + where type is an attribute of conflict.constraint_type and id is + either an index or a valid name for the type). + + As _group objects can contain many tuples, this method makes + sure that the expanded order is maintained. + """ + groups = [] + for arg in args: + try: + # Grab the tuple list out of any _group objects we encounter. + groups.extend(arg._gp) + except AttributeError: + # Otherwise, we assume these are tuples. + groups.append(arg) + return groups + + def _separate_groups(self, args): + """Separates group information into individual lists. + + This, so they can be passed into the callable library in the + expected format. + """ + grppref, grpbeg, grpind, grptype = [], [], [], [] + groups = self._expand_groups(args) + for group in groups: + pref, contpl = group + grppref.append(pref) + grpbeg.append(len(grpind)) + for contype, conid in contpl: + tran = self._getconvfunc(contype) + grptype.append(contype) + grpind.append(tran(conid)) + return grppref, grpbeg, grpind, grptype + + def _compose_groups(self, grppref, grpbeg, grpind, grptype): + """Convert individual lists of group information into group + format. + + These are tuples of length two (the first entry of which is the + preference for the group (a float), the second of which is a + tuple of pairs (type, id), where type is an attribute of + conflict.constraint_type and id is either an index or a valid + name for the type). + """ + groups = [] + grpbeglen = len(grpbeg) + for i in range(grpbeglen): + begin = grpbeg[i] + if i == grpbeglen - 1: + end = len(grpind) + else: + end = grpbeg[i + 1] + groups.append((grppref[i], tuple(zip(grptype[begin:end], + grpind[begin:end])))) + return groups + + def _make_group(self, which, *args): + conv = self._getconvfunc(which) + max_num = self._getnum(which) + return make_group(conv, max_num, which, *args) + + def _getinterface(self, which): + contype = self.constraint_type + switcher = { + contype.lower_bound: self._cplex.variables, + contype.upper_bound: self._cplex.variables, + contype.linear: self._cplex.linear_constraints, + contype.quadratic: self._cplex.quadratic_constraints, + contype.SOS: self._cplex.SOS, + contype.indicator: self._cplex.indicator_constraints, + contype.pwl: self._cplex.pwl_constraints + } + return switcher[which] + + def _getnum(self, which): + interface = self._getinterface(which) + return interface.get_num() + + def _getconvfunc(self, which): + interface = self._getinterface(which) + return interface._conv + +
+[docs] + def refine_MIP_start(self, MIP_start, *args): + """Identifies a minimal conflict among a set of constraints for a + given MIP start. + + This method can take arbitrarily many arguments. The first + argument must be either a name or index of a MIP start. + Additional arguments are optional and can be the object returned + by `all_constraints()` or any combination of constraint groups + and objects returned by `upper_bound_constraints()`, + `lower_bound_constraints()`, `linear_constraints()`, + `quadratic_constraints()`, `indicator_constraints()`, + `pwl_constraints()`, or `SOS_constraints()` may be used to + specify the constraints to consider. If no additional arguments + are specified, then constraint groups are created automatically + as in the CPLEX interactive. + + Constraint groups are sequences of length two, the first entry + of which is the preference for the group (a float), the second + of which is a sequence of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index + or a valid name for the type. + + See `CPXrefinemipstartconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/refinemipstartconflictext.html>`_ and in the Callable + Library Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> indices = c.variables.add([1], [0], [0], c.variables.type.binary) + >>> indices = c.variables.add([2], [0], [0], c.variables.type.binary) + >>> c.solve() + >>> indices = c.linear_constraints.add( + ... lin_expr=[[[0, 1], [1.0, 1.0]]], senses="E", rhs=[2.0]) + >>> c.conflict.refine_MIP_start(0, c.conflict.all_constraints()) + >>> c.conflict.get() + [-1, -1, -1, -1, 3] + >>> c.conflict.group_status[3], c.conflict.group_status[-1] + ('member', 'excluded') + >>> c.conflict.get_groups(0, 3) + [(1.0, ((2, 0),)), (1.0, ((2, 1),)), (1.0, ((1, 0),)), (1.0, ((1, 1),))] + """ + self._cplex._setup_callbacks() + mipstartindex = self._cplex.MIP_starts._conv(MIP_start) + if args: + grppref, grpbeg, grpind, grptype = self._separate_groups(args) + else: + grppref, grpbeg, grpind, grptype = None, None, None, None + CPX_PROC.refinemipstartconflictext(self._env._e, self._cplex._lp, + mipstartindex, + grppref, grpbeg, grpind, grptype)
+ + +
+[docs] + def refine(self, *args): + """Identifies a minimal conflict among a set of constraints. + + This method can take arbitrarily many arguments. Either the + object returned by `all_constraints()` or any combination of + constraint groups and objects returned by + `upper_bound_constraints()`, `lower_bound_constraints()`, + `linear_constraints()`, `quadratic_constraints()`, + `indicator_constraints()`, `pwl_constraints()`, or + `SOS_constraints()` may be used to specify the constraints to + consider. Alternatively, if no arguments are specified, then + constraint groups are created automatically as in the CPLEX + interactive. + + Constraint groups are sequences of length two, the first entry + of which is the preference for the group (a float), the second + of which is a sequence of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index or + a valid name for the type. + + See `CPXrefineconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/refineconflictext.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.linear_constraints(), + ... c.conflict.lower_bound_constraints()) + >>> c.conflict.get() + [3, -1, 3, -1, -1, -1] + >>> c.conflict.group_status[3], c.conflict.group_status[-1] + ('member', 'excluded') + >>> c.conflict.get_groups([0, 2]) + [(1.0, ((3, 0),)), (1.0, ((1, 0),))] + """ + self._cplex._setup_callbacks() + if args: + grppref, grpbeg, grpind, grptype = self._separate_groups(args) + else: + grppref, grpbeg, grpind, grptype = None, None, None, None + CPX_PROC.refineconflictext(self._env._e, self._cplex._lp, + grppref, grpbeg, grpind, grptype)
+ + +
+[docs] + def get(self, *args): + """Returns the status of a set of groups of constraints. + + Can be called by four forms. + + If called with no arguments, returns a list containing the + status of all constraint groups. + + If called with one integer argument, returns the status of + that constraint group. + + If called with two integer arguments, returns the status of + all constraint groups between the first and second argument, + inclusive. + + If called with a sequence of integers as its argument, returns + the status of all constraint groups in the sequence. + + The status codes are attributes of + Cplex.conflict.group_status. + + See `CPXgetconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictext.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> confstatus = c.conflict.get() + """ + def getconflict(a, b=self.get_num_groups() - 1): + return CPX_PROC.getconflictext(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getconflict, None, args)
+ + +
+[docs] + def get_num_groups(self): + """Returns the number of constraint groups used in the last call + to `refine()` or `refine_MIP_start()`. + + See `CPXgetconflictnumgroups <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictnumgroups.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> c.conflict.get_num_groups() + 10 + """ + return CPX_PROC.getconflictnumgroups(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_groups(self, *args): + """Returns the groups of constraints used in the last call to + `refine()` or `refine_MIP_start()`. + + Can be called by four forms. + + If called with no arguments, returns a list containing all + constraint groups. + + If called with one integer argument, returns that constraint + group. + + If called with two integer arguments, returns all constraint + groups between the first and second argument, inclusive. + + If called with a sequence of integers as its argument, returns + all constraint groups in the sequence. + + Constraint groups are tuples of length two, the first entry of + which is the preference for the group (a float), the second of + which is a tuple of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index + or a valid name for the type. + + See `CPXgetconflictgroups <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictgroups.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> groups = c.conflict.get_groups() + """ + def getgroups(begin, end=self.get_num_groups() - 1): + (grppref, grpbeg, grpind, + grptype) = CPX_PROC.getconflictgroups(self._env._e, + self._cplex._lp, + begin, end) + return self._compose_groups(grppref, grpbeg, grpind, grptype) + return apply_freeform_two_args(getgroups, None, args)
+ + +
+[docs] + def write(self, filename): + """Writes the conflict to a file. + + See `CPXclpwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/clpwrite.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> c.conflict.write("conflict.clp") + """ + CPX_PROC.clpwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class PivotVarStatus(ConstantClass): + """Use as input to pivoting methods.""" + at_lower_bound = _constants.CPX_AT_LOWER + at_upper_bound = _constants.CPX_AT_UPPER
+ + + +
+[docs] +class AdvancedCplexInterface(BaseInterface): + """Advanced control of a Cplex object.""" + + no_variable = _constants.CPX_NO_VARIABLE + """See `_constants.CPX_NO_VARIABLE` """ + variable_status = PivotVarStatus() + """See `PivotVarStatus()` """ + +
+[docs] + def delete_names(self): + """Deletes all names from the problem and its objects.""" + CPX_PROC.delnames(self._env._e, self._cplex._lp)
+ + +
+[docs] + def basic_presolve(self): + """Performs bound strengthening and detects redundant rows. + + Returns a tuple containing three lists: a list containing the + strengthened lower bounds, a list containing the strengthened + upper bounds, and a list containing the status of each row. + + See `CPXbasicpresolve <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/basicpresolve.html>`_ in the Callable Library Reference + Manual. + + Note + This method does not create a presolved problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> redlb, redub, rstat = c.advanced.basic_presolve() + """ + return CPX_PROC.basicpresolve(self._env._e, self._cplex._lp)
+ + +
+[docs] + def pivot(self, enter, leave, status): + """Pivots a variable into the basis. + + enter is a name or index of a variable or linear constraint. + The index of a slack variable is specified by a negative + integer; -i - 1 refers to the slack associated with the ith + linear constraint. enter must not identify a basic variable. + + leave is a name or index of a variable or linear constraint. + The index of a slack variable is specified by a negative + integer; -i - 1 refers to the slack associated with the ith + linear constraint. leave must identify either a basic + variable or a non-basic variable with both a lower and upper + bound to indicate that it is to move to its opposite bound. + leave may also be set to Cplex.advanced.no_variable to + instruct CPLEX to use a ratio test to determine the entering + variable. + + Note + If a linear constraint has the same name as a column, it must + be specified by -index - 1, not by name. + + status must be an attribute of Cplex.advanced.variable_status + specifying the nonbasic status to be assigned to the leaving + variable after the basis change. + + """ + def conv(var): + try: + return self._cplex.variables._conv(var) + except CplexSolverError: + # Variable name not found, try linear constraints. + return -self._cplex.linear_constraints._conv(var) - 1 + CPX_PROC.pivot(self._env._e, self._cplex._lp, conv(enter), + conv(leave), status)
+ + +
+[docs] + def pivot_slacks_in(self, which): + """Forcibly pivots slack variables into the basis. + + which may be either a single linear constraint index or name + or a sequence of linear constraint indices or names. + + """ + x = listify(self._cplex.linear_constraints._conv(which)) + CPX_PROC.pivotin(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def pivot_fixed_variables_out(self, which): + """Forcibly pivots structural variables out of the basis. + + which may be either a single variable index or name or a + sequence of variable indices or names. + + """ + x = listify(self._cplex.variables._conv(which)) + CPX_PROC.pivotout(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def strong_branching(self, variables, it_limit): + """Performs strong branching. + + variables is a sequence of names or indices of variables. + + it_limit is an integer that specifies the number of iterations + allowed. + + Returns a list of pairs (down_penalty, up_penalty) with the + same length as variables containing the penalties for + branching down or up, respectively, on each variable. + + See `CPXstrongbranch <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/strongbranch.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> itlim = c.parameters.simplex.limits.iterations.get() + >>> c.read("example.mps") + >>> c.solve() + >>> vars = list(range(c.variables.get_num())) + >>> result = c.advanced.strong_branching(vars, itlim) + """ + def conv(var): + return self._cplex.variables._conv(var) + return unzip(CPX_PROC.strongbranch( + self._env._e, self._cplex._lp, + conv(variables), it_limit))
+ + +
+[docs] + def complete(self): + """See `CPXcompletelp <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/completelp.html>`_ in the Callable Library Reference + Manual.""" + CPX_PROC.completelp(self._env._e, self._cplex.lp)
+
+ + + +
+[docs] +class BranchDirection(ConstantClass): + """Constants defining branch directions""" + default = _constants.CPX_BRANCH_GLOBAL + down = _constants.CPX_BRANCH_DOWN + up = _constants.CPX_BRANCH_UP
+ + + +
+[docs] +class OrderInterface(BaseInterface): + """Methods for setting and querying a priority order for branching. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(5)]) + >>> c.variables.set_types(zip(list(range(5)), ["C","I","I","I","I"])) + >>> c.order.set([(1, 10, c.order.branch_direction.up), ('3', 5, c.order.branch_direction.down)]) + >>> c.order.get() + [(1, 10, 1), (3, 5, -1)] + >>> c.order.get_variables() + [1, 3] + """ + + branch_direction = BranchDirection() + """See `BranchDirection()` """ + +
+[docs] + def get(self): + """Returns a list of triples (variable, priority, direction) + representing the priority order for branching. + """ + return unzip(CPX_PROC.getorder(self._env._e, self._cplex._lp))
+ + +
+[docs] + def get_variables(self): + """Returns the variables for which an order has been set.""" + return CPX_PROC.getorder(self._env._e, self._cplex._lp)[0]
+ + +
+[docs] + def set(self, order): + """Sets the priority order for branching. + + order must be a list of triples (variable, priority, direction). + + variable must be an index or name of a variable. + + priority must be a nonnegative integer. + + direction must be an attribute of order.branch_direction. + """ + ord = unzip(order) + ord[0] = self._cplex.variables._conv(ord[0]) + CPX_PROC.copyorder(self._env._e, self._cplex._lp, *ord)
+ + +
+[docs] + def read(self, filename): + """Reads a priority order from a file.""" + CPX_PROC.readcopyorder(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def write(self, filename): + """Writes the priority order to a file.""" + CPX_PROC.ordwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class InitialInterface(BaseInterface): + """Methods to set starting information for an optimization algorithm + to solve continuous problems (LP, QP, QCP). + + Note + Data passed to these methods cannot be queried immediately from + the methods in Cplex.solution. Those methods will return + data only after Cplex.solve() or Cplex.feasopt() has been called. + """ + + status = BasisVarStatus() + """See `BasisVarStatus()` """ + +
+[docs] + def set_start(self, col_status, row_status, col_primal, row_primal, + col_dual, row_dual): + """Sets basis statuses, primal values, and dual values. + + The arguments col_status, col_primal, and col_dual are lists + that either have length equal to the number of variables or + are empty. If col_status is empty, then row_status must also + be empty. If col_primal is empty, then row_primal must also + be empty. + + The arguments row_status, row_primal, and row_dual are lists + that either have length equal to the number of linear + constraints or are empty. If row_status is empty, the + col_status must also be empty. If row_dual is empty, then + col_dual must also be empty. + + Each entry of col_status and row_status must be an attribute of + Cplex.start.status. + + Each entry of col_primal and row_primal must be a float + specifying the starting primal values for the columns and + rows, respectively. + + Each entry of col_dual and row_dual must be a float + specifying the starting dual values for the columns and rows, + respectively. + + Note + The starting information is ignored by the optimizers if the + parameter cplex.parameters.advance is set to + cplex.parameters.advance.values.none. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=["v{0}".format(i) for i in range(5)] + ... ) + >>> indices = c.linear_constraints.add( + ... names=["r{0}".format(i) for i in range(3)] + ... ) + >>> s = c.start.status + >>> c.start.set_start( + ... [s.basic] * 3 + [s.at_lower_bound] * 2, + ... [s.basic] + [s.at_upper_bound] * 2, + ... [0.0] * 5, + ... [1.0] * 3, + ... [2.0] * 5, + ... [3.0] * 3 + ... ) + """ + CPX_PROC.copystart(self._env._e, self._cplex._lp, col_status, + row_status, col_primal, row_primal, col_dual, + row_dual)
+ + +
+[docs] + def read_start(self, filename): + """Reads the starting information from a file. + + See `CPXreadcopystartinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopystartinfo.html>`_ in the Callable Library + Reference Manual and also `SolutionInterface.write()`. + + Example usage: + + >>> import cplex + >>> c1 = cplex.Cplex() + >>> out = c1.set_results_stream(None) + >>> out = c1.set_log_stream(None) + >>> c1.read("lpex.mps") + >>> c1.solve() + >>> c1.solution.write("lpex.sol") + >>> c2 = cplex.Cplex() + >>> out = c2.set_results_stream(None) + >>> out = c2.set_log_stream(None) + >>> c2.read("lpex.mps") + >>> c2.start.read_start("lpex.sol") + """ + CPX_PROC.readcopystartinfo(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def read_basis(self, filename): + """Reads the starting basis from a file. + + See `CPXreadcopybase <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopybase.html>`_ in the Callable Library Reference + Manual and also `BasisInterface.write()`. + + Example: + + >>> import cplex + >>> c1 = cplex.Cplex() + >>> out = c1.set_results_stream(None) + >>> out = c1.set_log_stream(None) + >>> c1.read("lpex.mps") + >>> c1.solve() + >>> c1.solution.basis.write("lpex.bas") + >>> c2 = cplex.Cplex() + >>> out = c2.set_results_stream(None) + >>> out = c2.set_log_stream(None) + >>> c2.read("lpex.mps") + >>> c2.start.read_basis("lpex.bas") + """ + CPX_PROC.readcopybase(self._env._e, self._cplex._lp, filename)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/aborter.html b/docs/22.1.2.0/_modules/cplex/aborter.html new file mode 100644 index 0000000..311d1b3 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/aborter.html @@ -0,0 +1,240 @@ + + + + + + + cplex.aborter — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.aborter

+# --------------------------------------------------------------------------
+# File: aborter.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""Aborter API"""
+from ._internal import _procedural as _proc
+
+
+
+[docs] +class Aborter(): + """Gracefully terminates the solve and tuning methods of CPLEX. + + You can pass an instance of this class to one or more Cplex objects. + + Calling the method abort() will then terminate the solve or tuning + method of the Cplex object. + """ + +
+[docs] + def __init__(self): + """Constructor of the Aborter class. + + The Aborter object is a context manager and can be used, like so: + + with Aborter() as aborter: + # do stuff + + When the with block is finished, the end() method will be called + automatically. + """ + self._disposed = False + self._p = _proc.new_native_int() + self._cpxlst = set()
+ + + def _register(self, cpx): + self._cpxlst.add(cpx) + + def _unregister(self, cpx): + self._cpxlst.discard(cpx) + + def _throw_if_disposed(self): + if self._disposed: + raise ValueError( + 'illegal method invocation after Aborter.end()') + +
+[docs] + def abort(self): + """Aborts the solving and tuning methods. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.abort() + """ + self._throw_if_disposed() + _proc.set_native_int(self._p, 1)
+ + +
+[docs] + def clear(self): + """Clears the invoking aborter. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.clear() + """ + self._throw_if_disposed() + _proc.set_native_int(self._p, 0)
+ + +
+[docs] + def is_aborted(self): + """Returns True if the method to abort has been called. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.is_aborted() + False + """ + self._throw_if_disposed() + return _proc.get_native_int(self._p) != 0
+ + +
+[docs] + def end(self): + """Ends the invoking aborter. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.end() + """ + if self._disposed: + return + self._disposed = True + while self._cpxlst: + cpx = self._cpxlst.pop() + cpx.remove_aborter() + _proc.delete_native_int(self._p) + self._p = None
+ + + def __del__(self): + self.end() + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The with statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + Aborter objects return themselves. + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with block, the end() method is called. + """ + self.end()
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/callbacks.html b/docs/22.1.2.0/_modules/cplex/callbacks.html new file mode 100644 index 0000000..aa7cd2f --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/callbacks.html @@ -0,0 +1,3685 @@ + + + + + + + cplex.callbacks — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.callbacks

+# --------------------------------------------------------------------------
+# File: callback.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""Callback classes for the CPLEX Python API.
+
+This module defines the `Context` class which provides methods to query
+information and perform all actions that can be performed from a generic
+callback. See `Cplex.set_callback()`.
+
+See the following examples for more information on generic callbacks:
+
+ * admipex8.py
+ * admipex9.py
+ * bendersatsp2.py
+
+This module also defines a hierarchy of classes for legacy callbacks,
+many of which can be subclassed to define alternative behavior for the
+algorithms in CPLEX. The methods provided by the classes allow you to
+query information about the optimization in progress and to control the
+optimization algorithm.
+
+To use a subclassable legacy callback class, define a subclass of it that
+defines a __call__ method. Then pass that class name to the
+`Cplex.register_callback` method. The `Cplex` class will instantiate the
+legacy callback class and return the instance of the class that was
+created. If you wish to associate additional data with your callback
+class, you may do so after it has been registered with the `Cplex` object.
+
+See the following examples for more information on legacy callbacks:
+
+ * admipex1.py
+ * admipex2.py
+ * admipex3.py
+ * admipex5.py
+ * admipex6.py
+ * bendersatsp.py
+ * lpex4.py
+ * mipex4.py
+
+Note
+  If you operate the CPLEX Python API in parallel mode with callbacks
+  registered, there will be a single instance of each of your callback
+  classes shared among all threads.
+"""
+import weakref
+
+from . import _internal
+from ._internal._callbackinfoenum import CallbackInfo
+from ._internal import _constants as _const
+from ._internal._solutionstrategyenum import SolutionStrategy
+from ._internal import _procedural as _proc
+from ._internal._aux_functions import (apply_freeform_two_args,
+                                       apply_freeform_one_arg,
+                                       init_list_args, convert, max_arg_length,
+                                       validate_arg_lengths, unzip)
+from ._internal._matrices import SparsePair, _HBMatrix, unpack_pair
+from ._internal._subinterfaces import SolutionStatus
+from ._internal import _pycplex
+from .exceptions import (CplexError, CplexSolverError,
+                         WrongNumberOfArgumentsError)
+from .constant_class import ConstantClass
+from .exceptions.error_codes import CPXERR_UNSUPPORTED_OPERATION
+
+
+[docs] +class Callback(): + """Base class for Cplex callback classes. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + self._env = weakref.proxy(env) + self._cb_type_string = None + self._cb_set_function = None + self._cbstruct = None + self._env_lp_ptr = None + self._status = 0
+ + +
+[docs] + def __call__(self): + """Method to be overridden by user-defined callback class. + + See the `Cplex.register_callback` method. + """ + raise CplexError("Callback.__call__ is a pure virtual method")
+ + + def _conv_col(self, name, cache=None): + return convert(name, self._get_col_index, cache) + + def _get_col_index(self, name): + """non-public""" + status = _pycplex.cb_getcolindex( + self._cbstruct, self._env_lp_ptr, name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_row(self, name, cache=None): + return convert(name, self._get_row_index, cache) + + def _get_row_index(self, name): + """non-public""" + status = _pycplex.cb_getrowindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_quad(self, name, cache=None): + return convert(name, self._get_quad_index, cache) + + def _get_quad_index(self, name): + """non-public""" + status = _pycplex.cb_getqconstrindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_sos(self, name, cache=None): + return convert(name, self._get_sos_index, cache) + + def _get_sos_index(self, name): + """non-public""" + status = _pycplex.cb_getsosindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + +
+[docs] + def abort(self): + """Terminates optimization. + + Note + A call to abort should be followed immediately by a return + statement. Calling other callback methods may override the + effect of the abort statement. + """ + if hasattr(self, "_useraction"): + self._useraction = _const.CPX_CALLBACK_FAIL + self._status = 0 + else: + self._status = 1
+ + +
+[docs] + def get_end_time(self): + """Returns a time stamp for computing the time limit. + + Subtracting the return value of Callback.get_time() from the + return value of this method yields the time remaining in + seconds. + + The interpretation of this value as wall clock time or CPU + time is controlled by the parameter clocktype. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ENDTIME, + CplexSolverError)
+ + +
+[docs] + def get_end_dettime(self): + """Returns a deterministic time stamp in ticks. + + Subtracting the return value of Callback.get_dettime() from the + return value of this method yields the time remaining in + deterministic ticks. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ENDDETTIME, + CplexSolverError)
+ + +
+[docs] + def get_start_time(self): + """Returns a time stamp specifying when the solving process started. + + To compute elapsed time in seconds, subtract the result of + Callback.get_time() from the result of this method. This computation + yields either wallclock time (also known as real time) or CPU time, + depending on the clock set by the clocktype parameter. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_STARTTIME, + CplexSolverError)
+ + +
+[docs] + def get_start_dettime(self): + """Returns a deterministic time stamp specifying when the solving process started. + + To compute elapsed deterministic time in ticks, subtract the result of + Callback.get_dettime() from the result of this method. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_STARTDETTIME, + CplexSolverError)
+ + +
+[docs] + def get_time(self): + """Returns a time stamp for the current time. + + Subtracting the return value of this method from the return + value of Callback.get_end_time() yields the time remaining in + seconds. + + The interpretation of this value as wall clock time or CPU + time is controlled by the parameter clocktype. + """ + status = _pycplex.cb_gettime(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+ + +
+[docs] + def get_dettime(self): + """Returns a deterministic time stamp for the current time. + + Subtracting the return value of this method from the return + value of Callback.get_end_dettime() yields the time remaining in + deterministic ticks. + """ + status = _pycplex.cb_getdettime(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+
+ + + +
+[docs] +class OptimizationCallback(Callback): + """Base class for Cplex optimization callback classes.""" + + def _wherefrom(self): + """non-public""" + return _proc.get_wherefrom(self._cbstruct) + +
+[docs] + def get_num_quadratic_constraints(self): + """Returns the number of quadratic constraints in the problem.""" + return _pycplex.cb_getnumqconstrs(self._cbstruct, self._env_lp_ptr)
+ + +
+[docs] + def get_num_cols(self): + """Returns the number of variables in the problem.""" + return _pycplex.cb_getnumcols(self._cbstruct, self._env_lp_ptr)
+ + +
+[docs] + def get_num_rows(self): + """Returns the number of linear constraints in the problem.""" + return _pycplex.cb_getnumrows(self._cbstruct, self._env_lp_ptr)
+
+ + + +
+[docs] +class ContinuousCallback(OptimizationCallback): + """Subclassable class for Cplex continuous callbacks. + + When Cplex is solving a problem by a simplex or barrier method, + this callback will be called after the simplex or barrier + callback, if any such callbacks are registered. + + During concurrent optimization, CPLEX calls the user-written + callback only in the main thread, not in other concurrent threads. + + :undocumented: __init__, _wherefrom + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "continuous" + self._cb_set_function = _proc.setlpcallbackfunc
+ + +
+[docs] + def get_dual_infeasibility(self): + """Returns a measure of the dual infeasibility of the problem.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_INFMEAS, + CplexSolverError)
+ + +
+[docs] + def get_primal_infeasibility(self): + """Returns a measure of the primal infeasibility of the problem.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_INFMEAS, + CplexSolverError)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations completed.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ITCOUNT_LONG, + CplexSolverError)
+ + +
+[docs] + def get_objective_value(self): + """Returns the current value of the objective function.""" + if self._wherefrom() == _const.CPX_CALLBACK_DUAL: + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_OBJ, + CplexSolverError) + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_OBJ, + CplexSolverError)
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether or not the current solution is dual feasible.""" + if self._wherefrom() == _const.CPX_CALLBACK_PRIMAL: + return self.get_dual_infeasibility() <= 0.0 + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_FEAS, + CplexSolverError)
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether or not the current solution is primal feasible.""" + if self._wherefrom() == _const.CPX_CALLBACK_DUAL: + return self.get_primal_infeasibility() <= 0.0 + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_FEAS, + CplexSolverError)
+
+ + + +
+[docs] +class SimplexCallback(ContinuousCallback): + """Subclassable class for Cplex simplex callback classes. + + This callback will be used during execution of the primal simplex, + dual simplex, or quadratic simplex algorithms. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "simplex"
+
+ + + +
+[docs] +class BarrierCallback(ContinuousCallback): + """Subclassable class for Cplex barrier callback classes. + + This callback will be used during execution of the barrier or + quadratic barrier algorithms. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "barrier"
+ + +
+[docs] + def get_dual_objective_value(self): + """Returns the current dual value of the objective function.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_OBJ, + CplexSolverError)
+
+ + + +
+[docs] +class CrossoverCallback(OptimizationCallback): + """Subclassable class for Cplex crossover callback classes. + + This callback will be used during execution of a crossover + algorithm. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "crossover" + self._cb_set_function = _proc.setlpcallbackfunc
+ + +
+[docs] + def get_num_dual_exchanges(self): + """Returns the number of dual exchanges performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_dual_pushes(self): + """Returns the number of dual pushes performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_primal_exchanges(self): + """Returns the number of primal exchanges performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_primal_pushes(self): + """Returns the number of primal pushes performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_superbasics(self): + """Returns the number of superbasic variables in the basis.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_SBCNT, + CplexSolverError)
+
+ + + +
+[docs] +class QualityMetric(ConstantClass): + """Constants defining metrics for the quality of the MIP solve.""" + kappa_stable = _const.CPX_CALLBACK_INFO_KAPPA_STABLE + kappa_suspicious = _const.CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS + kappa_unstable = _const.CPX_CALLBACK_INFO_KAPPA_UNSTABLE + kappa_illposed = _const.CPX_CALLBACK_INFO_KAPPA_ILLPOSED + kappa_max = _const.CPX_CALLBACK_INFO_KAPPA_MAX + kappa_attention = _const.CPX_CALLBACK_INFO_KAPPA_ATTENTION
+ + + +
+[docs] +class CutType(ConstantClass): + """Arguments to MIPInfoCallback.get_num_cuts().""" + # NB: If you edit these, look at _subinterfaces.py:CutType too! + # Also add the cut to the list of valid values get_num_cuts()! + cover = _const.CPX_CALLBACK_INFO_COVER_COUNT + GUB_cover = _const.CPX_CALLBACK_INFO_GUBCOVER_COUNT + flow_cover = _const.CPX_CALLBACK_INFO_FLOWCOVER_COUNT + clique = _const.CPX_CALLBACK_INFO_CLIQUE_COUNT + fractional = _const.CPX_CALLBACK_INFO_FRACCUT_COUNT + MIR = _const.CPX_CALLBACK_INFO_MIRCUT_COUNT + flow_path = _const.CPX_CALLBACK_INFO_FLOWPATH_COUNT + disjunctive = _const.CPX_CALLBACK_INFO_DISJCUT_COUNT + implied_bound = _const.CPX_CALLBACK_INFO_IMPLBD_COUNT + zero_half = _const.CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT + multi_commodity_flow = _const.CPX_CALLBACK_INFO_MCFCUT_COUNT + lift_and_project = _const.CPX_CALLBACK_INFO_LANDPCUT_COUNT + user = _const.CPX_CALLBACK_INFO_USERCUT_COUNT + table = _const.CPX_CALLBACK_INFO_TABLECUT_COUNT + solution_pool = _const.CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT + benders = _const.CPX_CALLBACK_INFO_BENDERS_COUNT
+ + # Not Implemented: + # local_implied_bound + # BQP + # RLT + + +
+[docs] +class MIPInfoCallback(OptimizationCallback): + """Subclassable class for MIP informational callback classes. + + This callback will be used when CPLEX is solving a MIP problem. + + :undocumented: __init__ + """ + + quality_metric = QualityMetric() + """See `QualityMetric()`""" + + cut_type = CutType() + """See `CutType()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "MIP_info" + self._cb_set_function = _proc.setinfocallbackfunc
+ + + def _setup(self, e, lp): + self.num_cols = _proc.getnumcols(e, lp) + self.num_rows = _proc.getnumrows(e, lp) + self.num_quad = _proc.getnumqconstrs(e, lp) + +
+[docs] + def get_num_cols(self): + return self.num_cols
+ + +
+[docs] + def get_num_rows(self): + return self.num_rows
+ + +
+[docs] + def get_num_quadratic_constraints(self): + return self.num_quad
+ + +
+[docs] + def get_num_cuts(self, cut_type): + """Returns the number of cuts of type cut_type added so far.""" + if cut_type not in (_const.CPX_CALLBACK_INFO_COVER_COUNT, + _const.CPX_CALLBACK_INFO_GUBCOVER_COUNT, + _const.CPX_CALLBACK_INFO_FLOWCOVER_COUNT, + _const.CPX_CALLBACK_INFO_CLIQUE_COUNT, + _const.CPX_CALLBACK_INFO_FRACCUT_COUNT, + _const.CPX_CALLBACK_INFO_MIRCUT_COUNT, + _const.CPX_CALLBACK_INFO_FLOWPATH_COUNT, + _const.CPX_CALLBACK_INFO_DISJCUT_COUNT, + _const.CPX_CALLBACK_INFO_IMPLBD_COUNT, + _const.CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT, + _const.CPX_CALLBACK_INFO_MCFCUT_COUNT, + _const.CPX_CALLBACK_INFO_LANDPCUT_COUNT, + _const.CPX_CALLBACK_INFO_USERCUT_COUNT, + _const.CPX_CALLBACK_INFO_TABLECUT_COUNT, + _const.CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT, + _const.CPX_CALLBACK_INFO_BENDERS_COUNT): + raise ValueError("invalid value for cut_type ({0})".format(cut_type)) + return _pycplex.fast_getcallbackinfo(self._cbstruct, cut_type, + CplexSolverError)
+ + +
+[docs] + def get_best_objective_value(self): + """Returns the best objective value among unexplored nodes.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_BEST_REMAINING, + CplexSolverError)
+ + +
+[docs] + def get_cutoff(self): + """Returns the current cutoff value.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CUTOFF, + CplexSolverError)
+ + +
+[docs] + def get_incumbent_objective_value(self): + """Returns the objective value of the incumbent solution.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_BEST_INTEGER, + CplexSolverError)
+ + +
+[docs] + def get_incumbent_linear_slacks(self, *args): + """Returns a set of linear slacks for the incumbent solution. + + Can be called by four forms. + + self.get_incumbent_linear_slacks() + return all linear slack values from the incumbent solution. + + self.get_incumbent_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_incumbent_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_incumbent_linear_slacks(i) for i in s] + + self.get_incumbent_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_incumbent_linear_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_incumbent_values())] + status = _pycplex.cb_slackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.num_rows - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_incumbent_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks for the incumbent solution. + + Can be called by four forms. + + self.get_incumbent_quadratic_slacks() + return all quadratic slack values from the incumbent + solution. + + self.get_incumbent_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_incumbent_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to + [self.get_incumbent_quadratic_slacks(i) for i in s] + + self.get_incumbent_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_incumbent_quadratic_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_incumbent_values())] + status = _pycplex.cb_qconstrslackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.num_quad - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_incumbent_values(self, *args): + """Returns the variable values of the incumbent solution. + + There are four forms by which get_incumbent_values may be + called. + + self.get_incumbent_values() + returns the entire incumbent solution + + self.get_incumbent_values(i) + i must be a variable index or name. Returns the value + of the variable with index i in the incumbent solution. + + self.get_incumbent_values(s) + s must be a sequence of variables indices or names. + Returns a list of the values of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_incumbent_values(i) for i in s] + + self.get_incumbent_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the values of the variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_incumbent_values(range(begin, end + 1)) + """ + def getcallbackincumbent(begin, end=self.num_cols - 1): + return _proc.getcallbackincumbent(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbackincumbent, self._conv_col, args)
+ + +
+[docs] + def get_MIP_relative_gap(self): + """Returns the current relative MIP gap. + + Accesses the current relative gap, like the routine + CPXgetmiprelgap in the Callable Library. See CPXgetcallbackinfo + and CPXgetmiprelgap in the Callable Library Reference Manual for + more detail. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_REL_GAP, + CplexSolverError)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_nodes(self): + """Returns the number of nodes processed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_NODE_COUNT_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_remaining_nodes(self): + """Returns the number of unexplored nodes remaining.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_NODES_LEFT_LONG, + CplexSolverError)
+ + +
+[docs] + def has_incumbent(self): + """Returns whether or not an incumbent solution has been found.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_FEAS, + CplexSolverError)
+ + +
+[docs] + def get_float_quality(self, which): + """Returns a measure of the quality of the MIP solution as a floating point value. + + The measure of the quality of a solution must be an attribute + of self.quality_metric corresponding to a floating point + quality metric. Such metrics include: + + self.quality_metric.kappa_stable + self.quality_metric.kappa_suspicious + self.quality_metric.kappa_unstable + self.quality_metric.kappa_illposed + self.quality_metric.kappa_max + self.quality_metric.kappa_attention + """ + if which not in (_const.CPX_CALLBACK_INFO_KAPPA_STABLE, + _const.CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS, + _const.CPX_CALLBACK_INFO_KAPPA_UNSTABLE, + _const.CPX_CALLBACK_INFO_KAPPA_ILLPOSED, + _const.CPX_CALLBACK_INFO_KAPPA_MAX, + _const.CPX_CALLBACK_INFO_KAPPA_ATTENTION): + raise ValueError("invalid value for which ({0})".format(which)) + return _pycplex.fast_getcallbackinfo(self._cbstruct, which, + CplexSolverError)
+ + +
+[docs] + def get_thread_num(self): + """Returns the identifier for the thread from which the callback + was invoked. + + See CPX_CALLBACK_INFO_MY_THREAD_NUM in the Callable Library + Reference Manual for more detail. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MY_THREAD_NUM, + CplexSolverError)
+
+ + + +
+[docs] +class MIPCallback(MIPInfoCallback): + """Subclassable class for MIP callback classes. + + This callback will be used when CPLEX is solving a MIP problem. + + :undocumented: __init__, _get_node_info, _get_seq_info + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "MIP" + self._cb_set_function = _proc.setmipcallbackfunc
+ + + def _get_node_info(self, which_info, which_node): + """non-public""" + return _proc.getcallbacknodeinfo(self._cbstruct, which_node, which_info) + + def _get_seq_info(self, which_info, which_node): + """non-public""" + return _proc.getcallbackseqinfo(self._cbstruct, which_node, which_info) + +
+[docs] + def get_objective_coefficients(self, *args): + """Returns the coefficients of the linear objective function. + + There are four forms by which get_objective_coefficients may + be called. + + self.get_objective_coefficients() + returns the entire objective function. + + self.get_objective_coefficients(i) + i must be a variable index or name. Returns the objective + coefficient of the variable with index i. + + self.get_objective_coefficients(s) + s must be a sequence of variable indices or names. Returns + a list of the objective coefficients of the variables with + indices the members of s, in the same order as they appear + in s. Equivalent to [self.get_objective_coefficients(i) + for i in s] + + self.get_objective_coefficients(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the objective coefficients of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_objective_coefficients(range(begin, end + 1)) + """ + def getobj(begin, end=self.get_num_cols() - 1): + status = _pycplex.cb_getobj(self._cbstruct, self._env_lp_ptr, + begin, end) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + return apply_freeform_two_args( + getobj, self._conv_col, args)
+ + +
+[docs] + def get_current_node_depth(self): + """Returns the depth of the current node in the search tree. + + The root node has depth 0 (zero). The depth of other nodes is defined + recursively as the depth of their parent node plus one. In other + words, the depth of a node is its distance in terms of the number of + branches from the root. + """ + # The function is called get_current_node_depth() rather than + # get_depth() (as in the other APIs) for historical reasons: + # when we introduced the function we already had a get_depth() + # function in the node callback which had a different signature and + # different semantics + return _proc.getcallbacknodeinfo( + self._cbstruct, 0, + _const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG)
+
+ + + +
+[docs] +class FeasibilityStatus(ConstantClass): + """Feasibility status codes.""" + feasible = _const.CPX_INTEGER_FEASIBLE + implied_feasible = _const.CPX_IMPLIED_INTEGER_FEASIBLE + infeasible = _const.CPX_INTEGER_INFEASIBLE
+ + + +
+[docs] +class ControlCallback(MIPCallback): + """Base class for Cplex MIP control callback classes. + + :undocumented: __init__ + """ + + feasibility_status = FeasibilityStatus() + """See `FeasibilityStatus()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._useraction = _const.CPX_CALLBACK_DEFAULT
+ + +
+[docs] + def get_pseudo_costs(self, *args): + """Returns the current pseudo costs. + + There are four forms by which get_pseudo_costs may be + called. + + self.get_pseudo_costs() + returns a list of pairs with the pseudo costs for all the + variables. + + self.get_pseudo_costs(i) + i must be a variable index or name. Returns a pair (up, + down), where up is the up pseudo cost and down is the down + pseudo cost of branching on the variable i. + + self.get_pseudo_costs(s) + s must be a sequence of variable indices or names. Returns + a list of pairs (up, down) of pseudo costs of branching on + the variables with indices the members of s, in the same + order as they appear in s. Equivalent to + [self.get_pseudo_costs(i) for i in s] + + self.get_pseudo_costs(begin, end) + begin and end must be variable indices or variable names. + Returns a list of pairs (up, down) of pseudo costs of branching + on the variables with indices between begin and end, inclusive + of end. Equivalent to + self.get_pseudo_costs(range(begin, end + 1)) + """ + def getcallbackpseudocosts(begin, end=self.get_num_cols() - 1): + return unzip(_proc.getcallbackpseudocosts(self._cbstruct, begin, end)) + return apply_freeform_two_args( + getcallbackpseudocosts, self._conv_col, args)
+ + +
+[docs] + def get_feasibilities(self, *args): + """Returns the current integer feasibility status. + + There are four forms by which get_feasibilities may be + called. + + The return values are attributes of self.feasibility_status. + + self.get_feasibilities() + returns a list with the feasibility status for all the + variables. + + self.get_feasibilities(i) + i must be a variable index or name. Returns the + feasibility status of the variable with index i. + + self.get_feasibilities(s) + s must be a sequence of variable indices or names. Returns + a list of the feasibility statuses of the variables with + indices the members of s, in the same order as they appear + in s. Equivalent to [self.get_feasibilities(i) for i in s] + + self.get_feasibilities(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the feasibility statuses of the variables + with indices between begin and end, inclusive of end. + Equivalent to self.get_feasibilities(range(begin, end + 1)) + + Note + Before you call this method from a solve callback, a + solution must exist. That is, you must first create the + solution by calling a CPLEX optimization method, and then + you must verify that this optimization method generated a + solution by checking its return value before you call the + method get_feasibilities. + """ + def getcallbacknodeintfeas(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodeintfeas(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodeintfeas, self._conv_col, args)
+ + +
+[docs] + def get_lower_bounds(self, *args): + """Returns the lower bounds at the current node. + + There are four forms by which get_lower_bounds may be + called. + + self.get_lower_bounds() + returns a list with the lower bounds for all the variables. + + self.get_lower_bounds(i) + i must be a variable index or name. Returns the lower + bound of the variable with index i. + + self.get_lower_bounds(s) + s must be a sequence of variable indices or names. Returns + a list of the lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_lower_bounds(i) for i in s] + + self.get_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the lower bounds of the variables with + indices between begin and end, inclusive of end. Equivalent + to self.get_lower_bounds(range(begin, end + 1)) + """ + def getcallbacknodelb(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodelb(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodelb, self._conv_col, args)
+ + +
+[docs] + def get_upper_bounds(self, *args): + """Returns the upper bounds at the current node. + + There are four forms by which get_upper_bounds may be + called. + + self.get_upper_bounds() + returns a list with the upper bounds for all the variables. + + self.get_upper_bounds(i) + i must be a variable index or name. Returns the upper + bound of the variable with index i. + + self.get_upper_bounds(s) + s must be a sequence of variable indices or names. Returns + a list of the upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_upper_bounds(i) for i in s] + + self.get_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the upper bounds of the variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_upper_bounds(range(begin, end + 1)) + """ + def getcallbacknodeub(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodeub(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodeub, self._conv_col, args)
+ + +
+[docs] + def get_node_data(self): + """Returns the user handle for the current node. + + Returns None if no handle is set for the node. + """ + return self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_USERHANDLE, 0)
+ + +
+[docs] + def set_node_data(self, data): + """Set the user handle for the current node. + + Returns the user handle previously set for this node (or None + if no handle was set). + """ + return _proc.callbacksetuserhandle(self._cbstruct, data)
+ + +
+[docs] + def get_node_ID(self): + """Return the sequence number of this node.""" + return self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, 0)
+ + +
+[docs] + def get_objective_value(self): + """Returns the value of the objective function at the current node.""" + return _proc.getcallbacknodeobjval(self._cbstruct)
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks for the solution at the current node. + + Can be called by four forms. + + self.get_linear_slacks() + return all linear slack values from the problem at the + current node. + + self.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_linear_slacks(i) for i in s] + + self.get_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_linear_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_values())] + status = _pycplex.cb_slackfromx( + self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_rows() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks for the solution at the current node. + + Can be called by four forms. + + self.get_quadratic_slacks() + return all quadratic slack values from the problem at the + current node. + + self.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [self.get_quadratic_slacks(i) for i in s] + + self.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_quadratic_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_values())] + status = _pycplex.cb_qconstrslackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_quadratic_constraints() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_values(self, *args): + """Returns the solution values at the current node. + + In the case that the node LP is unbounded, this method returns + a vector that corresponds to an unbounded direction, scaled so + that at least one of its elements has magnitude + cplex.infinity. Thus, often the vector can be used directly, + for example to separate a lazy constraint. However, due to + the presence of large values in the vector care must be taken + to avoid potential numerical errors. If in doubt, + rescale the vector, and use it as an unbounded ray + rather than a primal vector. + + There are four forms by which get_values may be called. + + self.get_values() + returns the entire primal solution vector. + + self.get_values(i) + i must be a variable index or name. Returns the solution + value of the variable with index i. + + self.get_values(s) + s must be a sequence of variable indices or names. Returns + a list of the solution values of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_values(i) for i in s] + + self.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_values(range(begin, end + 1)) + """ + def getcallbacknodex(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodex(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodex, self._conv_col, args)
+ + +
+[docs] + def get_SOS_feasibilities(self, *args): + """Returns the current special ordered set feasibility status. + + There are four forms by which get_SOS_feasibilities may be + called. + + Returns 1 if the SOS is feasible and 0 if it is not. + + self.get_SOS_feasibilties() + Returns the feasibility statuses of all the special ordered + sets. + + self.get_SOS_feasibilities(i) + i must be a SOS index or name. Returns the feasibility + status of the special ordered set with index i. + + self.get_SOS_feasibilities(s) + s must be a sequence of SOS indices or names. Returns a + list of the feasibility statuses of the special ordered + sets with indices the members of s, in the same order as + they appear in s. Equivalent to + [self.get_SOS_feasibilities(i) for i in s] + + self.get_SOS_feasibilities(begin, end) + begin and end must be SOS indices or SOS names. Returns a list + of the feasibility statuses of the special ordered sets with + indices between begin and end, inclusive of end. Equivalent to + self.get_SOS_feasibilities(range(begin, end + 1)) + + Note + Before you call this method from a solve callback, a + solution must exist. That is, you must first create the + solution by calling a CPLEX optimization method, and then + you must verify that this optimization method generated a + solution by checking its return value before you call the + method get_SOS_feasibilities. + """ + def is_sos_feasible(index): + return _proc.getcallbacksosinfo( + self._cbstruct, index, 0, + _const.CPX_CALLBACK_INFO_SOS_IS_FEASIBLE) + return apply_freeform_one_arg( + is_sos_feasible, self._conv_sos, + _pycplex.cb_getnumsos(self._cbstruct, self._env_lp_ptr), args)
+
+ + + +
+[docs] +class BranchType(ConstantClass): + """Constants defining types of branches.""" + any = _const.CPX_TYPE_ANY + SOS1 = _const.CPX_TYPE_SOS1 + SOS2 = _const.CPX_TYPE_SOS2 + variable = _const.CPX_TYPE_VAR
+ + + +
+[docs] +class BranchCallback(ControlCallback): + """Subclassable class for branch callback classes. + + The user must be careful when using this class. Pruning a valid node + can prune the optimal solution. Also, choosing a different branching + variable can result in placing an invalid bound on a variable, in case + the variable was already restricted to other bounds before. + + In particular, the user must not branch on variables that are implied + feasible. ImpliedFeasible specifies that the variable has been + presolved out. It will be feasible when all other integer variables + are integer feasible. Branching on such variables can cut off + feasible solutions. + + If the user intends to branch on continuous variables, the user must + disable dual presolve reductions. To disable dual presolve + reductions, set the parameter to control primal and dual reduction + type, parameters.preprocessing.reduce, either to the value 1 (one) + (that is, CPX_PREREDUCE_PRIMALONLY) or to the value 0 (zero) (that + is, CPX_PREREDUCE_NOPRIMALORDUAL). + + Also, if the user intends to branch on continuous variables, the user + must turn off reductions that may interfere with crushing or uncrushing. + This is parameters.preprocessing.reformulations. + + By design, the CPLEX branch callback calculates and provides the + branching decisions that CPLEX would make in case the user does not + create any branches in the callback. Depending on variable selection + and other features of your model, the computation of these candidate + branches can be time-consuming. Consequently, if you know that you + will never use the branching candidates suggested by CPLEX, then you + can save time by disabling such features as strong branching. This + callback will be used prior to branching at a node in the branch and + cut tree. + + :undocumented: __init__ + """ + + branch_type = BranchType() + """See `BranchType()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + def fn(a, b): + _proc.setbranchcallbackfunc(a, b) + _proc.setbranchnosolncallbackfunc(a, b) + super().__init__(env) + self._cb_type_string = "branch" + self._cb_set_function = fn + self._node_count = 0 + self._bound_count = 0 + self._node_begin = [] + self._index = [] + self._bounds = [] + self._lu = [] + self._node_estimate = [] + self._branch_type = None
+ + +
+[docs] + def get_branch(self, which_branch): + """Returns one of the candidate branches at the current node. + + which_branch must be an integer such that 0 <= which_branch < + self.get_num_branches(). + + The return value of get_branch is a tuple t with two entries. + The first entry is the node estimate for the specified branch. + The second entry is a list of (var, dir, bnd) triples, where + var is the index of a variable whose bound will change, bnd is + the new bound, and dir is one of "L", "U", and "B", indicating + that the branch will change the lower bound, the upper bound, + or both, respectively. + """ + if which_branch < 0 or which_branch >= self._node_count: + raise CplexError("BranchCallback.get_branch: Bad branch index") + if which_branch == self._node_count - 1: + end = self._bound_count + else: + end = self._node_begin[which_branch + 1] + vars = self._index[self._node_begin[which_branch]: end] + bnds = self._bounds[self._node_begin[which_branch]: end] + dirs = self._lu[self._node_begin[which_branch]: end] + return (self._node_estimate[which_branch], list(zip(vars, dirs, bnds)))
+ + +
+[docs] + def get_branch_type(self): + """Returns the type of the branch. + + One of the following: + self.branch_type.any + self.branch_type.SOS1 + self.branch_type.SOS2 + self.branch_type.variable + """ + return self._branch_type
+ + +
+[docs] + def get_num_branches(self): + """Return the number of nodes Cplex will create from this branch.""" + return self._node_count
+ + +
+[docs] + def is_integer_feasible(self): + """Return whether or not the current node is integer feasible.""" + return self.get_num_branches() == 0
+ + +
+[docs] + def make_branch(self, objective_estimate, variables=None, + constraints=None, node_data=None): + """Makes a new branch with the specified data. + + objective_estimate is a float representing the estimated + objective value resulting from the specified branch. + + variables is a sequence of (var, dir, bnd) triples specifying + the variables on which to branch. var must be an index of a + variable, dir must be one of "L" and "U", indicating that the + bound is a lower or upper bound, respectively, and bnd is an + integer specifying the new bound for the variable. + + constraints is a sequence of (vec, sense, rhs) triples + specifying the constraints with which to branch. vec must be + either an instance of SparsePair or a sequence with two + entries, the first of which specifies the indices and the + second of which specifies the values of the constraint. rhs + must be a float determining the righthand side of the + constraint. sense must be one of "L", "G", or "E", specifying + whether the constraint is a less-than-or-equal-to (<=), + greater-than-or-equal-to (>=), or equality constraint. + + node_data may be any object to be associated with the created + node. It can be queried by the get_node_data methods of the + IncumbentCallback class and the NodeCallback class. + """ + variables, constraints = init_list_args(variables, constraints) + obje = objective_estimate + if variables: + a = unzip(variables) + else: + a = [[], [], []] + vars = list(a[0]) + dirs = ''.join(list(a[1])) + bnds = list(a[2]) + if constraints: + a = unzip(constraints) + else: + a = [[], [], []] + rmat = _HBMatrix(a[0]) + sense = ''.join(list(a[1])) + rhs = list(a[2]) + seqnum = _proc.branchcallbackbranchgeneral( + self._cbstruct, vars, dirs, bnds, rhs, sense, rmat.matbeg, + rmat.matind, rmat.matval, obje, node_data) + self._useraction = _const.CPX_CALLBACK_SET + return (seqnum,)
+ + +
+[docs] + def make_cplex_branch(self, which_branch, node_data=None): + """Replicates a CPLEX branch. + + This method replicates the n-th branch that CPLEX would create + at the current node. The purpose of this method is to branch + exactly like CPLEX, but at the same time attach a user object to + the newly created node. + + which_branch must be an integer such that 0 <= which_branch < + self.get_num_branches(). + + node_data may be any object to be associated with the created + node. It can be queried by the get_node_data methods of various + callback classes. + + This method returns the sequence number of the newly created + node. + """ + seqnum = _proc.branchcallbackbranchasCPLEX(self._cbstruct, + which_branch, + node_data) + self._useraction = _const.CPX_CALLBACK_SET + return seqnum
+ + +
+[docs] + def prune(self): + """Removes the current node from the search tree. + + Note + Prune must not be called in combination with make_branch. + Prune is not compatible with the populate_solution_pool + method of the Cplex class because + that method retains fathomed nodes for subsequent use. + """ + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class CutCallback(ControlCallback): + """Base class for user cut and lazy constraint callback classes. + + :undocumented: add, add_local + """ + + def _add(self, cut, sense, rhs, use_cut): + """non-public""" + indices, values = unpack_pair(cut) + if use_cut is True: + use_cut = 1 + if use_cut is False: + use_cut = 0 + _proc.cutcallbackadd( + self._cbstruct, rhs, sense, + self._conv_col(indices), + values, use_cut) + + def _add_local(self, cut, sense, rhs): + """non-public""" + indices, values = unpack_pair(cut) + _proc.cutcallbackaddlocal( + self._cbstruct, rhs, sense, + self._conv_col(indices), values)
+ + + +
+[docs] +class UseConstraint(ConstantClass): + """Constants to specify when to use the added constraint""" + force = _const.CPX_USECUT_FORCE + purge = _const.CPX_USECUT_PURGE
+ + + +
+[docs] +class LazyConstraintCallback(CutCallback): + """Subclassable class for lazy constraint callback classes. + + This callback will be used when CPLEX finds a new integer + feasible solution and when CPLEX finds that the LP relaxation + at the current node is unbounded. + + Note: + The lazy constraint callback may be invoked during MIP start + processing. In that case get_solution_source returns + mip_start_solution. When this value is returned some special + considerations apply: + + - MIP start processing occurs very early in the solution process. + At this point no search tree is setup yet and there are no + search tree nodes yet. Consequently, a lot of the callback + methods that require a node context will fail in this + situation. + - Lazy constraints separated when processing a MIP start will be + discarded after that MIP start has been processed. This means + that the callback may have to separate the same constraint + again for the next MIP start or for a solution that is found + later in the solution process. + + :undocumented: __init__ + """ + + use_constraint = UseConstraint() + """See `UseConstraint()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "lazycon" + self._cb_set_function = _proc.setlazyconstraintcallbackfunc
+ + +
+[docs] + def add(self, constraint, sense, rhs, use=use_constraint.force): + """Adds a linear constraint to the current subproblem. + + constraint must be either a SparsePair instance or a list of + two lists, the first of which specifies variables, the second + of which specifies the values of the constraint. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the constraint. + + use indicates under what circumstances the constraint should + be used. It can take the following values: + + self.use_constraint.force (default) : force CPLEX to use the constraint + self.use_constraint.purge : allow CPLEX to purge the constraint + + When you add a lazy constraint with the nondefault value purge, + you authorize CPLEX to purge (that is, to eliminate) the lazy + constraint under certain circumstances, for example, if the + lazy constraint becomes slack. Consequently, in view of such + purging, you must not assume that any previously added constraints + are still in current relaxation. In other words, the purged + lazy constraint may be violated in subsequent relaxations. + """ + self._add(constraint, sense, rhs, use)
+ + +
+[docs] + def add_local(self, constraint, sense, rhs): + """Adds a linear local constraint to the current subproblem. + + A local constraint is a constraint that will only be added to + the problem at the current node and the subtree rooted by the + current node. It will not be added to the constraint matrix of + the original model. + + constraint must be either a SparsePair instance or a list of + two lists, the first of which specifies variables, the second + of which specifies the values of the constraint. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the constraint. + """ + self._add_local(constraint, sense, rhs)
+ + +
+[docs] + def is_unbounded_node(self): + """Returns True if the current LP relaxation is unbounded, False otherwise.""" + return self._wherefrom() == _const.CPX_CALLBACK_MIP_CUT_UNBD
+ + +
+[docs] + def get_solution_source(self): + """Returns the source of the solution for which the lazy constraint callback was invoked. + + The possible return values are: + + IncumbentCallback.solution_source.node_solution: The integral solution is + the solution to the LP relaxation of a node in the MIP search + tree. + + IncumbentCallback.solution_source.heuristic_solution: The integral solution + has been found by a CPLEX internal heuristic. + + IncumbentCallback.solution_source.mipstart_solution: The integral solution has been + found during MIP start processing. + """ + node_info = self._get_node_info(_const.CPX_CALLBACK_INFO_LAZY_SOURCE, 0) + source = IncumbentCallback.solution_source + switcher = { + _const.CPX_LAZYCONSTRAINTCALLBACK_NODE: source.node_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_HEUR: source.heuristic_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_MIPSTART: source.mipstart_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_USER: source.user_solution + } + return switcher[node_info]
+
+ + + +
+[docs] +class UseCut(ConstantClass): + """Constants to specify when to use the added cut.""" + force = _const.CPX_USECUT_FORCE + purge = _const.CPX_USECUT_PURGE + filter = _const.CPX_USECUT_FILTER
+ + + +
+[docs] +class UserCutCallback(CutCallback): + """Subclassable class for lazy constraint callback classes. + + This callback will be used within the cut loop that CPLEX calls at + each node of the branch and cut algorithm. It will be called once + after CPLEX has ended its own cut generation loop so that the user + can specify additional cuts to be added to the cut pool. + + :undocumented: __init__ + """ + + use_cut = UseCut() + """See `UseCut()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "usercut" + self._cb_set_function = _proc.setusercutcallbackfunc
+ + +
+[docs] + def add(self, cut, sense, rhs, use=use_cut.force): + """Adds a linear cut to to the current subproblem. + + cut must be either a SparsePair instance or a list of two + lists, the first of which specifies variables, the second of + which specifies the values of the cut. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the cut. + + use indicates under what circumstances the cut should be used. + It can take the following values + + self.use_cut.force (default) : force CPLEX to use the cut + self.use_cut.purge : allow CPLEX to purge the cut + self.use_cut.filter : treat as cuts CPLEX creates + """ + self._add(cut, sense, rhs, use)
+ + +
+[docs] + def add_local(self, cut, sense, rhs): + """Adds a linear local cut to the current subproblem. + + A local cut is a cut that is only valid at the current + node and the subtree rooted by the current node. It does + not need to be globally valid. + + cut must be either a SparsePair instance or a list of two + lists, the first of which specifies variables, the second of + which specifies the values of the cut. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the cut. + """ + self._add_local(cut, sense, rhs)
+ + +
+[docs] + def is_after_cut_loop(self): + """Returns True if called after the cut loop, False otherwise.""" + return self._wherefrom() == _const.CPX_CALLBACK_MIP_CUT_LAST
+ + +
+[docs] + def abort_cut_loop(self): + """Terminate the cut loop and proceed with branching.""" + self._useraction = _const.CPX_CALLBACK_ABORT_CUT_LOOP
+
+ + + +
+[docs] +class MethodType(ConstantClass): + """Constants defining methods for solving the node LP.""" + primal = _const.CPX_ALG_PRIMAL + dual = _const.CPX_ALG_DUAL + barrier = _const.CPX_ALG_BARRIER + network = _const.CPX_ALG_NET
+ + + +
+[docs] +class HSCallback(ControlCallback): + """Base class for heuristic and solve callback classes.""" + + status = _internal._subinterfaces.SolutionStatus() + """See `_internal._subinterfaces.SolutionStatus()` """ + + method = MethodType() + """See `MethodType()`""" + +
+[docs] + def get_cplex_status(self): + """Returns the solution status of the current subproblem. + + Returns an attribute of self.status. + """ + status = _pycplex.cb_getstat(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether the solution of the current subproblem is dual feasible.""" + status = _pycplex.cb_solninfo(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return bool(status[2])
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether the solution of the current subproblem is primal feasible.""" + status = _pycplex.cb_solninfo(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return bool(status[1])
+ + +
+[docs] + def solve(self, alg=_const.CPX_ALG_DUAL): + """Solves the current subproblem. + + The value of alg, if specified, determines the algorithm to + use to solve the current subproblem. + + self.method.primal : primal simplex + + self.method.dual : dual simplex + + self.method.barrier : barrier + + self.method.network : network + + If this method generates a feasible solution it returns True, + otherwise it returns False. + """ + if alg == _const.CPX_ALG_PRIMAL: + status = _pycplex.cb_primopt(self._cbstruct) + elif alg in (_const.CPX_ALG_DUAL, _const.CPX_ALG_AUTOMATIC): + status = _pycplex.cb_dualopt(self._cbstruct) + elif alg == _const.CPX_ALG_BARRIER: + status = _pycplex.cb_hybbaropt(self._cbstruct) + elif alg == _const.CPX_ALG_NET: + status = _pycplex.cb_hybnetopt(self._cbstruct) + else: + raise CplexError("HSCallback.solve: bad algorithm identifier") + _proc.check_status(self._cbstruct, status, from_cb=True) + return self.get_cplex_status() in (self.status.optimal, + self.status.feasible, + self.status.MIP_optimal, + self.status.MIP_feasible)
+
+ + + +
+[docs] +class HeuristicCallback(HSCallback): + """Subclassable class for heuristic callback classes. + + This callback will be used after solving each subproblem and at + the root node before each round of cuts is added to the problem + and resolved. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "heuristic" + self._cb_set_function = _proc.setheuristiccallbackfunc + self._x = []
+ + +
+[docs] + def set_bounds(self, *args): + """Sets the bounds for a set of variables. + + Can be called by two forms. + + self.set_bounds(i, lb, ub) + i must be a variable name or index and lb and ub must be + real numbers. Sets the lower bound and upper bound of the + variable whose index or name is i to lb and ub, + respectively. + + self.set_lower_bounds(seq_of_triples) + seq_of_triples must be a list or tuple of tuples (i, lb, ub), + each of which consists of a variable name or index and + two real numbers. Sets the bounds of the specified + variables to the corresponding values. Equivalent to + [self.set_lower_bounds(triple[0], triple[1], triple[2]) for + triple in seq_of_triples]. + + Note + The variables specified must not have been removed by + presolve. + + Note + These bound changes affect only the problem at the current + node. + """ + if len(args) == 1: + vars, lb, ub = unzip(args) + elif len(args) == 3: + vars = [args[0]] + lb = [args[1]] + ub = [args[2]] + else: + raise WrongNumberOfArgumentsError() + vars = self._conv_col(vars) + status = _pycplex.cb_getprestat_c(self._cbstruct, self._env_lp_ptr) + if status is not None: + _proc.check_status(self._cbstruct, status[0], from_cb=True) + pstat = status[1] + for i in vars: + if pstat[i] == 0: + raise CplexError( + "Variable removed by presolve: cannot change bounds") + ind = [] + lu = "" + bd = [] + for i, v in enumerate(vars): + ind.append(v) + if lb[i] == ub[i]: + lu = ''.join([lu, "B"]) + bd.append(lb[i]) + else: + ind.append(v) + lu = ''.join([lu, "LU"]) + bd.extend([lb[i], ub[i]]) + status = _pycplex.cb_chgbds(self._cbstruct, ind, lu, bd) + _proc.check_status(self._cbstruct, status, from_cb=True)
+ + +
+[docs] + def set_solution(self, solution, objective_value=None): + """Sets a solution to be used as the incumbent. + + solution is either an instance of SparsePair or a sequence of + length two. If it is a sequence, the first entry is a + sequence of variable indices or names whose values are to be + changed and the second entry is a sequence of floats with the + corresponding new solution values. Variables whose indices + are not specified remain unchanged. + + If objective_value is specified, it is taken as the objective + value of the new solution. Otherwise, the objective value is + computed. + + Do not call this method multiple times. + Calling it again will overwrite any previously specified solution. + """ + vars, vals = unpack_pair(solution) + vars = self._conv_col(vars) + for i, v in enumerate(vars): + self._x[v] = vals[i] + if objective_value is None: + objective_value = 0.0 + obj_coef = self.get_objective_coefficients() + for i, v in enumerate(self._x): + objective_value += v * obj_coef[i] + self._objective_value = objective_value + self._useraction = _const.CPX_CALLBACK_SET + self._check_feasibility = 1 + self._status = 0
+
+ + + +
+[docs] +class SolveCallback(HSCallback): + """Subclassable class for solve callback classes. + + This callback can be used to solve node relaxations during branch + and cut search. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "solve" + self._cb_set_function = _proc.setsolvecallbackfunc
+ + +
+[docs] + def set_start(self, primal=None, dual=None): + """Sets the starting vectors for the next solve. + + The arguments primal and dual must either be instances of + SparsePair or sequences of length two. If they are sequences, + the first entry is a sequence of indices or names specifying + the columns or rows whose values are to be set, and the second + entry is a sequence of floats with the corresponding new + values. + + If primal is specified but dual is not, no dual values will be + stored. If dual is specified but primal is not, no primal + values will be stored. + + Variables whose indices are not specified will be set to 0.0. + + Note + If presolve is enabled, attempting to set dual values in + this method will raise an exception. + """ + if primal is None: + primal = SparsePair([], []) + if dual is None: + dual = SparsePair([], []) + var, x = unpack_pair(primal) + rng, pi = unpack_pair(dual) + prim = [0.0] * self.get_num_cols() + dual = [0.0] * self.get_num_rows() + var = self._conv_col(var) + rng = self._conv_row(rng) + for i, val in enumerate(x): + prim[var[i]] = val + for i, val in enumerate(pi): + dual[rng[i]] = val + if var: + status = _pycplex.cb_crushx(self._cbstruct, self._env_lp_ptr, prim) + if status is not None: + _proc.check_status(self._cbstruct, + status[0], from_cb=True) + prim = status[1] + if rng: + status = _pycplex.cb_crushpi(self._cbstruct, self._env_lp_ptr, dual) + if status is not None: + _proc.check_status(self._cbstruct, + status, from_cb=True) + raise CplexError( + "Presolve must be disabled to set dual vectors in SolveCallback.set_start") + status = _pycplex.cb_copystart(self._cbstruct, prim, dual) + _proc.check_status(self._cbstruct, status, from_cb=True)
+ + +
+[docs] + def use_solution(self): + """Tell CPLEX to use the resident solution after calling solve.""" + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class SolutionSource(ConstantClass): + """Attributes defining possible solution sources.""" + node_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_NODESOLN + heuristic_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN + user_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_USERSOLN + mipstart_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_MIPSTART
+ + + +
+[docs] +class IncumbentCallback(MIPCallback): + """Subclassable class for incumbent callback classes. + + This callback will be used after each new potential incumbent is found. + If the callback is used to reject incumbents, the user must set + the parameter + c.parameters.preprocessing.reduce either to the value + 1 (one) to restrict presolve to primal reductions only or to 0 (zero) + to disable all presolve reductions. This setting of the parameter is + not necessary if the incumbent callback is used for other purposes. + + Note + The incumbent callback may be invoked during MIP start processing. + In that case get_solution_source will return mip_start_solution. + In this situation the following special consideration applies: + + - MIP start processing occurs very early in the solution process. + At this point no search tree is setup yet and there are no search + tree nodes yet. Consequently, a lot of the callback methods + that require a node context will fail in this situation. + + :undocumented: __init__ + """ + + solution_source = SolutionSource() + """See `SolutionSource()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "incumbent" + self._cb_set_function = _proc.setincumbentcallbackfunc + self._useraction = _const.CPX_CALLBACK_DEFAULT + self._objective_value = 0.0 + self._x = []
+ + +
+[docs] + def get_node_data(self): + """Returns the user handle for the current node. + + Returns None if no handle is set for the node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_USERHANDLE, 0)
+ + +
+[docs] + def set_node_data(self, data): + """Set the user handle for the current node. + + Returns the user handle previously set for this node (or None + if no handle was set). + """ + return _proc.callbacksetuserhandle(self._cbstruct, data)
+ + +
+[docs] + def get_node_ID(self): + """Returns the sequence number of the current node.""" + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, 0)
+ + +
+[docs] + def get_objective_value(self): + """Returns the objective value of the potential incumbent.""" + return self._objective_value
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks for the solution at the current node. + + Can be called by four forms. + + self.get_linear_slacks() + return all linear slack values from the problem at the + current node. + + self.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_linear_slacks(i) for i in s] + + self.get_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_linear_slacks(range(begin, end + 1)). + """ + status = _pycplex.cb_slackfromx(self._cbstruct, self._env_lp_ptr, + self._x) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_rows() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Return a set of quadratic slacks for the solution at the current node. + + Can be called by four forms. + + self.get_quadratic_slacks() + return all quadratic slack values from the problem at the + current node. + + self.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [self.get_quadratic_slacks(i) for i in s] + + self.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or + quadratic constraint names. Returns the slack values associated + with the quadratic constraints with indices between begin and + end, inclusive of end. Equivalent to + self.get_quadratic_slacks(range(begin, end + 1)). + """ + status = _pycplex.cb_qconstrslackfromx( + self._cbstruct, self._env_lp_ptr, self._x) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_quadratic_constraints() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_values(self, *args): + """Return the potential incumbent solution values. + + There are four forms by which get_values may be called. + + self.get_values() + returns the entire potential incumbent. + + self.get_values(i) + i must be a variable index or name. Returns the potential + incumbent value of the variable with index i. + + self.get_values(s) + s must be a sequence of variable indices or names. Returns + a list of the potential incumbent values of the variables + with indices the members of s, in the same order as they + appear in s. Equivalent to [self.get_values(i) for i in s] + + self.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the potential incumbent values of variables + with indices between begin and end, inclusive of end. + Equivalent to self.get_values(range(begin, end + 1)) + """ + def getx(begin, end=self.get_num_cols() - 1): + return self._x[begin:end + 1] + return apply_freeform_two_args( + getx, self._conv_col, args)
+ + +
+[docs] + def get_solution_source(self): + """Returns the source of the solution for which the incumbent callback was invoked. + + The possible return values are: + + self.solution_source.node_solution: The integral solution is + the solution to the LP relaxation of a node in the MIP search + tree. + + self.solution_source.heuristic_solution: The integral solution + has been found by a CPLEX internal heuristic. + + self.solution_source.user_solution: The integral solution has been + found by the user in the heuristic callback. + + self.solution_source.mipstart_solution: The integral solution has been + found during MIP start processing. + """ + wherefrom = self._wherefrom() + source = self.solution_source + switcher = { + _const.CPX_CALLBACK_MIP_INCUMBENT_NODESOLN: source.node_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN: source.heuristic_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_USERSOLN: source.user_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_MIPSTART: source.mipstart_solution + } + return switcher[wherefrom]
+ + +
+[docs] + def reject(self): + """Tells Cplex not to use the potential incumbent.""" + self._useraction = _const.CPX_CALLBACK_SET + self._is_feasible = False
+
+ + + +
+[docs] +class NodeCallback(MIPCallback): + """Subclassable class for node callback classes. + + This callback will be used before CPLEX enters a node, and can select + a different node to be entered instead. + + :undocumented: __init__, __conditionally_convert + """ + + def __conditionally_convert(self, which_node): + if isinstance(which_node, type(())): + return self.get_node_number(which_node) + return which_node + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "node" + self._cb_set_function = _proc.setnodecallbackfunc + self._useraction = _const.CPX_CALLBACK_DEFAULT
+ + +
+[docs] + def get_branch_variable(self, which_node): + """Returns the index of the variable used to branch at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_VAR, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_depth(self, which_node): + """Returns the depth in the search tree of node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_current_node_depth(self): + """Returns the depth of the current node in the search tree. + + This method always raises an exception since the node callback is not + invoked in the context of any node. + """ + # Overrides MIPCallback.get_current_node_depth + # Always throw an exception. + # The intention is this: The super class has a getCurrentNodeDepth() + # function as well. That would throw an exception because the callable + # library returns a non-zero status. + # However, by explicitly overriding this function, we can explicitly + # document that this will fail. + raise CplexSolverError('Not in a node context', None, + CPXERR_UNSUPPORTED_OPERATION)
+ + +
+[docs] + def get_estimated_objective_value(self, which_node): + """Returns the estimated objective function value at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_ESTIMATE, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_infeasibility_sum(self, which_node): + """Returns the sum of infeasibilities at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_SIINF, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_num_infeasibilities(self, which_node): + """Returns the number of infeasibilities at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_NIINF, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_node_data(self, which_node): + """Returns the handle set by the user for node which_node. + + Returns None if no handle was set when the node was created. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_USERHANDLE, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def set_node_data(self, which_node, data): + """Set the user handle for the specified node. + + Returns the user handle previously set for that node (or None + if no handle was set). + """ + return _proc.callbacksetnodeuserhandle(self._cbstruct, + which_node, data)
+ + +
+[docs] + def get_node_ID(self, which_node): + """Returns a one-tuple containing the sequence number of node which_node. + + which_node must be an integer specifying the index + number of the desired node. + """ + return (self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, which_node),)
+ + +
+[docs] + def get_node_number(self, which_node): + """Returns the index number of node which_node. + + which_node must be a 1-tuple whose entry is an integer + specifying the sequence number of the desired node. + """ + return self._get_seq_info( + _const.CPX_CALLBACK_INFO_NODE_NODENUM_LONG, which_node[0])
+ + +
+[docs] + def get_objective_value(self, which_node): + """Returns the objective function value for node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_OBJVAL, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def select_node(self, which_node): + """Tells Cplex to enter node which_node next. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + self._node_number = self.__conditionally_convert(which_node) + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class TuningCallback(Callback): + """Subclassable class for tuning callback classes. + + This callback will be used during tuning. + + For general information about tuning callbacks, see that topic + in the CPLEX User's Manual. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "tuning" + self._cb_set_function = _proc.settuningcallbackfunc
+ + +
+[docs] + def get_progress(self): + """Returns the fraction of the tuning process that is done.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_TUNING_PROGRESS, + CplexSolverError)
+
+ + + +
+[docs] +class ContextType(ConstantClass): + """The different contexts in which a generic callback can be invoked. + + The values defined here serve two purposes: + + They are returned from `Context.get_id()` to indicate in which + context a particular callback invocation happened. + + The bit-wise OR of these values specifies to + `Cplex.set_callback()` in which contexts CPLEX invokes the + callback. + + See the reference manual of the CPLEX Callable Library (C API) + for a more detailed description of the various contexts. + """ + + thread_up = _const.CPX_CALLBACKCONTEXT_THREAD_UP + """See `CPX_CALLBACKCONTEXT_THREAD_UP <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_THREAD_UP.html>`_ in the C API.""" + + thread_down = _const.CPX_CALLBACKCONTEXT_THREAD_DOWN + """See `CPX_CALLBACKCONTEXT_THREAD_DOWN <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_THREAD_DOWN.html>`_ in the C API.""" + + local_progress = _const.CPX_CALLBACKCONTEXT_LOCAL_PROGRESS + """See `CPX_CALLBACKCONTEXT_LOCAL_PROGRESS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_LOCAL_PROGRESS.html>`_ in the C API.""" + + global_progress = _const.CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS + """See `CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS.html>`_ in the C API.""" + + candidate = _const.CPX_CALLBACKCONTEXT_CANDIDATE + """See `CPX_CALLBACKCONTEXT_CANDIDATE <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_CANDIDATE.html>`_ in the C API.""" + + relaxation = _const.CPX_CALLBACKCONTEXT_RELAXATION + """See `CPX_CALLBACKCONTEXT_RELAXATION <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_RELAXATION.html>`_ in the C API.""" + + branching = _const.CPX_CALLBACKCONTEXT_BRANCHING + """See `CPX_CALLBACKCONTEXT_BRANCHING <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_BRANCHING.html>`_ in the C API."""
+ + + +
+[docs] +class RelaxationFlags(ConstantClass): + """The flags that can be passed to `Context.get_relaxation_status()`. + + See the reference manual of the CPLEX Callable Library (C API) + for a more detailed description of the various contexts. + """ + + no_solve = _const.CPX_RELAXATION_FLAG_NOSOLVE + """See `CPX_RELAXATION_FLAG_NOSOLVE <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_RELAXATION_FLAG_NOSOLVE.html>`_ in the C API."""
+ + + +
+[docs] +class Context(): + """Context for the generic callback. + + An instance of this class defines the context in which a generic + callback was invoked. It provides methods to query information and + perform all actions that can be performed from a generic callback. + + Note that an instance of this class is only valid during the + execution of the callback into which it was passed. Don't store a + reference to the context across callback invocations. + + See `Cplex.set_callback()`. + + :undocumented: __init__ + """ + + info = CallbackInfo() + """See `CallbackInfo`""" + + solution_strategy = SolutionStrategy() + """See `SolutionStrategy`""" + + id = ContextType() + """See `ContextType`""" + + relaxation_flags = RelaxationFlags() + """See `RelaxationFlags`""" + + solution_status = SolutionStatus() + """See `SolutionStatus`""" + +
+[docs] + def __init__(self, cpx, contextptr, contextid): + """non-public""" + self._cpx = cpx + self._contextptr = contextptr + self._contextid = contextid
+ + + def _get_column_index(self, name): + """non-public""" + # Adapted from Callback._get_col_index + return _proc.getcolindex(env=self._cpx._env._e, lp=self._cpx._lp, + colname=name) + + def _get_column_count(self): + """non-public""" + return _proc.getnumcols(self._cpx._env._e, self._cpx._lp) + + def _colname2idx(self, name, cache=None): + """non-public""" + # This is the same as Callback._conv_col! + return convert(name, self._get_column_index, cache) + +
+[docs] + def get_id(self): + """Returns the context in which the current callback was invoked. + + The return value will be one of the constants in `ContextType`. + """ + return self._contextid
+ + +
+[docs] + def in_thread_up(self): + """Returns True if the callback was invoked in context + `ContextType.thread_up`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.thread_up` or not. + """ + return self._contextid == self.id.thread_up
+ + +
+[docs] + def in_thread_down(self): + """Returns True if the callback was invoked in context + `ContextType.thread_down`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.thread_down` or not. + """ + return self._contextid == self.id.thread_down
+ + +
+[docs] + def in_local_progress(self): + """Returns True if the callback was invoked in context + `ContextType.local_progress`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.local_progress` or not. + """ + return self._contextid == self.id.local_progress
+ + +
+[docs] + def in_global_progress(self): + """Returns True if the callback was invoked in context + `ContextType.global_progress`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.global_progress` or not. + """ + return self._contextid == self.id.global_progress
+ + +
+[docs] + def in_candidate(self): + """Returns True if the callback was invoked in context + `ContextType.candidate`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.candidate` or not. + """ + return self._contextid == self.id.candidate
+ + +
+[docs] + def in_relaxation(self): + """Returns True if the callback was invoked in context + `ContextType.relaxation`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.relaxation` or not. + """ + return self._contextid == self.id.relaxation
+ + +
+[docs] + def in_branching(self): + """Returns True if the callback was invoked in context + `ContextType.branching`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.branching` or not. + """ + return self._contextid == self.id.branching
+ + +
+[docs] + def get_int_info(self, what): + """Returns a 32bit signed information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfoint(self._contextptr, what)
+ + +
+[docs] + def get_long_info(self, what): + """Returns a 64bit signed information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfolong <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfolong.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfolong(self._contextptr, what)
+ + +
+[docs] + def get_double_info(self, what): + """Returns a float information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfodbl <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfodbl.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfodbl(self._contextptr, what)
+ + +
+[docs] + def abort(self): + """Aborts the optimization. + + If you call this method then CPLEX will abort optimization at + the next opportunity. + + See `CPXcallbackabort <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackabort.html>`_ in the Callable Library Reference + Manual for more detail. + """ + _proc.callbackabort(self._contextptr)
+ + +
+[docs] + def get_relaxation_point(self, *args): + """Returns the solution to the current relaxation. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + This method returns the values in the solution for the current + relaxation for the variables specified by the arguments. + + There are four forms by which get_relaxation_point may be called. + + self.get_relaxation_point() + returns the full solution vector. + + self.get_relaxation_point(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the solution to the current + relaxation. + + self.get_relaxation_point(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_relaxation_point(i) for i in s] + + self.get_relaxation_point(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_relaxation_point(range(begin, end + 1)). + + See `CPXcallbackgetrelaxationpoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationpoint.html>`_ in the Callable + Library Reference Manual for more detail. + """ + def callbackgetrelaxationpoint(begin, end=self._get_column_count() - 1): + return _proc.callbackgetrelaxationpoint(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetrelaxationpoint, self._colname2idx, args)
+ + +
+[docs] + def get_relaxation_objective(self): + """Returns the objective value of current relaxation. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + See `CPXcallbackgetrelaxationpoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationpoint.html>`_ in the Callable + Library Reference Manual for more detail. + """ + return _proc.callbackgetrelaxationpointobj(self._contextptr)
+ + +
+[docs] + def get_relaxation_status(self, flags=0): + """Returns the solution status of the relaxation LP. + + Returns the solution status of the LP relaxation at the current + node. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + See `CPXcallbackgetrelaxationstatus <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationstatus.html>`_ in the Callable + Library Reference Manual for more detail. + """ + return _proc.callbackgetrelaxationstatus(self._contextptr, flags)
+ + +
+[docs] + def make_branch(self, objective_estimate, variables=None, + constraints=None): + """Makes a new branch with the specified data. + + This method can only be invoked if `get_id()` returns + `ContextType.branching`. If invoked in a different context it + will raise an exception. + + objective_estimate is a float representing the estimated + objective value resulting from the specified branch. + + variables is a sequence of (var, dir, bnd) tuples specifying + the variables on which to branch. var must be an index of a + variable, dir must be one of "L" and "U", indicating that the + bound is a lower or upper bound, respectively, and bnd is an + integer specifying the new bound for the variable. + + constraints is a sequence of (vec, sense, rhs) tuples specifying + the constraints with which to branch. vec must be either an + instance of `SparsePair` or a sequence with two entries, the + first of which specifies the indices and the second of which + specifies the values of the constraint. rhs must be a float + determining the righthand side of the constraint. sense must be + one of "L", "G", or "E", specifying whether the constraint is a + less-than-or-equal-to (<=), greater-than-or-equal-to (>=), or + equality constraint (=). + + The method returns an integer that uniquely identifies the newly + created child node in the search tree. + + Note that the children will be dropped if you call + `prune_current_node()` at the same node. + + See `CPXcallbackmakebranch <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackmakebranch.html>`_ in the Callable Library + Reference Manual for more detail. + """ + variables, constraints = init_list_args(variables, constraints) + if variables: + a = unzip(variables) + else: + a = [[], [], []] + vars = list(a[0]) + dirs = ''.join(list(a[1])) + bnds = list(a[2]) + if constraints: + a = unzip(constraints) + else: + a = [[], [], []] + rmat = _HBMatrix(a[0]) + sense = ''.join(list(a[1])) + rhs = list(a[2]) + return _proc.callbackmakebranch(self._contextptr, + vars, dirs, bnds, rhs, sense, + rmat.matbeg, rmat.matind, rmat.matval, + objective_estimate)
+ + +
+[docs] + def prune_current_node(self): + """Ask CPLEX to prune the current node from the search tree. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + The node is marked for pruning. As soon as the callback returns, + CPLEX stops processing the node. In particular, no child nodes + will be created from that node, even if you called + `make_branch()` to explicitly create new nodes. + + See `CPXcallbackprunenode <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackprunenode.html>`_ in the Callable Library + Reference Manual for more detail. + """ + _proc.callbackprunenode(self._contextptr)
+ + +
+[docs] + def exit_cut_loop(self): + """Ask CPLEX to stop cutting plane separatation at the current + node. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + See `CPXcallbackexitcutloop <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackexitcutloop.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackexitcutloop(self._contextptr)
+ + +
+[docs] + def get_incumbent(self, *args): + """Returns the current incumbent solution. + + The method returns the values in the current incumbent solution + for the variables specified by the arguments. + + There are four forms by which get_incumbent may be called. + + self.get_incumbent() + returns the full incumbent vector. + + self.get_incumbent(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the current incumbent + solution. + + self.get_incumbent(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_incumbent(i) for i in s] + + self.get_incumbent(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_incumbent(range(begin, end + 1)). + + See `CPXcallbackgetincumbent <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetincumbent.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetincumbent(begin, end=self._get_column_count() - 1): + return _proc.callbackgetincumbent(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetincumbent, self._colname2idx, args)
+ + +
+[docs] + def get_incumbent_objective(self): + """Returns the objective value of the current incumbent. + + The returned value may be a huge value (such as 1e75) to indicate + that no incumbent was found yet. Consider using `get_int_info()` + with `CallbackInfo.feasible` first to check whether there is an + incumbent. + + See `CPXcallbackgetincumbent <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetincumbent.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetincumbentobj(self._contextptr)
+ + +
+[docs] + def is_candidate_point(self): + """Test if the callback was invoked for a candidate feasible + point. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method returns true if the callback was invoked for a + candidate feasible point. In that case the candidate feasible + point can be examined using `get_candidate_point()` and + `get_candidate_objective()`. + + See `CPXcallbackcandidateispoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackcandidateispoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackcandidateispoint(self._contextptr)
+ + +
+[docs] + def get_candidate_source(self): + """Get the source from which the current candidate solution originated. + + The value returned is from IncumbentCallback.solution_source. + """ + + # FIXME: Share this code with above + source = IncumbentCallback.solution_source + switcher = { + _const.CPX_LAZYCONSTRAINTCALLBACK_NODE: source.node_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_HEUR: source.heuristic_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_MIPSTART: source.mipstart_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_USER: source.user_solution + } + + return switcher[self.get_int_info(self.info.candidate_source)]
+ + +
+[docs] + def get_candidate_point(self, *args): + """Returns the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_point()` returns true. + If invoked in a different context it will raise an exception. + + This method returns the values in the current candidate solution + for the variables specified by the arguments. + + There are four forms by which get_candidate_point may be called. + + self.get_candidate_point() + returns the full solution vector. + + self.get_candidate_point(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the current candidate + solution. + + self.get_candidate_point(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_candidate_point(i) for i in s] + + self.get_candidate_point(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_candidate_point(range(begin, end + 1)) + + See `CPXcallbackgetcandidatepoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidatepoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetcandidatepoint(begin, end=self._get_column_count() - 1): + return _proc.callbackgetcandidatepoint(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetcandidatepoint, self._colname2idx, args)
+ + +
+[docs] + def get_candidate_objective(self): + """Returns the objective value of current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_point()` returns true. + It will raise an exception if invoked in a different context. + + See `CPXcallbackgetcandidatepoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidatepoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetcandidateobj(self._contextptr)
+ + +
+[docs] + def is_candidate_ray(self): + """Test if the callback was invoked for an unbounded ray. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method returns true if the callback was invoked for an + unbounded relaxation. In that case the unbounded ray can be + obtained using `get_candidate_ray()` and. + + See `CPXcallbackcandidateisray <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackcandidateisray.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackcandidateisray(self._contextptr)
+ + +
+[docs] + def get_candidate_ray(self, *args): + """Returns the current unbounded ray. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_ray()` returns true. If + invoked in a different context it will raise an exception. + + The method returns the values for in the unbounded ray for the + variables specified by the arguments. + + There are four forms by which get_candidate_ray may be called. + + self.get_candidate_ray() + returns the full ray vector. + + self.get_candidate_ray(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the unbounded ray. + + self.get_candidate_ray(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_candidate_ray(i) for i in s] + + self.get_candidate_ray(begin, end) + begin and end must be variable indices or variable names. + Returns a list of unbounded reay values of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_candidate_ray(range(begin, end + 1)). + + See `CPXcallbackgetcandidateray <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidateray.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetcandidateray(begin, end=self._get_column_count() - 1): + return _proc.callbackgetcandidateray(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetcandidateray, self._colname2idx, args)
+ + +
+[docs] + def get_local_lower_bounds(self, *args): + """Returns the current local lower bounds. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + There are four forms by which get_local_lower_bounds may be + called. + + self.get_local_lower_bounds() + returns local lower bounds for all variables. + + self.get_local_lower_bounds(i) + i must be a variable index or name. Returns the local lower + bound of the variable with index or name i. + + self.get_local_lower_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the local lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_local_lower_bounds(i) for i in s] + + self.get_local_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the local lower bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_local_lower_bounds(range(begin, end + 1)). + + See `CPXcallbackgetlocallb <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetlocallb.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetlocallb(begin, end=self._get_column_count() - 1): + return _proc.callbackgetlocallb(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetlocallb, self._colname2idx, args)
+ + +
+[docs] + def get_local_upper_bounds(self, *args): + """Returns the current local upper bounds. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + There are four forms by which get_local_upper_bounds may be + called. + + self.get_local_upper_bounds() + returns local upper bounds for all variables. + + self.get_local_upper_bounds(i) + i must be a variable index or name. Returns the local upper + bound of the variable with index or name i. + + self.get_local_upper_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the local upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_local_upper_bounds(i) for i in s] + + self.get_local_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the local upper bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_local_upper_bounds(range(begin, end + 1)). + + See `CPXcallbackgetlocalub <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetlocalub.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetlocalub(begin, end=self._get_column_count() - 1): + return _proc.callbackgetlocalub(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetlocalub, self._colname2idx, args)
+ + +
+[docs] + def get_global_lower_bounds(self, *args): + """Returns the current globally valid lower bounds. + + This method cannot be invoked if `get_id()` returns + `ContextType.thread_up` or `ContextType.thread_down`. + + There are four forms by which get_global_lower_bounds may be + called. + + self.get_global_lower_bounds() + returns global lower bounds for all variables. + + self.get_global_lower_bounds(i) + i must be a variable index or name. Returns the global lower + bound of the variable with index or name i. + + self.get_global_lower_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the global lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_global_lower_bounds(i) for i in s] + + self.get_global_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the global lower bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_global_lower_bounds(range(begin, end + 1)). + + See `CPXcallbackgetgloballb <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetgloballb.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetgloballb(begin, end=self._get_column_count() - 1): + return _proc.callbackgetgloballb(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetgloballb, self._colname2idx, args)
+ + +
+[docs] + def get_global_upper_bounds(self, *args): + """Returns the current globally valid upper bounds. + + This method cannot be invoked if `get_id()` returns + `ContextType.thread_up` or `ContextType.thread_down`. + + There are four forms by which get_global_upper_bounds may be + called. + + self.get_global_upper_bounds() + returns global upper bounds for all variables. + + self.get_global_upper_bounds(i) + i must be a variable index or name. Returns the global upper + bound of the variable with index or name i. + + self.get_global_upper_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the global upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_global_upper_bounds(i) for i in s] + + self.get_global_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the global upper bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_global_upper_bounds(range(begin, end + 1)). + + See `CPXcallbackgetglobalub <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetglobalub.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetglobalub(begin, end=self._get_column_count() - 1): + return _proc.callbackgetglobalub(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetglobalub, self._colname2idx, args)
+ + +
+[docs] + def post_heuristic_solution(self, x, obj, strategy): + """Posts a feasible solution vector to CPLEX. + + This method posts a (possibly partial) feasible solution to + CPLEX. CPLEX may use this vector to find a new incumbent + solution. + + x is either a `SparsePair` instance or a list of two lists, the + first of which specifies the variables (by index or name) and the + second of which specifies the values. + + obj is an estimate for the objective function value of the + solution provided by x. + + strategy specifies how CPLEX should complete partial solutions. + See `SolutionStrategy` for further details. + + See `CPXcallbackpostheursoln <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackpostheursoln.html>`_ in the Callable Library + Reference Manual for more detail. + """ + indices, values = unpack_pair(x) + _proc.callbackpostheursoln(self._contextptr, len(indices), + self._colname2idx(indices), values, + obj, strategy)
+ + +
+[docs] + def add_user_cuts(self, cuts, senses, rhs, cutmanagement, local): + """Adds user cuts. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + This method submits the specified user cuts to CPLEX. + + cuts, senses, rhs, cutmanagement, local must all be lists of + compatible dimensions. The first three specify the cuts to be + added. + + cuts must be either a list of `SparsePair` instances or a list of + lists of two lists, the first of which specifies variables, the + second of which specifies the values of the constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + cutmanagement must be a list of integer values specifying how + CPLEX should treat each cut (see `UseCut` constants for further + details). + + local must be a list of boolean values and specifies for each cut + whether it is only locally valid (True) or globally valid + (False). + + See `CPXcallbackaddusercuts <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackaddusercuts.html>`_ in the Callable Library + Reference Manual for more detail. + """ + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, cuts, cutmanagement, local] + ncuts = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": cuts, senses, rhs, cutmanagement, local" + ) + if ncuts > 0: + with _proc.chbmatrix(cuts, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackaddusercuts(self._contextptr, ncuts, nnz, + rhs, senses, rmat, + cutmanagement, local)
+ + +
+[docs] + def add_user_cut(self, cut, sense, rhs, cutmanagement, local): + """Convenience wrapper for `add_user_cuts()` that only adds a + single cut. + """ + self.add_user_cuts([cut], [sense], [rhs], [cutmanagement], [local])
+ + +
+[docs] + def reject_candidate(self, constraints=None, senses=None, rhs=None): + """Rejects the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method marks the current candidate solution as infeasible, + potentially specifying additional constraints that cut it off. + + If constraints, senses, and rhs are all None then the current + candidate solution is just rejected. If any of the three is not + None then all must be not None and all must have compatible + dimensions. In that case the three arguments specify a set of + constraints that cut off the current candidate solution. CPLEX + may use this information to tighten the problem formulation and + to avoid finding the same solution again. There is however no + guarantee that CPLEX will actually use those additional + constraints. + + constraints must be either a list of `SparsePair` instances or a + list of lists of two lists, the first of which specifies + variables, the second of which specifies the values of the + constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + See `CPXcallbackrejectcandidate <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackrejectcandidate.html>`_ in the Callable Library + Reference Manual for more detail. + """ + constraints, senses, rhs = init_list_args(constraints, senses, rhs) + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, constraints] + nconstraints = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": constraints, senses, rhs" + ) + with _proc.chbmatrix(constraints, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackrejectcandidate(self._contextptr, nconstraints, nnz, + rhs, senses, rmat)
+ + +
+[docs] + def reject_candidate_local(self, constraints=None, senses=None, rhs=None): + """Rejects the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and if the candidate was invoked for an + integral node. If invoked in a different context it will raise an + exception. + + This method marks the current candidate solution as infeasible, + potentially specifying additional constraints that cut it off. + The specified constraints are not required to be globally valid. + They are only required to be valid in the subtree in which the + callback was invoked. + + If constraints, senses, and rhs are all None then the current + candidate solution is just rejected. If any of the three is not + None then all must be not None and all must have compatible + dimensions. In that case the three arguments specify a set of + constraints that cut off the current candidate solution. CPLEX + may use this information to tighten the problem formulation and + to avoid finding the same solution again. There is however no + guarantee that CPLEX will actually use those additional + constraints. + + constraints must be either a list of `SparsePair` instances or a + list of lists of two lists, the first of which specifies + variables, the second of which specifies the values of the + constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + See `CPXcallbackrejectcandidatelocal <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackrejectcandidatelocal.html>`_ in the Callable Library + Reference Manual for more detail. + """ + constraints, senses, rhs = init_list_args(constraints, senses, rhs) + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, constraints] + nconstraints = max_arg_length(arg_list) + validate_arg_lengths(arg_list) + with _proc.chbmatrix(constraints, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackrejectcandidatelocal(self._contextptr, nconstraints, + nnz, rhs, senses, rmat)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/constant_class.html b/docs/22.1.2.0/_modules/cplex/constant_class.html new file mode 100644 index 0000000..a61f768 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/constant_class.html @@ -0,0 +1,153 @@ + + + + + + + cplex.constant_class — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.constant_class

+# --------------------------------------------------------------------------
+# File: constant_class.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""A base class for classes that contain groups of constants."""
+
+
+
+[docs] +class ConstantClass(): + """A base class for classes that contain groups of constants.""" + +
+[docs] + def __init__(self): + """Creates a new ConstantClass. + + This constructor is not meant to be used externally. + """ + self.__constant_map = None
+ + + def _get_constant_map(self): + return {key: value + for key, value + in self.__class__.__dict__.items() + if not key.startswith("_")} + +
+[docs] + def __getitem__(self, item): + """Converts a constant to a string.""" + if self.__constant_map is None: + self.__constant_map = self._get_constant_map() + for name, value in self.__constant_map.items(): + if item == value: + return name + raise KeyError(item)
+ + +
+[docs] + def __iter__(self): + """Iterate over the constants in this class.""" + if self.__constant_map is None: + self.__constant_map = self._get_constant_map() + for value in self.__constant_map.values(): + yield value
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/exceptions/errors.html b/docs/22.1.2.0/_modules/cplex/exceptions/errors.html new file mode 100644 index 0000000..6bcdaf0 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/exceptions/errors.html @@ -0,0 +1,154 @@ + + + + + + + cplex.exceptions.errors — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.exceptions.errors

+# ------------------------------------------------------------------------
+# File: errors.py
+# ------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Exceptions raised by the CPLEX Python API."""
+
+
+
+[docs] +class CplexError(Exception): + """Class for exceptions raised by the CPLEX Python API."""
+ + + +
+[docs] +class CplexSolverError(CplexError): + """Class for errors returned by the Callable Library functions. + + self.args[0] : A string describing the error. + + self.args[1] : The address of the environment that raised the error. + + self.args[2] : The integer status code of the error. + """ + + def __str__(self): + return self.args[0] # pylint: disable=unsubscriptable-object
+ + + +
+[docs] +class WrongNumberOfArgumentsError(CplexError, TypeError): + """Class for errors involving the wrong number of arguments. + + This exception is generally raised by methods that can accept a + dynamic number of arguments, but also enforce certain rules (e.g., to + be grouped in pairs, requires at least one argument, etc.). + """
+ + + +
+[docs] +class ErrorChannelMessage(CplexError): + """Class for storing the last message on the error channel. + + For internal use only. + """
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/cplex/paramset.html b/docs/22.1.2.0/_modules/cplex/paramset.html new file mode 100644 index 0000000..703fc36 --- /dev/null +++ b/docs/22.1.2.0/_modules/cplex/paramset.html @@ -0,0 +1,449 @@ + + + + + + + cplex.paramset — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.paramset

+# --------------------------------------------------------------------------
+# File: paramset.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""ParameterSet API"""
+import weakref
+from ._internal import _procedural as _proc
+
+
+def _get_id(param):
+    """Returns a parameter ID.
+
+    If param is a Parameter object, then we get the ID from it.
+    Otherwise, we assume param is an integer.
+    """
+    try:
+        # If this is a Parameter object, then return its _id attr.
+        return param._id
+    except AttributeError:
+        # Otherwise, we assume it's an integer.
+        return param
+
+
+def _get_type(env, param):
+    """Returns a parameter type.
+
+    If param is a Parameter object, then we get the type from it.
+    Otherwise, we assume param is an integer and query the parameter
+    type.
+    """
+    try:
+        return param._type
+    except AttributeError:
+        return _proc.getparamtype(env, param)
+
+
+
+[docs] +class ParameterSet(): + """A parameter set object for use with multi-objective optimization. + + A parameter set consists of key-value pairs where the key is a CPLEX + parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated + parameter value. + + When adding, getting, or deleting items from a parameter set the + param argument can be either a Parameter object (e.g, + Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND + (1001)). + + For more details see the section on multi-objective optimization in + the CPLEX User's Manual. + + See `Cplex.create_parameter_set` and `Cplex.copy_parameter_set`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, c.parameters.advance.values.none) + >>> len(ps) + 1 + """ + +
+[docs] + def __init__(self, env): + """Constructor of the ParameterSet class. + + This class is not meant to be instantiated directly nor used + externally. + """ + self._disposed = False + self._env = weakref.proxy(env) + self._ps = _proc.paramsetcreate(self._env._e)
+ + + def _throw_if_disposed(self): + if self._disposed: + raise ValueError( + 'illegal method invocation after ParameterSet.end()') + +
+[docs] + def end(self): + """Releases the ParameterSet object. + + Frees all data structures associated with a ParameterSet. After + a call of the method end(), the invoking object can no longer be + used. Attempts to use them subsequently raise a ValueError. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.end() + """ + if self._disposed: + return + self._disposed = True + try: + _proc.paramsetfree(self._env._e, self._ps) + except ReferenceError: + # Ignore error raised if the reference env of our weakref + # has been garbage collected. If the env has already been + # closed, then the paramset has already been freed. + pass + self._ps = None
+ + +
+[docs] + def __del__(self): + """Destructor of the ParameterSet class. + + When a ParameterSet object is destoyed, the end() method is + called. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> del ps + """ + self.end()
+ + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The with statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + ParameterSet objects return themselves. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> with c.create_parameter_set(): + ... pass # do something here + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with block, the end() method is called. + """ + self.end()
+ + +
+[docs] + def add(self, param, value): + """Add a parameter ID and value to a parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + """ + self._throw_if_disposed() + whichparam = _get_id(param) + paramtype = _get_type(self._env._e, param) + _proc.paramsetadd(self._env._e, self._ps, whichparam, value, + paramtype)
+ + +
+[docs] + def get(self, param): + """Gets a parameter value. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> val = ps.get(c.parameters.advance) + >>> val == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + whichparam = _get_id(param) + paramtype = _get_type(self._env._e, param) + return _proc.paramsetget(self._env._e, self._ps, whichparam, + paramtype)
+ + +
+[docs] + def get_ids(self): + """Gets the parameter IDs contained in a parameter set. + + Returns an iterator containing the parameter IDs in a parameter + set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> list(ps.get_ids()) + [1001] + """ + self._throw_if_disposed() + return _proc.paramsetgetids(self._env._e, self._ps)
+ + +
+[docs] + def delete(self, param): + """Deletes a parameter from a parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(ps) + 1 + >>> ps.delete(c.parameters.advance) + >>> len(ps) + 0 + """ + self._throw_if_disposed() + _proc.paramsetdel(self._env._e, self._ps, _get_id(param))
+ + +
+[docs] + def clear(self): + """Clears all items from the parameter set. + + Example Usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> ps.clear() + >>> len(ps) + 0 + """ + self._throw_if_disposed() + for item in self.get_ids(): + self.delete(item)
+ + +
+[docs] + def __len__(self): + """Return the number of items in the parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> len(ps) + 0 + """ + self._throw_if_disposed() + return _proc.paramsetgetnum(self._env._e, self._ps)
+ + +
+[docs] + def read(self, filename): + """Reads parameter names and settings from the file specified by + filename and copies them into the parameter set. + + Note that the content of the parameter set is not cleared out + before the parameters in the file are copied into the parameter + set. The parameters are read from the file one by one and are + added to the parameter set, or, if the parameter was already + present in the set, then its value is updated. + + This routine reads and copies files in the PRM format, as created + by Cplex.parameters.write. The PRM format is documented in the + CPLEX File Formats Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.advance.set(c.parameters.advance.values.none) + >>> c.parameters.write_file('example.prm') + >>> ps = c.create_parameter_set() + >>> ps.read('example.prm') + >>> value = ps.get(c.parameters.advance) + >>> value == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + _proc.paramsetreadcopy(self._env._e, self._ps, filename)
+ + +
+[docs] + def write(self, filename): + """Writes a parameter file that contains the parameters in the + parameter set. + + This routine writes a file in a format suitable for reading by + ParameterSet.read or by Cplex.parameters.read. + + The file is written in the PRM format which is documented in the + CPLEX File Formats Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> ps.write('example.prm') + >>> c.parameters.read_file('example.prm') + >>> value = c.parameters.advance.get() + >>> value == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + _proc.paramsetwrite(self._env._e, self._ps, filename)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_modules/index.html b/docs/22.1.2.0/_modules/index.html new file mode 100644 index 0000000..daa49e9 --- /dev/null +++ b/docs/22.1.2.0/_modules/index.html @@ -0,0 +1,110 @@ + + + + + + + Overview: module code — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/_static/base-stemmer.js b/docs/22.1.2.0/_static/base-stemmer.js new file mode 100644 index 0000000..e6fa0c4 --- /dev/null +++ b/docs/22.1.2.0/_static/base-stemmer.js @@ -0,0 +1,476 @@ +// @ts-check + +/**@constructor*/ +BaseStemmer = function() { + /** @protected */ + this.current = ''; + this.cursor = 0; + this.limit = 0; + this.limit_backward = 0; + this.bra = 0; + this.ket = 0; + + /** + * @param {string} value + */ + this.setCurrent = function(value) { + this.current = value; + this.cursor = 0; + this.limit = this.current.length; + this.limit_backward = 0; + this.bra = this.cursor; + this.ket = this.limit; + }; + + /** + * @return {string} + */ + this.getCurrent = function() { + return this.current; + }; + + /** + * @param {BaseStemmer} other + */ + this.copy_from = function(other) { + /** @protected */ + this.current = other.current; + this.cursor = other.cursor; + this.limit = other.limit; + this.limit_backward = other.limit_backward; + this.bra = other.bra; + this.ket = other.ket; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor++; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) + return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) + return true; + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor--; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return true; + this.cursor--; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) { + this.cursor++; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) { + this.cursor++; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) { + this.cursor--; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) { + this.cursor--; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor--; + } + return false; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s = function(s) + { + /** @protected */ + if (this.limit - this.cursor < s.length) return false; + if (this.current.slice(this.cursor, this.cursor + s.length) != s) + { + return false; + } + this.cursor += s.length; + return true; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s_b = function(s) + { + /** @protected */ + if (this.cursor - this.limit_backward < s.length) return false; + if (this.current.slice(this.cursor - s.length, this.cursor) != s) + { + return false; + } + this.cursor -= s.length; + return true; + }; + + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among = function(v) + { + /** @protected */ + var i = 0; + var j = v.length; + + var c = this.cursor; + var l = this.limit; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >>> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; // smaller + // w[0]: string, w[1]: substring_i, w[2]: result, w[3]: function (optional) + var w = v[k]; + var i2; + for (i2 = common; i2 < w[0].length; i2++) + { + if (c + common == l) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c + common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; // v->s has been inspected + if (j == i) break; // only one item in v + + // - but now we need to go round once more to get + // v->s inspected. This looks messy, but is actually + // the optimal approach. + + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c + w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c + w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + // find_among_b is for backwards processing. Same comments apply + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among_b = function(v) + { + /** @protected */ + var i = 0; + var j = v.length + + var c = this.cursor; + var lb = this.limit_backward; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; + var w = v[k]; + var i2; + for (i2 = w[0].length - 1 - common; i2 >= 0; i2--) + { + if (c - common == lb) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c - 1 - common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; + if (j == i) break; + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c - w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c - w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + /* to replace chars between c_bra and c_ket in this.current by the + * chars in s. + */ + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + * @return {number} + */ + this.replace_s = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = s.length - (c_ket - c_bra); + this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket); + this.limit += adjustment; + if (this.cursor >= c_ket) this.cursor += adjustment; + else if (this.cursor > c_bra) this.cursor = c_bra; + return adjustment; + }; + + /** + * @return {boolean} + */ + this.slice_check = function() + { + /** @protected */ + if (this.bra < 0 || + this.bra > this.ket || + this.ket > this.limit || + this.limit > this.current.length) + { + return false; + } + return true; + }; + + /** + * @param {number} c_bra + * @return {boolean} + */ + this.slice_from = function(s) + { + /** @protected */ + var result = false; + if (this.slice_check()) + { + this.replace_s(this.bra, this.ket, s); + result = true; + } + return result; + }; + + /** + * @return {boolean} + */ + this.slice_del = function() + { + /** @protected */ + return this.slice_from(""); + }; + + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + */ + this.insert = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = this.replace_s(c_bra, c_ket, s); + if (c_bra <= this.bra) this.bra += adjustment; + if (c_bra <= this.ket) this.ket += adjustment; + }; + + /** + * @return {string} + */ + this.slice_to = function() + { + /** @protected */ + var result = ''; + if (this.slice_check()) + { + result = this.current.slice(this.bra, this.ket); + } + return result; + }; + + /** + * @return {string} + */ + this.assign_to = function() + { + /** @protected */ + return this.current.slice(0, this.limit); + }; +}; diff --git a/docs/22.1.2.0/_static/basic.css b/docs/22.1.2.0/_static/basic.css new file mode 100644 index 0000000..4738b2e --- /dev/null +++ b/docs/22.1.2.0/_static/basic.css @@ -0,0 +1,906 @@ +/* + * Sphinx stylesheet -- basic theme. + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin-top: 10px; +} + +ul.search li { + padding: 5px 0; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/docs/22.1.2.0/_static/classic.css b/docs/22.1.2.0/_static/classic.css new file mode 100644 index 0000000..4c4bcc7 --- /dev/null +++ b/docs/22.1.2.0/_static/classic.css @@ -0,0 +1,311 @@ +/* + * Sphinx stylesheet -- classic theme. + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +html { + /* CSS hack for macOS's scrollbar (see #1125) */ + background-color: #FFFFFF; +} + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + display: flex; + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { + top: 30px; + bottom: 0; + margin: 0; + position: fixed; + overflow: auto; + height: auto; +} +/* this is nice, but it it leads to hidden headings when jumping + to an anchor */ +/* +div.related { + position: fixed; +} + +div.documentwrapper { + margin-top: 30px; +} +*/ + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + + + + +/* for collapsible sidebar */ +#sidebarbutton { + height: 100%; + background-color: #3c6e83; + margin-left: 0; + color: #FFFFFF; + border-left: 1px solid #133f52; + font-size: 1.2em; + cursor: pointer; + padding-top: 1px; + float: right; + display: table; /* for vertically centering the */ +} + +#sidebarbutton:hover { + background-color: #133f52; +} + +#sidebarbutton span { + display: table-cell; + vertical-align: middle; +} + +div.sphinxsidebarwrapper { + float: left; + margin-right: 0; +} + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #551a8b; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +nav.contents, +aside.topic, +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: unset; + color: unset; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +code { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th, dl.field-list > dt { + background-color: #ede; +} + +.warning code { + background: #efc2c2; +} + +.note code { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.code-block-caption { + color: #efefef; + background-color: #1c4e63; +} \ No newline at end of file diff --git a/docs/22.1.2.0/_static/copyright.png b/docs/22.1.2.0/_static/copyright.png new file mode 100644 index 0000000..173b6e8 Binary files /dev/null and b/docs/22.1.2.0/_static/copyright.png differ diff --git a/docs/22.1.2.0/_static/doctools.js b/docs/22.1.2.0/_static/doctools.js new file mode 100644 index 0000000..807cdb1 --- /dev/null +++ b/docs/22.1.2.0/_static/doctools.js @@ -0,0 +1,150 @@ +/* + * Base JavaScript utilities for all Sphinx HTML documentation. + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})`, + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)), + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS + && !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/docs/22.1.2.0/_static/documentation_options.js b/docs/22.1.2.0/_static/documentation_options.js new file mode 100644 index 0000000..829fd53 --- /dev/null +++ b/docs/22.1.2.0/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '22.1.2', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/22.1.2.0/_static/english-stemmer.js b/docs/22.1.2.0/_static/english-stemmer.js new file mode 100644 index 0000000..056760e --- /dev/null +++ b/docs/22.1.2.0/_static/english-stemmer.js @@ -0,0 +1,1066 @@ +// Generated from english.sbl by Snowball 3.0.1 - https://snowballstem.org/ + +/**@constructor*/ +var EnglishStemmer = function() { + var base = new BaseStemmer(); + + /** @const */ var a_0 = [ + ["arsen", -1, -1], + ["commun", -1, -1], + ["emerg", -1, -1], + ["gener", -1, -1], + ["later", -1, -1], + ["organ", -1, -1], + ["past", -1, -1], + ["univers", -1, -1] + ]; + + /** @const */ var a_1 = [ + ["'", -1, 1], + ["'s'", 0, 1], + ["'s", -1, 1] + ]; + + /** @const */ var a_2 = [ + ["ied", -1, 2], + ["s", -1, 3], + ["ies", 1, 2], + ["sses", 1, 1], + ["ss", 1, -1], + ["us", 1, -1] + ]; + + /** @const */ var a_3 = [ + ["succ", -1, 1], + ["proc", -1, 1], + ["exc", -1, 1] + ]; + + /** @const */ var a_4 = [ + ["even", -1, 2], + ["cann", -1, 2], + ["inn", -1, 2], + ["earr", -1, 2], + ["herr", -1, 2], + ["out", -1, 2], + ["y", -1, 1] + ]; + + /** @const */ var a_5 = [ + ["", -1, -1], + ["ed", 0, 2], + ["eed", 1, 1], + ["ing", 0, 3], + ["edly", 0, 2], + ["eedly", 4, 1], + ["ingly", 0, 2] + ]; + + /** @const */ var a_6 = [ + ["", -1, 3], + ["bb", 0, 2], + ["dd", 0, 2], + ["ff", 0, 2], + ["gg", 0, 2], + ["bl", 0, 1], + ["mm", 0, 2], + ["nn", 0, 2], + ["pp", 0, 2], + ["rr", 0, 2], + ["at", 0, 1], + ["tt", 0, 2], + ["iz", 0, 1] + ]; + + /** @const */ var a_7 = [ + ["anci", -1, 3], + ["enci", -1, 2], + ["ogi", -1, 14], + ["li", -1, 16], + ["bli", 3, 12], + ["abli", 4, 4], + ["alli", 3, 8], + ["fulli", 3, 9], + ["lessli", 3, 15], + ["ousli", 3, 10], + ["entli", 3, 5], + ["aliti", -1, 8], + ["biliti", -1, 12], + ["iviti", -1, 11], + ["tional", -1, 1], + ["ational", 14, 7], + ["alism", -1, 8], + ["ation", -1, 7], + ["ization", 17, 6], + ["izer", -1, 6], + ["ator", -1, 7], + ["iveness", -1, 11], + ["fulness", -1, 9], + ["ousness", -1, 10], + ["ogist", -1, 13] + ]; + + /** @const */ var a_8 = [ + ["icate", -1, 4], + ["ative", -1, 6], + ["alize", -1, 3], + ["iciti", -1, 4], + ["ical", -1, 4], + ["tional", -1, 1], + ["ational", 5, 2], + ["ful", -1, 5], + ["ness", -1, 5] + ]; + + /** @const */ var a_9 = [ + ["ic", -1, 1], + ["ance", -1, 1], + ["ence", -1, 1], + ["able", -1, 1], + ["ible", -1, 1], + ["ate", -1, 1], + ["ive", -1, 1], + ["ize", -1, 1], + ["iti", -1, 1], + ["al", -1, 1], + ["ism", -1, 1], + ["ion", -1, 2], + ["er", -1, 1], + ["ous", -1, 1], + ["ant", -1, 1], + ["ent", -1, 1], + ["ment", 15, 1], + ["ement", 16, 1] + ]; + + /** @const */ var a_10 = [ + ["e", -1, 1], + ["l", -1, 2] + ]; + + /** @const */ var a_11 = [ + ["andes", -1, -1], + ["atlas", -1, -1], + ["bias", -1, -1], + ["cosmos", -1, -1], + ["early", -1, 5], + ["gently", -1, 3], + ["howe", -1, -1], + ["idly", -1, 2], + ["news", -1, -1], + ["only", -1, 6], + ["singly", -1, 7], + ["skies", -1, 1], + ["sky", -1, -1], + ["ugly", -1, 4] + ]; + + /** @const */ var /** Array */ g_aeo = [17, 64]; + + /** @const */ var /** Array */ g_v = [17, 65, 16, 1]; + + /** @const */ var /** Array */ g_v_WXY = [1, 17, 65, 208, 1]; + + /** @const */ var /** Array */ g_valid_LI = [55, 141, 2]; + + var /** boolean */ B_Y_found = false; + var /** number */ I_p2 = 0; + var /** number */ I_p1 = 0; + + + /** @return {boolean} */ + function r_prelude() { + B_Y_found = false; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + base.bra = base.cursor; + if (!(base.eq_s("'"))) + { + break lab0; + } + base.ket = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.cursor = v_1; + /** @const */ var /** number */ v_2 = base.cursor; + lab1: { + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab1; + } + base.ket = base.cursor; + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + } + base.cursor = v_2; + /** @const */ var /** number */ v_3 = base.cursor; + lab2: { + while(true) + { + /** @const */ var /** number */ v_4 = base.cursor; + lab3: { + golab4: while(true) + { + /** @const */ var /** number */ v_5 = base.cursor; + lab5: { + if (!(base.in_grouping(g_v, 97, 121))) + { + break lab5; + } + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab5; + } + base.ket = base.cursor; + base.cursor = v_5; + break golab4; + } + base.cursor = v_5; + if (base.cursor >= base.limit) + { + break lab3; + } + base.cursor++; + } + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + continue; + } + base.cursor = v_4; + break; + } + } + base.cursor = v_3; + return true; + }; + + /** @return {boolean} */ + function r_mark_regions() { + I_p1 = base.limit; + I_p2 = base.limit; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + lab1: { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + if (base.find_among(a_0) == 0) + { + break lab2; + } + break lab1; + } + base.cursor = v_2; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + } + I_p1 = base.cursor; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + I_p2 = base.cursor; + } + base.cursor = v_1; + return true; + }; + + /** @return {boolean} */ + function r_shortv() { + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.out_grouping_b(g_v_WXY, 89, 121))) + { + break lab1; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + lab2: { + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (base.cursor > base.limit_backward) + { + break lab2; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("past"))) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_R1() { + return I_p1 <= base.cursor; + }; + + /** @return {boolean} */ + function r_R2() { + return I_p2 <= base.cursor; + }; + + /** @return {boolean} */ + function r_Step_1a() { + var /** number */ among_var; + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab0: { + base.ket = base.cursor; + if (base.find_among_b(a_1) == 0) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.ket = base.cursor; + among_var = base.find_among_b(a_2); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + if (!base.slice_from("ss")) + { + return false; + } + break; + case 2: + lab1: { + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + { + /** @const */ var /** number */ c1 = base.cursor - 2; + if (c1 < base.limit_backward) + { + break lab2; + } + base.cursor = c1; + } + if (!base.slice_from("i")) + { + return false; + } + break lab1; + } + base.cursor = base.limit - v_2; + if (!base.slice_from("ie")) + { + return false; + } + } + break; + case 3: + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1b() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_5); + base.bra = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + switch (among_var) { + case 1: + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + lab3: { + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + lab4: { + if (base.find_among_b(a_3) == 0) + { + break lab4; + } + if (base.cursor > base.limit_backward) + { + break lab4; + } + break lab3; + } + base.cursor = base.limit - v_3; + if (!r_R1()) + { + break lab2; + } + if (!base.slice_from("ee")) + { + return false; + } + } + } + base.cursor = base.limit - v_2; + break; + case 2: + break lab1; + case 3: + among_var = base.find_among_b(a_4); + if (among_var == 0) + { + break lab1; + } + switch (among_var) { + case 1: + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (base.cursor > base.limit_backward) + { + break lab1; + } + base.cursor = base.limit - v_4; + base.bra = base.cursor; + if (!base.slice_from("ie")) + { + return false; + } + break; + case 2: + if (base.cursor > base.limit_backward) + { + break lab1; + } + break; + } + break; + } + break lab0; + } + base.cursor = base.limit - v_1; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + base.cursor = base.limit - v_5; + if (!base.slice_del()) + { + return false; + } + base.ket = base.cursor; + base.bra = base.cursor; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + among_var = base.find_among_b(a_6); + switch (among_var) { + case 1: + if (!base.slice_from("e")) + { + return false; + } + return false; + case 2: + { + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + lab5: { + if (!(base.in_grouping_b(g_aeo, 97, 111))) + { + break lab5; + } + if (base.cursor > base.limit_backward) + { + break lab5; + } + return false; + } + base.cursor = base.limit - v_7; + } + break; + case 3: + if (base.cursor != I_p1) + { + return false; + } + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + if (!r_shortv()) + { + return false; + } + base.cursor = base.limit - v_8; + if (!base.slice_from("e")) + { + return false; + } + return false; + } + base.cursor = base.limit - v_6; + base.ket = base.cursor; + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1c() { + base.ket = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("y"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("Y"))) + { + return false; + } + } + base.bra = base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + return false; + } + lab2: { + if (base.cursor > base.limit_backward) + { + break lab2; + } + return false; + } + if (!base.slice_from("i")) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_2() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_7); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ence")) + { + return false; + } + break; + case 3: + if (!base.slice_from("ance")) + { + return false; + } + break; + case 4: + if (!base.slice_from("able")) + { + return false; + } + break; + case 5: + if (!base.slice_from("ent")) + { + return false; + } + break; + case 6: + if (!base.slice_from("ize")) + { + return false; + } + break; + case 7: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 8: + if (!base.slice_from("al")) + { + return false; + } + break; + case 9: + if (!base.slice_from("ful")) + { + return false; + } + break; + case 10: + if (!base.slice_from("ous")) + { + return false; + } + break; + case 11: + if (!base.slice_from("ive")) + { + return false; + } + break; + case 12: + if (!base.slice_from("ble")) + { + return false; + } + break; + case 13: + if (!base.slice_from("og")) + { + return false; + } + break; + case 14: + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_from("og")) + { + return false; + } + break; + case 15: + if (!base.slice_from("less")) + { + return false; + } + break; + case 16: + if (!(base.in_grouping_b(g_valid_LI, 99, 116))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_3() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_8); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 3: + if (!base.slice_from("al")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ic")) + { + return false; + } + break; + case 5: + if (!base.slice_del()) + { + return false; + } + break; + case 6: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_4() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_9); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R2()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_del()) + { + return false; + } + break; + case 2: + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("s"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("t"))) + { + return false; + } + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_5() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_10); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + lab0: { + lab1: { + if (!r_R2()) + { + break lab1; + } + break lab0; + } + if (!r_R1()) + { + return false; + } + { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab2: { + if (!r_shortv()) + { + break lab2; + } + return false; + } + base.cursor = base.limit - v_1; + } + } + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!r_R2()) + { + return false; + } + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_exception1() { + var /** number */ among_var; + base.bra = base.cursor; + among_var = base.find_among(a_11); + if (among_var == 0) + { + return false; + } + base.ket = base.cursor; + if (base.cursor < base.limit) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("sky")) + { + return false; + } + break; + case 2: + if (!base.slice_from("idl")) + { + return false; + } + break; + case 3: + if (!base.slice_from("gentl")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ugli")) + { + return false; + } + break; + case 5: + if (!base.slice_from("earli")) + { + return false; + } + break; + case 6: + if (!base.slice_from("onli")) + { + return false; + } + break; + case 7: + if (!base.slice_from("singl")) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_postlude() { + if (!B_Y_found) + { + return false; + } + while(true) + { + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + golab1: while(true) + { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + base.bra = base.cursor; + if (!(base.eq_s("Y"))) + { + break lab2; + } + base.ket = base.cursor; + base.cursor = v_2; + break golab1; + } + base.cursor = v_2; + if (base.cursor >= base.limit) + { + break lab0; + } + base.cursor++; + } + if (!base.slice_from("y")) + { + return false; + } + continue; + } + base.cursor = v_1; + break; + } + return true; + }; + + this.stem = /** @return {boolean} */ function() { + lab0: { + /** @const */ var /** number */ v_1 = base.cursor; + lab1: { + if (!r_exception1()) + { + break lab1; + } + break lab0; + } + base.cursor = v_1; + lab2: { + { + /** @const */ var /** number */ v_2 = base.cursor; + lab3: { + { + /** @const */ var /** number */ c1 = base.cursor + 3; + if (c1 > base.limit) + { + break lab3; + } + base.cursor = c1; + } + break lab2; + } + base.cursor = v_2; + } + break lab0; + } + base.cursor = v_1; + r_prelude(); + r_mark_regions(); + base.limit_backward = base.cursor; base.cursor = base.limit; + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + r_Step_1a(); + base.cursor = base.limit - v_3; + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + r_Step_1b(); + base.cursor = base.limit - v_4; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + r_Step_1c(); + base.cursor = base.limit - v_5; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + r_Step_2(); + base.cursor = base.limit - v_6; + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + r_Step_3(); + base.cursor = base.limit - v_7; + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + r_Step_4(); + base.cursor = base.limit - v_8; + /** @const */ var /** number */ v_9 = base.limit - base.cursor; + r_Step_5(); + base.cursor = base.limit - v_9; + base.cursor = base.limit_backward; + /** @const */ var /** number */ v_10 = base.cursor; + r_postlude(); + base.cursor = v_10; + } + return true; + }; + + /**@return{string}*/ + this['stemWord'] = function(/**string*/word) { + base.setCurrent(word); + this.stem(); + return base.getCurrent(); + }; +}; diff --git a/docs/22.1.2.0/_static/file.png b/docs/22.1.2.0/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/docs/22.1.2.0/_static/file.png differ diff --git a/docs/22.1.2.0/_static/graphviz.css b/docs/22.1.2.0/_static/graphviz.css new file mode 100644 index 0000000..30f3837 --- /dev/null +++ b/docs/22.1.2.0/_static/graphviz.css @@ -0,0 +1,12 @@ +/* + * Sphinx stylesheet -- graphviz extension. + */ + +img.graphviz { + border: 0; + max-width: 100%; +} + +object.graphviz { + max-width: 100%; +} diff --git a/docs/22.1.2.0/_static/ibm_python.css b/docs/22.1.2.0/_static/ibm_python.css new file mode 100644 index 0000000..84a51b7 --- /dev/null +++ b/docs/22.1.2.0/_static/ibm_python.css @@ -0,0 +1,403 @@ + + +/* Epydoc CSS Stylesheet + * + * This stylesheet can be used to customize the appearance of epydoc's + * HTML output. + * + */ + +/* Default Colors & Styles + * - Set the default foreground & background color with 'body'; and + * link colors with 'a:link' and 'a:visited'. + * - Use bold for decision list terms. + * - The heading styles defined here are used for headings *within* + * docstring descriptions. All headings used by epydoc itself use + * either class='epydoc' or class='toc' (CSS styles for both + * defined below). + */ +body { font-size: 13px; background: #ffffff; color: #000000; font-family: sans-serif } /*font-size nothing*/ +p { font-size: 13px; margin-top: 0.5em; margin-bottom: 0.5em; } +/*a:link { color: #0000ff; } +a:visited { color: #204080; }*/ + +a:active {color: #d7bb7a} /*From CPPREF config*/ +a:hover {color: #d7bb7a} +a:link {color: #005da0} +a:visited {color: #704d90} + +dt { font-weight: bold; } /*bold*/ +li dt { font-weight: normal; } /*bold*/ +h1 { font-size: 16px; font-style: normal; + font-weight: bold; } +h2 { font-size: 16px; font-style: normal; + font-weight: bold; } +h3 { font-size: 16px; font-style: normal; + font-weight: normal; } +code { font-size: 13px } /*100%*/ +/* N.B.: class, not pseudoclass */ +a.link { font-family: monospace; } + + +/* Page Header & Footer + * - The standard page header consists of a navigation bar (with + * pointers to standard pages such as 'home' and 'trees'); a + * breadcrumbs list, which can be used to navigate to containing + * classes or modules; options links, to show/hide private + * variables and to show/hide frames; and a page title (using + *

). The page title may be followed by a link to the + * corresponding source code (using 'span.codelink'). + * - The footer consists of a navigation bar, a timestamp, and a + * pointer to epydoc's homepage. + */ +h1.epydoc { margin: 0; font-size: 16px; font-weight: bold; margin-top: 5px;} +h2.epydoc { font-size: 16px; font-weight: bold; margin-top: 0; /* CC */} +h3.epydoc { font-size: 16px; font-weight: bold; /* +115%*/ + margin-top: 0.2em; } +td h3.epydoc { font-size: 13px; font-weight: bold; + margin-bottom: 0; } +table.navbar { background: #e8f0f8; color: #ffffff; /*background: #a0c0ff; color: #000000;*/ + border: 0px groove #c0d0d0; padding: 5px; margin-bottom: 10px} /*2px no cell padding*/ +table.navbar table { color: #000000} +th.navbar-select { font-size: 13px; + background: #e8f0f8; /*#70b0ff;*/ + color: #000000; } +table.navbar a { font-size: 13px; } +/*table.navbar a:link { color: #0000ff; } +table.navbar a:visited { color: #204080; }*/ +table.navbar a:active {color: #d7bb7a} /*From CPPREF config*/ +table.navbar a:hover {color: #d7bb7a} +table.navbar a:link {color: #005da0} +table.navbar a:visited {color: #704d90} + +span.breadcrumbs { font-size: 13px; font-weight: bold; } +span.options { font-size: 13px; } +span.codelink { font-size: 13px; } +span.pre { font-size: 13px } /*for Help page*/ +span.summary-sig { font-size: 13px;} + +/*Special CSS code to include an imahe for the copyright notice */ +td.footer { font-size: 13px; background-image:url(copyright.png); width: 251px; height: 22px; background-repeat:no-repeat;} + +/* Table Headers + * - Each summary table and details section begins with a 'header' + * row. This row contains a section title (marked by + * 'span.table-header') as well as a show/hide private link + * (marked by 'span.options', defined above). + * - Summary tables that contain user-defined groups mark those + * groups using 'group header' rows. + */ +td.table-header { background: #a9cbe7; color: #000000; /*background #70b0ff;*/ + border: 1px solid #608090; } +td.table-header table { color: #000000; } +/*td.table-header table a:link { color: #0000ff; } +td.table-header table a:visited { color: #204080; }*/ +td.table-header table a:active {color: #d7bb7a} /*From CPPREF config*/ +td.table-header table a:hover {color: #d7bb7a} +td.table-header table a:link {color: #005da0} +td.table-header table a:visited {color: #704d90} +span.table-header { font-size: 13px; font-weight: bold; } /*120%*/ +th.group-header { background: #c0e0f8; color: #000000; + text-align: left; font-style: italic; + font-size: 13px; + border: 1px solid #608090; } + +/* Summary Tables (functions, variables, etc) + * - Each object is described by a single row of the table with + * two cells. The left cell gives the object's type, and is + * marked with 'code.summary-type'. The right cell gives the + * object's name and a summary description. + * - CSS styles for the table's header and group headers are + * defined above, under 'Table Headers' + */ +table.summary { font-size: 13px; + border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin-bottom: 0.5em; } +td.summary { border: 1px solid #608090; font-size: 13px; } +td { font-size: 13px; } +code.summary-type { font-size: 13px; } +/*table.summary a:link { color: #0000ff; } +table.summary a:visited { color: #204080; }*/ +table.summary a:active {color: #d7bb7a} /*From CPPREF config*/ +table.summary a:hover {color: #d7bb7a} +table.summary a:link {color: #005da0} +table.summary a:visited {color: #704d90} + + +/* Details Tables (functions, variables, etc) + * - Each object is described in its own div. + * - A single-row summary table w/ table-header is used as + * a header for each details section (CSS style for table-header + * is defined above, under 'Table Headers'). + */ +table.details { font-size: 13px; + border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin: .2em 0 0 0; } +table.details table { color: #000000; } +/*table.details a:link { color: #0000ff; } +table.details a:visited { color: #204080; }*/ +table.details a:active {color: #d7bb7a} /*From CPPREF config*/ +table.details a:hover {color: #d7bb7a} +table.details a:link {color: #005da0} +table.details a:visited {color: #704d90} + +/* Fields */ +dl.fields { margin-left: 2em; margin-top: 1em; + margin-bottom: 1em; } +dl.fields dd ul { margin-left: 0em; padding-left: 0em; } +dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } +div.fields { margin-left: 2em; } +div.fields p { margin-bottom: 0.5em; } + + +/* Index tables (identifier index, term index, etc) + * - link-index is used for indices containing lists of links + * (namely, the identifier index & term index). + * - index-where is used in link indices for the text indicating + * the container/source for each link. + * - metadata-index is used for indices containing metadata + * extracted from fields (namely, the bug index & todo index). + */ +table.link-index { border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + /* CC border: 1px solid #608090; */ + border: 0px solid #608090; + margin-top : 2em; } +td.link-index { border-width: 0px;} +/* CC */ +table.link-index tr { border: 0px } + +/*table.link-index a:link { color: #0000ff; } +table.link-index a:visited { color: #204080; }*/ +table.link-index a:active {color: #d7bb7a} /*From CPPREF config*/ +table.link-index a:hover {color: #d7bb7a} +table.link-index a:link {color: #005da0} +table.link-index a:visited {color: #704d90} + + +span.index-where { font-size: 13px; } +table.metadata-index { border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin: .2em 0 0 0; } +td.metadata-index { border-width: 1px; border-style: solid; } +/*table.metadata-index a:link { color: #0000ff; } +table.metadata-index a:visited { color: #204080; }*/ +table.metadata-index a:active {color: #d7bb7a} /*From CPPREF config*/ +table.metadata-index a:hover {color: #d7bb7a} +table.metadata-index a:link {color: #005da0} +table.metadata-index a:visited {color: #704d90} + + +/* Function signatures + * - sig* is used for the signature in the details section. + * - .summary-sig* is used for the signature in the summary + * table, and when listing property accessor functions. + * */ +.sig-name { color: #000000; font-size: 13px;} /*#006080;*/ +.sig-arg { color: #000000; font-size: 13px;} /*#008060;*/ +.sig-default { color: #000000; font-size: 13px;} /*#602000;*/ +.summary-sig { font-family: monospace; font-size: 13px;} /*no font-size*/ +.summary-sig-name { color: #000000; font-weight: bold; font-size: 13px; } /*#006080;*/ +/*table.summary a.summary-sig-name:link + { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #006080; font-weight: bold; }*/ + +table.summary a.summary-sig-name:active + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-sig-name:hover + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-sig-name:link + { color: #005da0; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #704d90; font-weight: bold; } + +.summary-sig-arg { color: #006040; } +.summary-sig-default { color: #501800; } + +/* Subclass list + */ +ul.subclass-list { display: inline; } +ul.subclass-list li { display: inline; } + +/* To render variables, classes etc. like functions */ +table.summary .summary-name { font-size: 13px;color: #006080; font-weight: bold; /*not font-size*/ + font-family: monospace; } +/*table.summary + a.summary-name:link { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:visited { color: #006080; font-weight: bold; + font-family: monospace; }*/ + +table.summary a.summary-name:active + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-name:hover + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-name:link + { color: #005da0; font-weight: bold; } +table.summary a.summary-name:visited + { color: #704d90; font-weight: bold; } + + +/* Variable values + * - In the 'variable details' sections, each varaible's value is + * listed in a 'pre.variable' box. The width of this box is + * restricted to 80 chars; if the value's repr is longer than + * this it will be wrapped, using a backslash marked with + * class 'variable-linewrap'. If the value's repr is longer + * than 3 lines, the rest will be ellided; and an ellipsis + * marker ('...' marked with 'variable-ellipsis') will be used. + * - If the value is a string, its quote marks will be marked + * with 'variable-quote'. + * - If the variable is a regexp, it is syntax-highlighted using + * the re* CSS classes. + */ +pre.variable { padding: .5em; margin: 0; + background: #dce4ec; color: #000000; + border: 1px solid #708890; font-size: 13px;} /*no font-size*/ +.variable-linewrap { color: #604000; font-weight: bold; } +.variable-ellipsis { color: #604000; font-weight: bold; } +.variable-quote { color: #604000; font-weight: bold; } +.variable-group { color: #008000; font-weight: bold; } +.variable-op { color: #604000; font-weight: bold; } +.variable-string { color: #006030; } +.variable-unknown { color: #a00000; font-weight: bold; } +.re { color: #000000; } +.re-char { color: #006030; } +.re-op { color: #600000; } +.re-group { color: #003060; } +.re-ref { color: #404040; } + +/* Base tree + * - Used by class pages to display the base class hierarchy. + */ +pre.base-tree { font-size: 13px; margin: 0; } + +/* Frames-based table of contents headers + * - Consists of two frames: one for selecting modules; and + * the other listing the contents of the selected module. + * - h1.toc is used for each frame's heading + * - h2.toc is used for subheadings within each frame. + */ +h1.toc { text-align: center; font-size: 16px; + margin: 0; font-weight: bold; + padding: 0; } +h2.toc { font-size: 16px; font-weight: bold; + margin: 0.5em 0 0 -0.3em; } + +/* Syntax Highlighting for Source Code + * - doctest examples are displayed in a 'pre.py-doctest' block. + * If the example is in a details table entry, then it will use + * the colors specified by the 'table pre.py-doctest' line. + * - Source code listings are displayed in a 'pre.py-src' block. + * Each line is marked with 'span.py-line' (used to draw a line + * down the left margin, separating the code from the line + * numbers). Line numbers are displayed with 'span.py-lineno'. + * The expand/collapse block toggle button is displayed with + * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not + * modify the font size of the text.) + * - If a source code page is opened with an anchor, then the + * corresponding code block will be highlighted. The code + * block's header is highlighted with 'py-highlight-hdr'; and + * the code block's body is highlighted with 'py-highlight'. + * - The remaining py-* classes are used to perform syntax + * highlighting (py-string for string literals, py-name for names, + * etc.) + */ +pre.py-doctest { padding: .5em; margin: 1em; + background: #e8f0f8; color: #000000; + border: 1px solid #708890; font-size: 13px;} /*no font size*/ +table pre.py-doctest { background: #dce4ec; + color: #000000; } +pre.py-src { border: 2px solid #000000; + background: #f0f0f0; color: #000000; } +.py-line { border-left: 2px solid #000000; + margin-left: .2em; padding-left: .4em; } +.py-lineno { font-style: italic; font-size: 13px; + padding-left: .5em; } +a.py-toggle { text-decoration: none; } +div.py-highlight-hdr { border-top: 2px solid #000000; + border-bottom: 2px solid #000000; + background: #d8e8e8; } +div.py-highlight { border-bottom: 2px solid #000000; + background: #d0e0e0; } +.py-prompt { color: #005050; font-weight: bold;} +.py-more { color: #005050; font-weight: bold;} +.py-string { color: #006030; } +.py-comment { color: #003060; } +.py-keyword { color: #600000; } +.py-output { color: #404040; } +.py-name { color: #000050; } +.py-name:link { color: #000050 !important; } +.py-name:visited { color: #000050 !important; } +.py-number { color: #005000; } +.py-defname { color: #000060; font-weight: bold; } +.py-def-name { color: #000060; font-weight: bold; } +.py-base-class { color: #000060; } +.py-param { color: #000060; } +.py-docstring { color: #006030; } +.py-decorator { color: #804020; } +/* Use this if you don't want links to names underlined: */ +/*a.py-name { text-decoration: none; }*/ + +/* Graphs & Diagrams + * - These CSS styles are used for graphs & diagrams generated using + * Graphviz dot. 'img.graph-without-title' is used for bare + * diagrams (to remove the border created by making the image + * clickable). + */ +img.graph-without-title { border: none; } +img.graph-with-title { border: 1px solid #000000; } +span.graph-title { font-weight: bold; } +span.graph-caption { } + +/* General-purpose classes + * - 'p.indent-wrapped-lines' defines a paragraph whose first line + * is not indented, but whose subsequent lines are. + * - The 'nomargin-top' class is used to remove the top margin (e.g. + * from lists). The 'nomargin' class is used to remove both the + * top and bottom margin (but not the left or right margin -- + * for lists, that would cause the bullets to disappear.) + */ +p.indent-wrapped-lines { font-size: 13px;padding: 0 0 0 7em; text-indent: -7em; /*Nothing for font size*/ + margin: 0; } +.nomargin-top { margin-top: 0; } +.nomargin { margin-top: 0; margin-bottom: 0; } + +/* HTML Log */ +div.log-block { padding: 0; margin: .5em 0 .5em 0; + background: #e8f0f8; color: #000000; + border: 1px solid #000000; } +div.log-error { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffb0b0; color: #000000; + border: 1px solid #000000; } +div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffffb0; color: #000000; + border: 1px solid #000000; } +div.log-info { padding: .1em .3em .1em .3em; margin: 4px; + background: #b0ffb0; color: #000000; + border: 1px solid #000000; } +h2.log-hdr { background: #70b0ff; color: #000000; + margin: 0; padding: 0em 0.5em 0em 0.5em; + border-bottom: 1px solid #000000; font-size: 13px; } +p.log { font-weight: bold; margin: .5em 0 .5em 0; } +tr.opt-changed { color: #000000; font-weight: bold; } +tr.opt-default { color: #606060; } +pre.log { margin: 0; padding: 0; padding-left: 1em; } + +/* Accessibility for people with Physical disabilities */ +img.ibm-access { + border: 0px; +} + +div.ibm-access { + font-size:10px; + margin-top:-8px; + +} \ No newline at end of file diff --git a/docs/22.1.2.0/_static/language_data.js b/docs/22.1.2.0/_static/language_data.js new file mode 100644 index 0000000..5776786 --- /dev/null +++ b/docs/22.1.2.0/_static/language_data.js @@ -0,0 +1,13 @@ +/* + * This script contains the language-specific data used by searchtools.js, + * namely the set of stopwords, stemmer, scorer and splitter. + */ + +const stopwords = new Set(["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"]); +window.stopwords = stopwords; // Export to global scope + + +/* Non-minified versions are copied as separate JavaScript files, if available */ +BaseStemmer=function(){this.current="",this.cursor=0,this.limit=0,this.limit_backward=0,this.bra=0,this.ket=0,this.setCurrent=function(t){this.current=t,this.cursor=0,this.limit=this.current.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},this.getCurrent=function(){return this.current},this.copy_from=function(t){this.current=t.current,this.cursor=t.cursor,this.limit=t.limit,this.limit_backward=t.limit_backward,this.bra=t.bra,this.ket=t.ket},this.in_grouping=function(t,r,i){return!(this.cursor>=this.limit||i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i))||(this.cursor++,0))},this.go_in_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.in_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward||i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i))||(this.cursor--,0))},this.go_in_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(i>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.out_grouping=function(t,r,i){return!(this.cursor>=this.limit)&&(i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i)))&&(this.cursor++,!0)},this.go_out_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.out_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward)&&(i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i)))&&(this.cursor--,!0)},this.go_out_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(s<=i&&r<=s&&0!=(t[(s-=r)>>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.eq_s=function(t){return!(this.limit-this.cursor>>1),o=0,a=e=(l=t[r])[0].length){if(this.cursor=s+l[0].length,l.length<4)return l[2];var g=l[3](this);if(this.cursor=s+l[0].length,g)return l[2]}}while(0<=(r=l[1]));return 0},this.find_among_b=function(t){for(var r=0,i=t.length,s=this.cursor,h=this.limit_backward,e=0,n=0,c=!1;;){for(var u,o=r+(i-r>>1),a=0,l=e=(u=t[r])[0].length){if(this.cursor=s-u[0].length,u.length<4)return u[2];var g=u[3](this);if(this.cursor=s-u[0].length,g)return u[2]}}while(0<=(r=u[1]));return 0},this.replace_s=function(t,r,i){var s=i.length-(r-t);return this.current=this.current.slice(0,t)+i+this.current.slice(r),this.limit+=s,this.cursor>=r?this.cursor+=s:this.cursor>t&&(this.cursor=t),s},this.slice_check=function(){return!(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>this.current.length)},this.slice_from=function(t){var r=!1;return this.slice_check()&&(this.replace_s(this.bra,this.ket,t),r=!0),r},this.slice_del=function(){return this.slice_from("")},this.insert=function(t,r,i){r=this.replace_s(t,r,i);t<=this.bra&&(this.bra+=r),t<=this.ket&&(this.ket+=r)},this.slice_to=function(){var t="";return t=this.slice_check()?this.current.slice(this.bra,this.ket):t},this.assign_to=function(){return this.current.slice(0,this.limit)}}; +var EnglishStemmer=function(){var a=new BaseStemmer,c=[["arsen",-1,-1],["commun",-1,-1],["emerg",-1,-1],["gener",-1,-1],["later",-1,-1],["organ",-1,-1],["past",-1,-1],["univers",-1,-1]],o=[["'",-1,1],["'s'",0,1],["'s",-1,1]],u=[["ied",-1,2],["s",-1,3],["ies",1,2],["sses",1,1],["ss",1,-1],["us",1,-1]],t=[["succ",-1,1],["proc",-1,1],["exc",-1,1]],l=[["even",-1,2],["cann",-1,2],["inn",-1,2],["earr",-1,2],["herr",-1,2],["out",-1,2],["y",-1,1]],n=[["",-1,-1],["ed",0,2],["eed",1,1],["ing",0,3],["edly",0,2],["eedly",4,1],["ingly",0,2]],f=[["",-1,3],["bb",0,2],["dd",0,2],["ff",0,2],["gg",0,2],["bl",0,1],["mm",0,2],["nn",0,2],["pp",0,2],["rr",0,2],["at",0,1],["tt",0,2],["iz",0,1]],_=[["anci",-1,3],["enci",-1,2],["ogi",-1,14],["li",-1,16],["bli",3,12],["abli",4,4],["alli",3,8],["fulli",3,9],["lessli",3,15],["ousli",3,10],["entli",3,5],["aliti",-1,8],["biliti",-1,12],["iviti",-1,11],["tional",-1,1],["ational",14,7],["alism",-1,8],["ation",-1,7],["ization",17,6],["izer",-1,6],["ator",-1,7],["iveness",-1,11],["fulness",-1,9],["ousness",-1,10],["ogist",-1,13]],m=[["icate",-1,4],["ative",-1,6],["alize",-1,3],["iciti",-1,4],["ical",-1,4],["tional",-1,1],["ational",5,2],["ful",-1,5],["ness",-1,5]],b=[["ic",-1,1],["ance",-1,1],["ence",-1,1],["able",-1,1],["ible",-1,1],["ate",-1,1],["ive",-1,1],["ize",-1,1],["iti",-1,1],["al",-1,1],["ism",-1,1],["ion",-1,2],["er",-1,1],["ous",-1,1],["ant",-1,1],["ent",-1,1],["ment",15,1],["ement",16,1]],k=[["e",-1,1],["l",-1,2]],g=[["andes",-1,-1],["atlas",-1,-1],["bias",-1,-1],["cosmos",-1,-1],["early",-1,5],["gently",-1,3],["howe",-1,-1],["idly",-1,2],["news",-1,-1],["only",-1,6],["singly",-1,7],["skies",-1,1],["sky",-1,-1],["ugly",-1,4]],d=[17,64],v=[17,65,16,1],i=[1,17,65,208,1],w=[55,141,2],p=!1,y=0,h=0;function q(){var r=a.limit-a.cursor;return!!(a.out_grouping_b(i,89,121)&&a.in_grouping_b(v,97,121)&&a.out_grouping_b(v,97,121)||(a.cursor=a.limit-r,a.out_grouping_b(v,97,121)&&a.in_grouping_b(v,97,121)&&!(a.cursor>a.limit_backward))||(a.cursor=a.limit-r,a.eq_s_b("past")))}function z(){return h<=a.cursor}function Y(){return y<=a.cursor}this.stem=function(){var r=a.cursor;if(!(()=>{var r;if(a.bra=a.cursor,0!=(r=a.find_among(g))&&(a.ket=a.cursor,!(a.cursora.limit)a.cursor=i;else{a.cursor=e,a.cursor=r,(()=>{p=!1;var r=a.cursor;if(a.bra=a.cursor,!a.eq_s("'")||(a.ket=a.cursor,a.slice_del())){a.cursor=r;r=a.cursor;if(a.bra=a.cursor,a.eq_s("y")){if(a.ket=a.cursor,!a.slice_from("Y"))return;p=!0}a.cursor=r;for(r=a.cursor;;){var i=a.cursor;r:{for(;;){var e=a.cursor;if(a.in_grouping(v,97,121)&&(a.bra=a.cursor,a.eq_s("y"))){a.ket=a.cursor,a.cursor=e;break}if(a.cursor=e,a.cursor>=a.limit)break r;a.cursor++}if(!a.slice_from("Y"))return;p=!0;continue}a.cursor=i;break}a.cursor=r}})(),h=a.limit,y=a.limit;i=a.cursor;r:{var s=a.cursor;if(0==a.find_among(c)){if(a.cursor=s,!a.go_out_grouping(v,97,121))break r;if(a.cursor++,!a.go_in_grouping(v,97,121))break r;a.cursor++}h=a.cursor,a.go_out_grouping(v,97,121)&&(a.cursor++,a.go_in_grouping(v,97,121))&&(a.cursor++,y=a.cursor)}a.cursor=i,a.limit_backward=a.cursor,a.cursor=a.limit;var e=a.limit-a.cursor,r=((()=>{var r=a.limit-a.cursor;if(a.ket=a.cursor,0==a.find_among_b(o))a.cursor=a.limit-r;else if(a.bra=a.cursor,!a.slice_del())return;if(a.ket=a.cursor,0!=(r=a.find_among_b(u)))switch(a.bra=a.cursor,r){case 1:if(a.slice_from("ss"))break;return;case 2:r:{var i=a.limit-a.cursor,e=a.cursor-2;if(!(e{a.ket=a.cursor,o=a.find_among_b(n),a.bra=a.cursor;r:{var r=a.limit-a.cursor;i:{switch(o){case 1:var i=a.limit-a.cursor;e:{var e=a.limit-a.cursor;if(0==a.find_among_b(t)||a.cursor>a.limit_backward){if(a.cursor=a.limit-e,!z())break e;if(!a.slice_from("ee"))return}}a.cursor=a.limit-i;break;case 2:break i;case 3:if(0==(o=a.find_among_b(l)))break i;switch(o){case 1:var s=a.limit-a.cursor;if(!a.out_grouping_b(v,97,121))break i;if(a.cursor>a.limit_backward)break i;if(a.cursor=a.limit-s,a.bra=a.cursor,a.slice_from("ie"))break;return;case 2:if(a.cursor>a.limit_backward)break i}}break r}a.cursor=a.limit-r;var c=a.limit-a.cursor;if(!a.go_out_grouping_b(v,97,121))return;if(a.cursor--,a.cursor=a.limit-c,!a.slice_del())return;a.ket=a.cursor,a.bra=a.cursor;var o,c=a.limit-a.cursor;switch(o=a.find_among_b(f)){case 1:return a.slice_from("e");case 2:var u=a.limit-a.cursor;if(a.in_grouping_b(d,97,111)&&!(a.cursor>a.limit_backward))return;a.cursor=a.limit-u;break;case 3:return a.cursor!=h||(u=a.limit-a.cursor,q()&&(a.cursor=a.limit-u,a.slice_from("e")))}if(a.cursor=a.limit-c,a.ket=a.cursor,a.cursor<=a.limit_backward)return;if(a.cursor--,a.bra=a.cursor,!a.slice_del())return}})(),a.cursor=a.limit-r,a.limit-a.cursor),r=(a.ket=a.cursor,e=a.limit-a.cursor,(a.eq_s_b("y")||(a.cursor=a.limit-e,a.eq_s_b("Y")))&&(a.bra=a.cursor,a.out_grouping_b(v,97,121))&&a.cursor>a.limit_backward&&a.slice_from("i"),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(_))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ence"))break;return;case 3:if(a.slice_from("ance"))break;return;case 4:if(a.slice_from("able"))break;return;case 5:if(a.slice_from("ent"))break;return;case 6:if(a.slice_from("ize"))break;return;case 7:if(a.slice_from("ate"))break;return;case 8:if(a.slice_from("al"))break;return;case 9:if(a.slice_from("ful"))break;return;case 10:if(a.slice_from("ous"))break;return;case 11:if(a.slice_from("ive"))break;return;case 12:if(a.slice_from("ble"))break;return;case 13:if(a.slice_from("og"))break;return;case 14:if(!a.eq_s_b("l"))return;if(a.slice_from("og"))break;return;case 15:if(a.slice_from("less"))break;return;case 16:if(!a.in_grouping_b(w,99,116))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.limit-a.cursor),i=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(m))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ate"))break;return;case 3:if(a.slice_from("al"))break;return;case 4:if(a.slice_from("ic"))break;return;case 5:if(a.slice_del())break;return;case 6:if(!Y())return;if(a.slice_del())break}})(),a.cursor=a.limit-e,a.limit-a.cursor),r=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(b))&&(a.bra=a.cursor,Y()))switch(r){case 1:if(a.slice_del())break;return;case 2:var i=a.limit-a.cursor;if(!a.eq_s_b("s")&&(a.cursor=a.limit-i,!a.eq_s_b("t")))return;if(a.slice_del())break}})(),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(k)))switch(a.bra=a.cursor,r){case 1:if(!Y()){if(!z())return;var i=a.limit-a.cursor;if(q())return;a.cursor=a.limit-i}if(a.slice_del())break;return;case 2:if(!Y())return;if(!a.eq_s_b("l"))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.cursor=a.limit_backward,a.cursor);(()=>{if(p)for(;;){var r=a.cursor;r:{for(;;){var i=a.cursor;if(a.bra=a.cursor,a.eq_s("Y")){a.ket=a.cursor,a.cursor=i;break}if(a.cursor=i,a.cursor>=a.limit)break r;a.cursor++}if(a.slice_from("y"))continue;return}a.cursor=r;break}})(),a.cursor=e}}return!0},this.stemWord=function(r){return a.setCurrent(r),this.stem(),a.getCurrent()}}; +window.Stemmer = EnglishStemmer; diff --git a/docs/22.1.2.0/_static/minus.png b/docs/22.1.2.0/_static/minus.png new file mode 100644 index 0000000..d96755f Binary files /dev/null and b/docs/22.1.2.0/_static/minus.png differ diff --git a/docs/22.1.2.0/_static/plus.png b/docs/22.1.2.0/_static/plus.png new file mode 100644 index 0000000..7107cec Binary files /dev/null and b/docs/22.1.2.0/_static/plus.png differ diff --git a/docs/22.1.2.0/_static/pygments.css b/docs/22.1.2.0/_static/pygments.css new file mode 100644 index 0000000..5f2b0a2 --- /dev/null +++ b/docs/22.1.2.0/_static/pygments.css @@ -0,0 +1,75 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #F00 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #F00 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333 } /* Generic.Output */ +.highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #04D } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070A0 } /* Literal.String */ +.highlight .na { color: #4070A0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60ADD5 } /* Name.Constant */ +.highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287E } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #BB60D5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #BBB } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070A0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070A0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070A0 } /* Literal.String.Char */ +.highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070A0 } /* Literal.String.Double */ +.highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #C65D09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070A0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287E } /* Name.Function.Magic */ +.highlight .vc { color: #BB60D5 } /* Name.Variable.Class */ +.highlight .vg { color: #BB60D5 } /* Name.Variable.Global */ +.highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */ +.highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/22.1.2.0/_static/searchtools.js b/docs/22.1.2.0/_static/searchtools.js new file mode 100644 index 0000000..e29b1c7 --- /dev/null +++ b/docs/22.1.2.0/_static/searchtools.js @@ -0,0 +1,693 @@ +/* + * Sphinx JavaScript utilities for the full-text search. + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename, kind] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +// Global search result kind enum, used by themes to style search results. +// prettier-ignore +class SearchResultKind { + static get index() { return "index"; } + static get object() { return "object"; } + static get text() { return "text"; } + static get title() { return "title"; } +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _escapeHTML = (text) => { + return text + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +}; + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename, kind] = item; + + let listItem = document.createElement("li"); + // Add a class representing the item's type: + // can be used by a theme's CSS selector for styling + // See SearchResultKind for the class names. + listItem.classList.add(`kind-${kind}`); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = _escapeHTML(title); + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + ` (${_escapeHTML(descr)})`; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); + } else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor), + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.", + ); + else + Search.status.innerText = Documentation.ngettext( + "Search finished, found one page matching the search query.", + "Search finished, found ${resultCount} pages matching the search query.", + resultCount, + ).replace("${resultCount}", resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5, + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename, kind]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => + query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter((term) => term); // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString( + htmlString, + "text/html", + ); + for (const removalQuery of [".headerlink", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { + el.remove(); + }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector( + `[role="main"] ${anchor}`, + ); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`, + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template.", + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.setAttribute("role", "list"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords set is from language_data.js + if (stopwords.has(queryTermLower) || queryTerm.match(/^\d+$/)) return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + localStorage.setItem( + "sphinx_highlight_terms", + [...highlightTerms].join(" "), + ); + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: ( + query, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename, kind]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if ( + title.toLowerCase().trim().includes(queryLower) + && queryLower.length >= title.length / 2 + ) { + for (const [file, id] of foundTitles) { + const score = Math.round( + (Scorer.title * queryLower.length) / title.length, + ); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score + boost, + filenames[file], + SearchResultKind.title, + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && queryLower.length >= entry.length / 2) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round((100 * queryLower.length) / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + SearchResultKind.index, + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)), + ); + + // lookup as search terms in fulltext + normalResults.push( + ...Search.performTermsSearch(searchTerms, excludedTerms), + ); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result + .slice(0, 4) + .concat([result[5]]) + .map((v) => String(v)) + .join(","); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [ + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ] = Search._parseQuery(query); + const results = Search._performSearch( + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4]; + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + SearchResultKind.object, + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => objectSearchCallback(prefix, array)), + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + // find documents, if any, containing the query word in their text/title term indices + // use Object.hasOwnProperty to avoid mismatching against prototype properties + const arr = [ + { + files: terms.hasOwnProperty(word) ? terms[word] : undefined, + score: Scorer.term, + }, + { + files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, + score: Scorer.title, + }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, new Map()); + const fileScores = scoreMap.get(file); + fileScores.set(word, record.score); + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2, + ).length; + if ( + wordList.length !== searchTerms.size + && wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file + || titleTerms[term] === file + || (terms[term] || []).includes(file) + || (titleTerms[term] || []).includes(file), + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file).get(w))); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + SearchResultKind.text, + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = + top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/docs/22.1.2.0/_static/sidebar.js b/docs/22.1.2.0/_static/sidebar.js new file mode 100644 index 0000000..ac7b39e --- /dev/null +++ b/docs/22.1.2.0/_static/sidebar.js @@ -0,0 +1,64 @@ +/* + * This script makes the Sphinx sidebar collapsible. + * + * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds + * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton + * used to collapse and expand the sidebar. + * + * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden + * and the width of the sidebar and the margin-left of the document + * are decreased. When the sidebar is expanded the opposite happens. + * This script saves a per-browser/per-session cookie used to + * remember the position of the sidebar among the pages. + * Once the browser is closed the cookie is deleted and the position + * reset to the default (expanded). + * + */ + +const initialiseSidebar = () => { + + + + + // global elements used by the functions. + const bodyWrapper = document.getElementsByClassName("bodywrapper")[0] + const sidebar = document.getElementsByClassName("sphinxsidebar")[0] + const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0] + const sidebarButton = document.getElementById("sidebarbutton") + const sidebarArrow = sidebarButton.querySelector('span') + + // for some reason, the document has no sidebar; do not run into errors + if (typeof sidebar === "undefined") return; + + const flipArrow = element => element.innerText = (element.innerText === "»") ? "«" : "»" + + const collapse_sidebar = () => { + bodyWrapper.style.marginLeft = ".8em"; + sidebar.style.width = ".8em" + sidebarWrapper.style.display = "none" + flipArrow(sidebarArrow) + sidebarButton.title = _('Expand sidebar') + window.localStorage.setItem("sidebar", "collapsed") + } + + const expand_sidebar = () => { + bodyWrapper.style.marginLeft = "" + sidebar.style.removeProperty("width") + sidebarWrapper.style.display = "" + flipArrow(sidebarArrow) + sidebarButton.title = _('Collapse sidebar') + window.localStorage.setItem("sidebar", "expanded") + } + + sidebarButton.addEventListener("click", () => { + (sidebarWrapper.style.display === "none") ? expand_sidebar() : collapse_sidebar() + }) + + if (!window.localStorage.getItem("sidebar")) return + const value = window.localStorage.getItem("sidebar") + if (value === "collapsed") collapse_sidebar(); + else if (value === "expanded") expand_sidebar(); +} + +if (document.readyState !== "loading") initialiseSidebar() +else document.addEventListener("DOMContentLoaded", initialiseSidebar) \ No newline at end of file diff --git a/docs/22.1.2.0/_static/sphinx_highlight.js b/docs/22.1.2.0/_static/sphinx_highlight.js new file mode 100644 index 0000000..a74e103 --- /dev/null +++ b/docs/22.1.2.0/_static/sphinx_highlight.js @@ -0,0 +1,159 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true; + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 + && !parent.classList.contains(className) + && !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore(span, parent.insertBefore(rest, node.nextSibling)); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect", + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target), + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms"); + // Update history only if '?highlight' is present; otherwise it + // clears text fragments (not set in window.location by the browser) + if (url.searchParams.has("highlight")) { + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + } + + // get individual terms from highlight string + const terms = highlight + .toLowerCase() + .split(/\s+/) + .filter((x) => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '", + ), + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms"); + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) + return; + if ( + DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + && event.key === "Escape" + ) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/22.1.2.0/cplex._internal.html b/docs/22.1.2.0/cplex._internal.html new file mode 100644 index 0000000..0d3bbc2 --- /dev/null +++ b/docs/22.1.2.0/cplex._internal.html @@ -0,0 +1,15866 @@ + + + + + + + + cplex._internal package — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex._internal package

+
+
undocumented:
+

Environment, _aux_functions, _list_array_utils, _ostream

+
+
+
+
+class Environment[source]
+

Bases: object

+
Inheritance diagram of cplex._internal.Environment
+ + +

non-public

+
+
+RESULTS_CHNL_IDX = 0
+
+ +
+
+WARNING_CHNL_IDX = 1
+
+ +
+
+ERROR_CHNL_IDX = 2
+
+ +
+
+LOG_CHNL_IDX = 3
+
+ +
+
+__init__()[source]
+

non-public

+
+ +
+
+__del__()[source]
+

non-public

+
+ +
+
+register_callback(callback_class)[source]
+

Registers a callback for use when solving.

+

callback_class must be a proper subclass of one of the +callback classes defined in the module callbacks. It must +override the __call__ method with a method that has signature +__call__(self) -> None. If callback_class is a subclass of +more than one callback class, it will only be called when its +first superclass is called. register_callback returns the +instance of callback_class registered for use. Any previously +registered callback of the same class will no longer be +registered.

+
+ +
+
+unregister_callback(callback_class)[source]
+

Unregisters a callback.

+

callback_class must be one of the callback classes defined in +the module callback or a subclass of one of them. This method +unregisters any previously registered callback of the same +class. If callback_class is a subclass of more than one +callback class, this method unregisters only the callback of the +same type as its first superclass. unregister_callback +returns the instance of callback_class just unregistered.

+
+ +
+
+set_results_stream(results_file, fn=None)[source]
+

Specifies where results will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which results will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_warning_stream(warning_file, fn=None)[source]
+

Specifies where warnings will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which warnings will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_error_stream(error_file, fn=None)[source]
+

Specifies where errors will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which errors will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_log_stream(log_file, fn=None)[source]
+

Specifies where the log will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which the log will be written. To write +to this stream, use this object’s write() method.

+
+ +
+
+get_version()[source]
+

Returns a string specifying the version of CPLEX.

+
+ +
+
+get_versionnumber()[source]
+

Returns an integer specifying the version of CPLEX.

+

The version of CPLEX is in the format vvrrmmff, where vv is +the version, rr is the release, mm is the modification, and ff +is the fixpack number. For example, for CPLEX version 12.5.0.1 +the returned value is 12050001.

+
+ +
+
+get_num_cores()[source]
+

Returns the number of cores on this machine.

+
+ +
+
+get_time()[source]
+

Returns a timestamp in CPU or wallclock seconds from CPLEX.

+
+ +
+
+get_dettime()[source]
+

Returns the current deterministic time in ticks.

+
+ +
+ +
+
+class ProblemType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal.ProblemType
+ + + +

Types of problems the Cplex object can encapsulate.

+

For explanations of the problem types, see those topics in the +CPLEX User’s Manual in the topic titled Continuous Optimization +for LP, QP, and QCP or the topic titled Discrete Optimization +for MILP, FIXEDMILP, NODELP, NODEQP, MIQCP, NODEQCP.

+
+
+LP = 0
+

See CPXPROB_LP in the C API.

+
+ +
+
+MILP = 1
+

See CPXPROB_MILP in the C API.

+
+ +
+
+fixed_MILP = 3
+

See CPXPROB_FIXEDMILP in the C API.

+
+ +
+
+node_LP = 4
+

See CPXPROB_NODELP in the C API.

+
+ +
+
+QP = 5
+

See CPXPROB_QP in the C API.

+
+ +
+
+MIQP = 7
+

See CPXPROB_MIQP in the C API.

+
+ +
+
+fixed_MIQP = 8
+

See CPXPROB_MIQP in the C API.

+
+ +
+
+node_QP = 9
+

See CPXPROB_NODEQP in the C API.

+
+ +
+
+QCP = 10
+

See CPXPROB_QCP in the C API.

+
+ +
+
+MIQCP = 11
+

See CPXPROB_MIQCP in the C API.

+
+ +
+
+node_QCP = 12
+

See CPXPROB_QCP in the C API.

+
+ +
+ +
+

Submodules

+
+

cplex._internal._subinterfaces module

+

Sub-interfaces of the CPLEX API.

+
+
+class Histogram[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._subinterfaces.Histogram
+ + +

A class to retrieve histogram data of the columns or rows of the +linear constraint matrix.

+

See VariablesInterface.get_histogram() and +LinearConstraintInterface.get_histogram().

+
+
+__init__(c, key)[source]
+
+ +
+
+__getitem__(key)[source]
+

Returns the number of columns/rows with a given nonzero count.

+
+ +
+
+__str__()[source]
+

Returns a string containing a histogram in human readable form.

+
+ +
+ +
+
+class AdvancedVariablesInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedVariablesInterface
+ + + +

Methods for advanced operations on variables.

+
+
+__init__(parent)[source]
+

Creates a new AdvancedVariablesInterface.

+

The advanced variables interface is exposed by the top-level +Cplex class as Cplex.variables.advanced. This constructor is +not meant to be used externally.

+
+ +
+
+protect(*args)[source]
+

Prevents variables from being aggregated during presolve.

+

protect may be called with either a single variable identifier +or a sequence of variable identifiers. A variable identifier +is either an index or a name of a variable.

+
+
Note

Subsequent calls to protect will replace previously protected +variables with the new set of protected variables.

+
+
Note

If presolve can fix a variable to a value, it will be removed +from the problem even if it has been protected.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["a", "b", "c", "d"])
+>>> c.variables.advanced.protect("a")
+>>> c.variables.advanced.protect(["b", "d"])
+
+
+
+ +
+
+get_protected()[source]
+

Returns the currently protected variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["a", "b", "c", "d"])
+>>> c.variables.advanced.protect("a")
+>>> c.variables.advanced.get_protected()
+[0]
+>>> c.variables.advanced.protect(["b", "d"])
+>>> c.variables.advanced.get_protected()
+[1, 3]
+
+
+
+ +
+
+tighten_lower_bounds(*args)[source]
+

Tightens the lower bounds on the specified variables.

+

There are two forms by which +variables.advanced.tighten_lower_bounds may be called.

+
+
variables.advanced.tighten_lower_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the lower bound of the variable whose index +or name is i to lb.

+
+
variables.advanced.tighten_lower_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the lower bound of the specified variables to +the corresponding values. Equivalent to +[variables.advanced.tighten_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.advanced.tighten_lower_bounds(0, 1.0)
+>>> c.variables.get_lower_bounds()
+[1.0, 0.0, 0.0]
+>>> c.variables.advanced.tighten_lower_bounds([(2, 3.0), ("x1", -1.0)])
+>>> c.variables.get_lower_bounds()
+[1.0, -1.0, 3.0]
+
+
+
+ +
+
+tighten_upper_bounds(*args)[source]
+

Tightens the upper bounds on the specified variables.

+

There are two forms by which +variables.advanced.tighten_upper_bounds may be called.

+
+
variables.advanced.tighten_upper_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the upper bound of the variable whose index +or name is i to lb.

+
+
variables.advanced.tighten_upper_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the upper bound of the specified variables to +the corresponding values. Equivalent to +[variables.advanced.tighten_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.advanced.tighten_upper_bounds(0, 1.0)
+>>> c.variables.advanced.tighten_upper_bounds([(2, 3.0), ("x1", 10.0)])
+>>> c.variables.get_upper_bounds()
+[1.0, 10.0, 3.0]
+
+
+
+ +
+ +
+
+class VarTypes[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.VarTypes
+ + + +

Constants defining variable types

+

For a definition of each type, see those topics in the CPLEX User’s +Manual.

+
+
+continuous = 'C'
+
+ +
+
+binary = 'B'
+
+ +
+
+integer = 'I'
+
+ +
+
+semi_integer = 'N'
+
+ +
+
+semi_continuous = 'S'
+
+ +
+ +
+
+class VariablesInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.VariablesInterface
+ + + +

Methods for adding, querying, and modifying variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> # default values for lower_bounds are 0.0
+>>> c.variables.get_lower_bounds()
+[0.0, 0.0, 0.0]
+>>> # values can be set either one at a time or many at a time
+>>> c.variables.set_lower_bounds(0, 1.0)
+>>> c.variables.set_lower_bounds([("x1", -1.0), (2, 3.0)])
+>>> # values can be queried as a range
+>>> c.variables.get_lower_bounds(0, "x1")
+[1.0, -1.0]
+>>> # values can be queried as a sequence in arbitrary order
+>>> c.variables.get_lower_bounds(["x1", "x2", 0])
+[-1.0, 3.0, 1.0]
+>>> # can query the number of variables
+>>> c.variables.get_num()
+3
+>>> c.variables.set_types(0, c.variables.type.binary)
+>>> c.variables.get_num_binary()
+1
+
+
+
+
+type = <cplex._internal._subinterfaces.VarTypes object>
+

See VarTypes()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new VariablesInterface.

+

The variables interface is exposed by the top-level Cplex class +as Cplex.variables. This constructor is not meant to be used +externally.

+
+ +
+
+advanced
+

See AdvancedVariablesInterface()

+
+ +
+
+get_num()[source]
+

Returns the number of variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.get_num()
+3
+
+
+
+ +
+
+get_num_integer()[source]
+

Returns the number of integer variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.get_num_integer()
+1
+
+
+
+ +
+
+get_num_binary()[source]
+

Returns the number of binary variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.binary, t.integer])
+>>> c.variables.get_num_binary()
+1
+
+
+
+ +
+
+get_num_semicontinuous()[source]
+

Returns the number of semi-continuous variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer])
+>>> c.variables.get_num_semicontinuous()
+1
+
+
+
+ +
+
+get_num_semiinteger()[source]
+

Returns the number of semi-integer variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer])
+>>> c.variables.get_num_semiinteger()
+2
+
+
+
+ +
+
+add(obj=None, lb=None, ub=None, types='', names=None, columns=None)[source]
+

Adds variables and related data to the problem.

+

variables.add accepts the keyword arguments obj, lb, ub, +types, names, and columns.

+

If more than one argument is specified, all arguments must +have the same length.

+

obj is a list of floats specifying the linear objective +coefficients of the variables.

+

lb is a list of floats specifying the lower bounds on the +variables.

+

ub is a list of floats specifying the upper bounds on the +variables.

+

types must be either a list of single-character strings or a +string containing the types of the variables.

+
+
Note

If types is specified, the problem type will be a MIP, even if +all variables are specified to be continuous.

+
+
+

names is a list of strings.

+

columns may be either a list of sparse vectors or a matrix in +list-of-lists format.

+
+
Note

The entries of columns must not contain duplicate indices. +If an entry of columns references a row more than once, +either by index, name, or a combination of index and name, +an exception will be raised.

+
+
+

Returns an iterator containing the indices of the added +variables.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=["c0", "c1", "c2"])
+>>> indices = c.variables.add(
+...     obj=[1.0, 2.0, 3.0],
+...     types=[c.variables.type.integer] * 3)
+>>> indices = c.variables.add(
+...     obj=[1.0, 2.0, 3.0],
+...     lb=[-1.0, 1.0, 0.0],
+...     ub=[100.0, cplex.infinity, cplex.infinity],
+...     types=[c.variables.type.integer] * 3,
+...     names=["0", "1", "2"],
+...     columns=[cplex.SparsePair(ind=['c0', 2],
+...                               val=[1.0, -1.0]),
+...              [['c2'],[2.0]],
+...              cplex.SparsePair(ind=[0, 1],
+...                               val=[3.0, 4.0])])
+>>> c.variables.get_lower_bounds()
+[0.0, 0.0, 0.0, -1.0, 1.0, 0.0]
+>>> c.variables.get_cols("1")
+SparsePair(ind = [2], val = [2.0])
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes variables from the problem.

+

There are four forms by which variables.delete may be called.

+
+
variables.delete()

deletes all variables from the problem.

+
+
variables.delete(i)

i must be a variable name or index. Deletes the variable +whose index or name is i.

+
+
variables.delete(s)

s must be a sequence of variable names or indices. Deletes +the variables with names or indices contained within s. +Equivalent to [variables.delete(i) for i in s].

+
+
variables.delete(begin, end)

begin and end must be variable indices or variable names. +Deletes the variables with indices between begin and end, +inclusive of end. Equivalent to +variables.delete(range(begin, end + 1)). This will give the +best performance when deleting batches of variables.

+
+
+

See CPXdelcols in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.delete(8)
+>>> c.variables.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.variables.delete("1", 3)
+>>> c.variables.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.variables.delete([2, "0", 5])
+>>> c.variables.get_names()
+['4', '6', '7']
+>>> c.variables.delete()
+>>> c.variables.get_names()
+[]
+
+
+
+ +
+
+set_lower_bounds(*args)[source]
+

Sets the lower bound for a variable or set of variables.

+

There are two forms by which variables.set_lower_bounds may be +called.

+
+
variables.set_lower_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the lower bound of the variable whose index +or name is i to lb.

+
+
variables.set_lower_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the lower bound of the specified variables to +the corresponding values. Equivalent to +[variables.set_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.set_lower_bounds(0, 1.0)
+>>> c.variables.get_lower_bounds()
+[1.0, 0.0, 0.0]
+>>> c.variables.set_lower_bounds([(2, 3.0), ("x1", -1.0)])
+>>> c.variables.get_lower_bounds()
+[1.0, -1.0, 3.0]
+
+
+
+ +
+
+set_upper_bounds(*args)[source]
+

Sets the upper bound for a variable or set of variables.

+

There are two forms by which variables.set_upper_bounds may be +called.

+
+
variables.set_upper_bounds(i, ub)

i must be a variable name or index and ub must be a real +number. Sets the upper bound of the variable whose index +or name is i to ub.

+
+
variables.set_upper_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, ub) pairs, each +of which consists of a variable name or index and a real +number. Sets the upper bound of the specified variables to +the corresponding values. Equivalent to +[variables.set_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.set_upper_bounds(0, 1.0)
+>>> c.variables.set_upper_bounds([("x1", 10.0), (2, 3.0)])
+>>> c.variables.get_upper_bounds()
+[1.0, 10.0, 3.0]
+
+
+
+ +
+
+set_names(*args)[source]
+

Sets the name of a variable or set of variables.

+

There are two forms by which variables.set_names may be +called.

+
+
variables.set_names(i, name)

i must be a variable name or index and name must be a +string.

+
+
variables.set_names(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, name) pairs, +each of which consists of a variable name or index and a +string. Sets the name of the specified variables to the +corresponding strings. Equivalent to +[variables.set_names(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.set_names(0, "first")
+>>> c.variables.set_names([(2, "third"), (1, "second")])
+>>> c.variables.get_names()
+['first', 'second', 'third']
+
+
+
+ +
+
+set_types(*args)[source]
+

Sets the type of a variable or set of variables.

+

There are two forms by which variables.set_types may be +called.

+
+
variables.set_types(i, type)

i must be a variable name or index and name must be a +single-character string.

+
+
variables.set_types(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, type) pairs, +each of which consists of a variable name or index and a +single-character string. Sets the type of the specified +variables to the corresponding strings. Equivalent to +[variables.set_types(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
Note

If the types are set, the problem will be treated as a MIP, +even if all variable types are continuous.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(5)])
+>>> c.variables.set_types(0, c.variables.type.continuous)
+>>> c.variables.set_types([("1", c.variables.type.integer),
+                           ("2", c.variables.type.binary),
+                           ("3", c.variables.type.semi_continuous),
+                           ("4", c.variables.type.semi_integer)])
+>>> c.variables.get_types()
+['C', 'I', 'B', 'S', 'N']
+>>> c.variables.type[c.variables.get_types(0)]
+'continuous'
+
+
+
+ +
+
+get_lower_bounds(*args)[source]
+

Returns the lower bounds on variables from the problem.

+

There are four forms by which variables.get_lower_bounds may be called.

+
+
variables.get_lower_bounds()

return the lower bounds on all variables from the problem.

+
+
variables.get_lower_bounds(i)

i must be a variable name or index. Returns the lower +bound on the variable whose index or name is i.

+
+
variables.get_lower_bounds(s)

s must be a sequence of variable names or indices. Returns +the lower bounds on the variables with indices the members +of s. Equivalent to +[variables.get_lower_bounds(i) for i in s]

+
+
variables.get_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns the lower bounds on the variables with indices between +begin and end, inclusive of end. Equivalent to +variables.get_lower_bounds(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(lb = [1.5 * i for i in range(10)],
+                              names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_lower_bounds(8)
+12.0
+>>> c.variables.get_lower_bounds("1",3)
+[1.5, 3.0, 4.5]
+>>> c.variables.get_lower_bounds([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.variables.get_lower_bounds()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_upper_bounds(*args)[source]
+

Returns the upper bounds on variables from the problem.

+

There are four forms by which variables.get_upper_bounds may be called.

+
+
variables.get_upper_bounds()

return the upper bounds on all variables from the problem.

+
+
variables.get_upper_bounds(i)

i must be a variable name or index. Returns the upper +bound on the variable whose index or name is i.

+
+
variables.get_upper_bounds(s)

s must be a sequence of variable names or indices. Returns +the upper bounds on the variables with indices the members +of s. Equivalent to +[variables.get_upper_bounds(i) for i in s]

+
+
variables.get_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns the upper bounds on the variables with indices between +begin and end, inclusive of end. Equivalent to +variables.get_upper_bounds(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(ub = [(1.5 * i) + 1.0 for i in range(10)],
+                              names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_upper_bounds(8)
+13.0
+>>> c.variables.get_upper_bounds("1",3)
+[2.5, 4.0, 5.5]
+>>> c.variables.get_upper_bounds([2,"0",5])
+[4.0, 1.0, 8.5]
+>>> c.variables.get_upper_bounds()
+[1.0, 2.5, 4.0, 5.5, 7.0, 8.5, 10.0, 11.5, 13.0, 14.5]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of variables from the problem.

+

There are four forms by which variables.get_names may be called.

+
+
variables.get_names()

return the names of all variables from the problem.

+
+
variables.get_names(i)

i must be a variable index. Returns the name of variable i.

+
+
variables.get_names(s)

s must be a sequence of variable indices. Returns the +names of the variables with indices the members of s. +Equivalent to [variables.get_names(i) for i in s]

+
+
variables.get_names(begin, end)

begin and end must be variable indices. Returns the names of +the variables with indices between begin and end, inclusive of +end. Equivalent to variables.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x' + str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_names(8)
+'x8'
+>>> c.variables.get_names(1,3)
+['x1', 'x2', 'x3']
+>>> c.variables.get_names([2,0,5])
+['x2', 'x0', 'x5']
+>>> c.variables.get_names()
+['x0', 'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9']
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the types of variables from the problem.

+

There are four forms by which variables.types may be called.

+
+
variables.types()

return the types of all variables from the problem.

+
+
variables.types(i)

i must be a variable name or index. Returns the type of +the variable whose index or name is i.

+
+
variables.types(s)

s must be a sequence of variable names or indices. Returns +the types of the variables with indices the members of s. +Equivalent to [variables.get_types(i) for i in s]

+
+
variables.types(begin, end)

begin and end must be variable indices or variable names. +Returns the types of the variables with indices between begin +and end, inclusive of end. Equivalent to +variables.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(names = [str(i) for i in range(5)],
+                              types = [t.continuous, t.integer,
+                              t.binary, t.semi_continuous, t.semi_integer])
+>>> c.variables.get_num()
+5
+>>> c.variables.get_types(3)
+'S'
+>>> c.variables.get_types(1,3)
+['I', 'B', 'S']
+>>> c.variables.get_types([2,0,4])
+['B', 'C', 'N']
+>>> c.variables.get_types()
+['C', 'I', 'B', 'S', 'N']
+
+
+
+ +
+
+get_cols(*args)[source]
+

Returns a set of columns of the linear constraint matrix.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

There are four forms by which variables.get_cols may be called.

+
+
variables.get_cols()

return the entire linear constraint matrix.

+
+
variables.get_cols(i)

i must be a variable name or index. Returns the column of +the linear constraint matrix associated with variable i.

+
+
variables.get_cols(s)

s must be a sequence of variable names or indices. Returns +the columns of the linear constraint matrix associated with +the variables with indices the members of s. Equivalent to +[variables.get_cols(i) for i in s]

+
+
variables.get_cols(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the linear constraint matrix associated +with the variables with indices between begin and end, +inclusive of end. Equivalent to +variables.get_cols(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=['c1', 'c2'])
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(3)],
+...     columns=[cplex.SparsePair(ind=['c1'], val=[1.0]),
+...     cplex.SparsePair(ind=['c2'], val=[2.0]),
+...     cplex.SparsePair(ind=['c1','c2'], val=[3.0, 4.0])])
+>>> c.variables.get_num()
+3
+>>> c.variables.get_cols(2)
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+>>> for col in c.variables.get_cols(1, 2):
+...     print(col)
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+>>> for col in c.variables.get_cols([2, 0, 1]):
+...     print(col)
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+>>> for col in c.variables.get_cols():
+...     print(col)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+
+
+
+ +
+
+get_histogram()[source]
+

Returns a histogram of the columns of the linear constraint matrix.

+

To access the number of columns with given nonzero counts, use +slice notation. If a negative nonzero count is queried in +this manner an IndexError will be raised.

+

The __str__ method of the Histogram object returns a string +displaying the number of columns with given nonzeros counts in +human readable form.

+

The data member “orientation” of the histogram object is +“column”, indicating that the histogram shows the nonzero +counts for the columns of the linear constraint matrix.

+
>>> import cplex
+>>> c = cplex.Cplex("ind.lp")
+>>> histogram = c.variables.get_histogram()
+>>> print(histogram)
+Column counts (excluding fixed variables):
+
+    Nonzero Count:   1   2   3
+Number of Columns:   1   6  36
+
+
+>>> histogram[2]
+6
+>>> histogram[0:4]
+[0, 1, 6, 36]
+
+
+
+ +
+ +
+
+class AdvancedLinearConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedLinearConstraintInterface
+ + + +

Methods for handling lazy cuts and user cuts.

+

Lazy cuts are constraints not specified in the constraint +matrix of the MIP problem, but that must be not be violated +in a solution. Using lazy cuts makes sense when there are a +large number of constraints that must be satisfied at a solution, +but are unlikely to be violated if they are left out. When +you add lazy cuts to your model, set the CPLEX parameter +c.parameters.preprocessing.reduce to 0 (zero) or 1 (one) +in order to turn off dual reductions.

+

User cuts are constraints that are implied by the constraint +matrix and integrality requirements. Adding user cuts is helpful +to tighten the MIP formulation. When you add user cuts, set +the CPLEX parameter cplex.parameters.preprocessing.reformulations to +cplex.parameters.preprocessing.reformulations.values.interfere_uncrush or +cplex.parameters.preprocessing.reformulations.values.none to make sure +that CPLEX makes only reductions that do not interfere with crushing +linear forms (cuts in this case).

+
+
+__init__(parent)[source]
+

Creates a new AdvancedLinearConstraintInterface.

+

The advanced linear constraints interface is exposed by the +top-level Cplex class as Cplex.linear_constraints.advanced. +This constructor is not meant to be used externally.

+
+ +
+
+get_num_lazy_constraints()[source]
+

Returns the number of lazy cuts in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["lz1"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+1
+
+
+
+ +
+
+get_num_user_cuts()[source]
+

Returns the number of user cuts in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["usr1"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+1
+
+
+
+ +
+
+add_lazy_constraints(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds lazy constraints to the problem.

+

linear_constraints.advanced.add_lazy_constraints accepts the +keyword arguments lin_expr, senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+

Returns an iterator containing the indices of the added lazy +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["lz1"])
+>>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0])
+>>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut2, cut3],
+...     senses="EE",
+...     rhs=[0.0, 0.0],
+...     names=["lz2", "lz3"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+3
+
+
+
+ +
+
+add_user_cuts(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds user cuts to the problem.

+

linear_constraints.advanced.add_user_cuts accepts the keyword +arguments lin_expr, senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     names=["usr1"],
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0])
+>>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0])
+>>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut2, cut3],
+...     senses = "EE",
+...     rhs=[0.0, 0.0],
+...     names=["usr2", "usr3"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+3
+
+
+
+ +
+
+free_lazy_constraints()[source]
+

Removes all lazy constraints from the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr = [cut],
+...     senses = "E",
+...     rhs = [0.0],
+...     names = ["lz1"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+1
+>>> c.linear_constraints.advanced.free_lazy_constraints()
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+0
+
+
+
+ +
+
+free_user_cuts()[source]
+

Removes all user cuts from the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["usr1"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+1
+>>> c.linear_constraints.advanced.free_user_cuts()
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+0
+
+
+
+ +
+ +
+
+class LinearConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.LinearConstraintInterface
+ + + +

Methods for adding, modifying, and querying linear constraints.

+
+
+__init__(cplex)[source]
+

Creates a new LinearConstraintInterface.

+

The linear constraints interface is exposed by the top-level +Cplex class as Cplex.linear_constraints. This constructor is +not meant to be used externally.

+
+ +
+
+advanced
+

See AdvancedLinearConstraintInterface()

+
+ +
+
+get_num()[source]
+

Returns the number of linear constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c1", "c2", "c3"])
+>>> c.linear_constraints.get_num()
+3
+
+
+
+ +
+
+add(lin_expr=None, senses='', rhs=None, range_values=None, names=None)[source]
+

Adds linear constraints to the problem.

+

linear_constraints.add accepts the keyword arguments lin_expr, +senses, rhs, range_values, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints. +Each entry must +be one of ‘G’, ‘L’, ‘E’, and ‘R’, indicating +greater-than-or-equal-to (>=), less-than-or-equal-to (<=), +equality (=), and ranged constraints, respectively.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

range_values is a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

names is a list of strings.

+

Returns an iterator containing the indices of the added linear +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+        lin_expr = [cplex.SparsePair(ind = ["x1", "x3"], val = [1.0, -1.0]),
+                    cplex.SparsePair(ind = ["x1", "x2"], val = [1.0, 1.0]),
+                    cplex.SparsePair(ind = ["x1", "x2", "x3"], val = [-1.0] * 3),
+                    cplex.SparsePair(ind = ["x2", "x3"], val = [10.0, -2.0])],
+        senses = ["E", "L", "G", "R"],
+        rhs = [0.0, 1.0, -1.0, 2.0],
+        range_values = [0.0, 0.0, 0.0, -10.0],
+        names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+delete(*args)[source]
+

Removes linear constraints from the problem.

+

There are four forms by which linear_constraints.delete may be +called.

+
+
linear_constraints.delete()

deletes all linear constraints from the problem.

+
+
linear_constraints.delete(i)

i must be a linear constraint name or index. Deletes the +linear constraint whose index or name is i.

+
+
linear_constraints.delete(s)

s must be a sequence of linear constraint names or indices. +Deletes the linear constraints with names or indices contained +within s. Equivalent to [linear_constraints.delete(i) for i in s].

+
+
linear_constraints.delete(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Deletes the linear constraints with indices +between begin and end, inclusive of end. Equivalent to +linear_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of linear +constraints.

+
+
+

See CPXdelrows in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=[str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.delete(8)
+>>> c.linear_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.linear_constraints.delete("1", 3)
+>>> c.linear_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.linear_constraints.delete([2, "0", 5])
+>>> c.linear_constraints.get_names()
+['4', '6', '7']
+>>> c.linear_constraints.delete()
+>>> c.linear_constraints.get_names()
+[]
+
+
+
+ +
+
+set_rhs(*args)[source]
+

Sets the righthand side of a set of linear constraints.

+

There are two forms by which linear_constraints.set_rhs may be +called.

+
+
linear_constraints.set_rhs(i, rhs)

i must be a row name or index and rhs must be a real number. +Sets the righthand side of the row whose index or name is +i to rhs.

+
+
linear_constraints.set_rhs(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, rhs) pairs, each +of which consists of a row name or index and a real +number. Sets the righthand side of the specified rows to +the corresponding values. Equivalent to +[linear_constraints.set_rhs(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_rhs()
+[0.0, 0.0, 0.0, 0.0]
+>>> c.linear_constraints.set_rhs("c1", 1.0)
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, 0.0, 0.0]
+>>> c.linear_constraints.set_rhs([("c3", 2.0), (2, -1.0)])
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+set_names(*args)[source]
+

Sets the name of a linear constraint or set of linear constraints.

+

There are two forms by which linear_constraints.set_names may be +called.

+
+
linear_constraints.set_names(i, name)

i must be a linear constraint name or index and name must be a +string.

+
+
linear_constraints.set_names(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, name) pairs, +each of which consists of a linear constraint name or index and a +string. Sets the name of the specified linear constraints to the +corresponding strings. Equivalent to +[linear_constraints.set_names(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.set_names("c1", "second")
+>>> c.linear_constraints.get_names(1)
+'second'
+>>> c.linear_constraints.set_names([("c3", "last"), (2, "middle")])
+>>> c.linear_constraints.get_names()
+['c0', 'second', 'middle', 'last']
+
+
+
+ +
+
+set_senses(*args)[source]
+

Sets the sense of a linear constraint or set of linear constraints.

+

There are two forms by which linear_constraints.set_senses may be +called.

+
+
linear_constraints.set_senses(i, type)

i must be a row name or index and name must be a +single-character string.

+
+
linear_constraints.set_senses(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, sense) pairs, +each of which consists of a row name or index and a +single-character string. Sets the sense of the specified +rows to the corresponding strings. Equivalent to +[linear_constraints.set_senses(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+

The senses of the constraints must be one of ‘G’, ‘L’, ‘E’, +and ‘R’, indicating greater-than-or-equal-to (>=), +less-than-or-equal-to (<=), equality (=), and ranged constraints, +respectively.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_senses()
+['E', 'E', 'E', 'E']
+>>> c.linear_constraints.set_senses("c1", "G")
+>>> c.linear_constraints.get_senses(1)
+'G'
+>>> c.linear_constraints.set_senses([("c3", "L"), (2, "R")])
+>>> c.linear_constraints.get_senses()
+['E', 'G', 'R', 'L']
+
+
+
+ +
+
+set_linear_components(*args)[source]
+

Sets a linear constraint or set of linear constraints.

+

There are two forms by which this method may be called:

+
+
linear_constraints.set_linear_components(i, lin)

i must be a row name or index and lin must be either a +SparsePair or a pair of sequences, the first of which +consists of variable names or indices, the second of which +consists of floats.

+
+
linear_constraints.set_linear_components(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lin) pairs, +each of which consists of a row name or index and a vector +as described above. Sets the specified rows +to the corresponding vector. Equivalent to +[linear_constraints.set_linear_components(pair[0], pair[1]) +for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=["c0", "c1", "c2", "c3"])
+>>> indices = c.variables.add(names=["x0", "x1"])
+>>> c.linear_constraints.set_linear_components("c0", [["x0"], [1.0]])
+>>> c.linear_constraints.get_rows("c0")
+SparsePair(ind = [0], val = [1.0])
+>>> c.linear_constraints.set_linear_components([
+...     ("c3", cplex.SparsePair(ind=["x1"], val=[-1.0])),
+...     (2, [[0, 1], [-2.0, 3.0]])])
+>>> c.linear_constraints.get_rows("c3")
+SparsePair(ind = [1], val = [-1.0])
+>>> c.linear_constraints.get_rows(2)
+SparsePair(ind = [0, 1], val = [-2.0, 3.0])
+
+
+
+ +
+
+set_range_values(*args)[source]
+

Sets the range values for a set of linear constraints.

+

That is, this method sets the lefthand side (lhs) for each ranged +constraint of the form lhs <= lin_expr <= rhs.

+

The range values are a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

Note that changing the range values will not change the sense of a +constraint; you must call the method set_senses() of the class +LinearConstraintInterface to change the sense of a ranged row if +the previous range value was 0 (zero) and the constraint sense was not +‘R’. Similarly, changing the range coefficient from a nonzero value to +0 (zero) will not change the constraint sense from ‘R” to “E”; an +additional call of setsenses() is required to accomplish that.

+

There are two forms by which linear_constraints.set_range_values may be +called.

+
+
linear_constraints.set_range_values(i, range)

i must be a row name or index and range must be a real +number. Sets the range value of the row whose index or +name is i to range.

+
+
linear_constraints.set_range_values(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, range) pairs, each +of which consists of a row name or index and a real +number. Sets the range values for the specified rows to +the corresponding values. Equivalent to +[linear_constraints.set_range_values(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.set_range_values("c1", 1.0)
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.0, 0.0, 0.0]
+>>> c.linear_constraints.set_range_values([("c3", 2.0), (2, -1.0)])
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+set_coefficients(*args)[source]
+

Sets individual coefficients of the linear constraint matrix.

+

There are two forms by which +linear_constraints.set_coefficients may be called.

+
+
linear_constraints.set_coefficients(row, col, val)

row and col must be indices or names of a linear constraint +and variable, respectively. The corresponding coefficient +is set to val.

+
+
linear_constraints.set_coefficients(coefficients)

coefficients must be a list of (row, col, val) triples as +described above.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> indices = c.variables.add(names = ["x0", "x1"])
+>>> c.linear_constraints.set_coefficients("c0", "x1", 1.0)
+>>> c.linear_constraints.get_rows(0)
+SparsePair(ind = [1], val = [1.0])
+>>> c.linear_constraints.set_coefficients([("c2", "x0", 2.0),
+                                           ("c2", "x1", -1.0)])
+>>> c.linear_constraints.get_rows("c2")
+SparsePair(ind = [0, 1], val = [2.0, -1.0])
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of constraints from the problem.

+

Can be called by four forms.

+
+
linear_constraints.get_rhs()

return the righthand side of all linear constraints from +the problem.

+
+
linear_constraints.get_rhs(i)

i must be a linear constraint name or index. Returns the +righthand side of the linear constraint whose index or +name is i.

+
+
linear_constraints.get_rhs(s)

s must be a sequence of linear constraint names or indices. +Returns the righthand side of the linear constraints with +indices the members of s. Equivalent to +[linear_constraints.get_rhs(i) for i in s]

+
+
linear_constraints.get_rhs(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the righthand side of the linear +constraints with indices between begin and end, inclusive +of end. Equivalent to +linear_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(rhs = [1.5 * i for i in range(10)],
+                             names = [str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_rhs(8)
+12.0
+>>> c.linear_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.linear_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the senses of constraints from the problem.

+

Can be called by four forms.

+
+
linear_constraints.get_senses()

return the senses of all linear constraints from the +problem.

+
+
linear_constraints.get_senses(i)

i must be a linear constraint name or index. Returns the +sense of the linear constraint whose index or name is i.

+
+
linear_constraints.get_senses(s)

s must be a sequence of linear constraint names or indices. +Returns the senses of the linear constraints with indices +the members of s. Equivalent to +[linear_constraints.get_senses(i) for i in s]

+
+
linear_constraints.get_senses(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the senses of the linear constraints +with indices between begin and end, inclusive of end. +Equivalent to +linear_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(
+...     senses=["E", "G", "L", "R"],
+...     names=[str(i) for i in range(4)])
+>>> c.linear_constraints.get_num()
+4
+>>> c.linear_constraints.get_senses(1)
+'G'
+>>> c.linear_constraints.get_senses("1",3)
+['G', 'L', 'R']
+>>> c.linear_constraints.get_senses([2,"0",1])
+['L', 'E', 'G']
+>>> c.linear_constraints.get_senses()
+['E', 'G', 'L', 'R']
+
+
+
+ +
+
+get_range_values(*args)[source]
+

Returns the range values of linear constraints from the problem.

+

That is, this method returns the lefthand side (lhs) for each +ranged constraint of the form lhs <= lin_expr <= rhs. This method +makes sense only for ranged constraints, that is, linear constraints +of sense ‘R’.

+

The range values are a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

Can be called by four forms.

+
+
linear_constraints.get_range_values()

return the range values of all linear constraints from the +problem.

+
+
linear_constraints.get_range_values(i)

i must be a linear constraint name or index. Returns the +range value of the linear constraint whose index or name is i.

+
+
linear_constraints.get_range_values(s)

s must be a sequence of linear constraint names or indices. +Returns the range values of the linear constraints with +indices the members of s. Equivalent to +[linear_constraints.get_range_values(i) for i in s]

+
+
linear_constraints.get_range_values(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the range values of the linear +constraints with indices between begin and end, inclusive +of end. Equivalent to +linear_constraints.get_range_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(
+        range_values = [1.5 * i for i in range(10)],
+        senses = ["R"] * 10,
+        names = [str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_range_values(8)
+12.0
+>>> c.linear_constraints.get_range_values("1",3)
+[1.5, 3.0, 4.5]
+>>> c.linear_constraints.get_range_values([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_coefficients(*args)[source]
+

Returns coefficients by row, column coordinates.

+

There are two forms by which +linear_constraints.get_coefficients may be called.

+
+
linear_constraints.get_coefficients(row, col)

returns the coefficient.

+
+
linear_constraints.get_coefficients(sequence_of_pairs)

returns a list of coefficients.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1"])
+>>> indices = c.linear_constraints.add(
+        names = ["c0", "c1"],
+        lin_expr = [[[1], [1.0]], [[0, 1], [2.0, -1.0]]])
+>>> c.linear_constraints.get_coefficients("c0", "x1")
+1.0
+>>> c.linear_constraints.get_coefficients([("c1", "x0"), ("c1", "x1")])
+[2.0, -1.0]
+
+
+
+ +
+
+get_rows(*args)[source]
+

Returns a set of rows of the linear constraint matrix.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

There are four forms by which linear_constraints.get_rows may be +called.

+
+
linear_constraints.get_rows()

return the entire linear constraint matrix.

+
+
linear_constraints.get_rows(i)

i must be a row name or index. Returns the ith row of +the linear constraint matrix.

+
+
linear_constraints.get_rows(s)

s must be a sequence of row names or indices. Returns the +rows of the linear constraint matrix indexed by the members +of s. Equivalent to +[linear_constraints.get_rows(i) for i in s]

+
+
linear_constraints.get_rows(begin, end)

begin and end must be row indices or row names. Returns the +rows of the linear constraint matrix with indices between begin +and end, inclusive of end. Equivalent to +linear_constraints.get_rows(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+...     names=["c0", "c1", "c2", "c3"],
+...     lin_expr=[
+...         cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]),
+...         cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]),
+...         cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3),
+...         cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0])
+...     ]
+... )
+>>> c.linear_constraints.get_rows(0)
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+>>> for row in c.linear_constraints.get_rows(1,3):
+...     print(row)
+SparsePair(ind = [0, 1], val = [1.0, 1.0])
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [1, 2], val = [10.0, -2.0])
+>>> for row in c.linear_constraints.get_rows(["c2", 0]):
+...     print(row)
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+>>> for row in c.linear_constraints.get_rows():
+...     print(row)
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+SparsePair(ind = [0, 1], val = [1.0, 1.0])
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [1, 2], val = [10.0, -2.0])
+
+
+
+ +
+
+get_num_nonzeros()[source]
+

Returns the number of nonzeros in the linear constraint +matrix.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+...     names=["c0", "c1", "c2", "c3"],
+...     lin_expr=[
+...         cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]),
+...         cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]),
+...         cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3),
+...         cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0])
+...     ]
+... )
+>>> c.linear_constraints.get_num_nonzeros()
+9
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of linear constraints from the problem.

+

There are four forms by which linear_constraints.get_names may be called.

+
+
linear_constraints.get_names()

return the names of all linear constraints from the problem.

+
+
linear_constraints.get_names(i)

i must be a linear constraint index. Returns the name of row i.

+
+
linear_constraints.get_names(s)

s must be a sequence of row indices. Returns the names of +the linear constraints with indices the members of s. +Equivalent to [linear_constraints.get_names(i) for i in s]

+
+
linear_constraints.get_names(begin, end)

begin and end must be linear constraint indices. Returns the +names of the linear constraints with indices between begin and +end, inclusive of end. Equivalent to +linear_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c" + str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_names(8)
+'c8'
+>>> c.linear_constraints.get_names(1, 3)
+['c1', 'c2', 'c3']
+>>> c.linear_constraints.get_names([2, 0, 5])
+['c2', 'c0', 'c5']
+>>> c.linear_constraints.get_names()
+['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9']
+
+
+
+ +
+
+get_histogram()[source]
+

Returns a histogram of the rows of the linear constraint matrix.

+

To access the number of rows with given nonzero counts, use +slice notation. If a negative nonzero count is queried in +this manner an IndexError will be raised.

+

The __str__ method of the Histogram object returns a string +displaying the number of rows with given nonzeros counts in +human readable form.

+

The data member “orientation” of the histogram object is +“row”, indicating that the histogram shows the nonzero +counts for the rows of the linear constraint matrix.

+
>>> import cplex
+>>> c = cplex.Cplex("ind.lp")
+>>> histogram = c.linear_constraints.get_histogram()
+>>> print(histogram)
+Row counts (excluding fixed variables):
+
+ Nonzero Count:   3   4   5  10  37
+Number of Rows:   1   9   1   4   1
+
+
+>>> histogram[4]
+9
+>>> histogram[2:7]
+[0, 1, 9, 1, 0]
+
+
+
+ +
+ +
+
+class IndicatorType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.IndicatorType
+ + + +

Identifiers for types of indicator constraints.

+
+
+if_ = 1
+

CPX_INDICATOR_IF (‘->’).

+
+ +
+
+onlyif = 2
+

CPX_INDICATOR_ONLYIF (‘<-‘)

+
+ +
+
+iff = 3
+

CPX_INDICATOR_IFANDONLYIF (‘<->’)

+
+ +
+ +
+
+class IndicatorConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.IndicatorConstraintInterface
+ + + +

Methods for adding, modifying, and querying indicator constraints.

+
+
+type_ = <cplex._internal._subinterfaces.IndicatorType object>
+

See IndicatorType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new IndicatorConstraintInterface.

+

The indicator constraints interface is exposed by the top-level +Cplex class as Cplex.indicator_constraints. This constructor +is not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of indicator constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.indicator_constraints.add(name="ind1")
+0
+>>> c.indicator_constraints.get_num()
+1
+
+
+
+ +
+
+add_batch(lin_expr=None, sense=None, rhs=None, indvar=None, complemented=None, name=None, indtype=None)[source]
+

Adds indicator constraints to the problem.

+

Takes up to eight keyword arguments.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr : either a list of SparsePair instances or a matrix in +list-of-lists format.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

sense : must be either a list of single-character strings or a +string containing the senses of the indicator constraints. +Each entry must be one of ‘G’, ‘L’, ‘E’, indicating +greater-than-or-equal-to (>=), less-than-or-equal-to (<=), and +equality (=), respectively. Left unspecified, the default is ‘E’.

+

rhs : a list of floats, specifying the righthand side of each +indicator constraint.

+

indvar : a list of names or indices (or a mixture of the two), of +the variables that control whether the constraint is active or +not.

+

complemented : a list of values (0 or 1). Default value of 0 +instructs CPLEX to interpret indicator constraint as active when +the indicator variable is 1. Set complemented to 1 to instruct +CPLEX that the indicator constraint is active when indvar = 0.

+

name : a list of strings that determine the names of the +individual constraints.

+

indtype : a list of the types of indicator constraints. Defaults +to CPX_INDICATOR_IF (‘->’). See IndicatorType().

+

Returns an iterator containing the indices of the added indicator +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.indicator_constraints.add_batch(
+...     lin_expr=[cplex.SparsePair(ind=["x2"], val=[2.0]),
+...               cplex.SparsePair(ind=["x3"], val=[2.0])],
+...     sense="LL",
+...     rhs=[1.0, 1.0],
+...     indvar=["x1", "x2"],
+...     complemented=[0, 0],
+...     name=["ind1", "ind2"],
+...     indtype=[c.indicator_constraints.type_.if_,
+...              c.indicator_constraints.type_.if_])
+>>> len(list(indices))
+2
+
+
+
+ +
+
+add(lin_expr=None, sense='E', rhs=0.0, indvar=0, complemented=0, name='', indtype=1)[source]
+

Adds an indicator constraint to the problem.

+

Takes up to eight keyword arguments.

+

lin_expr : either a SparsePair or a list of two lists, the first of +which contains variable indices or names, the second of which +contains values.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

sense : the sense of the constraint, may be “L”, “G”, or “E”: +default is “E”

+

rhs : a float defining the righthand side of the constraint

+

indvar : the name or index of the variable that controls if +the constraint is active

+

complemented : default value of 0 instructs CPLEX to interpret +indicator constraint as active when the indicator variable is 1. +Set complemented to 1 to instruct CPLEX that the indicator +constraint is active when indvar = 0.

+

name : the name of the constraint.

+

indtype : the type of indicator constraint. Defaults to +CPX_INDICATOR_IF (‘->’). See IndicatorType().

+

Returns the index of the added indicator constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x1", "x2"])
+>>> c.indicator_constraints.add(
+...     indvar="x1",
+...     complemented=0,
+...     rhs=1.0,
+...     sense="G",
+...     lin_expr=cplex.SparsePair(ind=["x2"], val=[2.0]),
+...     name="ind1",
+...     indtype=c.indicator_constraints.type_.if_)
+0
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes indicator constraints from the problem.

+

There are four forms by which indicator_constraints.delete may be +called.

+
+
indicator_constraints.delete()

deletes all indicator constraints from the problem.

+
+
indicator_constraints.delete(i)

i must be an indicator constraint name or index. Deletes +the indicator constraint whose index or name is i.

+
+
indicator_constraints.delete(s)

s must be a sequence of indicator constraint names or +indices. Deletes the indicator constraints with names or +indices contained within s. Equivalent to +[indicator_constraints.delete(i) for i in s].

+
+
indicator_constraints.delete(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Deletes the indicator constraints with +indices between begin and end, inclusive of end. Equivalent to +indicator_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of indicator +constraints.

+
+
+

See CPXdelindconstrs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name=str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.delete(8)
+>>> c.indicator_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.indicator_constraints.delete("1", 3)
+>>> c.indicator_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.indicator_constraints.delete([2, "0", 5])
+>>> c.indicator_constraints.get_names()
+['4', '6', '7']
+>>> c.indicator_constraints.delete()
+>>> c.indicator_constraints.get_names()
+[]
+
+
+
+ +
+
+get_indicator_variables(*args)[source]
+

Returns the indicator variables of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_indicator_variables()

return the indicator variables of all indicator constraints +from the problem.

+
+
indicator_constraints.get_indicator_variables(i)

i must be an indicator constraint name or index. Returns the +indicator variables of the indicator constraint whose index +or name is i.

+
+
indicator_constraints.get_indicator_variables(s)

s must be a sequence of indicator constraint names or +indices. Returns the indicator variables of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_indicator_variables(i) for i in s]

+
+
indicator_constraints.get_indicator_variables(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the indicator variables of the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_indicator_variables(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=i,
+...      lin_expr=cplex.SparsePair(ind=[i+1], val=[1.0]))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_indicator_variables(8)
+8
+>>> c.indicator_constraints.get_indicator_variables("1",3)
+[1, 2, 3]
+>>> c.indicator_constraints.get_indicator_variables([2,"0",5])
+[2, 0, 5]
+>>> c.indicator_constraints.get_indicator_variables()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_complemented(*args)[source]
+

Returns whether a set of indicator constraints is complemented.

+

May be called by four forms.

+
+
indicator_constraints.get_complemented()

return whether or not all indicator constraints from the +problem are complemented.

+
+
indicator_constraints.get_complemented(i)

i must be an indicator constraint name or index. Returns +whether or not the indicator constraint whose index or name +is i is complemented.

+
+
indicator_constraints.get_complemented(s)

s must be a sequence of indicator constraint names or +indices. Returns whether or not the indicator constraints +with indices the members of s are complemented. Equivalent +to [indicator_constraints.get_complemented(i) for i in s]

+
+
indicator_constraints.get_complemented(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns whether or not the indicator +constraints with indices between begin and end, inclusive of +end, are complemented. Equivalent to +indicator_constraints.get_complemented(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=10,
+...      complemented=i % 2)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_complemented(8)
+0
+>>> c.indicator_constraints.get_complemented("1",3)
+[1, 0, 1]
+>>> c.indicator_constraints.get_complemented([2,"0",5])
+[0, 0, 1]
+>>> c.indicator_constraints.get_complemented()
+[0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
+
+
+
+ +
+
+get_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_num_nonzeros()

return the number of nonzeros in all indicator constraints +from the problem.

+
+
indicator_constraints.get_num_nonzeros(i)

i must be an indicator constraint name or index. Returns the +number of nonzeros in the indicator constraint whose index +or name is i.

+
+
indicator_constraints.get_num_nonzeros(s)

s must be a sequence of indicator constraint names or +indices. Returns the number of nonzeros in the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_num_nonzeros(i) for i in s]

+
+
indicator_constraints.get_num_nonzeros(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the number of nonzeros in the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=10,
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_num_nonzeros(8)
+8
+>>> c.indicator_constraints.get_num_nonzeros("1",3)
+[1, 2, 3]
+>>> c.indicator_constraints.get_num_nonzeros([2,"0",5])
+[2, 0, 5]
+>>> c.indicator_constraints.get_num_nonzeros()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_rhs()

return the righthand side of all indicator constraints +from the problem.

+
+
indicator_constraints.get_rhs(i)

i must be an indicator constraint name or index. Returns the +righthand side of the indicator constraint whose index or +name is i.

+
+
indicator_constraints.get_rhs(s)

s must be a sequence of indicator constraint names or +indices. Returns the righthand side of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_rhs(i) for i in s]

+
+
indicator_constraints.get_rhs(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the righthand side of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(rhs=1.5 * i, name=str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_rhs(8)
+12.0
+>>> c.indicator_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.indicator_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.indicator_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the sense of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_senses()

return the senses of all indicator constraints from the +problem.

+
+
indicator_constraints.get_senses(i)

i must be an indicator constraint name or index. Returns the +sense of the indicator constraint whose index or name is i.

+
+
indicator_constraints.get_senses(s)

s must be a sequence of indicator constraint names or +indices. Returns the senses of the indicator constraints +with indices the members of s. Equivalent to +[indicator_constraints.get_senses(i) for i in s]

+
+
indicator_constraints.get_senses(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the senses of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name=str(i), sense=j)
+...  for i, j in enumerate("EGLE")]
+[0, 1, 2, 3]
+>>> c.indicator_constraints.get_num()
+4
+>>> c.indicator_constraints.get_senses(1)
+'G'
+>>> c.indicator_constraints.get_senses("1",3)
+['G', 'L', 'E']
+>>> c.indicator_constraints.get_senses([2,"0",1])
+['L', 'E', 'G']
+>>> c.indicator_constraints.get_senses()
+['E', 'G', 'L', 'E']
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the type of a set of indicator constraints.

+

See IndicatorType().

+

May be called by four forms.

+
+
indicator_constraints.get_types()

return the types of all indicator constraints from the +problem.

+
+
indicator_constraints.get_types(i)

i must be an indicator constraint name or index. Returns the +type of the indicator constraint whose index or name is i.

+
+
indicator_constraints.get_types(s)

s must be a sequence of indicator constraint names or +indices. Returns the types of the indicator constraints +with indices the members of s. Equivalent to +[indicator_constraints.get_types(i) for i in s]

+
+
indicator_constraints.get_types(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the types of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.indicator_constraints.add(name='i1')
+>>> c.indicator_constraints.get_types(idx)
+1
+>>> c.indicator_constraints.type_[1]
+'if_'
+
+
+
+ +
+
+get_linear_components(*args)[source]
+

Returns the linear constraint of a set of indicator +constraints.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

May be called by four forms.

+
+
indicator_constraints.get_linear_components()

return the linear components of all indicator constraints +from the problem.

+
+
indicator_constraints.get_linear_components(i)

i must be an indicator constraint name or index. Returns the +linear component of the indicator constraint whose index or +name is i.

+
+
indicator_constraints.get_linear_components(s)

s must be a sequence of indicator constraint names or +indices. Returns the linear components of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_linear_components(i) for i in s]

+
+
indicator_constraints.get_linear_components(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the linear components of the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_linear_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=3,
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(3)]
+[0, 1, 2]
+>>> c.indicator_constraints.get_num()
+3
+>>> c.indicator_constraints.get_linear_components(2)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for row in c.indicator_constraints.get_linear_components("0", 1):
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+>>> for row in c.indicator_constraints.get_linear_components([1, "0"]):
+...     print(row)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> for row in c.indicator_constraints.get_linear_components():
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_names()

return the names of all indicator constraints from the +problem.

+
+
indicator_constraints.get_names(i)

i must be an indicator constraint index. Returns the name +of constraint i.

+
+
indicator_constraints.get_names(s)

s must be a sequence of indicator constraint indices. +Returns the names of the indicator constraints with indices +the members of s. Equivalent to +[indicator_constraints.get_names(i) for i in s]

+
+
indicator_constraints.get_names(begin, end)

begin and end must be indicator constraint indices. Returns the +names of the indicator constraints with indices between begin +and end, inclusive of end. Equivalent to +indicator_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name="i" + str(i))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_names(8)
+'i8'
+>>> c.indicator_constraints.get_names(1, 3)
+['i1', 'i2', 'i3']
+>>> c.indicator_constraints.get_names([2, 0, 5])
+['i2', 'i0', 'i5']
+>>> c.indicator_constraints.get_names()
+['i0', 'i1', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9']
+
+
+
+ +
+ +
+
+class QuadraticConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.QuadraticConstraintInterface
+ + + +

Methods for adding, modifying, and querying quadratic constraints.

+
+
+__init__(cplex)[source]
+

Creates a new QuadraticConstraintInterface.

+

The quadratic constraints interface is exposed by the top-level +Cplex class as Cplex.quadratic_constraints. This constructor +is not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of quadratic constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'])
+>>> l = cplex.SparsePair(ind = ['x'], val = [1.0])
+>>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0])
+>>> [c.quadratic_constraints.add(name=str(i), lin_expr=l, quad_expr=q)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+
+
+
+ +
+
+add(lin_expr=None, quad_expr=None, sense='L', rhs=0.0, name='')[source]
+

Adds a quadratic constraint to the problem.

+

Takes up to five keyword arguments:

+

lin_expr : either a SparsePair or a list of two lists specifying +the linear component of the constraint.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

quad_expr : either a SparseTriple or a list of three lists +specifying the quadratic component of the constraint.

+
+
Note

quad_expr must not contain duplicate indices. If quad_expr +references a matrix entry more than once, either by indices, +names, or a combination of indices and names, an exception +will be raised.

+
+
+

sense : either “L”, “G”, or “E”

+

rhs : a float specifying the righthand side of the constraint.

+

name : the name of the constraint.

+

Returns the index of the added quadratic constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'])
+>>> l = cplex.SparsePair(ind = ['x'], val = [1.0])
+>>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0])
+>>> c.quadratic_constraints.add(name = "my_quad",
+...                             lin_expr = l,
+...                             quad_expr = q,
+...                             rhs = 1.0,
+...                             sense = "G")
+0
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes quadratic constraints from the problem.

+

There are four forms by which quadratic_constraints.delete may be +called.

+
+
quadratic_constraints.delete()

deletes all quadratic constraints from the problem.

+
+
quadratic_constraints.delete(i)

i must be a quadratic constraint name or index. Deletes +the quadratic constraint whose index or name is i.

+
+
quadratic_constraints.delete(s)

s must be a sequence of quadratic constraint names or +indices. Deletes the quadratic constraints with names or +indices contained within s. Equivalent to +[quadratic_constraints.delete(i) for i in s].

+
+
quadratic_constraints.delete(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Deletes the quadratic constraints with +indices between begin and end, inclusive of end. Equivalent to +quadratic_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of quadratic +constraints.

+
+
+

See CPXdelqconstrs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'])
+>>> l = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> q = cplex.SparseTriple(ind1=['x'], ind2=['y'], val=[1.0])
+>>> [c.quadratic_constraints.add(
+...      name=str(i), lin_expr=l, quad_expr=q)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.delete(8)
+>>> c.quadratic_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.quadratic_constraints.delete("1", 3)
+>>> c.quadratic_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.quadratic_constraints.delete([2, "0", 5])
+>>> c.quadratic_constraints.get_names()
+['4', '6', '7']
+>>> c.quadratic_constraints.delete()
+>>> c.quadratic_constraints.get_names()
+[]
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_rhs()

return the righthand side of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_rhs(i)

i must be a quadratic constraint name or index. Returns the +righthand side of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_rhs(s)

s must be a sequence of quadratic constraint names or +indices. Returns the righthand side of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_rhs(i) for i in s]

+
+
quadratic_constraints.get_rhs(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the righthand side of the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +quadratic_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(10)])
+>>> [c.quadratic_constraints.add(rhs=1.5 * i, name=str(i))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_rhs(8)
+12.0
+>>> c.quadratic_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.quadratic_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.quadratic_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the senses of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_senses()

return the senses of all quadratic constraints from the +problem.

+
+
quadratic_constraints.get_senses(i)

i must be a quadratic constraint name or index. Returns the +sense of the quadratic constraint whose index or name is i.

+
+
quadratic_constraints.get_senses(s)

s must be a sequence of quadratic constraint names or +indices. Returns the senses of the quadratic constraints +with indices the members of s. Equivalent to +[quadratic_constraints.get_senses(i) for i in s]

+
+
quadratic_constraints.get_senses(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the senses of the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +quadratic_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0"])
+>>> [c.quadratic_constraints.add(name=str(i), sense=j)
+...  for i, j in enumerate("GGLL")]
+[0, 1, 2, 3]
+>>> c.quadratic_constraints.get_num()
+4
+>>> c.quadratic_constraints.get_senses(1)
+'G'
+>>> c.quadratic_constraints.get_senses("1",3)
+['G', 'L', 'L']
+>>> c.quadratic_constraints.get_senses([2,"0",1])
+['L', 'G', 'G']
+>>> c.quadratic_constraints.get_senses()
+['G', 'G', 'L', 'L']
+
+
+
+ +
+
+get_linear_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in the linear part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_linear_num_nonzeros()

return the number of nonzeros in all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_linear_num_nonzeros(i)

i must be a quadratic constraint name or index. Returns the +number of nonzeros in the quadratic constraint whose index +or name is i.

+
+
quadratic_constraints.get_linear_num_nonzeros(s)

s must be a sequence of quadratic constraint names or +indices. Returns the number of nonzeros in the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_linear_num_nonzeros(i) for i in s]

+
+
quadratic_constraints.get_linear_num_nonzeros(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the number of nonzeros in the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_linear_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.quadratic_constraints.add(
+...      name = str(i),
+...      lin_expr = [range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_linear_num_nonzeros(8)
+8
+>>> c.quadratic_constraints.get_linear_num_nonzeros("1",3)
+[1, 2, 3]
+>>> c.quadratic_constraints.get_linear_num_nonzeros([2,"0",5])
+[2, 0, 5]
+>>> c.quadratic_constraints.get_linear_num_nonzeros()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_linear_components(*args)[source]
+

Returns the linear part of a set of quadratic constraints.

+

Returns a list of SparsePair instances or one SparsePair +instance.

+

Can be called by four forms.

+
+
quadratic_constraints.get_linear_components()

return the linear components of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_linear_components(i)

i must be a quadratic constraint name or index. Returns the +linear component of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_linear_components(s)

s must be a sequence of quadratic constraint names or +indices. Returns the linear components of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_linear_components(i) for i in s]

+
+
quadratic_constraints.get_linear_components(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the linear components of the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_linear_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.quadratic_constraints.add(
+...      name=str(i),
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(3)]
+[0, 1, 2]
+>>> c.quadratic_constraints.get_num()
+3
+>>> c.quadratic_constraints.get_linear_components(2)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for row in c.quadratic_constraints.get_linear_components("0", 1):
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+>>> for row in c.quadratic_constraints.get_linear_components([1, "0"]):
+...     print(row)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> for row in c.quadratic_constraints.get_linear_components():
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_quad_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in the quadratic part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_quad_num_nonzeros()

Returns the number of nonzeros in all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_quad_num_nonzeros(i)

i must be a quadratic constraint name or index. Returns the +number of nonzeros in the quadratic constraint whose index +or name is i.

+
+
quadratic_constraints.get_quad_num_nonzeros(s)

s must be a sequence of quadratic constraint names or +indices. Returns the number of nonzeros in the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_quad_num_nonzeros(i) for i in s]

+
+
quadratic_constraints.get_quad_num_nonzeros(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the number of nonzeros in the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_quad_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)])
+>>> [c.quadratic_constraints.add(
+...      name = str(i),
+...      quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_quad_num_nonzeros(8)
+9
+>>> c.quadratic_constraints.get_quad_num_nonzeros("1",2)
+[1, 2, 3]
+>>> c.quadratic_constraints.get_quad_num_nonzeros([2,"1",5])
+[3, 1, 6]
+>>> c.quadratic_constraints.get_quad_num_nonzeros()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_quadratic_components(*args)[source]
+

Returns the quadratic part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_quadratic_components()

return the quadratic components of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_quadratic_components(i)

i must be a quadratic constraint name or index. Returns the +quadratic component of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_quadratic_components(s)

s must be a sequence of quadratic constraint names or +indices. Returns the quadratic components of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_quadratic_components(i) for i in s]

+
+
quadratic_constraints.get_quadratic_components(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the quadratic components of the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_quadratic_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)]
+... )
+>>> [c.quadratic_constraints.add(
+...      name="q{0}".format(i),
+...      quad_expr=[range(i), range(i),
+...                 [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 3)]
+[0, 1]
+>>> c.quadratic_constraints.get_num()
+2
+>>> c.quadratic_constraints.get_quadratic_components(1)
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components("q1", 1):
+...     print(quad)
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components(["q2", 0]):
+...     print(quad)
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components():
+...     print(quad)
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_names()

return the names of all quadratic constraints from the +problem.

+
+
quadratic_constraints.get_names(i)

i must be a quadratic constraint index. Returns the name +of constraint i.

+
+
quadratic_constraints.get_names(s)

s must be a sequence of quadratic constraint indices. +Returns the names of the quadratic constraints with indices +the members of s. Equivalent to +[quadratic_constraints.get_names(i) for i in s]

+
+
quadratic_constraints.get_names(begin, end)

begin and end must be quadratic constraint indices. Returns +the names of the quadratic constraints with indices between +begin and end, inclusive of end. Equivalent to +quadratic_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)])
+>>> [c.quadratic_constraints.add(
+...      name = "q" + str(i),
+...      quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_names(8)
+'q9'
+>>> c.quadratic_constraints.get_names(1, 3)
+['q2', 'q3', 'q4']
+>>> c.quadratic_constraints.get_names([2, 0, 5])
+['q3', 'q1', 'q6']
+>>> c.quadratic_constraints.get_names()
+['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9', 'q10']
+
+
+
+ +
+ +
+
+class SOSType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SOSType
+ + + +

Constants defining the type of special ordered sets.

+

For a definition of SOS type 1 and 2, see those topics in the CPLEX +User’s Manual.

+
+
+SOS1 = '1'
+
+ +
+
+SOS2 = '2'
+
+ +
+ +
+
+class SOSInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SOSInterface
+ + + +

Class containing methods for Special Ordered Sets (SOS).

+
+
+type = <cplex._internal._subinterfaces.SOSType object>
+

See SOSType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new SOSInterface.

+

The SOS interface is exposed by the top-level Cplex class as +Cplex.SOS. This constructor is not meant to be used +externally.

+
+ +
+
+get_num()[source]
+

Returns the number of special ordered sets.

+
+ +
+
+add(type='1', SOS=None, name='')[source]
+

Adds a special ordered set constraint to the problem.

+

Takes three keyword arguments.

+

type : can be either SOS.type.SOS1 or SOS.type.SOS2

+

SOS : either a SparsePair or a list of two lists, the first of +which contains variable indices or names, the second of which +contains the weights to assign to those variables.

+

name: the name of the SOS

+

Returns the index of the added SOS constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(10)])
+>>> c.SOS.add(type = "1", name = "type_one",
+...           SOS = cplex.SparsePair(ind = ["2", "3"],
+...                                  val = [25.0, 18.0]))
+0
+>>> c.SOS.add(type = "2", name = "type_two",
+...           SOS = cplex.SparsePair(ind = ["2", "4", "7", "3"],
+...                                  val = [1.0, 3.0, 25.0, 18.0]))
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes special ordered sets from the problem.

+

There are four forms by which SOS.delete may be called.

+
+
SOS.delete()

deletes all SOS constraints from the problem.

+
+
SOS.delete(i)

i must be a SOS constraint name or index. Deletes the SOS +constraint indexed as i or named i.

+
+
SOS.delete(s)

s must be a sequence of SOS constraint names or indices. +Deletes the SOS constraints with names or indices contained +within s. Equivalent to [SOS.delete(i) for i in s].

+
+
SOS.delete(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Deletes the SOS constraints with indices between begin +and end, inclusive of end. Equivalent to +SOS.delete(range(begin, end + 1)). This will give the best +performance when deleting batches of SOS constraints.

+
+
+

See CPXdelsos in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'])
+>>> l = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.SOS.add(name=str(i), SOS=l) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.delete(8)
+>>> c.SOS.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.SOS.delete("1", 3)
+>>> c.SOS.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.SOS.delete([2, "0", 5])
+>>> c.SOS.get_names()
+['4', '6', '7']
+>>> c.SOS.delete()
+>>> c.SOS.get_names()
+[]
+
+
+
+ +
+
+get_sets(*args)[source]
+

Returns the sets of variables and their corresponding weights.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
SOS.get_sets()

return the set of variables and weights of all SOS +constraints from the problem.

+
+
SOS.get_sets(i)

i must be a SOS constraint name or index. Returns the set +of variables and weights of the SOS constraint whose index +or name is i.

+
+
SOS.get_sets(s)

s must be a sequence of SOS constraint names or indices. +Returns the variables and weights of the SOS constraints +with indices the members of s. Equivalent to +[SOS.get_sets(i) for i in s]

+
+
SOS.get_sets(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the variables and weights of the SOS constraints +with indices between begin and end, inclusive of end. +Equivalent to SOS.get_sets(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.SOS.add(
+...      name="s{0}".format(i),
+...      SOS=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 3)]
+[0, 1]
+>>> c.SOS.get_num()
+2
+>>> c.SOS.get_sets(1)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for s in c.SOS.get_sets("s1", 1):
+...     print(s)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for s in c.SOS.get_sets(["s2", 0]):
+...     print(s)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+SparsePair(ind = [0], val = [1.0])
+>>> for s in c.SOS.get_sets():
+...     print(s)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the type of a set of special ordered sets.

+

Return values are attributes of Cplex.SOS.type.

+

Can be called by four forms.

+
+
SOS.get_types()

return the type of all SOS constraints.

+
+
SOS.get_types(i)

i must be a SOS constraint name or index. Returns the type +of the SOS constraint whose index or name is i.

+
+
SOS.get_types(s)

s must be a sequence of SOS constraint names or indices. +Returns the type of the SOS constraints with indices the +members of s. Equivalent to [SOS.get_types(i) for i in s]

+
+
SOS.get_types(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the type of the SOS constraints with indices +between begin and end, inclusive of end. Equivalent to +SOS.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.SOS.add(name = str(i), type = str(i % 2 + 1))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_types(8)
+'1'
+>>> c.SOS.get_types("1",3)
+['2', '1', '2']
+>>> c.SOS.get_types([2,"0",5])
+['1', '1', '2']
+>>> c.SOS.get_types()
+['1', '2', '1', '2', '1', '2', '1', '2', '1', '2']
+
+
+
+ +
+
+get_num_members(*args)[source]
+

Returns the size of a set of special ordered sets.

+

Can be called by four forms.

+
+
SOS.get_num_members()

return the number of variables in all SOS constraints from +the problem.

+
+
SOS.get_num_members(i)

i must be a SOS constraint name or index. Returns the +number of variables in the SOS constraint whose index or +name is i.

+
+
SOS.get_num_members(s)

s must be a sequence of SOS constraint names or indices. +Returns the number of variables in the SOS constraints with +indices the members of s. Equivalent to +[SOS.get_num_members(i) for i in s]

+
+
SOS.get_num_members(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the number of variables in the SOS constraints +with indices between begin and end, inclusive of end. +Equivalent to SOS.get_num_members(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.SOS.add(name = str(i),
+...            SOS = [range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1,11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_num_members(7)
+8
+>>> c.SOS.get_num_members("1",2)
+[1, 2, 3]
+>>> c.SOS.get_num_members([3,"1",4])
+[4, 1, 5]
+>>> c.SOS.get_num_members()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of special ordered sets.

+

Can be called by four forms.

+
+
SOS.get_names()

return the names of all SOS constraints from the problem.

+
+
SOS.get_names(i)

i must be an SOS constraint index. Returns the name of +SOS constraint i.

+
+
SOS.get_names(s)

s must be a sequence of SOS constraint indices. Returns +the names of the SOS constraints with indices the members +of s. Equivalent to [SOS.get_names(i) for i in s]

+
+
SOS.get_names(begin, end)

begin and end must be SOS constraint indices. Returns the names +of the SOS constraints with indices between begin and end, +inclusive of end. Equivalent to +SOS.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0"])
+>>> [c.SOS.add(name = "sos" + str(i)) for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_names(8)
+'sos9'
+>>> c.SOS.get_names(1, 3)
+['sos2', 'sos3', 'sos4']
+>>> c.SOS.get_names([2, 0, 5])
+['sos3', 'sos1', 'sos6']
+>>> c.SOS.get_names()
+['sos1', 'sos2', 'sos3', 'sos4', 'sos5', 'sos6', 'sos7', 'sos8', 'sos9', 'sos10']
+
+
+
+ +
+ +
+
+class EffortLevel[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.EffortLevel
+ + + +

Effort levels associated with a MIP start

+
+
+auto = 0
+
+ +
+
+check_feasibility = 1
+
+ +
+
+solve_fixed = 2
+
+ +
+
+solve_MIP = 3
+
+ +
+
+repair = 4
+
+ +
+
+no_check = 5
+
+ +
+ +
+
+class MIPStartsInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.MIPStartsInterface
+ + + +

Contains methods pertaining to MIP starts.

+
+
+effort_level = <cplex._internal._subinterfaces.EffortLevel object>
+

See EffortLevel()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new MIPStartsInterface.

+

The MIP starts interface is exposed by the top-level Cplex +class as Cplex.MIP_starts. This constructor is not meant to be +used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of MIP starts currently stored.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(5)])
+>>> c.MIP_starts.get_num()
+5
+
+
+
+ +
+
+read(filename)[source]
+

Reads MIP starts from a file.

+

This method reads a file in the format MST and copies the +information of all the MIP starts contained in that file into a +CPLEX problem object. The parameter cplex.parameters.advance +must be set to cplex.parameters.advance.values.standard, its +default value, or cplex.parameters.advance.values.alternate +in order for the MIP starts to be used.

+
+
Note

If the MIP start file is successfully read, then any +previously existing MIP starts will be deleted.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.MIP_starts.write("test_all.mst")
+>>> c.MIP_starts.read("test_all.mst")
+
+
+
+ +
+
+write(filename, begin=-1, end=-1)[source]
+

Writes a set of MIP starts to a file.

+

If called with only a filename, writes all MIP starts to that +file.

+

If called with a filename and one index or name of a MIP +start, writes only that MIP start to the file.

+

If called with a filename and two indices or names of MIP +starts, writes all MIP starts between the first and second +index or name, inclusive of begin and end, to the file.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)], types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(5)])
+>>> c.MIP_starts.write("test_all.mst")
+>>> c.MIP_starts.write("test_one.mst", 1)
+>>> c.MIP_starts.write("test_four.mst", 1, 4)
+
+
+
+ +
+
+add(*args)[source]
+

Adds MIP starts to the problem.

+

To add a single MIP start, call this method as

+

cpx.MIP_starts.add(start, effort_level, name)

+

The first argument, start, must be either a SparsePair +instance or a list of two lists, the first of which contains +variable indices or names, the second of which contains the +values that those variables take.

+

The second argument, effort_level, must be an attribute of +MIP_starts.effort_level.

+

The third optional argument is the name of the MIP start.

+

To add a set of MIP starts, call this method as

+

cpx.MIP_starts.add(sequence)

+

where sequence is a list or tuple of pairs (start, +effort_level) or triples (start, effort_level, name) as +described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)],
+...                           types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     cplex.SparsePair(ind = [0], val = [0.0]),
+...     c.MIP_starts.effort_level.repair, "first")
+>>> indices = c.MIP_starts.add(
+...     cplex.SparsePair(ind = [1], val = [0.0]),
+...     c.MIP_starts.effort_level.solve_MIP)
+>>> indices = c.MIP_starts.add(
+...     [([[2, 4], [0.0, 1.0]],
+...       c.MIP_starts.effort_level.auto, "third"),
+...      ([[3, 4], [1.0, 3.0]],
+...       c.MIP_starts.effort_level.check_feasibility)])
+>>> c.MIP_starts.get_num()
+4
+>>> c.MIP_starts.get_names()
+['first', 'm2', 'third', 'm4']
+
+
+
+ +
+
+change(*args)[source]
+

Changes a MIP start or set of MIP starts.

+

To change a single MIP start, call this method as

+

cpx.MIP_starts.change(ID, start, effort_level)

+

The first argument, ID, must be an index or name of an +existing MIP start.

+

The second argument, start, must be either a SparsePair +instance or a list of two lists, the first of which contains +variable indices or names, the second of which contains the +values that those variables take. If the MIP start identified +by ID already has a value for a variable specified by start, +that value is replaced.

+

The third argument, effort_level, must be an attribute of +MIP_starts.effort_level.

+

To change multiple MIP starts, call this method as

+

cpx.MIP_starts.change(sequence)

+

where sequence is a list of tuple of triples (ID, start, +effort_level) as described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = ["x{0}".format(i) for i in range(4)],
+...     types = "I" * 4
+... )
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(3)])
+>>> for s in c.MIP_starts.get_starts():
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [0.0]), 0)
+(SparsePair(ind = [2], val = [0.0]), 0)
+>>> c.MIP_starts.get_names()
+['m1', 'm2', 'm3']
+>>> check = c.MIP_starts.effort_level.check_feasibility
+>>> repair = c.MIP_starts.effort_level.repair
+>>> c.MIP_starts.change("m1", [["x0", "x1"], [1.0, 2.0]], check)
+>>> c.MIP_starts.get_starts("m1")
+(SparsePair(ind = [0, 1], val = [1.0, 2.0]), 1)
+>>> c.MIP_starts.change(1, [[1, 2], [-1.0, -2.0]], repair)
+>>> c.MIP_starts.get_starts("m2")
+(SparsePair(ind = [1, 2], val = [-1.0, -2.0]), 4)
+>>> c.MIP_starts.change([(1, [[0, 2], [-1.0, 2.0]], check),
+...                      ("m3", [["x0", 2], [3.0, 2.0]], repair)])
+>>> for s in c.MIP_starts.get_starts(["m2", "m3"]):
+...     print(s)
+(SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, 2.0]), 1)
+(SparsePair(ind = [0, 2], val = [3.0, 2.0]), 4)
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes MIP starts from the problem.

+

There are four forms by which MIP_starts.delete may be called.

+
+
MIP_starts.delete()

deletes all MIP starts from the problem.

+
+
MIP_starts.delete(i)

i must be a MIP start name or index. Deletes the MIP start +whose index or name is i.

+
+
MIP_starts.delete(s)

s must be a sequence of MIP start names or indices. +Deletes the MIP starts with names or indices contained within +s. Equivalent to [MIP_starts.delete(i) for i in s].

+
+
MIP_starts.delete(begin, end)

begin and end must be MIP start indices or MIP start names. +Deletes the MIP starts with indices between begin and end, +inclusive of end. Equivalent to +MIP_starts.delete(range(begin, end + 1)). This will give the +best performance when deleting batches of MIP starts.

+
+
+

See CPXdelmipstarts in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["II"])
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind=['x'], val=[1.0]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.delete(8)
+>>> c.MIP_starts.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.MIP_starts.delete("1", 3)
+>>> c.MIP_starts.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.MIP_starts.delete([2, "0", 5])
+>>> c.MIP_starts.get_names()
+['4', '6', '7']
+>>> c.MIP_starts.delete()
+>>> c.MIP_starts.get_names()
+[]
+
+
+
+ +
+
+get_starts(*args)[source]
+

Returns a set of MIP starts.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
MIP_starts.get_starts()

return the starting vector for all MIP starts from the +problem.

+
+
MIP_starts.get_starts(i)

i must be a MIP start name or index. Returns the starting +vector for the MIP start whose index or name is i.

+
+
MIP_starts.get_starts(s)

s must be a sequence of MIP start names or indices. +Returns the starting vector for the MIP starts with indices +the members of s. Equivalent to [MIP_starts.get_starts(i) +for i in s]

+
+
MIP_starts.get_starts(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the starting vector for the MIP starts with indices +between begin and end, inclusive of end. Equivalent to +MIP_starts.get_starts(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(11)],
+...     types="B" * 11)
+>>> indices =c.MIP_starts.add(
+...     [(cplex.SparsePair(ind=[i], val=[1.0 * i]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_starts(7)
+(SparsePair(ind = [7], val = [7.0]), 0)
+>>> for s in c.MIP_starts.get_starts("0", 2):
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [1.0]), 0)
+(SparsePair(ind = [2], val = [2.0]), 0)
+>>> for s in c.MIP_starts.get_starts([2, "0", 5]):
+...     print(s)
+(SparsePair(ind = [2], val = [2.0]), 0)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [5], val = [5.0]), 0)
+>>> c.MIP_starts.delete(3,9)
+>>> for s in c.MIP_starts.get_starts():
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [1.0]), 0)
+(SparsePair(ind = [2], val = [2.0]), 0)
+>>> c.MIP_starts.effort_level[0]
+'auto'
+
+
+
+ +
+
+get_effort_levels(*args)[source]
+

Returns the effort levels for a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_effort_levels()

return the effort level for all MIP starts from the +problem.

+
+
MIP_starts.get_effort_levels(i)

i must be a MIP start name or index. Returns the effort +level for the MIP start whose index or name is i.

+
+
MIP_starts.get_effort_levels(s)

s must be a sequence of MIP start names or indices. +Returns the effort level for the MIP starts with indices +the members of s. Equivalent to +[MIP_starts.get_effort_levels(i) for i in s]

+
+
MIP_starts.get_effort_levels(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the effort level for the MIP starts with indices +between begin and end, inclusive of end. Equivalent to +MIP_starts.get_effort_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(10)],
+...     types = "B" * 10)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [1.0 * i]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.change([(1, [[0], [0.0]], c.MIP_starts.effort_level.check_feasibility),
+                         (2, [[0], [0.0]], c.MIP_starts.effort_level.solve_fixed),
+                         (3, [[0], [0.0]], c.MIP_starts.effort_level.solve_MIP),
+                         (4, [[0], [0.0]], c.MIP_starts.effort_level.repair),
+                         (5, [[0], [0.0]], c.MIP_starts.effort_level.no_check)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.effort_level[c.MIP_starts.get_effort_levels(3)]
+'solve_MIP'
+>>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels("0",2)]
+['auto', 'check_feasibility', 'solve_fixed']
+>>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels([2,"0",5])]
+['solve_fixed', 'auto', 'no_check']
+>>> c.MIP_starts.get_effort_levels()
+[0, 1, 2, 3, 4, 5, 0, 0, 0, 0]
+
+
+
+ +
+
+get_num_entries(*args)[source]
+

Returns the number of variables specified by a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_num_entries()

return the length of the starting vector for all MIP starts +from the problem.

+
+
MIP_starts.get_num_entries(i)

i must be a MIP start name or index. Returns the length of +the starting vector for the MIP start whose index or name +is i.

+
+
MIP_starts.get_num_entries(s)

s must be a sequence of MIP start names or indices. +Returns the length of the starting vector for the MIP +starts with indices the members of s. Equivalent to +[MIP_starts.get_num_entries(i) for i in s]

+
+
MIP_starts.get_num_entries(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the length of the starting vector for the MIP starts +with indices between begin and end, inclusive of end. +Equivalent to +MIP_starts.get_num_entries(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "B" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = range(i), val = [0.0] * i),
+...       c.MIP_starts.effort_level.auto, str(i - 1))
+...      for i in range(1, 11)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_num_entries(3)
+4
+>>> c.MIP_starts.get_num_entries("0",2)
+[1, 2, 3]
+>>> c.MIP_starts.get_num_entries([2,"0",5])
+[3, 1, 6]
+>>> c.MIP_starts.get_num_entries()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_names()

return the names of all MIP starts from the problem.

+
+
MIP_starts.get_names(i)

i must be a MIP start index. Returns the name of MIP start i.

+
+
MIP_starts.get_names(s)

s must be a sequence of MIP start indices. Returns the +names of the MIP starts with indices the members of s. +Equivalent to [MIP_starts.get_names(i) for i in s]

+
+
MIP_starts.get_names(begin, end)

begin and end must be MIP start indices. Returns the names of +the MIP starts with indices between begin and end, inclusive of +end. Equivalent to MIP_starts.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "B" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = range(i), val = [0.0] * i),
+...       c.MIP_starts.effort_level.auto, "mst" + str(i - 1))
+...      for i in range(1, 11)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_names(8)
+'mst8'
+>>> c.MIP_starts.get_names(1, 3)
+['mst1', 'mst2', 'mst3']
+>>> c.MIP_starts.get_names([2, 0, 5])
+['mst2', 'mst0', 'mst5']
+>>> c.MIP_starts.get_names()
+['mst0', 'mst1', 'mst2', 'mst3', 'mst4', 'mst5', 'mst6', 'mst7', 'mst8', 'mst9']
+
+
+
+ +
+ +
+
+class ObjSense[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ObjSense
+ + + +

Constants defining the sense of the objective function.

+

See CPXgetobjsen in the Callable Library Reference +Manual for more detail.

+
+
+maximize = -1
+

See CPX_MAX in the C API.

+
+ +
+
+minimize = 1
+

See CPX_MIN in the C API.

+
+ +
+ +
+
+class ObjectiveInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ObjectiveInterface
+ + + +

Contains methods for querying and modifying the objective function.

+
+
+sense = <cplex._internal._subinterfaces.ObjSense object>
+

See ObjSense()

+
+ +
+
+set_linear(*args)[source]
+

Changes the linear part of the objective function.

+

Can be called by two forms:

+
+
objective.set_linear(var, value)

var must be a variable index or name and value must be a +float. Changes the coefficient of the variable identified +by var to value.

+
+
objective.set_linear(sequence)

sequence is a sequence of pairs (var, value) as described +above. Changes the coefficients for the specified +variables to the given values.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(4)])
+>>> c.objective.get_linear()
+[0.0, 0.0, 0.0, 0.0]
+>>> c.objective.set_linear(0, 1.0)
+>>> c.objective.get_linear()
+[1.0, 0.0, 0.0, 0.0]
+>>> c.objective.set_linear("3", -1.0)
+>>> c.objective.get_linear()
+[1.0, 0.0, 0.0, -1.0]
+>>> c.objective.set_linear([("2", 2.0), (1, 0.5)])
+>>> c.objective.get_linear()
+[1.0, 0.5, 2.0, -1.0]
+
+
+
+ +
+
+set_quadratic(*args)[source]
+

Sets the quadratic part of the objective function.

+

Call this method with a list with length equal to the number +of variables in the problem.

+

If the quadratic objective function is separable, the entries +of the list must all be of type float or int.

+

If the quadratic objective function is not separable, the +entries of the list must be either SparsePair instances or +lists of two lists, the first of which contains variable +indices or names, the second of which contains the values that +those variables take.

+
+
Note

Successive calls to set_quadratic will overwrite any previous +quadratic objective function. To modify only part of the +quadratic objective function, use the method +set_quadratic_coefficients.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(3)])
+>>> c.objective.set_quadratic(
+...     [cplex.SparsePair(ind=[0, 1, 2], val=[1.0, -2.0, 0.5]),
+...      cplex.SparsePair(ind=[0, 1], val=[-2.0, -1.0]),
+...      cplex.SparsePair(ind=[0, 2], val=[0.5, -3.0])]
+... )
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [0, 1, 2], val = [1.0, -2.0, 0.5])
+SparsePair(ind = [0, 1], val = [-2.0, -1.0])
+SparsePair(ind = [0, 2], val = [0.5, -3.0])
+>>> c.objective.set_quadratic([1.0, 2.0, 3.0])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [2], val = [3.0])
+
+
+
+ +
+
+set_quadratic_coefficients(*args)[source]
+

Sets coefficients of the quadratic component of the objective +function.

+

To set a single coefficient, call this method as

+

objective.set_quadratic_coefficients(v1, v2, val)

+

where v1 and v2 are names or indices of variables and val is +the value for the coefficient.

+

To set multiple coefficients, call this method as

+

objective.set_quadratic_coefficients(sequence)

+

where sequence is a list or tuple of triples (v1, v2, val) as +described above.

+
+
Note

Since the quadratic objective function must be symmetric, each +triple in which v1 is different from v2 is used to set both +the (v1, v2) coefficient and the (v2, v1) coefficient. If +(v1, v2) and (v2, v1) are set with a single call, the second +value is stored.

+
+
Note

Attempting to set many coefficients with set_quadratic_coefficients +can be time consuming. Instead, use the method set_quadratic to set +the quadratic part of the objective efficiently.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1], val = [1.0])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0),
+...                                         (0, 2, 3.0)])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1, 2], val = [1.0, 3.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+SparsePair(ind = [0], val = [3.0])
+>>> c.objective.set_quadratic_coefficients([(0, 1, 4.0),
+...                                         (1, 0, 5.0)])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1, 2], val = [5.0, 3.0])
+SparsePair(ind = [0, 1], val = [5.0, 2.0])
+SparsePair(ind = [0], val = [3.0])
+
+
+
+ +
+
+set_sense(sense)[source]
+

Sets the sense of the objective function.

+

The argument to this method must be either +objective.sense.minimize or objective.sense.maximize.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+>>> c.objective.set_sense(c.objective.sense.maximize)
+>>> c.objective.sense[c.objective.get_sense()]
+'maximize'
+>>> c.objective.set_sense(c.objective.sense.minimize)
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+
+
+
+ +
+
+set_name(name)[source]
+

Sets the name of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_name("cost")
+>>> c.objective.get_name()
+'cost'
+
+
+
+ +
+
+get_linear(*args)[source]
+

Returns the linear coefficients of a set of variables.

+

Can be called by four forms.

+
+
objective.get_linear()

return the linear objective coefficients of all variables +from the problem.

+
+
objective.get_linear(i)

i must be a variable name or index. Returns the linear +objective coefficient of the variable whose index or name +is i.

+
+
objective.get_linear(s)

s must be a sequence of variable names or indices. Returns +the linear objective coefficient of the variables with +indices the members of s. Equivalent to +[objective.get_linear(i) for i in s]

+
+
objective.get_linear(begin, end)

begin and end must be variable indices or variable names. +Returns the linear objective coefficient of the variables with +indices between begin and end, inclusive of end. Equivalent to +objective.get_linear(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj = [1.5 * i for i in range(10)],
+                    names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.objective.get_linear(8)
+12.0
+>>> c.objective.get_linear("1",3)
+[1.5, 3.0, 4.5]
+>>> c.objective.get_linear([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.objective.get_linear()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_quadratic(*args)[source]
+

Returns a set of columns of the quadratic component of the +objective function.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
objective.get_quadratic()

return the entire quadratic objective function.

+
+
objective.get_quadratic(i)

i must be a variable name or index. Returns the column of +the quadratic objective function associated with the +variable whose index or name is i.

+
+
objective.get_quadratic(s)

s must be a sequence of variable names or indices. Returns +the columns of the quadratic objective function associated +with the variables with indices the members of s. +Equivalent to [objective.get_quadratic(i) for i in s]

+
+
objective.get_quadratic(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the quadratic objective function +associated with the variables with indices between begin and +end, inclusive of end. Equivalent to +objective.get_quadratic(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.objective.set_quadratic([1.5 * i for i in range(10)])
+>>> c.objective.get_quadratic(8)
+SparsePair(ind = [8], val = [12.0])
+>>> for q in c.objective.get_quadratic("1", 3):
+...     print(q)
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [2], val = [3.0])
+SparsePair(ind = [3], val = [4.5])
+>>> for q in c.objective.get_quadratic([3, "1", 5]):
+...     print(q)
+SparsePair(ind = [3], val = [4.5])
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [5], val = [7.5])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [2], val = [3.0])
+SparsePair(ind = [3], val = [4.5])
+SparsePair(ind = [4], val = [6.0])
+SparsePair(ind = [5], val = [7.5])
+SparsePair(ind = [6], val = [9.0])
+SparsePair(ind = [7], val = [10.5])
+SparsePair(ind = [8], val = [12.0])
+SparsePair(ind = [9], val = [13.5])
+
+
+
+ +
+
+get_quadratic_coefficients(*args)[source]
+

Returns individual coefficients from the quadratic objective function.

+

To query a single coefficient, call this as

+

objective.get_quadratic_coefficients(v1, v2)

+

where v1 and v2 are indices or names of variables.

+

To query multiple coefficients, call this method as

+

objective.get_quadratic_coefficients(sequence)

+

where sequence is a list or tuple of pairs (v1, v2) as +described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_quadratic_coefficients("1", 0)
+1.0
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0), (1, 0, 5.0)])
+>>> c.objective.get_quadratic_coefficients([(1, 0), (1, "1"), (2, "0")])
+[5.0, 2.0, 3.0]
+
+
+
+ +
+
+get_sense()[source]
+

Returns the sense of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+>>> c.objective.set_sense(c.objective.sense.maximize)
+>>> c.objective.sense[c.objective.get_sense()]
+'maximize'
+>>> c.objective.set_sense(c.objective.sense.minimize)
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+
+
+
+ +
+
+get_name()[source]
+

Returns the name of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_name("cost")
+>>> c.objective.get_name()
+'cost'
+
+
+
+ +
+
+get_num_quadratic_variables()[source]
+

Returns the number of variables with quadratic coefficients.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_num_quadratic_variables()
+2
+>>> c.objective.set_quadratic([1.0, 0.0, 0.0])
+>>> c.objective.get_num_quadratic_variables()
+1
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)])
+>>> c.objective.get_num_quadratic_variables()
+3
+
+
+
+ +
+
+get_num_quadratic_nonzeros()[source]
+

Returns the number of nonzeros in the quadratic objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_num_quadratic_nonzeros()
+2
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)])
+>>> c.objective.get_num_quadratic_nonzeros()
+5
+>>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), (1, 0, 0.0)])
+>>> c.objective.get_num_quadratic_nonzeros()
+3
+
+
+
+ +
+
+get_offset()[source]
+

Returns the constant offset of the objective function for a problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> offset = c.objective.get_offset()
+>>> abs(offset - 0.0) < 1e-6
+True
+
+
+
+ +
+
+set_offset(offset)[source]
+

Sets the constant offset of the objective function for a problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_offset(3.14)
+>>> offset = c.objective.get_offset()
+>>> abs(offset - 3.14) < 1e-6
+True
+
+
+
+ +
+ +
+
+class ProgressInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ProgressInterface
+ + + +

Methods to query the progress of optimization.

+
+
+__init__(parent)[source]
+

Creates a new ProgressInterface.

+

The progress interface is exposed by the top-level Cplex +class as Cplex.solution.progress. This constructor is not +meant to be used externally.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations executed so far.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_iterations()
+
+
+
+ +
+
+get_num_barrier_iterations()[source]
+

Returns the number of barrier iterations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_barrier_iterations()
+
+
+
+ +
+
+get_num_sifting_iterations()[source]
+

Returns the number of sifting iterations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting)
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_sifting_iterations()
+
+
+
+ +
+
+get_num_phase_one_iterations()[source]
+

Returns the number of iterations to find a feasible solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_phase_one_iterations()
+
+
+
+ +
+
+get_num_sifting_phase_one_iterations()[source]
+

Returns the number of sifting iterations to find a feasible solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting)
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_sifting_phase_one_iterations()
+
+
+
+ +
+
+get_num_nodes_processed()[source]
+

Returns the number of nodes processed.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num_nodes = c.solution.progress.get_num_nodes_processed()
+
+
+
+ +
+
+get_num_nodes_remaining()[source]
+

Returns the number of nodes left to process.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num_nodes = c.solution.progress.get_num_nodes_remaining()
+
+
+
+ +
+
+get_num_primal_push()[source]
+

Returns the number of primal push operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_push = c.solution.progress.get_num_primal_push()
+
+
+
+ +
+
+get_num_primal_exchange()[source]
+

Returns the number of primal exchange operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_exch = c.solution.progress.get_num_primal_exchange()
+
+
+
+ +
+
+get_num_dual_push()[source]
+

Returns the number of dual push operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_push = c.solution.progress.get_num_dual_push()
+
+
+
+ +
+
+get_num_dual_exchange()[source]
+

Returns the number of dual exchange operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_exch = c.solution.progress.get_num_dual_exchange()
+
+
+
+ +
+
+get_num_conflict_passes()[source]
+

Returns the number of passes performed by the conflict +refiner.

+

See CPXgetconflictnumpasses in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine()
+>>> c.solution.progress.get_num_conflict_passes()
+5
+
+
+
+ +
+ +
+
+class InfeasibilityInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.InfeasibilityInterface
+ + + +

Methods for computing degree of infeasibility in a solution vector.

+

Each of these methods takes one required argument, x, which must +be a list of floats with length equal to the number of variables.

+

If no other arguments are provided, the methods return the +violation for all constraints of the given type.

+

If one string or integer is provided, it is taken to be the name +or index of a constraint of the given type. The methods return +the violation of that constraint.

+

If two strings or integers are provided, they are taken to be the +names or indices of constraints of the given type. All violations +for constraints between the first and second, inclusive, are +returned in a list.

+

If a sequence of strings or integers are provided, they are taken +to be the names or indices of constraints of the given type. All +violations for constraints identified in the sequence are returned +in a list.

+
+
+__init__(parent)[source]
+

Creates a new InfeasibilityInterface.

+

The infeasibility interface is exposed by the top-level Cplex +class as Cplex.solution.infeasibility. This constructor is not +meant to be used externally.

+
+ +
+
+bound_constraints(x, *args)[source]
+

Returns the amount by which variable bounds are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), 2)
+0.0
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), "x10")
+0.0
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), ["x10", 8])
+[0.0, 0.0]
+>>> bd = c.solution.infeasibility.bound_constraints(c.solution.get_values())
+>>> bd[15]
+0.0
+
+
+
+ +
+
+linear_constraints(x, *args)[source]
+

Returns the amount by which a set of linear constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> sol_vals = c.solution.get_values()
+>>> getrowinfeas = c.solution.infeasibility.linear_constraints
+>>> abs(getrowinfeas(sol_vals, "c10"))
+0.0
+>>> abs(getrowinfeas(sol_vals, 7))
+0.0
+>>> [abs(x) for x in getrowinfeas(sol_vals, ["c13", 4])]
+[0.0, 0.0]
+>>> lconstraint = getrowinfeas(sol_vals)
+>>> abs(lconstraint[5])
+0.0
+
+
+
+ +
+
+quadratic_constraints(x, *args)[source]
+

Returns the amount by which a set of quadratic constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> getqconstrinfeas = c.solution.infeasibility.quadratic_constraints
+>>> abs(getqconstrinfeas(c.solution.get_values(), 2)) < 1e-6
+True
+>>> abs(getqconstrinfeas(c.solution.get_values(), "QC3")) < 1e-6
+True
+>>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values(), [1, "QC1"])]
+[True, True]
+>>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values())]
+[True, True, True, True]
+
+
+
+ +
+
+indicator_constraints(x, *args)[source]
+

Returns the amount by which indicator constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), 3)
+0.0
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), "c21")
+0.0
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), ["c21", 10])
+[0.0, 0.0]
+>>> iconstraint = c.solution.infeasibility.indicator_constraints(c.solution.get_values())
+>>> iconstraint[5]
+0.0
+
+
+
+ +
+
+SOS_constraints(x, *args)[source]
+

Returns the amount by which SOS constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), 0)
+0.0
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), "set1")
+0.0
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), ["set1", 0])
+[0.0, 0.0]
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values())
+[0.0]
+
+
+
+ +
+ +
+
+class CutType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.CutType
+ + + +

Identifiers for types of cuts.

+
+
+cover = 0
+
+ +
+
+GUB_cover = 1
+
+ +
+
+flow_cover = 2
+
+ +
+
+clique = 3
+
+ +
+
+fractional = 4
+
+ +
+
+MIR = 5
+
+ +
+
+flow_path = 6
+
+ +
+
+disjunctive = 7
+
+ +
+
+implied_bound = 8
+
+ +
+
+zero_half = 9
+
+ +
+
+multi_commodity_flow = 10
+
+ +
+
+lift_and_project = 14
+
+ +
+
+user = 15
+
+ +
+
+table = 16
+
+ +
+
+solution_pool = 17
+
+ +
+
+local_implied_bound = 18
+
+ +
+
+BQP = 19
+
+ +
+
+RLT = 20
+
+ +
+
+benders = 21
+
+ +
+ +
+
+class MIPSolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.MIPSolutionInterface
+ + + +

Methods for accessing solutions to a MIP.

+
+
+cut_type = <cplex._internal._subinterfaces.CutType object>
+

See CutType()

+
+ +
+
+__init__(parent)[source]
+

Creates a new MIPSolutionInterface.

+

The MIP solution interface is exposed by the top-level Cplex +class as Cplex.solution.MIP. This constructor is not meant to +be used externally.

+
+ +
+
+get_best_objective()[source]
+

Returns the currently best known bound of all the remaining +open nodes in a branch-and-cut tree.

+

It is computed for a minimization problem as the minimum +objective function value of all remaining unexplored nodes. +Similarly, it is computed for a maximization problem as the +maximum objective function value of all remaining unexplored +nodes.

+

For a regular MIP optimization, this value is also the best known +bound on the optimal solution value of the MIP problem. In fact, +when a problem has been solved to optimality, this value matches +the optimal solution value.

+

However, for the populate method, the value can also exceed the +optimal solution value if CPLEX has already solved the model to +optimality but continues to search for additional solutions.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> best_obj = c.solution.MIP.get_best_objective()
+>>> abs(best_obj - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_cutoff()[source]
+

Returns the MIP cutoff value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> cutoff = c.solution.MIP.get_cutoff()
+>>> abs(cutoff - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_mip_relative_gap()[source]
+

Returns the MIP relative gap.

+

See CPXgetmiprelgap in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.MIP.get_mip_relative_gap()
+0.0
+
+
+
+ +
+
+get_incumbent_node()[source]
+

Returns the node number of the best solution found.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.threads.set(1)
+>>> c.solve()
+>>> c.solution.MIP.get_incumbent_node() >= 0
+True
+
+
+
+ +
+
+get_num_cuts(cut_type)[source]
+

Returns the number of cuts of the specified type.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> ncuts = c.solution.MIP.get_num_cuts(
+...     c.solution.MIP.cut_type.zero_half)
+
+
+
+ +
+
+get_subproblem_status()[source]
+

Returns the solution status of the last subproblem optimization.

+

Returns an attribute of Cplex.solution.status if there was an +error termination where a subproblem could not be solved to +completion during mixed integer optimization. Otherwise 0 +(zero) is returned if no error occurred.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.MIP.get_subproblem_status()
+0
+
+
+
+ +
+ +
+
+class BasisVarStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.BasisVarStatus
+ + + +

Status values returned by basis query methods.

+
+
+at_lower_bound = 0
+
+ +
+
+basic = 1
+
+ +
+
+at_upper_bound = 2
+
+ +
+
+free_nonbasic = 3
+
+ +
+ +
+
+class BasisInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.BasisInterface
+ + + +

Methods for accessing the basis of a solution.

+
+
+status = <cplex._internal._subinterfaces.BasisVarStatus object>
+

See BasisVarStatus()

+
+ +
+
+__init__(parent)[source]
+

Creates a new BasisInterface.

+

The basis interface is exposed by the top-level Cplex class as +Cplex.solution.basis. This constructor is not meant to be used +externally.

+
+ +
+
+get_basis()[source]
+

Returns the status of structural and slack variables.

+

Returns a pair of lists of attributes of solution.basis.status. +The first lists the status of the structural variables (of length +equal to the number of variables), the second lists the status of +the slack variables (of length equal to the number of linear +constraints).

+

See CPXgetbase in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> pair_of_lists = c.solution.basis.get_basis()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the basis to a file.

+

See CPXmbasewrite in the Callable Library Reference +Manual and also InitialInterface.read_basis().

+

Example:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.basis.write("lpex.bas")
+
+
+
+ +
+
+get_header()[source]
+

Returns the basis header.

+

Returns a pair (head, x), where head is a list of variable +indices and x is a list of floats indicating the values of +those variables. Indices of basic slacks are specified by +-rowindex - 1.

+
+ +
+
+get_basic_row_index(row)[source]
+

Returns the position of a basic slack variable in the basis header.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.basis.get_basic_row_index(2)
+3
+
+
+
+ +
+
+get_basic_col_index(col)[source]
+

Returns the position of a basic structural variable in the basis header.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.basis.get_basic_col_index(2)
+1
+
+
+
+ +
+
+get_primal_norms()[source]
+

Returns norms from the primal steepest edge.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.parameters.simplex.pgradient.set(c.parameters.simplex.pgradient.values.steep)
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal)
+>>> c.solve()
+>>> pnorm = c.solution.basis.get_primal_norms()
+>>> for i, j in zip(pnorm[1], [1.722656, 1.691406, 2.0, 1.062499]):
+...     abs(i - j) < 1e-6
+...
+True
+True
+True
+True
+
+
+
+ +
+
+get_dual_norms()[source]
+

Returns norms from the dual steepest edge.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.solve()
+>>> c.solution.basis.get_dual_norms()
+([1.0, 1.0, 1.0, 1.0], [1, 2, 3, -3])
+
+
+
+ +
+
+get_basis_dual_norms()[source]
+

Returns basis and dual norms.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.solve()
+>>> c.solution.basis.get_basis_dual_norms()
+([2, 1, 1, 1], [0, 0, 1, 0], [1.0, 1.0, 1.0, 1.0])
+
+
+
+ +
+
+get_num_primal_superbasic()[source]
+

Returns the number of primal superbasic variables.

+
+ +
+
+get_num_dual_superbasic()[source]
+

Returns the number of primal superbasic variables.

+
+ +
+ +
+
+class SensitivityInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SensitivityInterface
+ + + +

Methods for sensitivity analysis.

+
+
+__init__(parent)[source]
+

Creates a new SensitivityInterface.

+

The sensitivity interface is exposed by the top-level Cplex +class as Cplex.solution.sensitivity. This constructor is not +meant to be used externally.

+
+ +
+
+lower_bounds(*args)[source]
+

Returns the sensitivity of a set of lower bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.lower_bounds(1)
+(-1e+20, 17.5)
+>>> c.solution.sensitivity.lower_bounds('x3')
+(-1e+20, 42.5)
+>>> c.solution.sensitivity.lower_bounds(["x3", 0])
+[(-1e+20, 42.5), (-1e+20, 40.0)]
+>>> c.solution.sensitivity.lower_bounds()
+[(-1e+20, 40.0), (-1e+20, 17.5), (-1e+20, 42.5), (-1e+20, 0.625)]
+
+
+
+ +
+
+upper_bounds(*args)[source]
+

Returns the sensitivity of a set of upper bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.upper_bounds(1)
+(17.5, 1e+20)
+>>> c.solution.sensitivity.upper_bounds("x3")
+(42.5, 1e+20)
+>>> bupper = c.solution.sensitivity.upper_bounds(["x3", 0])
+>>> for i, j in zip(bupper, [(42.5, 1e+20), (36.428571, 155.0)]):
+...     abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6
+...
+True
+True
+>>> bupper = c.solution.sensitivity.upper_bounds()
+>>> for i, j in zip(bupper[3], (0.625, 1e+20)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+
+bounds(*args)[source]
+

Returns the sensitivity of a set of both lower and upper bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.bounds(1)
+(-1e+20, 17.5, 17.5, 1e+20)
+>>> c.solution.sensitivity.bounds("x3")
+(-1e+20, 42.5, 42.5, 1e+20)
+>>> c.solution.sensitivity.bounds(["x3", 1])
+[(-1e+20, 42.5, 42.5, 1e+20), (-1e+20, 17.5, 17.5, 1e+20)]
+>>> bd = c.solution.sensitivity.bounds()
+>>> bd[1]
+(-1e+20, 17.5, 17.5, 1e+20)
+
+
+
+ +
+
+objective(*args)[source]
+

Returns the sensitivity of part of the objective function.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.objective(1)
+(-3.0, 5.0)
+>>> c.solution.sensitivity.objective("x3")
+(-1e+20, -2.0)
+>>> c.solution.sensitivity.objective(["x3", 1])
+[(-1e+20, -2.0), (-3.0, 5.0)]
+>>> c.solution.sensitivity.objective()
+[(-1e+20, 2.5), (-3.0, 5.0), (-1e+20, -2.0), (0.0, 4.0)]
+
+
+
+ +
+
+rhs(*args)[source]
+

Returns the sensitivity of the righthand side of a set of linear constraints.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> rhssa = c.solution.sensitivity.rhs(1)
+>>> for i, j in zip(rhssa, (20.0, 46.666666)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+>>> c.solution.sensitivity.rhs("c3")
+(-1e+20, 112.5)
+>>> rhssa = c.solution.sensitivity.rhs(["c3", 1])
+>>> for i, j in zip(rhssa, [(-1e+20, 112.5), (20.0, 46.666666)]):
+...     abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6
+...
+True
+True
+>>> rhssa = c.solution.sensitivity.rhs()
+>>> for i, j in zip(rhssa[3], (-1e+20, 42.5)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+ +
+
+class FilterType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.FilterType
+ + + +

Attributes define the filter types.

+
+
+diversity = 1
+
+ +
+
+range = 2
+
+ +
+ +
+
+class SolnPoolFilterInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolnPoolFilterInterface
+ + + +

Methods for solution pool filters.

+
+
+type = <cplex._internal._subinterfaces.FilterType object>
+

See FilterType()

+
+ +
+
+__init__(parent)[source]
+

Creates a new SolnPoolFilterInterface.

+

The solution pool filter interface is exposed by the top-level +Cplex class as Cplex.solution.pool.filter. This constructor +is not meant to be used externally.

+
+ +
+
+add_diversity_filter(lb, ub, expression, weights=None, name='')[source]
+

Adds a diversity filter to the solution pool.

+

The arguments determine, in order,

+

the lower bound (float)

+

the upper bound (float)

+

the variables and values it takes as either a SparsePair or a +list of two lists.

+

a set of weights (a list of floats with the same length as +expression). If an empty list is given, then weights of 1.0 +(one) will be used.

+

name (string)

+

Returns the index of the added diversity filter.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_diversity_filter(
+...     300, 600, [['x1','x2'], [1,1]], [2,1], "")
+0
+
+
+
+ +
+
+add_range_filter(lb, ub, expression, name='')[source]
+

Adds a range filter to the solution pool.

+

The arguments determine, in order,

+

the lower bound (float)

+

the upper bound (float)

+

the variables and values it takes as either a SparsePair or a +list of two lists.

+

name (string)

+

Returns the index of the added range filter.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+
+
+
+ +
+
+get_diversity_filters(*args)[source]
+

Returns a set of diversity filters.

+

Returns filters as pairs of (SparsePair, weights), where +weights is a list of floats.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["BB"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], str(i))
+...  for i in range(2)]
+[0, 1]
+>>> c.solution.pool.filter.get_diversity_filters(0)
+(SparsePair(ind = [0], val = [1.0]), [1.0])
+>>> c.solution.pool.filter.get_diversity_filters("1")
+(SparsePair(ind = [0], val = [1.0]), [1.0])
+>>> c.solution.pool.filter.get_diversity_filters([0, "1"])
+[(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])]
+>>> c.solution.pool.filter.get_diversity_filters()
+[(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])]
+
+
+
+ +
+
+get_range_filters(*args)[source]
+

Returns a set of range filters.

+

Returns filters as SparsePair instances.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(2)]
+[0, 1]
+>>> c.solution.pool.filter.get_range_filters(0)
+SparsePair(ind = [0], val = [1.0])
+>>> c.solution.pool.filter.get_range_filters("1")
+SparsePair(ind = [0], val = [1.0])
+>>> c.solution.pool.filter.get_range_filters([0, "1"])
+[SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])]
+>>> c.solution.pool.filter.get_range_filters()
+[SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])]
+
+
+
+ +
+
+get_bounds(*args)[source]
+

Returns (lb, ub) pairs for a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["BB"])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], "div{0}".format(i)) for i in range(2)]
+[0, 1]
+>>> [c.solution.pool.filter.add_range_filter(
+...      0, 1, f, "rng{0}".format(i)) for i in range(2)]
+[2, 3]
+>>> c.solution.pool.filter.get_bounds(0)
+(0.0, 1.0)
+>>> c.solution.pool.filter.get_bounds("rng0")
+(0.0, 1.0)
+>>> c.solution.pool.filter.get_bounds(["div0", 2])
+[(0.0, 1.0), (0.0, 1.0)]
+>>> c.solution.pool.filter.get_bounds()
+[(0.0, 1.0), (0.0, 1.0), (0.0, 1.0), (0.0, 1.0)]
+
+
+
+ +
+
+get_num_nonzeros(*args)[source]
+

Returns the number of variables specified by a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["BB"])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], "div{0}".format(i)) for i in range(2)]
+[0, 1]
+>>> [c.solution.pool.filter.add_range_filter(
+...      0, 1, f, "rng{0}".format(i)) for i in range(2)]
+[2, 3]
+>>> c.solution.pool.filter.get_num_nonzeros(0)
+1
+>>> c.solution.pool.filter.get_num_nonzeros("rng0")
+1
+>>> c.solution.pool.filter.get_num_nonzeros(["div0", 2])
+[1, 1]
+>>> c.solution.pool.filter.get_num_nonzeros()
+[1, 1, 1, 1]
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes filters from the problem.

+

There are four forms by which filters.delete may be called.

+
+
filters.delete()

deletes all filters from the problem.

+
+
filters.delete(i)

i must be a filter name or index. Deletes the filter whose +index or name is i.

+
+
filters.delete(s)

s must be a sequence of filter names or indices. Deletes +the filters with names or indices contained within s. +Equivalent to [filters.delete(i) for i in s].

+
+
filters.delete(begin, end)

begin and end must be filter indices or filter names. Deletes +the filters with indices between begin and end, inclusive of +end. Equivalent to filters.delete(range(begin, end + 1)). This +will give the best performance when deleting batches of +filters.

+
+
+

See CPXdelsolnpoolfilters in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=['II'])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_num()
+10
+>>> c.solution.pool.filter.delete(8)
+>>> c.solution.pool.filter.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.solution.pool.filter.delete('1', 3)
+>>> c.solution.pool.filter.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.solution.pool.filter.delete([2, '0', 5])
+>>> c.solution.pool.filter.get_names()
+['4', '6', '7']
+>>> c.solution.pool.filter.delete()
+>>> c.solution.pool.filter.get_names()
+[]
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the types of a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_types(3)
+2
+>>> c.solution.pool.filter.get_types("5")
+2
+>>> c.solution.pool.filter.get_types([2, "8"])
+[2, 2]
+>>> c.solution.pool.filter.get_types()
+[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of filters, given their indices.

+

There are four forms by which solution.pool.filter.get_names may be called.

+
+
solution.pool.filter.get_names()

return the names of all solution pool filters from the problem.

+
+
solution.pool.filter.get_names(i)

i must be a solution filter index. Returns the name of row i.

+
+
solution.pool.filter.get_names(s)

s must be a sequence of row indices. Returns the names of +the solution pool filters with indices the members of s. +Equivalent to [solution.pool.filter.get_names(i) for i in s]

+
+
solution.pool.filter.get_names(begin, end)

begin and end must be solution filter indices. Returns the +names of the solution pool filter with indices between begin +and end, inclusive of end. Equivalent to +solution.pool.filter.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
+>>> c.solution.pool.filter.get_names(6)
+'6'
+>>> c.solution.pool.filter.get_names([5, 3])
+['5', '3']
+>>> c.solution.pool.filter.get_names(3, 5)
+['3', '4', '5']
+
+
+
+ +
+
+write(filename)[source]
+

Writes the filters to a file.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.write("ind.flt")
+
+
+
+ +
+
+read(filename)[source]
+

Reads filters from a file.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.write("ind.flt")
+>>> c.solution.pool.filter.read("ind.flt")
+
+
+
+ +
+
+get_num()[source]
+

Returns the number of filters in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.get_num()
+1
+
+
+
+ +
+ +
+
+class QualityMetric[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.QualityMetric
+ + + +

Measures of solution quality.

+
+
+max_primal_infeasibility = 1
+
+ +
+
+max_scaled_primal_infeasibility = 2
+
+ +
+
+sum_primal_infeasibilities = 3
+
+ +
+
+sum_scaled_primal_infeasibilities = 4
+
+ +
+
+max_dual_infeasibility = 5
+
+ +
+
+max_scaled_dual_infeasibility = 6
+
+ +
+
+sum_dual_infeasibilities = 7
+
+ +
+
+sum_scaled_dual_infeasibilities = 8
+
+ +
+
+max_int_infeasibility = 9
+
+ +
+
+sum_integer_infeasibilities = 10
+
+ +
+
+max_primal_residual = 11
+
+ +
+
+max_scaled_primal_residual = 12
+
+ +
+
+sum_primal_residual = 13
+
+ +
+
+sum_scaled_primal_residual = 14
+
+ +
+
+max_dual_residual = 15
+
+ +
+
+max_scaled_dual_residual = 16
+
+ +
+
+sum_dual_residual = 17
+
+ +
+
+sum_scaled_dual_residual = 18
+
+ +
+
+max_comp_slack = 19
+
+ +
+
+sum_comp_slack = 21
+
+ +
+
+max_x = 23
+
+ +
+
+max_scaled_x = 24
+
+ +
+
+max_pi = 25
+
+ +
+
+max_scaled_pi = 26
+
+ +
+
+max_slack = 27
+
+ +
+
+max_scaled_slack = 28
+
+ +
+
+max_reduced_cost = 29
+
+ +
+
+max_scaled_reduced_cost = 30
+
+ +
+
+sum_x = 31
+
+ +
+
+sum_scaled_x = 32
+
+ +
+
+sum_pi = 33
+
+ +
+
+sum_scaled_pi = 34
+
+ +
+
+sum_slack = 35
+
+ +
+
+sum_scaled_slack = 36
+
+ +
+
+sum_reduced_cost = 37
+
+ +
+
+sum_scaled_reduced_cost = 38
+
+ +
+
+kappa = 39
+
+ +
+
+objective_gap = 40
+
+ +
+
+dual_objective = 41
+
+ +
+
+primal_objective = 42
+
+ +
+
+max_quadratic_primal_residual = 43
+
+ +
+
+sum_quadratic_primal_residual = 44
+
+ +
+
+max_quadratic_slack_infeasibility = 45
+
+ +
+
+sum_quadratic_slack_infeasibility = 46
+
+ +
+
+max_quadratic_slack = 47
+
+ +
+
+sum_quadratic_slack = 48
+
+ +
+
+max_indicator_slack_infeasibility = 49
+
+ +
+
+sum_indicator_slack_infeasibility = 50
+
+ +
+
+max_pwl_slack_infeasibility = 58
+
+ +
+
+sum_pwl_slack_infeasibility = 59
+
+ +
+
+exact_kappa = 51
+
+ +
+
+kappa_stable = 52
+
+ +
+
+kappa_suspicious = 53
+
+ +
+
+kappa_unstable = 54
+
+ +
+
+kappa_illposed = 55
+
+ +
+
+kappa_max = 56
+
+ +
+
+kappa_attention = 57
+
+ +
+ +
+
+class QualityMetrics[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._subinterfaces.QualityMetrics
+ + +

A class containing measures of the quality of a solution.

+

The __str__ method of this class prints all available measures of +the quality of the solution in human readable form.

+

This class may have a different set of data members depending on +the optimization algorithm used and the quality metrics that are +available.

+

An instance of this class always has the member quality_type, +which is one of the following strings:

+
+
    +
  • “feasopt”

  • +
  • “simplex”

  • +
  • “quadratically_constrained”

  • +
  • “barrier”

  • +
  • “MIP”

  • +
+
+

If self.quality_type is “feasopt” this instance has the following +members:

+
+
    +
  • scaled

  • +
  • max_x

  • +
  • max_bound_infeas

  • +
  • max_Ax_minus_b

  • +
  • max_slack

  • +
+
+

If self.scaled is 1, this instance also has the members:

+
+
    +
  • max_scaled_x

  • +
  • max_scaled_bound_infeas

  • +
  • max_scaled_Ax_minus_b

  • +
  • max_scaled_slack

  • +
+
+

If self.quality_type is “simplex” this instance has the following +members:

+
+
    +
  • scaled

  • +
  • max_x

  • +
  • max_pi

  • +
  • max_reduced_cost

  • +
  • max_bound_infeas

  • +
  • max_reduced_cost_infeas

  • +
  • max_Ax_minus_b

  • +
  • max_c_minus_Bpi

  • +
  • max_slack

  • +
+
+

If self.scaled is 1, this instance also has the members:

+
+
    +
  • max_scaled_x

  • +
  • max_scaled_pi

  • +
  • max_scaled_reduced_cost

  • +
  • max_scaled_bound_infeas

  • +
  • max_scaled_reduced_cost_infeas

  • +
  • max_scaled_Ax_minus_b

  • +
  • max_scaled_c_minus_Bpi

  • +
  • max_scaled_slack

  • +
+
+

If the condition number of the final basis is available, this +instance has the member:

+
+
    +
  • kappa

  • +
+
+

If self.quality_type is “quadratically_constrained” this instance +has the following members:

+
+
    +
  • objective

  • +
  • norm_total

  • +
  • norm_max

  • +
  • error_Ax_b_total

  • +
  • error_Ax_b_max

  • +
  • error_xQx_dx_f_total

  • +
  • error_xQx_dx_f_max

  • +
  • x_bound_error_total

  • +
  • x_bound_error_max

  • +
  • slack_bound_error_total

  • +
  • slack_bound_error_max

  • +
  • quadratic_slack_bound_error_total

  • +
  • quadratic_slack_bound_error_max

  • +
  • normalized_error_max

  • +
+
+

If self.quality_type is “barrier” this instance has the following +members:

+
+
    +
  • primal_objective

  • +
  • dual_objective

  • +
  • duality_gap

  • +
  • complementarity_total

  • +
  • column_complementarity_total

  • +
  • column_complementarity_max

  • +
  • row_complementarity_total

  • +
  • row_complementarity_max

  • +
  • primal_norm_total

  • +
  • primal_norm_max

  • +
  • dual_norm_total

  • +
  • dual_norm_max

  • +
  • primal_error_total

  • +
  • primal_error_max

  • +
  • dual_error_total

  • +
  • dual_error_max

  • +
  • primal_x_bound_error_total

  • +
  • primal_x_bound_error_max

  • +
  • primal_slack_bound_error_total

  • +
  • primal_slack_bound_error_max

  • +
  • dual_pi_bound_error_total

  • +
  • dual_pi_bound_error_max

  • +
  • dual_reduced_cost_bound_error_total

  • +
  • dual_reduced_cost_bound_error_max

  • +
  • primal_normalized_error

  • +
  • dual_normalized_error

  • +
+
+

If self.quality_type is “MIP” and this instance was generated for +a specific member of the solution pool, it has the members:

+
+
    +
  • solution_name

  • +
  • num_solutions

  • +
+
+

If self.quality_type is “MIP”, this instance was not generated for +a specific member of the solution pool, and kappa statistics are +available, it has the members:

+
+
    +
  • max_kappa

  • +
  • pct_kappa_stable

  • +
  • pct_kappa_suspicious

  • +
  • pct_kappa_unstable

  • +
  • pct_kappa_illposed

  • +
  • kappa_attention

  • +
+
+

If self.quality_type is “MIP” and this instance was generated for +the incumbent solution, it has the members:

+
+
    +
  • solver

  • +
  • objective

  • +
  • x_norm_total

  • +
  • x_norm_max

  • +
  • error_Ax_b_total

  • +
  • error_Ax_b_max

  • +
  • x_bound_error_total

  • +
  • x_bound_error_max

  • +
  • integrality_error_total

  • +
  • integrality_error_max

  • +
  • slack_bound_error_total

  • +
  • slack_bound_error_max

  • +
+
+

If in addition the problem this instance was generated for has +indicator constraints, it has the members:

+
+
    +
  • indicator_slack_bound_error_total

  • +
  • indicator_slack_bound_error_max

  • +
+
+

if in addition the problem this instance was generated for has +piecewise linear constraints, it has the members:

+
+
    +
  • piecewise_linear_error_total

  • +
  • piecewise_linear_error_max

  • +
+
+

If solver is “MIQCP” this instance also has the members:

+
+
    +
  • error_xQx_dx_f_total

  • +
  • error_xQx_dx_f_max

  • +
  • quadratic_slack_bound_error_total

  • +
  • quadratic_slack_bound_error_max

  • +
+
+

See also SolutionInterface.get_quality_metrics and +SolnPoolInterface.get_quality_metrics.

+
+
+__init__(c, soln=-1)[source]
+
+ +
+
+__str__()[source]
+

Returns a string containing quality metrics in human readable form.

+
+ +
+ +
+
+class SolnPoolInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolnPoolInterface
+ + + +

Methods for accessing the solution pool.

+
+
+incumbent = -1
+

See _constants.CPX_INCUMBENT_ID

+
+ +
+
+quality_metric = <cplex._internal._subinterfaces.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+__init__(parent)[source]
+

Creates a new SolnPoolInterface.

+

The solution pool interface is exposed by the top-level Cplex +class as Cplex.solution.pool. This constructor is not meant to +be used externally.

+
+ +
+
+filter
+

See SolnPoolFilterInterface()

+
+ +
+
+get_objective_value(soln)[source]
+

Returns the objective value for a member of the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> obj_val = c.solution.pool.get_objective_value(0)
+>>> abs(obj_val - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_values(soln, *args)[source]
+

Returns the values of a set of variables for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> v1 = c.solution.pool.get_values(1, 2)
+>>> v2 = c.solution.pool.get_values(1, "x2")
+>>> somevals = c.solution.pool.get_values(1, [2, "x2"])
+>>> v1 == somevals[0], v2 == somevals[1]
+(True, True)
+>>> allvals = c.solution.pool.get_values(1)
+>>> v1 == allvals[2]
+True
+
+
+
+ +
+
+get_linear_slacks(soln, *args)[source]
+

Returns a set of linear slacks for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> s1 = c.solution.pool.get_linear_slacks(1, 1)
+>>> s2 = c.solution.pool.get_linear_slacks(1, "c2")
+>>> someslacks = c.solution.pool.get_linear_slacks(1, [1, "c2"])
+>>> s1 == someslacks[0], s2 == someslacks[1]
+(True, True)
+>>> allslacks = c.solution.pool.get_linear_slacks(1)
+>>> s1 == allslacks[1]
+True
+
+
+
+ +
+
+get_quadratic_slacks(soln, *args)[source]
+

Returns a set of quadratic slacks for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> var = c.solution.pool.get_quadratic_slacks(1, 1)
+>>> var = c.solution.pool.get_quadratic_slacks(1, "QC3")
+>>> vars = c.solution.pool.get_quadratic_slacks(1, ["QC3", 1])
+>>> vars = c.solution.pool.get_quadratic_slacks(1)
+
+
+
+ +
+
+get_integer_quality(soln, which)[source]
+

Returns the integer quality of a given solution.

+

The integer quality of a solution can either be a single attribute of +solution.pool.quality_metrics or a sequence of such +attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetsolnpoolintquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> quality_metric = c.solution.pool.quality_metric
+>>> misi = quality_metric.max_indicator_slack_infeasibility
+>>> c.solution.pool.get_integer_quality(1, misi)
+0
+
+
+
+ +
+
+get_float_quality(soln, which)[source]
+

Returns the float quality of a given solution.

+

The float quality of a solution can either be a single attribute of +solution.pool.quality_metrics or a sequence of such +attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetsolnpooldblquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> qual = c.solution.pool.get_float_quality(1,
+                         c.solution.pool.quality_metric.max_indicator_slack_infeasibility)
+>>> abs(qual) < 1.e-6
+True
+
+
+
+ +
+
+get_mean_objective_value()[source]
+

Returns the average among the objective values in the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> mov = c.solution.pool.get_mean_objective_value()
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes solutions from the solution pool.

+

There are four forms by which pool.delete may be called.

+
+
pool.delete()

deletes all solutions from the problem.

+
+
pool.delete(i)

i must be a solution name or index. Deletes the solution +whose index or name is i.

+
+
pool.delete(s)

s must be a sequence of solution names or indices. Deletes +the solutions with names or indices contained within s. +Equivalent to [pool.delete(i) for i in s].

+
+
pool.delete(begin, end)

begin and end must be solution indices or solution names. +Deletes the solutions with indices between begin and end, +inclusive of end. Equivalent to +pool.delete(range(begin, end + 1)). This will give the best +performance when deleting batches of solutions from the +solution pool.

+
+
+

See CPXdelsolnpoolsolns in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(5)
+>>> c.populate_solution_pool()
+>>> names = c.solution.pool.get_names()
+>>> c.solution.pool.delete(1)
+>>> n = c.solution.pool.get_names()
+>>> del names[1]
+>>> n == names
+True
+>>> c.solution.pool.delete(names[1])
+>>> n = c.solution.pool.get_names()
+>>> names.remove(names[1])
+>>> n == names
+True
+>>> c.solution.pool.delete([names[1], 0])
+>>> n = c.solution.pool.get_names()
+>>> names.remove(names[1])
+>>> del names[0]
+>>> n == names
+True
+>>> c.solution.pool.delete()
+>>> c.solution.pool.get_names()
+[]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of solutions.

+

There are four forms by which solution.pool.get_names may be called.

+
+
solution.pool.get_names()

return the names of all solutions from the problem.

+
+
solution.pool.get_names(i)

i must be a solution index. Returns the name of row i.

+
+
solution.pool.get_names(s)

s must be a sequence of row indices. Returns the names of +the solutions with indices the members of s. +Equivalent to [solution.pool.get_names(i) for i in s]

+
+
solution.pool.get_names(begin, end)

begin and end must be solution indices. Returns the names of +the solutions with indices between begin and end, inclusive of +end. Equivalent to +solution.pool.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(10)
+>>> c.populate_solution_pool()
+>>> names = c.solution.pool.get_names()
+>>> names[1] == c.solution.pool.get_names(1)
+True
+>>> [names[i] for i in [1,2]] == c.solution.pool.get_names([1,2])
+True
+>>> names[1:5] == c.solution.pool.get_names(1, 4)
+True
+
+
+
+ +
+
+get_num_replaced()[source]
+

Returns the number of solution pool members that have been replaced.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.get_num_replaced()
+0
+
+
+
+ +
+
+get_num()[source]
+

Returns the number of solutions in the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num = c.solution.pool.get_num()
+
+
+
+ +
+
+write(filename, which=None)[source]
+

Writes solutions to a file.

+

If no second argument is provided, all solutions are written +to file.

+

If a second argument is provided, it is the index of a +solution in the solution pool. Only that solution will be +written to file.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(10)
+>>> c.populate_solution_pool()
+>>> c.solution.pool.write("ind.sol",4)
+
+
+
+ +
+
+get_quality_metrics(soln)[source]
+

Returns an object containing measures of the quality of the +specified solution.

+

See QualityMetrics.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> qm = c.solution.pool.get_quality_metrics(0)
+
+
+
+ +
+ +
+
+class AdvancedSolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedSolutionInterface
+ + + +

Advanced methods for accessing solution information.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvcol = c.solution.advanced.binvcol()
+>>> binvrow = c.solution.advanced.binvrow()
+>>> binvacol = c.solution.advanced.binvacol()
+>>> binvarow = c.solution.advanced.binvarow()
+>>> binvcol[0][24], binvcol[1][6]
+(-0.215, 1.0)
+>>> binvrow[24][0], binvrow[6][1]
+(-0.215, 1.0)
+>>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)]
+([1.0, 0.0, 0.0], [0.0, 1.0, 0.0])
+>>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)]
+([1.0, 0.0], [0.0, 1.0], [0.0, 0.0])
+>>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num())
+>>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)]
+>>> [x if x else 0.0 for x in bbtran]
+[0.0, 2.0, 1.0]
+>>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num())
+>>> ftran[0]
+2.891
+
+
+
+
+__init__(parent)[source]
+

Creates a new AdvancedSolutionInterface.

+

The advanced solution interface is exposed by the top-level +Cplex class as Cplex.solution.advanced. This constructor is +not meant to be used externally.

+
+ +
+
+binvcol(*args)[source]
+

Returns a set of columns of the inverted basis matrix.

+

Can be called by four forms.

+
+
solution.advanced.binvcol()

returns the inverted basis matrix as a list of columns.

+
+
solution.advanced.binvcol(i)

i must be a linear constraint name or index. Returns the +column of the inverted basis matrix associated with i.

+
+
solution.advanced.binvcol(s)

s must be a sequence of linear constraint names or indices. +Returns the columns of the inverted basis matrix associated +with the members of s. Equivalent to +[solution.advanced.binvcol(i) for i in s]

+
+
solution.advanced.binvcol(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the columns of the inverted basis +matrix associated with the linear constraints between begin +and end, inclusive of end. Equivalent to +solution.advanced.binvcol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvcol = c.solution.advanced.binvcol()
+>>> binvcol[0][24], binvcol[1][6]
+(-0.215, 1.0)
+
+
+
+ +
+
+binvrow(*args)[source]
+

Returns a set of rows of the inverted basis matrix.

+

Can be called by four forms.

+
+
solution.advanced.binvrow()

returns the inverted basis matrix as a list of rows.

+
+
solution.advanced.binvrow(i)

i must be a linear constraint name or index. Returns the +row of the inverted basis matrix associated with i.

+
+
solution.advanced.binvrow(s)

s must be a sequence of linear constraint names or indices. +Returns the rows of the inverted basis matrix associated +with the members of s. Equivalent to +[solution.advanced.binvrow(i) for i in s]

+
+
solution.advanced.binvrow(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the rows of the inverted basis matrix +associated with the linear constraints between begin and end, +inclusive of end. Equivalent to +solution.advanced.binvrow(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvrow = c.solution.advanced.binvrow()
+>>> binvrow[24][0], binvrow[6][1]
+(-0.215, 1.0)
+
+
+
+ +
+
+binvacol(*args)[source]
+

Returns a set of columns of the tableau.

+

Can be called by four forms.

+
+
solution.advanced.binvacol()

returns the tableau as a list of columns.

+
+
solution.advanced.binvacol(i)

i must be a variable name or index. Returns the column of +the tableau associated with i.

+
+
solution.advanced.binvacol(s)

s must be a sequence of variable names or indices. Returns +the columns of the tableau associated with the members of s. +Equivalent to [solution.advanced.binvacol(i) for i in s]

+
+
solution.advanced.binvacol(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the tableau associated with the +variables between begin and end, inclusive of end. Equivalent +to solution.advanced.binvacol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvacol = c.solution.advanced.binvacol()
+>>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)]
+([1.0, 0.0, 0.0], [0.0, 1.0, 0.0])
+
+
+
+ +
+
+binvarow(*args)[source]
+

Returns a set of rows of the tableau.

+

Can be called by four forms.

+
+
solution.advanced.binvacol()

returns the tableau as a list of rows.

+
+
solution.advanced.binvacol(i)

i must be a linear constraint name or index. Returns the +row of the tableau associated with i.

+
+
solution.advanced.binvacol(s)

s must be a sequence of linear constraint names or indices. +Returns the rows of the tableau associated with the members +of s. Equivalent to [solution.advanced.binvacol(i) +for i in s]

+
+
solution.advanced.binvacol(begin, end)

begin and end must be linear constraint indices or variable +names. Returns the rows of the tableau associated with the +variables between begin and end, inclusive of end. Equivalent +to solution.advanced.binvacol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvarow = c.solution.advanced.binvarow()
+>>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)]
+([1.0, 0.0], [0.0, 1.0], [0.0, 0.0])
+
+
+
+ +
+
+btran(y)[source]
+

Performs a backward linear solve using the basis matrix.

+

Returns the solution to the linear system

+

x^T B = y^T

+

y must be a list of floats with length equal to the number of +linear constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num())
+>>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)]
+>>> [x if x else 0.0 for x in bbtran]
+[0.0, 2.0, 1.0]
+
+
+
+ +
+
+ftran(x)[source]
+

Performs a linear solve using the basis matrix.

+

Returns the solution to the linear system

+

B x = y

+

y must be a list of floats with length equal to the number of +linear constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num())
+>>> ftran[0]
+2.891
+
+
+
+ +
+
+get_gradients(*args)[source]
+

Returns information useful in post-solution analysis after an +LP has been solved and a basis is available.

+

See CPXgetgrad in the Callable Library Reference Manual +for more detail.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> grad = c.solution.advanced.get_gradients(1)
+>>> grad.ind[1]
+1
+>>> grad.val[1]
+1.0
+
+
+
+ +
+
+get_linear_slacks_from_x(x)[source]
+

Computes the slack values from the given solution x

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> slack = c.solution.advanced.get_linear_slacks_from_x(c.solution.get_values())
+>>> abs(slack[3]) < 1e-6
+True
+
+
+
+ +
+
+get_quadratic_slacks_from_x(x)[source]
+

Computes the slack values for quadratic constraints from the given solution x

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> qslack = c.solution.advanced.get_quadratic_slacks_from_x(c.solution.get_values())
+>>> abs(qslack[0]) < 1e-6
+True
+
+
+
+ +
+
+get_linear_reduced_costs_from_pi(pi)[source]
+

Computes the reduced costs from the given dual solution pi

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> reducedcost = c.solution.advanced.get_linear_reduced_costs_from_pi(
+                                                            c.solution.get_dual_values())
+>>> abs(reducedcost[0]) < 1e-6
+True
+
+
+
+ +
+
+get_quadratic_reduced_costs_from_pi(pi, x)[source]
+

Computes the reduced costs for QP from the given solution (pi, x)

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qp.lp")
+>>> c.solve()
+>>> qreducedcost = c.solution.advanced.get_quadratic_reduced_costs_from_pi(
+                                                            c.solution.get_dual_values(),
+                                                            c.solution.get_values())
+>>> abs(qreducedcost[0]) < 1e-6
+True
+
+
+
+ +
+
+get_Driebeek_penalties(basic_variables)[source]
+

Returns values known as Driebeek penalties for a sequence of basic variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c_stat, _ = c.solution.basis.get_basis()
+>>> b = [i for i, v in enumerate(c_stat) if v == c.solution.basis.status.basic]
+>>> penalties = c.solution.advanced.get_Driebeek_penalties(b)
+>>> penalties[0]
+(0.34477142857142856, 8.021494102228047)
+
+
+
+ +
+
+get_quadratic_indefinite_certificate()[source]
+

Compute a vector x that satisfies x’Qx < 0

+

Such a vector demonstrates that the matrix Q violates the +assumption of positive semi-definiteness, and can be an aid in +debugging a user’s program if indefiniteness is an unexpected +outcome.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qpindef.lp")
+>>> x = c.solution.advanced.get_quadratic_indefinite_certificate()
+>>> abs(-0.5547001 - x[1]) < 1e-6
+True
+
+
+
+ +
+
+dual_farkas()[source]
+

Returns Farkas proof of infeasibility for the active LP model after proven infeasibility.

+

See CPXdualfarkas in the Callable Library Reference +Manual for more detail.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.linear_constraints.add(senses="L", rhs=[-1])
+>>> indices = c.variables.add(lb=[1], ub=[2],columns=[[[0],[1]]])
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> y = c.solution.advanced.dual_farkas()
+>>> y[1]
+2.0
+
+
+
+ +
+
+get_diverging_index()[source]
+

Returns the index of the diverging row or column

+

if the problem is not unbounded, get_diverging_index returns -1.

+

If the problem is unbounded, get_diverging_index returns the +index of the diverging variable in the augmented form of the +constraint matrix. In other words, if the diverging variable +is a structural variable, get_diverging_index returns its +index; if the diverging variable is a slack or ranged +variable, get_diverging_index returns the sum of the number of +structural variables and the index of the corresponding +constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.variables.add(obj=[1,1],lb=[1,-cplex.infinity],ub=[2,cplex.infinity])
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> idx = c.solution.advanced.get_diverging_index()
+>>> idx
+1
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.variables.add(obj=[-1,-1],lb=[1,1],ub=[2,2])
+>>> indices = c.linear_constraints.add(lin_expr = [[[0,1],[-1,-1]]], rhs=[-10], senses="L")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> idx = c.solution.advanced.get_diverging_index()
+>>> idx
+2
+
+
+
+ +
+
+get_ray()[source]
+

Returns an unbounded direction, i.e., ray, if a LP model is unbounded

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("unblp.lp")
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> ray = c.solution.advanced.get_ray()
+>>> ray[0]
+-1.0
+
+
+
+ +
+ +
+
+class SolutionMethod[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionMethod
+ + + +

Solution methods.

+
+
+none = -1
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+feasopt = 11
+
+ +
+
+MIP = 12
+
+ +
+
+pivot = 10
+
+ +
+
+pivot_in = 8
+
+ +
+
+pivot_out = 9
+
+ +
+ +
+
+class SolutionStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionStatus
+ + + +

Solution status codes.

+

For documentation of each status code, see the reference manual +of the CPLEX Callable Library, especially the group +optim.cplex.callable.solutionstatus.

+
+
+unknown = 0
+
+ +
+
+optimal = 1
+
+ +
+
+unbounded = 2
+
+ +
+
+infeasible = 3
+
+ +
+
+feasible = 23
+
+ +
+
+infeasible_or_unbounded = 4
+
+ +
+
+optimal_infeasible = 5
+
+ +
+
+num_best = 6
+
+ +
+
+feasible_relaxed_sum = 14
+
+ +
+
+optimal_relaxed_sum = 15
+
+ +
+
+feasible_relaxed_inf = 16
+
+ +
+
+optimal_relaxed_inf = 17
+
+ +
+
+feasible_relaxed_quad = 18
+
+ +
+
+optimal_relaxed_quad = 19
+
+ +
+
+abort_obj_limit = 12
+
+ +
+
+abort_primal_obj_limit = 21
+
+ +
+
+abort_dual_obj_limit = 22
+
+ +
+
+first_order = 24
+
+ +
+
+abort_iteration_limit = 10
+
+ +
+
+abort_time_limit = 11
+
+ +
+
+abort_dettime_limit = 25
+
+ +
+
+abort_user = 13
+
+ +
+
+optimal_face_unbounded = 20
+
+ +
+
+conflict_feasible = 30
+
+ +
+
+conflict_minimal = 31
+
+ +
+
+conflict_abort_contradiction = 32
+
+ +
+
+conflict_abort_time_limit = 33
+
+ +
+
+conflict_abort_dettime_limit = 39
+
+ +
+
+conflict_abort_iteration_limit = 34
+
+ +
+
+conflict_abort_node_limit = 35
+
+ +
+
+conflict_abort_obj_limit = 36
+
+ +
+
+conflict_abort_memory_limit = 37
+
+ +
+
+conflict_abort_user = 38
+
+ +
+
+relaxation_unbounded = 133
+
+ +
+
+abort_relaxed = 126
+
+ +
+
+optimal_tolerance = 102
+
+ +
+
+solution_limit = 104
+
+ +
+
+populate_solution_limit = 128
+
+ +
+
+node_limit_feasible = 105
+
+ +
+
+node_limit_infeasible = 106
+
+ +
+
+fail_feasible = 109
+
+ +
+
+fail_infeasible = 110
+
+ +
+
+mem_limit_feasible = 111
+
+ +
+
+mem_limit_infeasible = 112
+
+ +
+
+fail_feasible_no_tree = 116
+
+ +
+
+fail_infeasible_no_tree = 117
+
+ +
+
+optimal_populated = 129
+
+ +
+
+optimal_populated_tolerance = 130
+
+ +
+
+benders_num_best = 41
+
+ +
+
+MIP_optimal = 101
+
+ +
+
+MIP_infeasible = 103
+
+ +
+
+MIP_time_limit_feasible = 107
+
+ +
+
+MIP_time_limit_infeasible = 108
+
+ +
+
+MIP_dettime_limit_feasible = 131
+
+ +
+
+MIP_dettime_limit_infeasible = 132
+
+ +
+
+MIP_abort_feasible = 113
+
+ +
+
+MIP_abort_infeasible = 114
+
+ +
+
+MIP_optimal_infeasible = 115
+
+ +
+
+MIP_unbounded = 118
+
+ +
+
+MIP_infeasible_or_unbounded = 119
+
+ +
+
+MIP_feasible_relaxed_sum = 120
+
+ +
+
+MIP_optimal_relaxed_sum = 121
+
+ +
+
+MIP_feasible_relaxed_inf = 122
+
+ +
+
+MIP_optimal_relaxed_inf = 123
+
+ +
+
+MIP_feasible_relaxed_quad = 124
+
+ +
+
+MIP_optimal_relaxed_quad = 125
+
+ +
+
+MIP_feasible = 127
+
+ +
+
+multiobj_optimal = 301
+
+ +
+
+multiobj_infeasible = 302
+
+ +
+
+multiobj_inforunbd = 303
+
+ +
+
+multiobj_non_optimal = 305
+
+ +
+
+multiobj_stopped = 306
+
+ +
+
+multiobj_unbounded = 304
+
+ +
+ +
+
+class SolutionType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionType
+ + + +

Solution types

+
+
+none = 0
+
+ +
+
+basic = 1
+
+ +
+
+nonbasic = 2
+
+ +
+
+primal = 3
+
+ +
+ +
+
+class SolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionInterface
+ + + +

Methods for querying the solution to an optimization problem.

+
+
+method = <cplex._internal._subinterfaces.SolutionMethod object>
+

See SolutionMethod()

+
+ +
+
+quality_metric = <cplex._internal._subinterfaces.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See SolutionStatus()

+
+ +
+
+type = <cplex._internal._subinterfaces.SolutionType object>
+

See SolutionType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new SolutionInterface.

+

The solution interface is exposed by the top-level Cplex class +as Cplex.solution. This constructor is not meant to be used +externally.

+
+ +
+
+progress
+

See ProgressInterface()

+
+ +
+
+infeasibility
+

See InfeasibilityInterface()

+
+ +
+
+MIP
+

See MIPSolutionInterface()

+
+ +
+
+basis
+

See BasisInterface()

+
+ +
+
+sensitivity
+

See SensitivityInterface()

+
+ +
+
+pool
+

See SolnPoolInterface()

+
+ +
+
+advanced
+

See AdvancedSolutionInterface()

+
+ +
+
+multiobj
+

See MultiObjSolnInterface()

+
+ +
+
+get_status()[source]
+

Returns the status of the solution.

+

Returns an attribute of Cplex.solution.status. +For interpretations of the status codes, see the +reference manual of the CPLEX Callable Library, +especially the group optim.cplex.callable.solutionstatus

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_status()
+1
+
+
+
+ +
+
+get_method()[source]
+

Returns the method used to solve the problem.

+

Returns an attribute of Cplex.solution.method.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_method()
+2
+
+
+
+ +
+
+get_status_string(status_code=None)[source]
+

Returns a string describing the status of the solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_status_string()
+'optimal'
+
+
+
+ +
+
+get_objective_value()[source]
+

Returns the value of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_objective_value()
+-202.5
+
+
+
+ +
+
+get_values(*args)[source]
+

Returns the values of a set of variables at the solution.

+

Can be called by four forms.

+
+
solution.get_values()

return the values of all variables from the problem.

+
+
solution.get_values(i)

i must be a variable name or index. Returns the value of +the variable whose index or name is i.

+
+
solution.get_values(s)

s must be a sequence of variable names or indices. Returns +the values of the variables with indices the members of s. +Equivalent to [solution.get_values(i) for i in s]

+
+
solution.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns the values of the variables with indices between begin +and end, inclusive of end. Equivalent to +solution.get_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_values([0, 4, 5])
+[25.5, 0.0, 80.0]
+
+
+
+ +
+
+get_reduced_costs(*args)[source]
+

Returns the reduced costs of a set of variables.

+

The values returned by this method are defined to be the dual +multipliers for bound constraints on the specified variables.

+

Can be called by four forms.

+
+
solution.get_reduced_costs()

return the reduced costs of all variables from the problem.

+
+
solution.get_reduced_costs(i)

i must be a variable name or index. Returns the reduced +cost of the variable whose index or name is i.

+
+
solution.get_reduced_costs(s)

s must be a sequence of variable names or indices. Returns +the reduced costs of the variables with indices the members +of s. Equivalent to [solution.get_reduced_costs(i) for i +in s]

+
+
solution.get_reduced_costs(begin, end)

begin and end must be variable indices or variable names. +Returns the reduced costs of the variables with indices between +begin and end, inclusive of end. Equivalent to +solution.get_reduced_costs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_reduced_costs([0, 4, 5])
+[0.0, 10.0, 0.0]
+
+
+
+ +
+
+get_dual_values(*args)[source]
+

Returns a set of dual values.

+

Note that the values returned by this function are not only +meaningful for linear programs. Also for second order cone +programs, they provide information about the dual solution. +Refer to the user manual to see how to use the values returned by +this function for second order cone programs.

+

Can be called by four forms.

+
+
solution.get_dual_values()

return all dual values from the problem.

+
+
solution.get_dual_values(i)

i must be a linear constraint name or index. Returns the +dual value associated with the linear constraint whose +index or name is i.

+
+
solution.get_dual_values(s)

s must be a sequence of linear constraint names or indices. +Returns the dual values associated with the linear +constraints with indices the members of s. Equivalent to +[solution.get_dual_values(i) for i in s]

+
+
solution.get_dual_values(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the dual values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_dual_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> pi = c.solution.get_dual_values([0, 1])
+>>> for i, j in zip(pi, [-0.628571, 0.0]):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+
+get_quadratic_dualslack(*args)[source]
+

Returns the dual slack for a quadratic constraint.

+

The function returns the dual slack vector of its arguments as a +SparsePair. +The function argument may be either the index or the name of a +quadratic constraint.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks.

+

Can be called by four forms.

+
+
solution.get_linear_slacks()

return all linear slack values from the problem.

+
+
solution.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
solution.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[solution.get_linear_slacks(i) for i in s]

+
+
solution.get_linear_slacks(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_linear_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> abs(c.solution.get_linear_slacks(5)) < 1e-6
+True
+
+
+
+ +
+
+get_indicator_slacks(*args)[source]
+

Returns a set of indicator slacks.

+

Can be called by four forms.

+
+
solution.get_indicator_slacks()

return all indicator slack values from the problem.

+
+
solution.get_indicator_slacks(i)

i must be a indicator constraint name or index. Returns +the slack values associated with the indicator constraint +whose index or name is i.

+
+
solution.get_indicator_slacks(s)

s must be a sequence of indicator constraint names or +indices. Returns the slack values associated with the +indicator constraints with indices the members of s. +Equivalent to [solution.get_indicator_slacks(i) for i in s]

+
+
solution.get_indicator_slacks(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the slack values associated with the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_indicator_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.get_indicator_slacks([0, 18])
+[1e+20, 0.0]
+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks.

+

Can be called by four forms.

+
+
solution.get_quadratic_slacks()

return all quadratic slack values from the problem.

+
+
solution.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
solution.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [solution.get_quadratic_slacks(i) for i in s]

+
+
solution.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> slack = c.solution.get_quadratic_slacks(0)
+>>> abs(slack) < 1e-6
+True
+
+
+
+ +
+
+get_integer_quality(which)[source]
+

Returns a measure of the quality of the solution.

+

The measure of the quality of a solution can be a single attribute of +solution.quality_metrics or a sequence of such +attributes.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> m = c.solution.quality_metric
+>>> c.solution.get_integer_quality([m.max_x, m.max_dual_infeasibility])
+[18, -1]
+
+
+
+ +
+
+get_float_quality(which)[source]
+

Returns a measure of the quality of the solution.

+

The measure of the quality of a solution can be a single attribute of +solution.quality_metrics or a sequence of such attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetdblquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> m = c.solution.quality_metric
+>>> c.solution.get_float_quality([m.max_x, m.max_dual_infeasibility])
+[500.0, 0.0]
+
+
+
+ +
+
+get_solution_type()[source]
+

Returns the type of the solution.

+

Returns an attribute of Cplex.solution.type.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_solution_type()
+1
+
+
+
+ +
+
+is_primal_feasible()[source]
+

Returns whether or not the solution is known to be primal feasible.

+
+
Note

Returning False does not necessarily mean that the problem is +not primal feasible, only that it is not proved to be primal +feasible.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.is_primal_feasible()
+True
+
+
+
+ +
+
+is_dual_feasible()[source]
+

Returns whether or not the solution is known to be dual feasible.

+
+
Note

Returning False does not necessarily mean that the problem is +not dual feasible, only that it is not proved to be dual +feasible.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.is_dual_feasible()
+True
+
+
+
+ +
+
+get_activity_levels(*args)[source]
+

Returns the activity levels for set of linear constraints.

+

Can be called by four forms.

+
+
solution.get_activity_levels()

return the activity levels for all linear constraints from +the problem.

+
+
solution.get_activity_levels(i)

i must be a linear constraint name or index. Returns the +activity levels for the linear constraint whose index or +name is i.

+
+
solution.get_activity_levels(s)

s must be a sequence of linear constraint names or indices. +Returns the activity levels for the linear constraints with +indices the members of s. Equivalent to +[solution.get_activity_levels(i) for i in s]

+
+
solution.get_activity_levels(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the activity levels for the linear +constraints with indices between begin and end, inclusive of +end. Equivalent to +solution.get_activity_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_activity_levels([2, 3, 12])
+[80.0, 0.0, 500.0]
+
+
+
+ +
+
+get_quadratic_activity_levels(*args)[source]
+

Returns the activity levels for set of quadratic constraints.

+

Can be called by four forms.

+
+
solution.get_quadratic_activity_levels()

return the activity levels for all quadratic constraints +from the problem.

+
+
solution.get_quadratic_activity_levels(i)

i must be a quadratic constraint name or index. Returns +the activity levels for the quadratic constraint whose +index or name is i.

+
+
solution.get_quadratic_activity_levels(s)

s must be a sequence of quadratic constraint names or +indices. Returns the activity levels for the quadratic +constraints with indices the members of s. Equivalent to +[solution.get_quadratic_activity_levels(i) for i in s]

+
+
solution.get_quadratic_activity_levels(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the activity levels for the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +solution.get_quadratic_activity_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> xqxax = c.solution.get_quadratic_activity_levels()
+>>> abs(xqxax[0] - 2.015616) < 1e-6
+True
+
+
+
+ +
+
+get_quality_metrics()[source]
+

Returns an object containing measures of the solution quality.

+

See QualityMetrics.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> qm = c.solution.get_quality_metrics()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the incumbent solution to a file.

+

See CPXsolwrite in the Callable Library Reference +Manual and also InitialInterface.read_start().

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.write("lpex.sol")
+
+
+
+ +
+ +
+
+class PresolveStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveStatus
+ + + +

Presolve status codes

+
+
+no_reductions = 0
+
+ +
+
+has_problem = 1
+
+ +
+
+empty_problem = 2
+
+ +
+ +
+
+class PresolveMethod[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveMethod
+ + + +

Presolve solution methods

+
+
+none = -1
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+ +
+
+class PresolveColStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveColStatus
+ + + +

Presolve variable status codes

+
+
+lower_bound = -1
+
+ +
+
+upper_bound = -2
+
+ +
+
+fixed = -3
+
+ +
+
+aggregated = -4
+
+ +
+
+other = -5
+
+ +
+ +
+
+class PresolveRowStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveRowStatus
+ + + +

Presolve linear constraint status codes

+
+
+reduced = -1
+
+ +
+
+aggregated = -2
+
+ +
+
+other = -3
+
+ +
+ +
+
+class PresolveInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveInterface
+ + + +

Methods for dealing with the presolved problem.

+
+
+status = <cplex._internal._subinterfaces.PresolveStatus object>
+

See PresolveStatus()

+
+ +
+
+method = <cplex._internal._subinterfaces.PresolveMethod object>
+

See PresolveMethod()

+
+ +
+
+col_status = <cplex._internal._subinterfaces.PresolveColStatus object>
+

See PresolveColStatus()

+
+ +
+
+row_status = <cplex._internal._subinterfaces.PresolveRowStatus object>
+

See PresolveRowStatus()

+
+ +
+
+crush_formula(formula)[source]
+

Crushes a linear formula down into the presolved space.

+

formula may either be an instance of the SparsePair class or a +sequence of length two, the first entry of which contains +variable names or indices, the second entry of which contains +the float values associated with those variables.

+

Returns a (crushed_formula, offset) pair, where +crushed_formula is a SparsePair object containing the crushed +formula in terms of the presolved variables and offset is the +value of the linear formula corresponding to variables that +have been removed in the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2))
+(SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0)
+
+
+
+ +
+
+crush_x(x)[source]
+

Projects a primal solution down to the presolved space.

+

x must be a list of floats with length equal to the number of +variables in the original problem. Returns a list of floats +with length equal to the number of variables in the presolved +problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_x([1.0] * 4)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+crush_pi(pi)[source]
+

Projects a dual solution down to the presolved space.

+

pi must be a list of floats with length equal to the number of +linear constraints in the original problem. Returns a list of +floats with length equal to the number of linear constraints +in the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_pi([1.0] * 4)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+uncrush_formula(pre_formula)[source]
+

Uncrushes a linear formula up from the presolved space.

+

formula may either be an instance of the SparsePair class or a +sequence of length two, the first entry of which contains +variable names or indices, the second entry of which contains +the float values associated with those variables.

+

Returns a (formula, offset) pair, where formula is a +SparsePair object containing the formula in terms of variables +in the original problem and offset is the value of the linear +formula corresponding to variables that have been removed in +the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2))
+(SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0)
+
+
+
+ +
+
+uncrush_x(pre_x)[source]
+

Projects a primal presolved solution up to the original space.

+

x must be a list of floats with length equal to the number of +variables in the presolved problem. Returns a list of floats +with length equal to the number of variables in the original +problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_x([1.0] * 3)
+[1.0, 1.0, 1.0, 0.0]
+
+
+
+ +
+
+uncrush_pi(pre_pi)[source]
+

Projects a dual presolved solution up to the presolved space.

+

pi must be a list of floats with length equal to the number of +linear constraints in the presolved problem. Returns a list +of floats with length equal to the number of linear +constraints in the original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_pi([1.0] * 3)
+[1.0, 1.0, 1.0, 0.0]
+
+
+
+ +
+
+free()[source]
+

Frees the presolved problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.free()
+
+
+
+ +
+
+get_status()[source]
+

Returns the status of presolve.

+

Returns an attribute of Cplex.presolve.status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_status()
+1
+
+
+
+ +
+
+get_row_status()[source]
+

Returns the status of the original linear constraints.

+

Returns a list of integers with length equal to the number of +linear constraints in the original problem. Each entry of +this list is an attribute of Cplex.presolve.row_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_row_status()
+[-3, 1, 2, -3]
+
+
+
+ +
+
+get_col_status()[source]
+

Returns the status of the original variables.

+

Returns a list of integers with length equal to the number of +variables in the original problem. Each entry of this list +is an attribute of Cplex.presolve.col_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_col_status()
+[0, 1, 2, -5]
+
+
+
+ +
+
+get_presolved_row_status()[source]
+

Returns the status of the presolved linear constraints.

+

Returns a list of integers with length equal to the number of +linear constraints in the presolved problem. -1 indicates +that the presolved linear constraint corresponds to more than +one linear constraint in the original problem. Otherwise the +value is the index of the corresponding linear constraint in +the original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_presolved_row_status()
+[-1, 1, 2]
+
+
+
+ +
+
+get_presolved_col_status()[source]
+

Returns the status of the presolved variables.

+

Returns a list of integers with length equal to the number of +variables in the presolved problem. -1 indicates that the +presolved variable corresponds to a linear combination of more +than one variable in the original problem. Otherwise the +value is the index of the corresponding variable in the +original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_presolved_col_status()
+[0, 1, 2]
+
+
+
+ +
+
+add_rows(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds linear constraints to the presolved problem.

+

presolve.add_rows accepts the keyword arguments lin_expr, +senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the types of the variables.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+

The specified constraints are added to both the original +problem and the presolved problem.

+
+ +
+
+set_objective(objective)[source]
+

Sets the linear objective function of the presolved problem.

+

objective must be either a SparsePair instance or a list of +two lists, the first of which contains variable indices or +names, the second of which contains floats.

+

The objective function of both the original problem and the +presolved problem are changed.

+
+ +
+
+presolve(method)[source]
+

Solves the presolved problem.

+

method must be an attribute of Cplex.presolve.method.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+
+
+
+ +
+
+write(filename)[source]
+

Writes the presolved problem to a file.

+
+ +
+ +
+
+class FeasoptConstraintType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.FeasoptConstraintType
+ + + +

Types of constraints

+
+
+lower_bound = 1
+
+ +
+
+upper_bound = 2
+
+ +
+
+linear = 3
+
+ +
+
+quadratic = 4
+
+ +
+
+indicator = 6
+
+ +
+ +
+
+class FeasoptInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.FeasoptInterface
+ + + +

Finds a minimal relaxation of the problem that is feasible.

+

This is a callable class. To find a feasible relaxation of a problem, +invoke the __call__ method of this class.

+
+
+constraint_type = <cplex._internal._subinterfaces.FeasoptConstraintType object>
+

See FeasoptConstraintType()

+
+ +
+
+all_constraints()[source]
+

Returns an object instructing feasopt to relax all constraints.

+

Calling Cplex.feasopt(Cplex.feasopt.all_constraints()) will +result in every constraint being relaxed independently with +equal weight.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.all_constraints()
+
+
+
+ +
+
+upper_bound_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all upper bounds.

+

If called with no arguments, every upper bound is assigned +weight 1.0.

+

If called with one or more arguments, every upper bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of upper bounds to be relaxed. If one variable index or name +is specified, it is the only upper bound that can be relaxed. +If two variable indices or names are specified, then upper +bounds of all variables between the first and the second, +inclusive, can be relaxed. If a sequence of variable names or +indices is passed in, all of their upper bounds can be +relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.upper_bound_constraints()
+
+
+
+ +
+
+lower_bound_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all lower bounds.

+

If called with no arguments, every lower bound is assigned +weight 1.0.

+

If called with one or more arguments, every lower bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of lower bounds to be relaxed. If one variable index or name +is specified, it is the only lower bound that can be relaxed. +If two variable indices or names are specified, then lower +bounds of all variables between the first and the second, +inclusive, can be relaxed. If a sequence of variable names or +indices is passed in, all of their lower bounds can be +relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.lower_bound_constraints()
+
+
+
+ +
+
+linear_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all linear constraints.

+

If called with no arguments, every linear constraint is +assigned weight 1.0.

+

If called with one or more arguments, every linear constraint +is assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of linear constraints to be relaxed. If one linear constraint +index or name is specified, it is the only linear constraint +that can be relaxed. If two linear constraint indices or +names are specified, then all linear constraints between the +first and the second, inclusive, can be relaxed. If a sequence +of linear constraint names or indices is passed in, all of their +linear constraints can be relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.linear_constraints()
+
+
+
+ +
+
+quadratic_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all quadratic constraints.

+

If called with no arguments, every quadratic constraint is +assigned weight 1.0.

+

If called with one or more arguments, every quadratic +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of quadratic constraints to be relaxed. If one quadratic +constraint index or name is specified, it is the only +quadratic constraint that can be relaxed. If two quadratic +constraint indices or names are specified, then all quadratic +constraints between the first and the second, inclusive, can be +relaxed. If a sequence of quadratic constraint names or indices +is passed in, all of their quadratic constraints can be relaxed.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.quadratic_constraints()
+
+
+
+ +
+
+indicator_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all indicator constraints.

+

If called with no arguments, every indicator constraint is +assigned weight 1.0.

+

If called with one or more arguments, every indicator +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of indicator constraints to be relaxed. If one indicator +constraint index or name is specified, it is the only +indicator constraint that can be relaxed. If two indicator +constraint indices or names are specified, then all indicator +constraints between the first and the second, inclusive, can be +relaxed. If a sequence of indicator constraint names or indices +is passed in, all of their indicator constraints can be relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.indicator_constraints()
+
+
+
+ +
+
+__call__(*args)[source]
+

Finds a minimal relaxation of the problem that is feasible.

+

This method can take arbitrarily many arguments. Either the +object returned by feasopt.all_constraints() or any combination +of constraint groups and objects returned by +upper_bound_constraints(), lower_bound_constraints(), +linear_constraints(), quadratic_constraints(), or +indicator_constraints() may be used to specify the constraints +to consider.

+

Constraint groups are sequences of length two, the first entry of +which is the preference for the group (a float), the second of +which is a sequence of pairs (type, id), where type is an +attribute of self.constraint_type and id is either an index or a +valid name for the type.

+

See CPXfeasoptext in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.feasopt(c.feasopt.all_constraints())
+>>> c.solution.get_objective_value()
+2.0
+>>> c.solution.get_values()
+[3.0, 2.0, 3.0, 2.0]
+
+
+
+ +
+ +
+
+class ConflictStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictStatus
+ + + +

Status codes returned by conflict.get

+
+
+excluded = -1
+
+ +
+
+possible_member = 0
+
+ +
+
+member = 3
+
+ +
+ +
+
+class ConflictConstraintType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictConstraintType
+ + + +

Types of constraints

+
+
+lower_bound = 1
+
+ +
+
+upper_bound = 2
+
+ +
+
+linear = 3
+
+ +
+
+quadratic = 4
+
+ +
+
+indicator = 6
+
+ +
+
+SOS = 5
+
+ +
+
+pwl = 7
+
+ +
+ +
+
+class ConflictInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictInterface
+ + + +

Methods for identifying conflicts among constraints.

+
+
+group_status = <cplex._internal._subinterfaces.ConflictStatus object>
+

See ConflictStatus()

+
+ +
+
+constraint_type = <cplex._internal._subinterfaces.ConflictConstraintType object>
+

See ConflictConstraintType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new ConflictInterface.

+

The conflict interface is exposed by the top-level Cplex class +as Cplex.conflict. This constructor is not meant to be used +externally.

+
+ +
+
+all_constraints()[source]
+

Returns an object instructing the conflict refiner to include +all constraints.

+

Calling +Cplex.conflict.refine(Cplex.conflict.all_constraints()) or +Cplex.conflict.refine_MIP_start(Cplex.conflict.all_constraints()) +will result in every constraint being included in the search +for conflicts with equal preference.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.all_constraints()
+
+
+
+ +
+
+upper_bound_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all upper bounds.

+

If called with no arguments, every upper bound is assigned +weight 1.0.

+

If called with one or more arguments, every upper bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of upper bounds to be included. If one variable index or name +is specified, it is the only upper bound that will be +included. If two variable indices or names are specified, then +upper bounds of all variables between the first and the +second, inclusive, will be included. If a sequence of +variable names or indices is passed in, all of their upper +bounds will be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.upper_bound_constraints()
+
+
+
+ +
+
+lower_bound_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all lower bounds.

+

If called with no arguments, every lower bound is assigned +weight 1.0.

+

If called with one or more arguments, every lower bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of lower bounds to be included. If one variable index or name +is specified, it is the only lower bound that will be +included. If two variable indices or names are specified, then +lower bounds of all variables between the first and the +second, inclusive, will be included. If a sequence of +variable names or indices is passed in, all of their lower +bounds will be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.lower_bound_constraints()
+
+
+
+ +
+
+linear_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all linear constraints.

+

If called with no arguments, every linear constraint is +assigned weight 1.0.

+

If called with one or more arguments, every linear constraint +is assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of linear constraints to be included. If one linear +constraint index or name is specified, it is the only linear +constraint that will be included. If two linear constraint +indices or names are specified, then all linear constraints +between the first and the second, inclusive, will be included. +If a sequence of linear constraint names or indices is passed +in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.linear_constraints()
+
+
+
+ +
+
+quadratic_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all quadratic constraints.

+

If called with no arguments, every quadratic constraint is +assigned weight 1.0.

+

If called with one or more arguments, every quadratic +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of quadratic constraints to be included. If one quadratic +constraint index or name is specified, it is the only +quadratic constraint that will be included. If two quadratic +constraint indices or names are specified, then all quadratic +constraints between the first and the second, inclusive, will +be included. If a sequence of quadratic constraint names or +indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.quadratic_constraints()
+
+
+
+ +
+
+indicator_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all indicator constraints.

+

If called with no arguments, every indicator constraint is +assigned weight 1.0.

+

If called with one or more arguments, every indicator +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of indicator constraints to be included. If one indicator +constraint index or name is specified, it is the only +indicator constraint that will be included. If two indicator +constraint indices or names are specified, the all indicator +constraints between the first and the second, inclusive, will +be included. If a sequence of indicator constraint names or +indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.indicator_constraints()
+
+
+
+ +
+
+pwl_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all PWL constraints.

+

If called with no arguments, every PWL constraint is assigned +weight 1.0.

+

If called with one or more arguments, every PWL constraint is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of PWL constraints to be included. If one PWL constraint index or +name is specified, it is the only PWL constraint that will be +included. If two PWL constraint indices or names are specified, +then all PWL constraints between the first and the second, +inclusive, will be included. If a sequence of PWL constraint +names or indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.pwl_constraints()
+
+
+
+ +
+
+SOS_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all SOS constraints.

+

If called with no arguments, every SOS constraint is assigned +weight 1.0.

+

If called with one or more arguments, every SOS constraint is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of SOS constraints to be included. If one SOS constraint +index or name is specified, it is the only SOS constraint that +will be included. If two SOS constraint indices or names are +specified, then all SOS constraints between the first and the +second, inclusive, will be included. If a sequence of SOS +constraint names or indices is passed in, they will all be +included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.SOS_constraints()
+
+
+
+ +
+
+refine_MIP_start(MIP_start, *args)[source]
+

Identifies a minimal conflict among a set of constraints for a +given MIP start.

+

This method can take arbitrarily many arguments. The first +argument must be either a name or index of a MIP start. +Additional arguments are optional and can be the object returned +by all_constraints() or any combination of constraint groups +and objects returned by upper_bound_constraints(), +lower_bound_constraints(), linear_constraints(), +quadratic_constraints(), indicator_constraints(), +pwl_constraints(), or SOS_constraints() may be used to +specify the constraints to consider. If no additional arguments +are specified, then constraint groups are created automatically +as in the CPLEX interactive.

+

Constraint groups are sequences of length two, the first entry +of which is the preference for the group (a float), the second +of which is a sequence of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index +or a valid name for the type.

+

See CPXrefinemipstartconflictext and in the Callable +Library Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> indices = c.variables.add([1], [0], [0], c.variables.type.binary)
+>>> indices = c.variables.add([2], [0], [0], c.variables.type.binary)
+>>> c.solve()
+>>> indices = c.linear_constraints.add(
+...     lin_expr=[[[0, 1], [1.0, 1.0]]], senses="E", rhs=[2.0])
+>>> c.conflict.refine_MIP_start(0, c.conflict.all_constraints())
+>>> c.conflict.get()
+[-1, -1, -1, -1, 3]
+>>> c.conflict.group_status[3], c.conflict.group_status[-1]
+('member', 'excluded')
+>>> c.conflict.get_groups(0, 3)
+[(1.0, ((2, 0),)), (1.0, ((2, 1),)), (1.0, ((1, 0),)), (1.0, ((1, 1),))]
+
+
+
+ +
+
+refine(*args)[source]
+

Identifies a minimal conflict among a set of constraints.

+

This method can take arbitrarily many arguments. Either the +object returned by all_constraints() or any combination of +constraint groups and objects returned by +upper_bound_constraints(), lower_bound_constraints(), +linear_constraints(), quadratic_constraints(), +indicator_constraints(), pwl_constraints(), or +SOS_constraints() may be used to specify the constraints to +consider. Alternatively, if no arguments are specified, then +constraint groups are created automatically as in the CPLEX +interactive.

+

Constraint groups are sequences of length two, the first entry +of which is the preference for the group (a float), the second +of which is a sequence of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index or +a valid name for the type.

+

See CPXrefineconflictext in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.linear_constraints(),
+...                   c.conflict.lower_bound_constraints())
+>>> c.conflict.get()
+[3, -1, 3, -1, -1, -1]
+>>> c.conflict.group_status[3], c.conflict.group_status[-1]
+('member', 'excluded')
+>>> c.conflict.get_groups([0, 2])
+[(1.0, ((3, 0),)), (1.0, ((1, 0),))]
+
+
+
+ +
+
+get(*args)[source]
+

Returns the status of a set of groups of constraints.

+

Can be called by four forms.

+

If called with no arguments, returns a list containing the +status of all constraint groups.

+

If called with one integer argument, returns the status of +that constraint group.

+

If called with two integer arguments, returns the status of +all constraint groups between the first and second argument, +inclusive.

+

If called with a sequence of integers as its argument, returns +the status of all constraint groups in the sequence.

+

The status codes are attributes of +Cplex.conflict.group_status.

+

See CPXgetconflictext in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> confstatus = c.conflict.get()
+
+
+
+ +
+
+get_num_groups()[source]
+

Returns the number of constraint groups used in the last call +to refine() or refine_MIP_start().

+

See CPXgetconflictnumgroups in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> c.conflict.get_num_groups()
+10
+
+
+
+ +
+
+get_groups(*args)[source]
+

Returns the groups of constraints used in the last call to +refine() or refine_MIP_start().

+

Can be called by four forms.

+

If called with no arguments, returns a list containing all +constraint groups.

+

If called with one integer argument, returns that constraint +group.

+

If called with two integer arguments, returns all constraint +groups between the first and second argument, inclusive.

+

If called with a sequence of integers as its argument, returns +all constraint groups in the sequence.

+

Constraint groups are tuples of length two, the first entry of +which is the preference for the group (a float), the second of +which is a tuple of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index +or a valid name for the type.

+

See CPXgetconflictgroups in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> groups = c.conflict.get_groups()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the conflict to a file.

+

See CPXclpwrite in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> c.conflict.write("conflict.clp")
+
+
+
+ +
+ +
+
+class PivotVarStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PivotVarStatus
+ + + +

Use as input to pivoting methods.

+
+
+at_lower_bound = 0
+
+ +
+
+at_upper_bound = 2
+
+ +
+ +
+
+class AdvancedCplexInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedCplexInterface
+ + + +

Advanced control of a Cplex object.

+
+
+no_variable = 2100000000
+

See _constants.CPX_NO_VARIABLE

+
+ +
+
+variable_status = <cplex._internal._subinterfaces.PivotVarStatus object>
+

See PivotVarStatus()

+
+ +
+
+delete_names()[source]
+

Deletes all names from the problem and its objects.

+
+ +
+
+basic_presolve()[source]
+

Performs bound strengthening and detects redundant rows.

+

Returns a tuple containing three lists: a list containing the +strengthened lower bounds, a list containing the strengthened +upper bounds, and a list containing the status of each row.

+

See CPXbasicpresolve in the Callable Library Reference +Manual.

+
+
Note

This method does not create a presolved problem.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> redlb, redub, rstat = c.advanced.basic_presolve()
+
+
+
+ +
+
+pivot(enter, leave, status)[source]
+

Pivots a variable into the basis.

+

enter is a name or index of a variable or linear constraint. +The index of a slack variable is specified by a negative +integer; -i - 1 refers to the slack associated with the ith +linear constraint. enter must not identify a basic variable.

+

leave is a name or index of a variable or linear constraint. +The index of a slack variable is specified by a negative +integer; -i - 1 refers to the slack associated with the ith +linear constraint. leave must identify either a basic +variable or a non-basic variable with both a lower and upper +bound to indicate that it is to move to its opposite bound. +leave may also be set to Cplex.advanced.no_variable to +instruct CPLEX to use a ratio test to determine the entering +variable.

+
+
Note

If a linear constraint has the same name as a column, it must +be specified by -index - 1, not by name.

+
+
+

status must be an attribute of Cplex.advanced.variable_status +specifying the nonbasic status to be assigned to the leaving +variable after the basis change.

+
+ +
+
+pivot_slacks_in(which)[source]
+

Forcibly pivots slack variables into the basis.

+

which may be either a single linear constraint index or name +or a sequence of linear constraint indices or names.

+
+ +
+
+pivot_fixed_variables_out(which)[source]
+

Forcibly pivots structural variables out of the basis.

+

which may be either a single variable index or name or a +sequence of variable indices or names.

+
+ +
+
+strong_branching(variables, it_limit)[source]
+

Performs strong branching.

+

variables is a sequence of names or indices of variables.

+

it_limit is an integer that specifies the number of iterations +allowed.

+

Returns a list of pairs (down_penalty, up_penalty) with the +same length as variables containing the penalties for +branching down or up, respectively, on each variable.

+

See CPXstrongbranch in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> itlim = c.parameters.simplex.limits.iterations.get()
+>>> c.read("example.mps")
+>>> c.solve()
+>>> vars = list(range(c.variables.get_num()))
+>>> result = c.advanced.strong_branching(vars, itlim)
+
+
+
+ +
+
+complete()[source]
+

See CPXcompletelp in the Callable Library Reference +Manual.

+
+ +
+ +
+
+class BranchDirection[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.BranchDirection
+ + + +

Constants defining branch directions

+
+
+default = 0
+
+ +
+
+down = -1
+
+ +
+
+up = 1
+
+ +
+ +
+
+class OrderInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.OrderInterface
+ + + +

Methods for setting and querying a priority order for branching.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(5)])
+>>> c.variables.set_types(zip(list(range(5)), ["C","I","I","I","I"]))
+>>> c.order.set([(1, 10, c.order.branch_direction.up), ('3', 5, c.order.branch_direction.down)])
+>>> c.order.get()
+[(1, 10, 1), (3, 5, -1)]
+>>> c.order.get_variables()
+[1, 3]
+
+
+
+
+branch_direction = <cplex._internal._subinterfaces.BranchDirection object>
+

See BranchDirection()

+
+ +
+
+get()[source]
+

Returns a list of triples (variable, priority, direction) +representing the priority order for branching.

+
+ +
+
+get_variables()[source]
+

Returns the variables for which an order has been set.

+
+ +
+
+set(order)[source]
+

Sets the priority order for branching.

+

order must be a list of triples (variable, priority, direction).

+

variable must be an index or name of a variable.

+

priority must be a nonnegative integer.

+

direction must be an attribute of order.branch_direction.

+
+ +
+
+read(filename)[source]
+

Reads a priority order from a file.

+
+ +
+
+write(filename)[source]
+

Writes the priority order to a file.

+
+ +
+ +
+
+class InitialInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.InitialInterface
+ + + +

Methods to set starting information for an optimization algorithm +to solve continuous problems (LP, QP, QCP).

+
+
Note

Data passed to these methods cannot be queried immediately from +the methods in Cplex.solution. Those methods will return +data only after Cplex.solve() or Cplex.feasopt() has been called.

+
+
+
+
+status = <cplex._internal._subinterfaces.BasisVarStatus object>
+

See BasisVarStatus()

+
+ +
+
+set_start(col_status, row_status, col_primal, row_primal, col_dual, row_dual)[source]
+

Sets basis statuses, primal values, and dual values.

+

The arguments col_status, col_primal, and col_dual are lists +that either have length equal to the number of variables or +are empty. If col_status is empty, then row_status must also +be empty. If col_primal is empty, then row_primal must also +be empty.

+

The arguments row_status, row_primal, and row_dual are lists +that either have length equal to the number of linear +constraints or are empty. If row_status is empty, the +col_status must also be empty. If row_dual is empty, then +col_dual must also be empty.

+

Each entry of col_status and row_status must be an attribute of +Cplex.start.status.

+

Each entry of col_primal and row_primal must be a float +specifying the starting primal values for the columns and +rows, respectively.

+

Each entry of col_dual and row_dual must be a float +specifying the starting dual values for the columns and rows, +respectively.

+
+
Note

The starting information is ignored by the optimizers if the +parameter cplex.parameters.advance is set to +cplex.parameters.advance.values.none.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=["v{0}".format(i) for i in range(5)]
+... )
+>>> indices = c.linear_constraints.add(
+...     names=["r{0}".format(i) for i in range(3)]
+... )
+>>> s = c.start.status
+>>> c.start.set_start(
+...     [s.basic] * 3 + [s.at_lower_bound] * 2,
+...     [s.basic] + [s.at_upper_bound] * 2,
+...     [0.0] * 5,
+...     [1.0] * 3,
+...     [2.0] * 5,
+...     [3.0] * 3
+... )
+
+
+
+ +
+
+read_start(filename)[source]
+

Reads the starting information from a file.

+

See CPXreadcopystartinfo in the Callable Library +Reference Manual and also SolutionInterface.write().

+

Example usage:

+
>>> import cplex
+>>> c1 = cplex.Cplex()
+>>> out = c1.set_results_stream(None)
+>>> out = c1.set_log_stream(None)
+>>> c1.read("lpex.mps")
+>>> c1.solve()
+>>> c1.solution.write("lpex.sol")
+>>> c2 = cplex.Cplex()
+>>> out = c2.set_results_stream(None)
+>>> out = c2.set_log_stream(None)
+>>> c2.read("lpex.mps")
+>>> c2.start.read_start("lpex.sol")
+
+
+
+ +
+
+read_basis(filename)[source]
+

Reads the starting basis from a file.

+

See CPXreadcopybase in the Callable Library Reference +Manual and also BasisInterface.write().

+

Example:

+
>>> import cplex
+>>> c1 = cplex.Cplex()
+>>> out = c1.set_results_stream(None)
+>>> out = c1.set_log_stream(None)
+>>> c1.read("lpex.mps")
+>>> c1.solve()
+>>> c1.solution.basis.write("lpex.bas")
+>>> c2 = cplex.Cplex()
+>>> out = c2.set_results_stream(None)
+>>> out = c2.set_log_stream(None)
+>>> c2.read("lpex.mps")
+>>> c2.start.read_basis("lpex.bas")
+
+
+
+ +
+ +
+
+

cplex._internal._baseinterface module

+

Base-interface of the CPLEX API

+
+
+class BaseInterface[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._baseinterface.BaseInterface
+ + +

Common methods for sub-interfaces.

+
+
+__init__(cplex, advanced=False, getindexfunc=None)[source]
+

Creates a new BaseInterface.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+get_indices(name)[source]
+

Converts from names to indices.

+

If name is a string, get_indices returns the index of the +object with that name. If no such object exists, an +exception is raised.

+

If name is a sequence of strings, get_indices returns a list +of the indices corresponding to the strings in name. +Equivalent to map(self.get_indices, name).

+

If the subclass does not provide an index function (i.e., the +interface is not indexed), then a NotImplementedError is raised.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["a", "b"])
+>>> c.variables.get_indices("a")
+0
+>>> c.variables.get_indices(["a", "b"])
+[0, 1]
+
+
+
+ +
+ +
+
+

cplex._internal._procedural module

+

Wrapper functions for the CPLEX C Callable Library

+
+
+getstatstring(env, statind)[source]
+
+ +
+
+geterrorstring(env, errcode)[source]
+
+ +
+
+cb_geterrorstring(env, status)[source]
+
+ +
+
+new_native_int()[source]
+
+ +
+
+delete_native_int(p)[source]
+
+ +
+
+set_native_int(p, v)[source]
+
+ +
+
+get_native_int(p)[source]
+
+ +
+
+setterminate(env, env_lp_ptr, p)[source]
+
+ +
+
+class SigIntHandler[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._procedural.SigIntHandler
+ + +

Handle Ctrl-C events during long running processes.

+

:undocumented

+
+
+__init__()[source]
+
+ +
+ +
+
+pack_env_lp_ptr(env, lp)[source]
+
+ +
+
+chbmatrix(lolmat, env_lp_ptr, r_c)[source]
+

See matrix_conversion.c:Pylolmat_to_CHBmat().

+
+ +
+
+Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c)[source]
+
+ +
+
+free_CHBmat(lolmat)[source]
+
+ +
+
+class StatusChecker[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._procedural.StatusChecker
+ + +

A callable object used for checking status codes.

+

:undocumented

+
+
+__init__()[source]
+
+ +
+ +
+
+set_status_checker()[source]
+
+ +
+
+version(env)[source]
+
+ +
+
+versionnumber(env)[source]
+
+ +
+
+openCPLEX()[source]
+
+ +
+
+closeCPLEX(env)[source]
+
+ +
+
+getchannels(env)[source]
+
+ +
+
+addfuncdest(env, channel, fileobj)[source]
+
+ +
+
+delfuncdest(env, channel, fileobj)[source]
+
+ +
+
+setlpcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setnetcallbackfunc(env, cbhandle)[source]
+
+ +
+
+settuningcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setheuristiccallbackfunc(env, cbhandle)[source]
+
+ +
+
+setlazyconstraintcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setusercutcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setincumbentcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setnodecallbackfunc(env, cbhandle)[source]
+
+ +
+
+setbranchcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setbranchnosolncallbackfunc(env, cbhandle)[source]
+
+ +
+
+setsolvecallbackfunc(env, cbhandle)[source]
+
+ +
+
+setinfocallbackfunc(env, cbhandle)[source]
+
+ +
+
+setmipcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setdefaults(env)[source]
+
+ +
+
+setintparam(env, whichparam, newvalue)[source]
+
+ +
+
+setlongparam(env, whichparam, newvalue)[source]
+
+ +
+
+setdblparam(env, whichparam, newvalue)[source]
+
+ +
+
+setstrparam(env, whichparam, newvalue)[source]
+
+ +
+
+getintparam(env, whichparam)[source]
+
+ +
+
+getlongparam(env, whichparam)[source]
+
+ +
+
+getdblparam(env, whichparam)[source]
+
+ +
+
+getstrparam(env, whichparam)[source]
+
+ +
+
+infointparam(env, whichparam)[source]
+
+ +
+
+infolongparam(env, whichparam)[source]
+
+ +
+
+infodblparam(env, whichparam)[source]
+
+ +
+
+infostrparam(env, whichparam)[source]
+
+ +
+
+getparamtype(env, param_name)[source]
+
+ +
+
+readcopyparam(env, filename)[source]
+
+ +
+
+writeparam(env, filename)[source]
+
+ +
+
+tuneparam(env, lp, int_param_values, dbl_param_values, str_param_values)[source]
+
+ +
+
+tuneparamprobset(env, filenames, filetypes, int_param_values, dbl_param_values, str_param_values)[source]
+
+ +
+
+fixparam(env, paramnum)[source]
+
+ +
+
+paramsetadd(env, ps, whichparam, newvalue, paramtype=None)[source]
+
+ +
+
+paramsetadddbl(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddint(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddlong(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddstr(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetapply(env, ps)[source]
+
+ +
+
+paramsetcopy(env, targetps, sourceps)[source]
+
+ +
+
+paramsetcreate(env)[source]
+
+ +
+
+paramsetdel(env, ps, whichparam)[source]
+
+ +
+
+paramsetfree(env, ps)[source]
+
+ +
+
+paramsetget(env, ps, whichparam, paramtype=None)[source]
+
+ +
+
+paramsetgetdbl(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetint(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetlong(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetstr(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetids(env, ps)[source]
+
+ +
+
+paramsetreadcopy(env, ps, filename)[source]
+
+ +
+
+paramsetwrite(env, ps, filename)[source]
+
+ +
+
+paramsetgetnum(env, ps)[source]
+
+ +
+
+runseeds(env, lp, cnt)[source]
+
+ +
+
+createprob(env, probname)[source]
+
+ +
+
+readcopyprob(env, lp, filename, filetype='')[source]
+
+ +
+
+cloneprob(env, lp)[source]
+
+ +
+
+freeprob(env, lp)[source]
+
+ +
+
+mipopt(env, lp)[source]
+
+ +
+
+qpopt(env, lp)[source]
+
+ +
+
+baropt(env, lp)[source]
+
+ +
+
+hybbaropt(env, lp, method)[source]
+
+ +
+
+hybnetopt(env, lp, method)[source]
+
+ +
+
+lpopt(env, lp)[source]
+
+ +
+
+primopt(env, lp)[source]
+
+ +
+
+dualopt(env, lp)[source]
+
+ +
+
+siftopt(env, lp)[source]
+
+ +
+
+feasoptext(env, lp, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+delnames(env, lp)[source]
+
+ +
+
+writeprob(env, lp, filename, filetype='')[source]
+
+ +
+
+writeprobdev(env, lp, stream, filename, filetype)[source]
+
+ +
+
+embwrite(env, lp, filename)[source]
+
+ +
+
+dperwrite(env, lp, filename, epsilon)[source]
+
+ +
+
+pperwrite(env, lp, filename, epsilon)[source]
+
+ +
+
+preslvwrite(env, lp, filename)[source]
+
+ +
+
+dualwrite(env, lp, filename)[source]
+
+ +
+
+chgprobtype(env, lp, probtype)[source]
+
+ +
+
+chgprobtypesolnpool(env, lp, probtype, soln)[source]
+
+ +
+
+getprobtype(env, lp)[source]
+
+ +
+
+chgprobname(env, lp, probname)[source]
+
+ +
+
+getprobname(env, lp)[source]
+
+ +
+
+getnumcols(env, lp)[source]
+
+ +
+
+getnumint(env, lp)[source]
+
+ +
+
+getnumbin(env, lp)[source]
+
+ +
+
+getnumsemicont(env, lp)[source]
+
+ +
+
+getnumsemiint(env, lp)[source]
+
+ +
+
+getnumrows(env, lp)[source]
+
+ +
+
+populate(env, lp)[source]
+
+ +
+
+getnumqconstrs(env, lp)[source]
+
+ +
+
+getnumindconstrs(env, lp)[source]
+
+ +
+
+getnumsos(env, lp)[source]
+
+ +
+
+cleanup(env, lp, eps)[source]
+
+ +
+
+basicpresolve(env, lp)[source]
+
+ +
+
+pivotin(env, lp, rlist)[source]
+
+ +
+
+pivotout(env, lp, clist)[source]
+
+ +
+
+pivot(env, lp, jenter, jleave, leavestat)[source]
+
+ +
+
+strongbranch(env, lp, goodlist, itlim)[source]
+
+ +
+
+completelp(env, lp)[source]
+
+ +
+
+fast_getrows(env, lp)[source]
+
+ +
+
+fast_getcolname(env, lp, begin, end)[source]
+
+ +
+
+fast_getrowname(env, lp, begin, end)[source]
+
+ +
+
+fast_getsosname(env, lp, begin, end)[source]
+
+ +
+
+fast_getmipstartname(env, lp, begin, end)[source]
+
+ +
+
+fast_getobj(env, lp, begin, end)[source]
+
+ +
+
+fast_multiobjgetobj(env, lp, objidx, begin, end)[source]
+
+ +
+
+fast_multiobjgetoffset(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetweight(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetpriority(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetabstol(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetreltol(env, lp, objidx)[source]
+
+ +
+
+fast_newcols(env, lp, nb, lb, ub, xctype)[source]
+
+ +
+
+has_name(env, lp, start, end)[source]
+
+ +
+
+has_non_default_lb(env, lp, start, end)[source]
+
+ +
+
+has_non_default_ub(env, lp, start, end)[source]
+
+ +
+
+newcols(env, lp, obj, lb, ub, xctype, colname)[source]
+
+ +
+
+addcols(env, lp, ccnt, nzcnt, obj, cmat, lb, ub, colname)[source]
+
+ +
+
+delcols(env, lp, begin, end)[source]
+
+ +
+
+chgbds(env, lp, indices, lu, bd)[source]
+
+ +
+
+chgcolname(env, lp, indices, newnames)[source]
+
+ +
+
+chgctype(env, lp, indices, xctype)[source]
+
+ +
+
+getcolindex(env, lp, colname)[source]
+
+ +
+
+getcolname(env, lp, begin, end)[source]
+
+ +
+
+getctype(env, lp, begin, end)[source]
+
+ +
+
+getlb(env, lp, begin, end)[source]
+
+ +
+
+getub(env, lp, begin, end)[source]
+
+ +
+
+getcols(env, lp, begin, end)[source]
+
+ +
+
+copyprotected(env, lp, indices)[source]
+
+ +
+
+getprotected(env, lp)[source]
+
+ +
+
+tightenbds(env, lp, indices, lu, bd)[source]
+
+ +
+
+newrows(env, lp, rhs, sense, rngval, rowname)[source]
+
+ +
+
+addrows(env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmat, colname, rowname)[source]
+
+ +
+
+delrows(env, lp, begin, end)[source]
+
+ +
+
+chgrowname(env, lp, indices, newnames)[source]
+
+ +
+
+chgcoeflist(env, lp, rowlist, collist, vallist)[source]
+
+ +
+
+chgrhs(env, lp, indices, values)[source]
+
+ +
+
+chgrngval(env, lp, indices, values)[source]
+
+ +
+
+chgsense(env, lp, indices, senses)[source]
+
+ +
+
+getrhs(env, lp, begin, end)[source]
+
+ +
+
+getsense(env, lp, begin, end)[source]
+
+ +
+
+getrngval(env, lp, begin, end)[source]
+
+ +
+
+getrowname(env, lp, begin, end)[source]
+
+ +
+
+getcoef(env, lp, i, j)[source]
+
+ +
+
+getrowindex(env, lp, rowname)[source]
+
+ +
+
+getrows(env, lp, begin, end)[source]
+
+ +
+
+getnumnz(env, lp)[source]
+
+ +
+
+addlazyconstraints(env, lp, rhs, sense, lin_expr, names)[source]
+
+ +
+
+addusercuts(env, lp, rhs, sense, lin_expr, names)[source]
+
+ +
+
+freelazyconstraints(env, lp)[source]
+
+ +
+
+freeusercuts(env, lp)[source]
+
+ +
+
+copylpwnames(env, lp, numcols, numrows, objsense, obj, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval, colname, rowname)[source]
+
+ +
+
+addsos(env, lp, sostype, sosbeg, sosind, soswt, sosnames)[source]
+
+ +
+
+delsos(env, lp, begin, end)[source]
+
+ +
+
+getsos_info(env, lp, begin, end)[source]
+
+ +
+
+getsos(env, lp, begin, end)[source]
+
+ +
+
+getsosindex(env, lp, name)[source]
+
+ +
+
+getsosname(env, lp, begin, end)[source]
+
+ +
+
+addindconstr(env, lp, indcnt, indvar, complemented, rhs, sense, linmat, indtype, name, nzcnt)[source]
+
+ +
+
+getindconstr(env, lp, begin, end)[source]
+
+ +
+
+getindconstr_constant(env, lp, begin, end)[source]
+
+ +
+
+getindconstrindex(env, lp, name)[source]
+
+ +
+
+delindconstrs(env, lp, begin, end)[source]
+
+ +
+
+getindconstrslack(env, lp, begin, end)[source]
+
+ +
+
+getindconstrname(env, lp, which)[source]
+
+ +
+
+addqconstr(env, lp, rhs, sense, linind, linval, quadrow, quadcol, quadval, name)[source]
+
+ +
+
+getqconstr_info(env, lp, which)[source]
+
+ +
+
+getqconstr_lin(env, lp, which)[source]
+
+ +
+
+getqconstr_quad(env, lp, which)[source]
+
+ +
+
+delqconstrs(env, lp, begin, end)[source]
+
+ +
+
+getqconstrindex(env, lp, name)[source]
+
+ +
+
+getqconstrslack(env, lp, begin, end)[source]
+
+ +
+
+getqconstrname(env, lp, which)[source]
+
+ +
+
+newlonganno(env, lp, name, defval)[source]
+
+ +
+
+newdblanno(env, lp, name, defval)[source]
+
+ +
+
+dellonganno(env, lp, begin, end)[source]
+
+ +
+
+deldblanno(env, lp, begin, end)[source]
+
+ +
+
+getlongannoindex(env, lp, name)[source]
+
+ +
+
+getdblannoindex(env, lp, name)[source]
+
+ +
+
+getlongannoname(env, lp, idx)[source]
+
+ +
+
+getdblannoname(env, lp, idx)[source]
+
+ +
+
+getnumlonganno(env, lp)[source]
+
+ +
+
+getnumdblanno(env, lp)[source]
+
+ +
+
+getlongannodefval(env, lp, idx)[source]
+
+ +
+
+getdblannodefval(env, lp, idx)[source]
+
+ +
+
+setlonganno(env, lp, idx, objtype, ind, val)[source]
+
+ +
+
+setdblanno(env, lp, idx, objtype, ind, val)[source]
+
+ +
+
+getlonganno(env, lp, idx, objtype, begin, end)[source]
+
+ +
+
+getdblanno(env, lp, idx, objtype, begin, end)[source]
+
+ +
+
+readcopyanno(env, lp, filename)[source]
+
+ +
+
+writeanno(env, lp, filename)[source]
+
+ +
+
+writebendersanno(env, lp, filename)[source]
+
+ +
+
+addpwl(env, lp, vary, varx, preslope, postslope, nbreaks, breakx, breaky, name)[source]
+
+ +
+
+delpwl(env, lp, begin, end)[source]
+
+ +
+
+getnumpwl(env, lp)[source]
+
+ +
+
+getpwl(env, lp, idx)[source]
+
+ +
+
+getpwlindex(env, lp, name)[source]
+
+ +
+
+getpwlname(env, lp, idx)[source]
+
+ +
+
+copyobjname(env, lp, objname)[source]
+
+ +
+
+chgobj(env, lp, indices, values)[source]
+
+ +
+
+chgobjsen(env, lp, maxormin)[source]
+
+ +
+
+getobjsen(env, lp)[source]
+
+ +
+
+getobjoffset(env, lp)[source]
+
+ +
+
+chgobjoffset(env, lp, offset)[source]
+
+ +
+
+getobj(env, lp, begin, end)[source]
+
+ +
+
+getobjname(env, lp)[source]
+
+ +
+
+copyquad(env, lp, qmatbeg, qmatind, qmatval)[source]
+
+ +
+
+copyqpsep(env, lp, qsepvec)[source]
+
+ +
+
+chgqpcoef(env, lp, row, col, value)[source]
+
+ +
+
+getquad(env, lp, begin, end)[source]
+
+ +
+
+getqpcoef(env, lp, row, col)[source]
+
+ +
+
+getnumquad(env, lp)[source]
+
+ +
+
+getnumqpnz(env, lp)[source]
+
+ +
+
+getnumobjs(env, lp)[source]
+
+ +
+
+multiobjchgattribs(env, lp, objidx, offset=nan, weight=nan, priority=-1, abstol=nan, reltol=nan, name=None)[source]
+
+ +
+
+multiobjgetindex(env, lp, name)[source]
+
+ +
+
+multiobjgetname(env, lp, objidx)[source]
+
+ +
+
+multiobjgetobj(env, lp, objidx, begin, end)[source]
+
+ +
+
+multiobjsetobj(env, lp, objidx, objind, objval, offset=nan, weight=nan, priority=-1, abstol=nan, reltol=nan, objname=None)[source]
+
+ +
+
+setnumobjs(env, lp, n)[source]
+
+ +
+
+multiobjopt(env, lp, paramsets)[source]
+
+ +
+
+multiobjgetobjval(env, lp, objidx)[source]
+
+ +
+
+multiobjgetobjvalbypriority(env, lp, priority)[source]
+
+ +
+
+multiobjgetdblinfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetintinfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetlonginfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetnumsolves(env, lp)[source]
+
+ +
+
+getnumprios(env, lp)[source]
+
+ +
+
+ismultiobj(env, lp)[source]
+
+ +
+
+solninfo(env, lp)[source]
+
+ +
+
+getstat(env, lp)[source]
+
+ +
+
+getmethod(env, lp)[source]
+
+ +
+
+getobjval(env, lp)[source]
+
+ +
+
+getx(env, lp, begin, end)[source]
+
+ +
+
+getnumcores(env)[source]
+
+ +
+
+getax(env, lp, begin, end)[source]
+
+ +
+
+getxqxax(env, lp, begin, end)[source]
+
+ +
+
+getpi(env, lp, begin, end)[source]
+
+ +
+
+getslack(env, lp, begin, end)[source]
+
+ +
+
+getdj(env, lp, begin, end)[source]
+
+ +
+
+getqconstrdslack(env, lp, qind)[source]
+
+ +
+
+getrowinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getcolinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getqconstrinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getindconstrinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getsosinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getbase(env, lp)[source]
+
+ +
+
+getbhead(env, lp)[source]
+
+ +
+
+mbasewrite(env, lp, filename)[source]
+
+ +
+
+getijrow(env, lp, idx, is_row_index)[source]
+
+ +
+
+getpnorms(env, lp)[source]
+
+ +
+
+getdnorms(env, lp)[source]
+
+ +
+
+getbasednorms(env, lp)[source]
+
+ +
+
+getpsbcnt(env, lp)[source]
+
+ +
+
+getdsbcnt(env, lp)[source]
+
+ +
+
+getdblquality(env, lp, what)[source]
+
+ +
+
+getintquality(env, lp, what)[source]
+
+ +
+
+boundsa_lower(env, lp, begin, end)[source]
+
+ +
+
+boundsa_upper(env, lp, begin, end)[source]
+
+ +
+
+boundsa(env, lp, begin, end)[source]
+
+ +
+
+objsa(env, lp, begin, end)[source]
+
+ +
+
+rhssa(env, lp, begin, end)[source]
+
+ +
+
+refinemipstartconflictext(env, lp, mipstartindex, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+refineconflictext(env, lp, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+getconflictext(env, lp, begin, end)[source]
+
+ +
+
+getconflictnumgroups(env, lp)[source]
+
+ +
+
+getconflictgroups(env, lp, begin, end)[source]
+
+ +
+
+getconflictnumpasses(env, lp)[source]
+
+ +
+
+clpwrite(env, lp, filename)[source]
+
+ +
+
+solwrite(env, lp, filename)[source]
+
+ +
+
+binvcol(env, lp, j)[source]
+
+ +
+
+binvrow(env, lp, i)[source]
+
+ +
+
+binvacol(env, lp, j)[source]
+
+ +
+
+binvarow(env, lp, i)[source]
+
+ +
+
+ftran(env, lp, x)[source]
+
+ +
+
+btran(env, lp, y)[source]
+
+ +
+
+getgrad(env, lp, j)[source]
+
+ +
+
+slackfromx(env, lp, x)[source]
+
+ +
+
+qconstrslackfromx(env, lp, x)[source]
+
+ +
+
+djfrompi(env, lp, pi)[source]
+
+ +
+
+qpdjfrompi(env, lp, pi, x)[source]
+
+ +
+
+mdleave(env, lp, goodlist)[source]
+
+ +
+
+qpindefcertificate(env, lp)[source]
+
+ +
+
+dualfarkas(env, lp)[source]
+
+ +
+
+getijdiv(env, lp)[source]
+
+ +
+
+getray(env, lp)[source]
+
+ +
+
+presolve(env, lp, method)[source]
+
+ +
+
+freepresolve(env, lp)[source]
+
+ +
+
+crushx(env, lp, x)[source]
+
+ +
+
+uncrushx(env, lp, prex)[source]
+
+ +
+
+crushpi(env, lp, pi)[source]
+
+ +
+
+uncrushpi(env, lp, prepi)[source]
+
+ +
+
+crushform(env, lp, ind, val)[source]
+
+ +
+
+uncrushform(env, lp, pind, pval)[source]
+
+ +
+
+getprestat_status(env, lp)[source]
+
+ +
+
+getprestat_r(env, lp)[source]
+
+ +
+
+getprestat_c(env, lp)[source]
+
+ +
+
+getprestat_or(env, lp)[source]
+
+ +
+
+getprestat_oc(env, lp)[source]
+
+ +
+
+prechgobj(env, lp, ind, val)[source]
+
+ +
+
+preaddrows(env, lp, rhs, sense, rmatbeg, rmatind, rmatval, names)[source]
+
+ +
+
+getnummipstarts(env, lp)[source]
+
+ +
+
+chgmipstarts(env, lp, mipstartindices, beg, varindices, values, effortlevel)[source]
+
+ +
+
+addmipstarts(env, lp, beg, varindices, values, effortlevel, mipstartname)[source]
+
+ +
+
+delmipstarts(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts_size(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts_effort(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts(env, lp, begin, end)[source]
+
+ +
+
+getmipstartname(env, lp, begin, end)[source]
+
+ +
+
+getmipstartindex(env, lp, mipstartname)[source]
+
+ +
+
+readcopymipstarts(env, lp, filename)[source]
+
+ +
+
+writemipstarts(env, lp, filename, begin, end)[source]
+
+ +
+
+getitcnt(env, lp)[source]
+
+ +
+
+getphase1cnt(env, lp)[source]
+
+ +
+
+getsiftitcnt(env, lp)[source]
+
+ +
+
+getsiftphase1cnt(env, lp)[source]
+
+ +
+
+getbaritcnt(env, lp)[source]
+
+ +
+
+getcrossppushcnt(env, lp)[source]
+
+ +
+
+getcrosspexchcnt(env, lp)[source]
+
+ +
+
+getcrossdpushcnt(env, lp)[source]
+
+ +
+
+getcrossdexchcnt(env, lp)[source]
+
+ +
+
+getmipitcnt(env, lp)[source]
+
+ +
+
+getnodecnt(env, lp)[source]
+
+ +
+
+getnodeleftcnt(env, lp)[source]
+
+ +
+
+getbestobjval(env, lp)[source]
+
+ +
+
+getcutoff(env, lp)[source]
+
+ +
+
+getmiprelgap(env, lp)[source]
+
+ +
+
+getnumcuts(env, lp, cuttype)[source]
+
+ +
+
+getnodeint(env, lp)[source]
+
+ +
+
+getsubstat(env, lp)[source]
+
+ +
+
+get_wherefrom(cbstruct)[source]
+
+ +
+
+gettime(env)[source]
+
+ +
+
+getdettime(env)[source]
+
+ +
+
+getcallbackincumbent(cbstruct, begin, end)[source]
+
+ +
+
+getcallbackpseudocosts(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeintfeas(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodelb(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeub(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeobjval(cbstruct)[source]
+
+ +
+
+getcallbacknodex(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeinfo(cbstruct, node, which)[source]
+
+ +
+
+callbacksetuserhandle(cbstruct, userhandle)[source]
+
+ +
+
+callbacksetnodeuserhandle(cbstruct, nodeindex, userhandle)[source]
+
+ +
+
+getcallbackseqinfo(cbstruct, node, which)[source]
+
+ +
+
+getcallbacksosinfo(cbstruct, sosindex, member, which)[source]
+
+ +
+
+cutcallbackadd(cbstruct, rhs, sense, ind, val, purgeable)[source]
+
+ +
+
+cutcallbackaddlocal(cbstruct, rhs, sense, ind, val)[source]
+
+ +
+
+branchcallbackbranchgeneral(cbstruct, ind, lu, bd, rhs, sense, matbeg, matind, matval, nodeest, userhandle)[source]
+
+ +
+
+branchcallbackbranchasCPLEX(cbstruct, n, userhandle)[source]
+
+ +
+
+setpydel(env)[source]
+
+ +
+
+delpydel(env)[source]
+
+ +
+
+addsolnpooldivfilter(env, lp, lb, ub, ind, wts, ref, name)[source]
+
+ +
+
+addsolnpoolrngfilter(env, lp, lb, ub, ind, val, name)[source]
+
+ +
+
+getsolnpooldivfilter_constant(env, lp, which)[source]
+
+ +
+
+getsolnpooldivfilter(env, lp, which)[source]
+
+ +
+
+getsolnpoolrngfilter_constant(env, lp, which)[source]
+
+ +
+
+getsolnpoolrngfilter(env, lp, which)[source]
+
+ +
+
+delsolnpoolfilters(env, lp, begin, end)[source]
+
+ +
+
+getsolnpoolfiltername(env, lp, which)[source]
+
+ +
+
+getsolnpoolnumfilters(env, lp)[source]
+
+ +
+
+fltwrite(env, lp, filename)[source]
+
+ +
+
+readcopysolnpoolfilters(env, lp, filename)[source]
+
+ +
+
+getsolnpoolfilterindex(env, lp, colname)[source]
+
+ +
+
+getsolnpoolfiltertype(env, lp, index)[source]
+
+ +
+
+delsolnpoolsolns(env, lp, begin, end)[source]
+
+ +
+
+getsolnpoolnumsolns(env, lp)[source]
+
+ +
+
+getsolnpoolnumreplaced(env, lp)[source]
+
+ +
+
+getsolnpoolsolnindex(env, lp, colname)[source]
+
+ +
+
+getsolnpoolmeanobjval(env, lp)[source]
+
+ +
+
+getsolnpoolsolnname(env, lp, which)[source]
+
+ +
+
+solwritesolnpool(env, lp, soln, filename)[source]
+
+ +
+
+solwritesolnpoolall(env, lp, filename)[source]
+
+ +
+
+getsolnpoolobjval(env, lp, soln)[source]
+
+ +
+
+getsolnpoolx(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolslack(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolqconstrslack(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolintquality(env, lp, soln, what)[source]
+
+ +
+
+getsolnpooldblquality(env, lp, soln, what)[source]
+
+ +
+
+copystart(env, lp, cstat, rstat, cprim, rprim, cdual, rdual)[source]
+
+ +
+
+readcopybase(env, lp, filename)[source]
+
+ +
+
+getorder(env, lp)[source]
+
+ +
+
+copyorder(env, lp, indices, priority, direction)[source]
+
+ +
+
+readcopyorder(env, lp, filename)[source]
+
+ +
+
+ordwrite(env, lp, filename)[source]
+
+ +
+
+readcopystartinfo(env, lp, filename)[source]
+
+ +
+
+initlock()[source]
+
+ +
+
+finitlock(lock)[source]
+
+ +
+
+getprobstats(env, lp)[source]
+
+ +
+
+gethist(env, lp, key)[source]
+
+ +
+
+getqualitymetrics(env, lp, soln)[source]
+
+ +
+
+showquality(env, lp, soln)[source]
+
+ +
+
+setgenericcallbackfunc(env, lp, contextmask, cbhandle)[source]
+
+ +
+
+callbackgetinfoint(contextptr, which)[source]
+
+ +
+
+callbackgetinfolong(contextptr, which)[source]
+
+ +
+
+callbackgetinfodbl(contextptr, which)[source]
+
+ +
+
+callbackabort(contextptr)[source]
+
+ +
+
+callbackcandidateispoint(contextptr)[source]
+
+ +
+
+callbackgetcandidatepoint(contextptr, begin, end)[source]
+
+ +
+
+callbackcandidateisray(contextptr)[source]
+
+ +
+
+callbackgetcandidateray(contextptr, begin, end)[source]
+
+ +
+
+callbackgetcandidateobj(contextptr)[source]
+
+ +
+
+callbackgetrelaxationpoint(contextptr, begin, end)[source]
+
+ +
+
+callbackgetrelaxationpointobj(contextptr)[source]
+
+ +
+
+callbackgetrelaxationstatus(contextptr, flags)[source]
+
+ +
+
+callbackmakebranch(contextptr, ind, lu, bd, rhs, sense, matbeg, matind, matval, nodeest)[source]
+
+ +
+
+callbackprunenode(contextptr)[source]
+
+ +
+
+callbackexitcutloop(contextptr)[source]
+
+ +
+
+callbackgetincumbent(contextptr, begin, end)[source]
+
+ +
+
+callbackgetincumbentobj(contextptr)[source]
+
+ +
+
+callbackgetlocallb(contextptr, begin, end)[source]
+
+ +
+
+callbackgetlocalub(contextptr, begin, end)[source]
+
+ +
+
+callbackgetgloballb(contextptr, begin, end)[source]
+
+ +
+
+callbackgetglobalub(contextptr, begin, end)[source]
+
+ +
+
+callbackpostheursoln(contextptr, cnt, ind, val, obj, strategy)[source]
+
+ +
+
+callbackaddusercuts(contextptr, rcnt, nzcnt, rhs, sense, rmat, cutmanagement, local)[source]
+
+ +
+
+callbackrejectcandidate(contextptr, rcnt, nzcnt, rhs, sense, rmat)[source]
+
+ +
+
+callbackrejectcandidatelocal(contextptr, rcnt, nzcnt, rhs, sense, rmat)[source]
+
+ +
+
+modelasstcallbacksetfunc(env, lp, cbhandle)[source]
+
+ +
+
+

cplex._internal._matrices module

+
+
undocumented:
+

_C_HB_Matrix, _HB_Matrix

+
+
+
+
+unpack_pair(item)[source]
+

Extracts the indices and values from an object.

+

The argument item can either be an instance of SparsePair or a +sequence of length two.

+

Example usage:

+
>>> sp = SparsePair()
+>>> ind, val = unpack_pair(sp)
+>>> lin_expr = [[], []]
+>>> ind, val = unpack_pair(lin_expr)
+
+
+
+ +
+
+unpack_triple(item)[source]
+

Extracts the indices and values from an object.

+

The argument item can either be an instance of SparseTriple or a +sequence of length three.

+

Example usage:

+
>>> st = SparseTriple()
+>>> ind1, ind2, val = unpack_triple(st)
+>>> quad_expr = [[], [], []]
+>>> ind1, ind2, val = unpack_triple(quad_expr)
+
+
+
+ +
+
+

cplex._internal._multiobj module

+

Multi-Objective API

+
+
+class MultiObjInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._multiobj.MultiObjInterface
+ + + +

Methods for adding, querying, and modifying multiple objectives.

+

The methods in this interface can be used to add, query, and modify +objectives in a specified problem. These objectives are used when +multi-objective optimization is initiated.

+

See also MultiObjSolnInterface where methods for accessing +solutions for multi-objective models can be found.

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+
+
+sense = <cplex._internal._subinterfaces.ObjSense object>
+

See ObjSense()

+
+ +
+
+__init__(cpx)[source]
+

Creates a new MultiObjInterface.

+

The Multi-Objective interface is exposed by the top-level Cplex +class as Cplex.multiobj. This constructor is not meant to be +used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of objectives in the problem.

+

See CPXgetnumobjs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.get_num()
+1
+>>> indices = c.multiobj.set_num(2)
+>>> c.multiobj.get_num()
+2
+
+
+
+ +
+
+set_num(numobj)[source]
+

Sets the number of objectives in the problem instance.

+

There is always at least one objective in the problem instance +(indexed 0) thus numobj must be at least 1. If before calling +this method there were more objectives in the instance than the +specified numobj then the objectives whose index is >= numobj are +removed from the instance. If before calling this method the +number of objectives was <= numobj then new objectives are +created, all with all-zero coefficients and default settings +(like priority, weight, etc).

+

See CPXsetnumobjs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.get_num()
+2
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of objectives.

+

There are four forms by which multiobj.get_names may be called.

+
+
multiobj.get_names()

return the names of all objectives from the problem.

+
+
multiobj.get_names(i)

i must be an objective index. Returns the name of row i.

+
+
multiobj.get_names(s)

s must be a sequence of objective indices. Returns the names of +the objectives with indices the members of s. Equivalent to +[multiobj.get_names(i) for i in s]

+
+
multiobj.get_names(begin, end)

begin and end must be objective indices. Returns the names of +the objectives with indices between begin and end, inclusive of +end. Equivalent to multiobj.get_names(range(begin, end + 1)).

+
+
+

See CPXmultiobjgetname in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_definition(0, name='mo1')
+>>> c.multiobj.get_names(0)
+'mo1'
+
+
+
+ +
+
+set_name(objidx, name)[source]
+

Sets the name of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_num(3)
+>>> for i in range(3):
+...     c.multiobj.set_name(i, str(i))
+>>> c.multiobj.get_names()
+['0', '1', '2']
+
+
+
+ +
+
+get_definition(objidx, begin=None, end=None)[source]
+

Returns the definition of an objective.

+

Returns an objective definitions, where the definition is a list +containing the following components: obj (a list containing the +linear objective coefficients), offset, weight, priority, abstol, +reltol (see set_definition).

+

objidx is the name or index of the objective to be accessed.

+

The optional begin and end arguments must be variable indices +or names. Together, begin and end specify the range of objective +function coefficients to be returned. By default, the linear +objective coefficients of all variables from the problem will be +returned (i.e., begin will default to the first variable index +and end will default to the last variable index).

+

See CPXmultiobjgetobj in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> varind = list(c.variables.add(obj=[1.0, 2.0]))
+>>> c.multiobj.get_definition(0)
+[[1.0, 2.0], 0.0, 1.0, 0, 0.0, 0.0]
+
+
+
+ +
+
+set_definition(objidx, obj=None, offset=0.0, weight=1.0, priority=0, abstol=None, reltol=None, name=None)[source]
+

Sets the definition of an objective.

+

multiobj.set_definition accepts the keyword arguments objidx, +obj, offset, weight, priority, abstol, reltol, and name.

+

objidx is the name or index of the objective to be set. The +objective index must be in the interval +[0, Cplex.multiobj.get_num() - 1].

+

obj can be either a SparsePair or a list of two lists specifying +the linear component of the objective. If not specified, the +coefficients of every variable are set to 0.0.

+
+
Note

obj must not contain duplicate indices. If obj references a +variable more than once, either by index, name, or a +combination of index and name, an exception will be raised.

+
+
+

offset is the offset of the objective to be set. If not +specififed, the offset is set to 0.0.

+

weight is the weight of the objective to be set. For the +definition of the weight see the description of blended objective +in the multi-objective optimization section of the CPLEX User’s +Manual. If not specified, the weight is set to 1.0.

+

priority is the priority of the objective to be set. It must be a +nonnegative integer. For the definition of the priority see the +description of lexicographic objective in the multi-objective +optimization section of the CPLEX User’s Manual. If not +specified, the priority is set to 0.

+

abstol is the absolute tolerance of the objective to be set. If +not specified, the absolute tolerance is set to 0.0.

+

reltol is the relative tolerance of the objective to be set. If +not specified, the relative tolerance is set to 0.0.

+

name is a string representing the name of the objective to be +set. If not specified, the objective name will default to None.

+

See CPXmultiobjsetobj in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> varind = list(c.variables.add(names=['x1', 'x2']))
+>>> c.multiobj.set_definition(
+...     objidx=0,
+...     obj=cplex.SparsePair(ind=varind, val=[1.0, 2.0]),
+...     offset=0.0,
+...     weight=1.0,
+...     priority=0,
+...     abstol=1e-06,
+...     reltol=1e-04,
+...     name='obj1')
+>>> c.multiobj.get_definition('obj1')
+[[1.0, 2.0], 0.0, 1.0, 0, 1e-06, 0.0001]
+>>> c.multiobj.get_names(0)
+'obj1'
+
+
+
+ +
+
+get_linear(objidx, *args)[source]
+

Returns the linear coefficients of a set of variables.

+

Can be called by four forms each of which requires an objidx +argument. objidx must be an objective name or index.

+
+
multiobj.get_linear(objidx)

return the linear objective coefficients of all variables +from the problem.

+
+
multiobj.get_linear(objidx, i)

i must be a variable name or index. Returns the linear +objective coefficient of the variable whose index or name is i.

+
+
multiobj.get_linear(objidx, s)

s must be a sequence of variable names or indices. Returns the +linear objective coefficient of the variables with indices the +members of s. Equivalent to +[multiobj.get_linear(objidx, i) for i in s]

+
+
multiobj.get_linear(objidx, begin, end)

begin and end must be variable indices or variable names. +Returns the linear objective coefficient of the variables with +indices between begin and end, inclusive of end. Equivalent to +multiobj.get_linear(objidx, range(begin, end + 1)).

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     obj=[1.5 * i for i in range(10)],
+...     names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.multiobj.get_linear(0, 8)
+12.0
+>>> c.multiobj.get_linear(0, '1', 3)
+[1.5, 3.0, 4.5]
+>>> c.multiobj.get_linear(0, [2, '0', 5])
+[3.0, 0.0, 7.5]
+>>> c.multiobj.get_linear(0)
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+set_linear(objidx, *args)[source]
+

Changes the linear part of an objective function.

+

Can be called by two forms each of which requires an objidx +argument. objidx must be an objective name or index.

+
+
multiobj.set_linear(objidx, var, value)

var must be a variable index or name and value must be a float. +Changes the coefficient of the variable identified by var to +value.

+
+
multiobj.set_linear(objidx, sequence)

sequence is a sequence of pairs (var, value) as described +above. Changes the coefficients for the specified variables to +the given values.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(4)])
+>>> c.multiobj.get_linear(0)
+[0.0, 0.0, 0.0, 0.0]
+>>> c.multiobj.set_linear(0, 0, 1.0)
+>>> c.multiobj.get_linear(0)
+[1.0, 0.0, 0.0, 0.0]
+>>> c.multiobj.set_linear(0, '3', -1.0)
+>>> c.multiobj.get_linear(0)
+[1.0, 0.0, 0.0, -1.0]
+>>> c.multiobj.set_linear(0, [('2', 2.0), (1, 0.5)])
+>>> c.multiobj.get_linear(0)
+[1.0, 0.5, 2.0, -1.0]
+
+
+
+ +
+
+get_sense()[source]
+

Returns the sense of all objective functions.

+

See ObjSense.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+>>> c.multiobj.set_sense(c.multiobj.sense.maximize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'maximize'
+>>> c.multiobj.set_sense(c.multiobj.sense.minimize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+
+
+
+ +
+
+set_sense(sense)[source]
+

Sets the sense of all objective functions.

+
+
Note

All objective functions share the same sense. To model an +objective with a different sense use a negative value for the +weight attribute. See set_weight.

+
+
+

The argument to this method must be either ObjSense.minimize +or ObjSense.maximize.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+>>> c.multiobj.set_sense(c.multiobj.sense.maximize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'maximize'
+>>> c.multiobj.set_sense(c.multiobj.sense.minimize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+
+
+
+ +
+
+get_offset(objidx)[source]
+

Returns the constant offset of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_offset(0)
+0.0
+
+
+
+ +
+
+set_offset(objidx, offset)[source]
+

Sets the constant offset of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.objective.set_offset(3.14)
+>>> c.objective.get_offset()
+3.14
+
+
+
+ +
+
+get_weight(objidx)[source]
+

Returns the weight of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_weight(0)
+1.0
+
+
+
+ +
+
+set_weight(objidx, weight)[source]
+

Sets the weight of an objective function.

+

objidx must be an objective name or index.

+
+
Note

All objective functions share the same sense. To model an +objective with a different sense use a negative value for the +weight attribute. See set_sense.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_weight(0, -2.0)
+>>> c.multiobj.get_weight(0)
+-2.0
+
+
+
+ +
+
+get_priority(objidx)[source]
+

Returns the priority of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_priority(0)
+0
+
+
+
+ +
+
+set_priority(objidx, priority)[source]
+

Sets the priority of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_priority(0, 2)
+>>> c.multiobj.get_priority(0)
+2
+
+
+
+ +
+
+get_abstol(objidx)[source]
+

Returns the absolute tolerance of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_abstol(0)
+0.0
+
+
+
+ +
+
+set_abstol(objidx, abstol)[source]
+

Sets the absolute tolerance of an objective function.

+

objidx must be an objective name or index.

+

abstol should be a float. When specifying a new value, the same +limits apply as with the +Cplex.parameters.mip.tolerances.absmipgap parameter. See the +section on Specifying multiple objective problems in the CPLEX +User’s Manual for the details on the meaning of this tolerance.

+

See CPXmultiobjchgattribs in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_abstol(0, 1e-6)
+>>> c.multiobj.get_abstol(0)
+1e-06
+
+
+
+ +
+
+get_reltol(objidx)[source]
+

Returns the relative tolerance of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_reltol(0)
+0.0
+
+
+
+ +
+
+set_reltol(objidx, reltol)[source]
+

Sets the relative tolerance of an objective function.

+

objidx must be an objective name or index.

+

reltol should be a float. When specifying a new value, the same +limits apply as with the Cplex.parameters.mip.tolerances.mipgap +parameter. Note that a nondefault setting of this parameter only +applies to MIP multiobjective problems. See the section on +Specifying multiple objective problems in the CPLEX User’s Manual +for the details on the meaning of this tolerance.

+

See CPXmultiobjchgattribs in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_reltol(0, 1e-4)
+>>> c.multiobj.get_reltol(0)
+0.0001
+
+
+
+ +
+ +
+
+

cplex._internal._multiobjsoln module

+

Multi-Objective Solution API

+
+
+class MultiObjFloatInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjFloatInfo
+ + + +

Types of floating point information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+time = 2
+

See CPX_MULTIOBJ_TIME in the C API.

+
+ +
+
+dettime = 3
+

See CPX_MULTIOBJ_DETTIME in the C API.

+
+ +
+
+objective = 14
+

See CPX_MULTIOBJ_OBJVAL in the C API.

+
+ +
+
+best_objective = 15
+

See CPX_MULTIOBJ_BESTOBJVAL in the C API.

+
+ +
+ +
+
+class MultiObjIntInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjIntInfo
+ + + +

Types of integer information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+error = 0
+

See CPX_MULTIOBJ_ERROR in the C API.

+
+ +
+
+status = 1
+

See CPX_MULTIOBJ_STATUS in the C API.

+
+ +
+
+method = 18
+

See CPX_MULTIOBJ_METHOD in the C API.

+
+ +
+
+priority = 17
+

See CPX_MULTIOBJ_PRIORITY in the C API.

+
+ +
+
+blend = 20
+

See CPX_MULTIOBJ_BLEND in the C API.

+
+ +
+
+pfeas = 21
+

See CPX_MULTIOBJ_PFEAS in the C API.

+
+ +
+
+dfeas = 22
+

See CPX_MULTIOBJ_DFEAS in the C API.

+
+ +
+ +
+
+class MultiObjLongInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjLongInfo
+ + + +

Types of long integer information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+num_barrier_iterations = 4
+

See CPX_MULTIOBJ_BARITCNT in the C API.

+
+ +
+
+num_sifting_iterations = 5
+

See CPX_MULTIOBJ_SIFTITCNT in the C API.

+
+ +
+
+num_sifting_phase1_iterations = 6
+

See CPX_MULTIOBJ_SIFTPHASE1CNT in the C API.

+
+ +
+
+num_degenerate_iterations = 7
+

See CPX_MULTIOBJ_DEGCNT in the C API.

+
+ +
+
+num_iterations = 8
+

See CPX_MULTIOBJ_ITCNT in the C API.

+
+ +
+
+num_phase1_iterations = 9
+

See CPX_MULTIOBJ_PHASE1CNT in the C API.

+
+ +
+
+num_primal_pushes = 10
+

See CPX_MULTIOBJ_PPUSH in the C API.

+
+ +
+
+num_primal_exchanges = 11
+

See CPX_MULTIOBJ_PEXCH in the C API.

+
+ +
+
+num_dual_pushes = 12
+

See CPX_MULTIOBJ_DPUSH in the C API.

+
+ +
+
+num_dual_exchanges = 13
+

See CPX_MULTIOBJ_DEXCH in the C API.

+
+ +
+
+num_nodes = 16
+

See CPX_MULTIOBJ_NODECNT in the C API.

+
+ +
+
+num_nodes_left = 19
+

See CPX_MULTIOBJ_NODELEFTCNT in the C API.

+
+ +
+ +
+
+class MultiObjSolnInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjSolnInterface
+ + + +

Methods for accessing solutions for multi-objective models.

+

The methods in this interface can be used to query solutions for +multi-objective models.

+

See also MultiObjInterface where methods for adding, querying, and +modifying multiple objectives can be found.

+
+
+float_info = <cplex._internal._multiobjsoln.MultiObjFloatInfo object>
+

See MultiObjFloatInfo()

+
+ +
+
+int_info = <cplex._internal._multiobjsoln.MultiObjIntInfo object>
+

See MultiObjIntInfo()

+
+ +
+
+long_info = <cplex._internal._multiobjsoln.MultiObjLongInfo object>
+

See MultiObjLongInfo()

+
+ +
+
+__init__(parent)[source]
+

Creates a new MIPSolutionInterface.

+

The multi-objective solution interface is exposed by the +top-level Cplex class as Cplex.solution.multiobj. This +constructor is not meant to be used externally.

+
+ +
+
+get_objective_value(objidx)[source]
+

Returns the value of an objective function.

+

objidx is the name or index of the objective to be accessed.

+

See CPXmultiobjgetobjval in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.solve()
+>>> c.solution.multiobj.get_objective_value(0)
+-202.5
+>>> c.solution.multiobj.get_objective_value(1)
+-202.5
+
+
+
+ +
+
+get_objval_by_priority(priority)[source]
+

Returns the value of an objective function by priority.

+

After multi-objective optimization, returns the blended objective +value for the specified priority.

+

See CPXmultiobjgetobjvalbypriority in the Callable +Library Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> c.solution.multiobj.get_objval_by_priority(1)
+-202.5
+>>> c.solution.multiobj.get_objval_by_priority(2)
+-202.5
+
+
+
+ +
+
+get_num_solves()[source]
+

Returns the number of sub-problems that where successfully +solved during the last optimization of a multi-objective problem.

+

See CPXmultiobjgetnumsolves in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> c.solution.multiobj.get_num_solves()
+2
+
+
+
+ +
+
+get_info(subprob, what)[source]
+

Returns the solution information of a sub-problem of a +multi-objective optimization.

+

subprob is the sub-problem of a multi-objective optimization.

+

what is an attribute from Cplex.solution.multiobj.float_info +(see MultiObjFloatInfo), Cplex.solution.multiobj.int_info +(see MultiObjIntInfo), or Cplex.solution.multiobj.long_info +(see MultiObjLongInfo).

+

See CPXmultiobjgetdblinfo, +CPXmultiobjgetintinfo, +CPXmultiobjgetlonginfo, etc. in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> num = c.solution.multiobj.get_num_solves()
+>>> for i in range(num):
+...     priority = c.solution.multiobj.get_info(
+...         i,
+...         c.solution.multiobj.int_info.priority
+...     )
+
+
+
+ +
+ +
+
+

cplex._internal._pwl module

+

Piecewise Linear API

+
+
+class PWLConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._pwl.PWLConstraintInterface
+ + + +

Methods for adding, querying, and modifying PWL constraints.

+

A PWL constraint describes a piecewise linear relationship between +two variables: vary=pwl(varx). The PWL constraint is described by +specifying the index of the vary and varx variables involved and by +providing the breakpoints of the PWL function (specified by the +(breakx[i],breaky[i]) coordinate pairs). Before the first segment of +the PWL function there may be a half-line; its slope is specified by +preslope. After the last segment of the the PWL function there may +be a half-line; its slope is specified by postslope. Two consecutive +breakpoints may have the same x coordinate, in such cases there is a +discontinuity in the PWL function. Three consecutive breakpoints +may not have the same x coordinate.

+
+
+__init__(cpx)[source]
+

Creates a new PWLConstraintInterface.

+

The PWL constraint interface is exposed by the top-level Cplex +class as Cplex.pwl_constraints. This constructor is not meant +to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of PWL constraints in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.pwl_constraints.get_num()
+0
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+
+
+
+ +
+
+add(vary, varx, preslope, postslope, breakx, breaky, name='')[source]
+

Adds a PWL constraint to the problem.

+

vary: the index of the ‘y’ variable in the vary=pwl(varx) +function.

+

varx: the index of the ‘x’ variable in the vary=pwl(varx) +function.

+

preslope: before the first segment of the PWL function there is +a half-line; its slope is specified by preslope.

+

postslope: after the last segment of the the PWL function there +is a half-line; its slope is specified by postslope.

+

breakx: A list containing the indices of the ‘x’ variables +involved.

+

breaky: A list containing the indices of the ‘y’ variables +involved.

+

name: the name of the PWL constraint; defaults to the empty +string.

+

Returns the index of the PWL constraint.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes PWL constraints from the problem.

+

There are four forms by which pwl_constraints.delete may be +called.

+
+
pwl_constraints.delete()

deletes all PWL constraints from the problem.

+
+
pwl_constraints.delete(i)

i must be a PWL constraint name or index. Deletes the PWL +constraint whose index or name is i.

+
+
pwl_constraints.delete(seq)

seq must be a sequence of PWL constraint names or indices. +Deletes the PWL constraints with names or indices contained +within s. Equivalent to [pwl_constraints.delete(i) for i in s].

+
+
pwl_constraints.delete(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Deletes the PWL constraints with indices between begin +and end, inclusive of end. Equivalent to +pwl_constraints.delete(range(begin, end + 1)). This will give +the best performance when deleting batches of PWL constraints.

+
+
+

See CPXdelpwl in the Callable Library Reference Manual for more +detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+>>> c.pwl_constraints.delete(idx)
+>>> c.pwl_constraints.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of PWL constraints.

+

May be called by four forms.

+
+
pwl_constraints.get_names()

return the names of all PWL constraints in the problem.

+
+
pwl_constraints.get_names(i)

i must be a PWL constraint name or index. Returns the name of +PWL constraint i.

+
+
pwl_constraints.get_names(seq)

seq must be a sequence of PWL constraint names or indices. +Returns the names of PWL constraints with names or indices in +s. Equivalent to +[pwl_constraints.get_names(i) for i in s]

+
+
pwl_constraints.get_names(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Returns the names of PWL constraints with indices +between begin and end, inclusive of end. Equivalent to +pwl_constraints.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_names(idx)
+'pwl1'
+
+
+
+ +
+
+get_definitions(*args)[source]
+

Returns the definitions of a set of PWL constraints.

+

Returns a list of PWL definitions, where each definition is a +list containing the following components: vary, varx, preslope, +postslope, breakx, breaky (see add).

+

May be called by four forms.

+
+
pwl_constraints.get_definitions()

return the definitions of all PWL constraints in the +problem.

+
+
pwl_constraints.get_definitions(i)

i must be a PWL constraint name or index. Returns the +definition of PWL constraint i.

+
+
pwl_constraints.get_definitions(seq)

seq must be a sequence of PWL constraint names or indices. +Returns the definitions of PWL constraints with names or +indices in s. Equivalent to +[pwl_constraints.get_definitions(i) for i in s]

+
+
pwl_constraints.get_definitions(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Returns the definitions of PWL constraints with indices +between begin and end, inclusive of end. Equivalent to +pwl_constraints.get_definitions(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_definitions(idx)
+[0, 1, 0.5, 2.0, [0.0, 1.0, 2.0], [0.0, 1.0, 4.0]]
+
+
+
+ +
+ +
+
+

cplex._internal._anno module

+

Annotation API

+
+
+class AnnotationObjectType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._anno.AnnotationObjectType
+ + + +

Constants defining annotation object types.

+
+
+objective = 0
+
+ +
+
+variable = 1
+
+ +
+
+row = 2
+
+ +
+
+sos_constraint = 3
+
+ +
+
+indicator_constraint = 4
+
+ +
+
+quadratic_constraint = 5
+
+ +
+ +
+
+class AnnotationInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._anno.AnnotationInterface
+ + + +

Methods for adding, querying, and modifying annotations.

+
+
+object_type = <cplex._internal._anno.AnnotationObjectType object>
+

See AnnotationObjectType()

+
+ +
+ +
+
+class LongAnnotationInterface[source]
+

Bases: AnnotationInterface

+
Inheritance diagram of cplex._internal._anno.LongAnnotationInterface
+ + + + +

Methods for adding, querying, and modifying long annotations.

+
+
+benders_annotation = 'cpxBendersPartition'
+

String constant for the name of the Benders annotation.

+
+ +
+
+benders_mastervalue = 0
+

Default value for the Benders master partition.

+
+ +
+
+__init__(cpx)[source]
+

Creates a new LongAnnotationInterface.

+

The long annotation interface is exposed by the top-level Cplex +class as Cplex.long_annotations. This constructor is not meant +to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of long annotations in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.long_annotations.get_num()
+0
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> c.long_annotations.get_num()
+1
+
+
+
+ +
+
+add(name, defval)[source]
+

Adds an annotation to the problem.

+

name: the name of the annotation.

+

defval: the default value for annotation objects.

+

Returns the index of the added annotation.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add(name='ann1', defval=0)
+>>> c.long_annotations.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes long annotations from the problem.

+

There are four forms by which long_annotations.delete may be +called.

+
+
long_annotations.delete()

deletes all long annotations from the problem.

+
+
long_annotations.delete(i)

i must be an annotation name or index. Deletes the long +annotation whose index or name is i.

+
+
long_annotations.delete(seq)

seq must be a sequence of annotation names or indices. +Deletes the long annotations with names or indices contained +within s. Equivalent to [long_annotations.delete(i) for i in s].

+
+
long_annotations.delete(begin, end)

begin and end must be annotation indices or annotation names. +Deletes the long annotations with indices between begin and +end, inclusive of end. Equivalent to +long_annotations.delete(range(begin, end + 1)). This will give +the best performance when deleting batches of long annotations.

+
+
+

See CPXdellongannotations in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> c.long_annotations.get_num()
+1
+>>> c.long_annotations.delete(idx)
+>>> c.long_annotations.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of long annotations.

+

May be called by four forms.

+
+
long_annotations.get_names()

return the names of all long annotations in the problem.

+
+
long_annotations.get_names(i)

i must be an annotation name or index. Returns the name of +long annotation i.

+
+
long_annotations.get_names(seq)

seq must be a sequence of annotation names or indices. +Returns the names of long annotations with names or indices in +s. Equivalent to +[long_annotations.get_names(i) for i in s]

+
+
long_annotations.get_names(begin, end)

begin and end must be annotation indices or annotation names. +Returns the names of long annotations with indices between +begin and end, inclusive of end. Equivalent to +long_annotations.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.long_annotations.add('ann{0}'.format(i), i)
+...  for i in range(1, 6)]
+[0, 1, 2, 3, 4]
+>>> c.long_annotations.get_names()
+['ann1', 'ann2', 'ann3', 'ann4', 'ann5']
+>>> c.long_annotations.get_names(0)
+'ann1'
+>>> c.long_annotations.get_names([0, 2, 4])
+['ann1', 'ann3', 'ann5']
+>>> c.long_annotations.get_names(1, 3)
+['ann2', 'ann3', 'ann4']
+
+
+
+ +
+
+get_default_values(*args)[source]
+

Returns the default value of a set of long annotations.

+

May be called by four forms.

+
+
long_annotations.get_default_values()

return the default values of all long annotations in the +problem.

+
+
long_annotations.get_default_values(i)

i must be an annotation name or index. Returns the default +value of long annotation i.

+
+
long_annotations.get_default_values(seq)

seq must be a sequence of annotation names or indices. +Returns the default values of long annotations with names or +indices in s. Equivalent to +[long_annotations.get_default_values(i) for i in s]

+
+
long_annotations.get_default_values(begin, end)

begin and end must be annotation indices or annotation names. +Returns the default values of long annotations with indices +between begin and end, inclusive of end. Equivalent to +long_annotations.get_default_values(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx1 = c.long_annotations.add(name='ann1', defval=0)
+>>> idx2 = c.long_annotations.add(name='ann2', defval=1)
+>>> c.long_annotations.get_default_values()
+[0, 1]
+
+
+
+ +
+
+set_values(idx, objtype, *args)[source]
+

Sets the values for objects in the specified long annotation.

+

idx: the long annotation index or name.

+

objtype: the annotation object type.

+

Can be called by two forms:

+
+
long_annotations.set_values(idx, objtype, i, val)

i must be a name or index. Changes the long annotation value +of the object identified by i.

+
+
long_annotations.set_values(idx, objtype, seq)

seq is a sequence of pairs (i, val) as described above. +Changes the long annotation values for the specified objects.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.objective
+>>> c.long_annotations.set_values(idx, objtype, 0, 1)
+>>> c.long_annotations.get_values(idx, objtype, 0)
+1
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.long_annotations.object_type.variable
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.long_annotations.get_values(idx, objtype)
+[1, 1, 1]
+
+
+
+ +
+
+get_values(idx, objtype, *args)[source]
+

Returns the long annotation values for the specified objects.

+

idx: the long annotation index or name.

+

objtype: the annotation object type.

+

Can be called by four forms:

+
+
long_annotations.get_values(idx, objtype)

return the values of all objects for a given annotation.

+
+
long_annotations.get_values(idx, objtype, i)

i must be a name or index. Returns the long annotation value +of the object identified by i.

+
+
long_annotations.get_values(idx, objtype, seq)

seq is a sequence of object names or indices. Returns the +long annotation values for the specified objects. Equivalent +to +[long_annotations.get_values(idx, objtype, i) for i in seq]

+
+
long_annotations.get_values(idx, objtype, begin, end)

begin and end must be object indices or object names. Returns +the long annotation values of objects with indices between +begin and end, inclusive of end. Equivalent to +long_annotations.get_values(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.objective
+>>> c.long_annotations.set_values(idx, objtype, 0, 1)
+>>> c.long_annotations.get_values(idx, objtype, 0)
+1
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.long_annotations.object_type.variable
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.long_annotations.get_values(idx, objtype, list(indices))
+[1, 1, 1]
+
+
+
+ +
+ +
+
+class DoubleAnnotationInterface[source]
+

Bases: AnnotationInterface

+
Inheritance diagram of cplex._internal._anno.DoubleAnnotationInterface
+ + + + +

Methods for adding, querying, and modifying double annotations.

+
+
+__init__(cpx)[source]
+

Creates a new DoubleAnnotationInterface.

+

The double annotation interface is exposed by the top-level +Cplex class as Cplex.double_annotations. This constructor is +not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of double annotations in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.double_annotations.get_num()
+0
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+add(name, defval)[source]
+

Adds an annotation to the problem.

+

name: the name of the annotation.

+

defval: the default value for annotation objects.

+

Returns the index of the added annotation.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add(name='ann1', defval=0.0)
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes double annotations from the problem.

+

There are four forms by which double_annotations.delete may be +called.

+
+
double_annotations.delete()

deletes all double annotations from the problem.

+
+
double_annotations.delete(i)

i must be an annotation name or index. Deletes the double +annotation whose index or name is i.

+
+
double_annotations.delete(seq)

seq must be a sequence of annotation names or indices. +Deletes the double annotations with names or indices contained +within s. Equivalent to +[double_annotations.delete(i) for i in s].

+
+
double_annotations.delete(begin, end)

begin and end must be annotation indices or annotation names. +Deletes the double annotations with indices between begin and +end, inclusive of end. Equivalent to +double_annotations.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of double +annotations.

+
+
+

See CPXdeldblannotations in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> c.double_annotations.get_num()
+1
+>>> c.double_annotations.delete(idx)
+>>> c.double_annotations.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of double annotations.

+

May be called by four forms.

+
+
double_annotations.get_names()

return the names of all double annotations in the problem.

+
+
double_annotations.get_names(i)

i must be an annotation name or index. Returns the name of +double annotation i.

+
+
double_annotations.get_names(seq)

seq must be a sequence of annotation names or indices. +Returns the names of double annotations with names or indices +in s. Equivalent to +[double_annotations.get_names(i) for i in s]

+
+
double_annotations.get_names(begin, end)

begin and end must be annotation indices or annotation names. +Returns the names of double annotations with indices between +begin and end, inclusive of end. Equivalent to +double_annotations.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.double_annotations.add('ann{0}'.format(i), i)
+...  for i in range(1, 6)]
+[0, 1, 2, 3, 4]
+>>> c.double_annotations.get_names()
+['ann1', 'ann2', 'ann3', 'ann4', 'ann5']
+>>> c.double_annotations.get_names(0)
+'ann1'
+>>> c.double_annotations.get_names([0, 2, 4])
+['ann1', 'ann3', 'ann5']
+>>> c.double_annotations.get_names(1, 3)
+['ann2', 'ann3', 'ann4']
+
+
+
+ +
+
+get_default_values(*args)[source]
+

Returns the default value of a set of double annotations.

+

May be called by four forms.

+
+
double_annotations.get_default_values()

return the default values of all double annotations in the +problem.

+
+
double_annotations.get_default_values(i)

i must be an annotation name or index. Returns the default +value of double annotation i.

+
+
double_annotations.get_default_values(seq)

seq must be a sequence of annotation names or indices. +Returns the default values of double annotations with names or +indices in s. Equivalent to +[double_annotations.get_default_values(i) for i in s]

+
+
double_annotations.get_default_values(begin, end)

begin and end must be annotation indices or annotation names. +Returns the default values of double annotations with indices +between begin and end, inclusive of end. Equivalent to +double_annotations.get_default_values(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx1 = c.double_annotations.add(name='ann1', defval=0.0)
+>>> idx2 = c.double_annotations.add(name='ann2', defval=1.0)
+>>> c.double_annotations.get_default_values()
+[0.0, 1.0]
+
+
+
+ +
+
+set_values(idx, objtype, *args)[source]
+

Sets the values for objects in the specified double annotation.

+

idx: the double annotation index or name.

+

objtype: the annotation object type.

+

Can be called by two forms:

+
+
double_annotations.set_values(idx, objtype, i, val)

i must be a name or index. Changes the double annotation +value of the object identified by i.

+
+
double_annotations.set_values(idx, objtype, seq)

seq is a sequence of pairs (i, val) as described above. +Changes the double annotation values for the specified +objects.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> objtype = c.double_annotations.object_type.objective
+>>> c.double_annotations.set_values(idx, objtype, 0, 1.0)
+>>> c.double_annotations.get_values(idx, objtype, 0)
+1.0
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.double_annotations.object_type.variable
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1.0) for i in indices])
+>>> c.double_annotations.get_values(idx, objtype)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+get_values(idx, objtype, *args)[source]
+

Returns the double annotation values for the specified objects.

+

idx: the double annotation index or name.

+

objtype: the annotation object type.

+

Can be called by four forms:

+
+
double_annotations.get_values(idx, objtype)

return the values of all objects for a given annotation.

+
+
double_annotations.get_values(idx, objtype, i)

i must be a name or index. Returns the double annotation +value of the object identified by i.

+
+
double_annotations.get_values(idx, objtype, seq)

seq is a sequence of object names or indices. Returns the +double annotation values for the specified objects. +Equivalent to +[double_annotations.get_values(idx, objtype, i) for i in seq]

+
+
double_annotations.get_values(idx, objtype, begin, end)

begin and end must be object indices or object names. Returns +the double annotation values of objects with indices between +begin and end, inclusive of end. Equivalent to +double_annotations.get_values(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> objtype = c.double_annotations.object_type.objective
+>>> c.double_annotations.set_values(idx, objtype, 0, 1.0)
+>>> c.double_annotations.get_values(idx, objtype, 0)
+1.0
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.double_annotations.object_type.variable
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1.0) for i in indices])
+>>> c.double_annotations.get_values(idx, objtype, list(indices))
+[1.0, 1.0, 1.0]
+
+
+
+ +
+ +
+
+

cplex._internal._constants module

+

Constants from the CPLEX C Callable Library

+
+
+

cplex._internal._constantsenum module

+

Enum constants from the CPLEX C Callable Library

+
+
+

cplex._internal._aux_functions module

+

Internal auxiliary functions.

+
+
+class deprecated[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._aux_functions.deprecated
+ + +

A decorator that marks methods/functions as deprecated.

+
+
+__init__(version)[source]
+
+ +
+ +
+
+deprecated_class(name, version, stacklevel=3)[source]
+

Emits a warning for a deprecated class.

+

This should be called in __init__.

+

name - the name of the class (e.g., PresolveCallback).

+
+
version - the version at which the class was deprecated (e.g.,

“V12.7.1”).

+
+
+

stacklevel - indicates how many levels up the stack is the caller.

+
+ +
+
+max_arg_length(arg_list)[source]
+

Returns the max length of the arguments in arg_list.

+
+ +
+
+validate_arg_lengths(arg_list, allow_empty=True, extra_msg='')[source]
+

Checks for equivalent argument lengths.

+

If allow_empty is True (the default), then empty arguments are not +checked against the max length of non-empty arguments. Some functions +allow NULL arguments in the Callable Library, for example.

+
+ +
+
+make_ranges(indices)[source]
+

non-public

+
+ +
+
+identity(x)[source]
+

Simple identity function.

+
+ +
+
+apply_freeform_two_args(fn, conv, args, unpack_single=True)[source]
+

non-public

+
+ +
+
+apply_freeform_one_arg(fn, conv, maxval, args)[source]
+

non-public

+
+ +
+
+apply_pairs(fn, conv, *args)[source]
+

non-public

+
+ +
+
+delete_set_by_range(fn, conv, max_num, *args)[source]
+

non-public

+
+ +
+
+make_group(conv, max_num, c_type, *args)[source]
+

Returns a _group object

+

input: +conv - a function that will convert names to indices +max_num - number of existing constraints of a given type +c_type - constraint type +args - arbitrarily many arguments (see description below)

+

If args is empty, every constraint/bound is assigned weight 1.0.

+

If args is of length one or more, every constraint/bound is assigned +a weight equal to the float passed in as the first item.

+

If args contains additional items, they determine a subset of +constraints/bounds to be included. If one index or name is +specified, it is the only one that will be included. If two indices +or names are specified, all constraints between the first and the +second, inclusive, will be included. If a sequence of names or +indices is passed in, all of their constraints/bounds will be +included.

+

See example usage in _subinterfaces.ConflictInterface.

+
+ +
+
+init_list_args(*args)[source]
+

Initialize default arguments with empty lists if necessary.

+
+ +
+
+listify(x)[source]
+

Returns [x] if x isn’t already a list.

+

This is used to wrap arguments for functions that require lists.

+
+ +
+
+convert_sequence(seq, getindexfunc, cache=None)[source]
+

Converts a sequence of names to indices as necessary.

+

If you are calling convert (see below) in a tight loop, but you +know that you are always working with a sequence, then it can be +more efficient to call this method directly (there is no overhead +checking if it is a sequence).

+
+ +
+
+convert(name, getindexfunc, cache=None)[source]
+

Converts from names to indices as necessary.

+

If name is a string, an index is returned.

+

If name is a sequence, a sequence of indices is returned.

+

If name is neither (i.e., it’s an integer), then that is returned +as is.

+

getindexfunc is a function that takes a name and returns an index.

+

The optional cache argument allows for further localized +caching (e.g., within a loop).

+
+ +
+
+unzip(iterable=None)[source]
+

Inverse of the zip function.

+

Example usage:

+
>>> z = list(zip([1, 2, 3], [4, 5, 6]))
+>>> unzip(z)
+[(1, 2, 3), (4, 5, 6)]
+
+
+
+ +
+
+

cplex._internal._parameter_classes module

+

Parameters for the CPLEX Python API.

+

This module defines classes for parameters, groups of parameters, and +parameter constants used in the CPLEX Python API. For more detail, see also +the corresponding commands of the Interactive Optimizer documented in the +CPLEX Parameters Reference Manual.

+
+
+class Parameter[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._parameter_classes.Parameter
+ + +

Base class for Cplex parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env, about, parent, name, constants=None)[source]
+

non-public

+
+ +
+
+__repr__()[source]
+

Returns the name of the parameter within the hierarchy.

+
+ +
+
+set(value)[source]
+

Sets the parameter to value.

+
+ +
+
+get()[source]
+

Returns the current value of the parameter.

+
+ +
+
+reset()[source]
+

Sets the parameter to its default value.

+
+ +
+
+default()[source]
+

Returns the default value of the parameter.

+
+ +
+
+type()[source]
+

Returns the type of the parameter.

+

Allowed types are float, int, and str.

+
+ +
+
+help()[source]
+

Returns the documentation for the parameter.

+
+ +
+ +
+
+class NumParameter[source]
+

Bases: Parameter

+
Inheritance diagram of cplex._internal._parameter_classes.NumParameter
+ + + +

Class for integer and float parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+min()[source]
+

Returns the minimum value for the parameter.

+
+ +
+
+max()[source]
+

Returns the maximum value for the parameter.

+
+ +
+ +
+
+class StrParameter[source]
+

Bases: Parameter

+
Inheritance diagram of cplex._internal._parameter_classes.StrParameter
+ + + +

Class for string parameters.

+
+
Undocumented:
+

__init__

+
+
+
+ +
+
+class ParameterGroup[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._parameter_classes.ParameterGroup
+ + +

Class containing a group of Cplex parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env, members, parent)[source]
+

non-public

+
+ +
+
+__repr__()[source]
+

Returns the name of the parameter group within the hierarchy.

+
+ +
+
+reset()[source]
+

Sets the parameters in the group to their default values.

+
+ +
+
+get_changed()[source]
+

Returns a list of the changed parameters in the group.

+

Returns a list of (parameter, value) pairs. Each parameter is +an instance of the Parameter class, and thus the parameter +value can be changed via its set method, or this object can be +passed to the tuning functions.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.read.datacheck.set(
+...     c.parameters.read.datacheck.values.assist)
+>>> for parameter, value in c.parameters.get_changed():
+...     pass  # do something
+
+
+
+ +
+
+get_all()[source]
+

Returns a list of all the parameters in the group.

+

Returns a list of (parameter, value) pairs. Each parameter is +an instance of the Parameter class, and thus the parameter +value can be changed via its set method, or this object can be +passed to the tuning functions.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> for parameter, value in c.parameters.get_all():
+...     pass  # do something
+
+
+
+ +
+ +
+
+class TuningConstants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.TuningConstants
+ + + +

Status codes returned by tuning methods.

+

For an explanation of tuning, see that topic in +the CPLEX User’s Manual.

+
+
+completed = 0
+
+ +
+
+abort = 1
+
+ +
+
+time_limit = 2
+
+ +
+
+dettime_limit = 3
+
+ +
+ +
+
+class RootParameterGroup[source]
+

Bases: ParameterGroup

+
Inheritance diagram of cplex._internal._parameter_classes.RootParameterGroup
+ + + +

Class containing all the Cplex parameters.

+
+
Undocumented:
+

__init__, _set, _get, _get_info

+
+
+
+
+tuning_status = <cplex._internal._parameter_classes.TuningConstants object>
+

See TuningConstants()

+
+ +
+
+__init__(env, members)[source]
+

non-public

+
+ +
+
+reset()[source]
+

Sets the parameters in the group to their default values.

+
+ +
+
+__repr__()[source]
+

Return ‘parameters’.

+
+ +
+
+tune_problem_set(filenames, filetypes=None, fixed_parameters_and_values=None)[source]
+

Tunes parameters for a set of problems.

+

filenames must be a sequence of strings specifying a set of +problems to tune.

+

If filetypes is given, it must be a sequence of the same +length as filenames also consisting of strings that specify +the types of the corresponding files.

+

If fixed_parameters_and_values is given, it may be either a +ParameterSet instance or a sequence of sequences of length 2 +containing instances of the Parameter class that are to be fixed +during the tuning process and the values at which they are to be +fixed.

+

tune_problem_set returns the status of the tuning procedure, +which is an attribute of parameters.tuning_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.lpmethod,
+...        c.parameters.lpmethod.values.auto)
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"],
+...     fixed_parameters_and_values=ps)
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"],
+...     fixed_parameters_and_values=[
+...         (c.parameters.lpmethod,
+...          c.parameters.lpmethod.values.auto)])
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"])
+>>> c.parameters.tuning_status[status]
+'completed'
+
+
+
+ +
+
+tune_problem(fixed_parameters_and_values=None)[source]
+

Tunes parameters for a Cplex problem.

+

If fixed_parameters_and_values is given, it may be either a +ParameterSet instance or a sequence of sequences of length 2 +containing instances of the Parameter class that are to be fixed +during the tuning process and the values at which they are to be +fixed.

+

tune_problem returns the status of the tuning procedure, which +is an attribute of parameters.tuning_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.lpmethod,
+...        c.parameters.lpmethod.values.auto)
+>>> status = c.parameters.tune_problem(ps)
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem([
+...     (c.parameters.lpmethod,
+...      c.parameters.lpmethod.values.auto)])
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem()
+>>> c.parameters.tuning_status[status]
+'completed'
+
+
+
+ +
+
+read_file(filename)[source]
+

Reads a set of parameters from the file filename.

+
+ +
+
+write_file(filename)[source]
+

Writes a set of parameters to the file filename.

+
+ +
+ +
+
+class off_on_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.off_on_constants
+ + + +
+
+off = 0
+
+ +
+
+on = 1
+
+ +
+ +
+
+class auto_off_on_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.auto_off_on_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+on = 1
+
+ +
+ +
+
+class writelevel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.writelevel_constants
+ + + +
+
+auto = 0
+
+ +
+
+all_variables = 1
+
+ +
+
+discrete_variables = 2
+
+ +
+
+nonzero_variables = 3
+
+ +
+
+nonzero_discrete_variables = 4
+
+ +
+ +
+
+class scale_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.scale_constants
+ + + +
+
+none = -1
+
+ +
+
+equilibration = 0
+
+ +
+
+aggressive = 1
+
+ +
+ +
+
+class mip_emph_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.mip_emph_constants
+ + + +
+
+balanced = 0
+
+ +
+
+optimality = 2
+
+ +
+
+feasibility = 1
+
+ +
+
+best_bound = 3
+
+ +
+
+hidden_feasibility = 4
+
+ +
+
+heuristic = 5
+
+ +
+ +
+
+class brdir_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.brdir_constants
+ + + +
+
+down = -1
+
+ +
+
+auto = 0
+
+ +
+
+up = 1
+
+ +
+ +
+
+class search_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.search_constants
+ + + +
+
+auto = 0
+
+ +
+
+traditional = 1
+
+ +
+
+dynamic = 2
+
+ +
+ +
+
+class subalg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.subalg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+network = 3
+
+ +
+
+barrier = 4
+
+ +
+
+sifting = 5
+
+ +
+ +
+
+class nodesel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.nodesel_constants
+ + + +
+
+depth_first = 0
+
+ +
+
+best_bound = 1
+
+ +
+
+best_estimate = 2
+
+ +
+
+best_estimate_alt = 3
+
+ +
+ +
+
+class alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+sifting = 5
+
+ +
+
+network = 3
+
+ +
+
+concurrent = 6
+
+ +
+ +
+
+class varsel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.varsel_constants
+ + + +
+
+min_infeasibility = -1
+
+ +
+
+default = 0
+
+ +
+
+max_infeasibility = 1
+
+ +
+
+pseudo_costs = 2
+
+ +
+
+strong_branching = 3
+
+ +
+
+pseudo_reduced_costs = 4
+
+ +
+ +
+
+class dive_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dive_constants
+ + + +
+
+auto = 0
+
+ +
+
+traditional = 1
+
+ +
+
+probing = 2
+
+ +
+
+guided = 3
+
+ +
+ +
+
+class file_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.file_constants
+ + + +
+
+auto = 0
+
+ +
+
+memory = 1
+
+ +
+
+disk = 2
+
+ +
+
+disk_compressed = 3
+
+ +
+ +
+
+class fpheur_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.fpheur_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+feas = 1
+
+ +
+
+obj_and_feas = 2
+
+ +
+ +
+
+class cardls_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.cardls_constants
+ + + +
+
+disabled = -1
+
+ +
+
+auto = 0
+
+ +
+
+at_root = 1
+
+ +
+
+at_all_nodes = 2
+
+ +
+ +
+
+class miqcp_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.miqcp_constants
+ + + +
+
+auto = 0
+
+ +
+
+QCP_at_node = 1
+
+ +
+
+LP_at_node = 2
+
+ +
+ +
+
+class presolve_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.presolve_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+force = 1
+
+ +
+
+probe = 2
+
+ +
+ +
+
+class v_agg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.v_agg_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+moderate = 1
+
+ +
+
+aggressive = 2
+
+ +
+
+very_aggressive = 3
+
+ +
+ +
+
+class kappastats_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.kappastats_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+sample = 1
+
+ +
+
+full = 2
+
+ +
+ +
+
+class agg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.agg_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+moderate = 1
+
+ +
+
+aggressive = 2
+
+ +
+ +
+
+class replace_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.replace_constants
+ + + +
+
+firstin_firstout = 0
+
+ +
+
+worst_objective = 1
+
+ +
+
+diversity = 2
+
+ +
+ +
+
+class ordertype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.ordertype_constants
+ + + +
+
+default = 0
+
+ +
+
+cost = 1
+
+ +
+
+bounds = 2
+
+ +
+
+scaled_cost = 3
+
+ +
+ +
+
+class mip_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.mip_display_constants
+ + + +
+
+none = 0
+
+ +
+
+integer_feasible = 1
+
+ +
+
+mip_interval_nodes = 2
+
+ +
+
+node_cuts = 3
+
+ +
+
+LP_root = 4
+
+ +
+
+LP_all = 5
+
+ +
+ +
+
+class conflict_algorithm_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.conflict_algorithm_constants
+ + + +
+
+auto = 0
+
+ +
+
+fast = 1
+
+ +
+
+propagate = 2
+
+ +
+
+presolve = 3
+
+ +
+
+iis = 4
+
+ +
+
+limitedsolve = 5
+
+ +
+
+solve = 6
+
+ +
+ +
+
+class dual_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dual_pricing_constants
+ + + +
+
+auto = 0
+
+ +
+
+full = 1
+
+ +
+
+steep = 2
+
+ +
+
+full_steep = 3
+
+ +
+
+steep_Q_start = 4
+
+ +
+
+devex = 5
+
+ +
+ +
+
+class primal_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.primal_pricing_constants
+ + + +
+
+partial = -1
+
+ +
+
+auto = 0
+
+ +
+
+devex = 1
+
+ +
+
+steep = 2
+
+ +
+
+steep_Q_start = 3
+
+ +
+
+full = 4
+
+ +
+ +
+
+class display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.display_constants
+ + + +
+
+none = 0
+
+ +
+
+normal = 1
+
+ +
+
+detailed = 2
+
+ +
+ +
+
+class prered_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.prered_constants
+ + + +
+
+none = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+primal_and_dual = 3
+
+ +
+ +
+
+class prereform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.prereform_constants
+ + + +
+
+none = 0
+
+ +
+
+interfere_crush = 1
+
+ +
+
+interfere_uncrush = 2
+
+ +
+
+all = 3
+
+ +
+ +
+
+class sos1reform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sos1reform_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+logarithmic = 1
+
+ +
+ +
+
+class sos2reform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sos2reform_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+logarithmic = 1
+
+ +
+ +
+
+class coeffreduce_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.coeffreduce_constants
+ + + +
+
+none = 0
+
+ +
+
+integral = 1
+
+ +
+
+any = 2
+
+ +
+ +
+
+class dependency_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dependency_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+begin = 1
+
+ +
+
+end = 2
+
+ +
+
+begin_and_end = 3
+
+ +
+ +
+
+class dual_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dual_constants
+ + + +
+
+no = -1
+
+ +
+
+auto = 0
+
+ +
+
+yes = 1
+
+ +
+ +
+
+class linear_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.linear_constants
+ + + +
+
+only_linear = 0
+
+ +
+
+full = 1
+
+ +
+ +
+
+class repeatpre_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.repeatpre_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+without_cuts = 1
+
+ +
+
+with_cuts = 2
+
+ +
+
+new_root_cuts = 3
+
+ +
+ +
+
+class sym_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sym_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+mild = 1
+
+ +
+
+moderate = 2
+
+ +
+
+aggressive = 3
+
+ +
+
+more_aggressive = 4
+
+ +
+
+very_aggressive = 5
+
+ +
+ +
+
+class qcpduals_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.qcpduals_constants
+ + + +
+
+no = 0
+
+ +
+
+if_possible = 1
+
+ +
+
+force = 2
+
+ +
+ +
+
+class sift_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sift_alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+network = 3
+
+ +
+ +
+
+class feasopt_mode_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.feasopt_mode_constants
+ + + +
+
+min_sum = 0
+
+ +
+
+opt_sum = 1
+
+ +
+
+min_inf = 2
+
+ +
+
+opt_inf = 3
+
+ +
+
+min_quad = 4
+
+ +
+
+opt_quad = 5
+
+ +
+ +
+
+class measure_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.measure_constants
+ + + +
+
+average = 1
+
+ +
+
+minmax = 2
+
+ +
+ +
+
+class tune_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.tune_display_constants
+ + + +
+
+none = 0
+
+ +
+
+minimal = 1
+
+ +
+
+settings = 2
+
+ +
+
+settings_and_logs = 3
+
+ +
+ +
+
+class bar_order_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_order_constants
+ + + +
+
+approx_min_degree = 1
+
+ +
+
+approx_min_fill = 2
+
+ +
+
+nested_dissection = 3
+
+ +
+ +
+
+class crossover_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.crossover_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+ +
+
+class bar_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_alg_constants
+ + + +
+
+default = 0
+
+ +
+
+infeas_estimate = 1
+
+ +
+
+infeas_constant = 2
+
+ +
+
+standard = 3
+
+ +
+ +
+
+class bar_start_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_start_alg_constants
+ + + +
+
+zero_dual = 1
+
+ +
+
+estimated_dual = 2
+
+ +
+
+average_primal_zero_dual = 3
+
+ +
+
+average_primal_estimated_dual = 4
+
+ +
+ +
+
+class par_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.par_constants
+ + + +
+
+opportunistic = -1
+
+ +
+
+auto = 0
+
+ +
+
+deterministic = 1
+
+ +
+ +
+
+class qp_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.qp_alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+network = 3
+
+ +
+
+barrier = 4
+
+ +
+ +
+
+class advance_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.advance_constants
+ + + +
+
+none = 0
+
+ +
+
+standard = 1
+
+ +
+
+alternate = 2
+
+ +
+ +
+
+class clocktype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.clocktype_constants
+ + + +
+
+auto = 0
+
+ +
+
+CPU = 1
+
+ +
+
+wall = 2
+
+ +
+ +
+
+class solutiontype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.solutiontype_constants
+ + + +
+
+auto = 0
+
+ +
+
+basic = 1
+
+ +
+
+non_basic = 2
+
+ +
+ +
+
+class optimalitytarget_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.optimalitytarget_constants
+ + + +
+
+auto = 0
+
+ +
+
+optimal_convex = 1
+
+ +
+
+first_order = 2
+
+ +
+
+optimal_global = 3
+
+ +
+ +
+
+class datacheck_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.datacheck_constants
+ + + +
+
+off = 0
+
+ +
+
+warn = 1
+
+ +
+
+assist = 2
+
+ +
+ +
+
+class benders_strategy_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.benders_strategy_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+user = 1
+
+ +
+
+workers = 2
+
+ +
+
+full = 3
+
+ +
+ +
+
+class network_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_display_constants
+ + + +
+
+none = 0
+
+ +
+
+true_objective_values = 1
+
+ +
+
+penalized_objective_values = 2
+
+ +
+ +
+
+class network_netfind_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_netfind_constants
+ + + +
+
+pure = 1
+
+ +
+
+reflection_scaling = 2
+
+ +
+
+general_scaling = 3
+
+ +
+ +
+
+class network_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_pricing_constants
+ + + +
+
+auto = 0
+
+ +
+
+partial = 1
+
+ +
+
+multiple_partial = 2
+
+ +
+
+multiple_partial_with_sorting = 3
+
+ +
+ +
+
+

cplex._internal._solutionstrategyenum module

+

A module for the SolutionStrategy class.

+
+
+class SolutionStrategy[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._solutionstrategyenum.SolutionStrategy
+ + + +

The different types of solutions that can submitted to +cplex.callbacks.Context.post_heuristic_solution().

+

For further details about these values, see the reference manual of +the CPLEX Callable Library (C API) particularly, the enumeration +CPXCALLBACKSOLUTIONSTRATEGY.

+
+
+no_check = -1
+

See CPXCALLBACKSOLUTION_NOCHECK in the C API.

+
+ +
+
+check_feasible = 0
+

See CPXCALLBACKSOLUTION_CHECKFEAS in the C API.

+
+ +
+
+propagate = 1
+

See CPXCALLBACKSOLUTION_PROPAGATE in the C API.

+
+ +
+
+solve = 2
+

See CPXCALLBACKSOLUTION_SOLVE in the C API.

+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/cplex.html b/docs/22.1.2.0/cplex.html new file mode 100644 index 0000000..19ab9ad --- /dev/null +++ b/docs/22.1.2.0/cplex.html @@ -0,0 +1,6249 @@ + + + + + + + + cplex package — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex package

+

The CPLEX Python API.

+

This package contains classes for accessing CPLEX from the Python +programming language. The most important class defined by this package +is the Cplex class, which provides methods for creating, modifying, +querying, or solving an optimization problem, and for querying aspects of +a solution.

+

The exceptions module defines the exception classes that are raised +during abnormal operation by the CPLEX Python API.

+

The callbacks module defines callback classes that can be used to alter +the behavior of the algorithms used by CPLEX.

+

The constant infinity, defined in the cplex package, should be used to +set infinite upper and lower bounds.

+

The classes SparsePair and SparseTriple are used as input and output +classes for sparse vector and sparse matrix output, respectively. See +the documentation for individual methods for details about the usage +of these classes.

+
+
+class Cplex[source]
+

Bases: object

+
Inheritance diagram of cplex.Cplex
+ + +

A class encapsulating a CPLEX Problem.

+

An instance of the Cplex class provides methods for creating, +modifying, and querying an optimization problem, solving it, and +querying aspects of the solution.

+

Most of the methods are provided within subinterfaces: for example, +methods for adding, modifying, and querying data associated with +variables are within the Cplex.variables interface, and methods for +querying the solution are within the Cplex.solution category.

+
+
Undocumented:
+

__del__

+
+
+
+
+problem_type = <cplex._internal.ProblemType object>
+

See ProblemType

+
+ +
+
+__init__(*args)[source]
+

Constructor of the Cplex class.

+

The Cplex constructor accepts four types of argument lists.

+
>>> cpx = cplex.Cplex()
+
+
+

cpx is a new problem with no data

+
>>> cpx = cplex.Cplex("filename")
+
+
+

cpx is a new problem containing the data in filename. If filename +does not exist, an exception is raised.

+
>>> cpx = cplex.Cplex("filename", "filetype")
+
+
+

same as form 2, but cplex reads the file filename as a file of +type filetype, rather than inferring the file type from its +extension.

+
>>> cpx = cplex.Cplex(old_cpx)
+
+
+

cpx contains the same problem data as old_cpx, but is a different +object and contains no solution data. Future changes to one do +not affect the other.

+

The Cplex object is a context manager and can be used, like so:

+
>>> import cplex
+>>> with cplex.Cplex() as cpx:
+...     # do stuff
+...     pass
+
+
+

When the with-block is finished, the end() method will be +called automatically.

+
+ +
+
+parameters
+

See RootParameterGroup

+
+ +
+
+variables
+

See VariablesInterface

+
+ +
+
+linear_constraints
+

See LinearConstraintInterface

+
+ +
+
+quadratic_constraints
+

See QuadraticConstraintInterface

+
+ +
+
+indicator_constraints
+

See IndicatorConstraintInterface

+
+ +
+
+SOS
+

See SOSInterface

+
+ +
+
+objective
+

See ObjectiveInterface

+
+ +
+
+multiobj
+

See MultiObjInterface

+
+ +
+
+MIP_starts
+

See MIPStartsInterface

+
+ +
+
+solution
+

See SolutionInterface

+
+ +
+
+presolve
+

See PresolveInterface

+
+ +
+
+order
+

See OrderInterface

+
+ +
+
+conflict
+

See ConflictInterface

+
+ +
+
+advanced
+

See AdvancedCplexInterface

+
+ +
+
+start
+

See InitialInterface

+
+ +
+
+feasopt
+

See FeasoptInterface

+
+ +
+
+long_annotations
+

See LongAnnotationInterface

+
+ +
+
+double_annotations
+

See DoubleAnnotationInterface

+
+ +
+
+pwl_constraints
+

See PWLConstraintInterface

+
+ +
+
+end()[source]
+

Releases the Cplex object.

+

Frees all data structures associated with CPLEX. After a call of +the method end(), the invoking Cplex object and all objects that +have been created with it (such as variables and constraints) can +no longer be used. Attempts to use them subsequently raise a +ValueError.

+
+
Note

The Cplex object is a context manager. Thus, rather than +calling this method explicitly, the best practice should be to +use a Cplex object in a “with” statement (see __enter__ and +__exit__).

+
+
+

Example usage:

+
>>> import cplex
+>>> cpx = cplex.Cplex()
+>>> cpx.end()
+
+
+
+ +
+
+__del__()[source]
+

non-public

+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The “with” statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Cplex objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as cpx:
+...     # do stuff
+...     pass
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with-block, the end() method is called +automatically.

+
+ +
+
+read(filename, filetype='')[source]
+

Reads a problem from file.

+

The first argument is a string specifying the filename from which +the problem will be read.

+

If the method is called with two arguments, the second argument +is a string specifying the file type. If this argument is +omitted, filetype is taken to be the extension of the filename.

+

See CPXreadcopyprob in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+
+
+
+ +
+
+write(filename, filetype='')[source]
+

Writes a problem to a file.

+

The first argument is a string specifying the filename to which +the problem will be written.

+

If the filename ends with .bz2 (for BZip2) or .gz (for GNU Zip), +a compressed file is written.

+

If the method is called with two arguments, the second argument +is a string specifying the file type. If this argument is +omitted, filetype is taken to be the extension of the filename.

+

If filetype is any of “sav”, “mps”, “lp”, the problem is written +in the corresponding format. If filetype is either “rew” or “rlp” +the problem is written with generic names in mps or lp format, +respectively. If filetype is “alp” the problem is written with +generic names in lp format, where the variable names are +annotated to indicate the type and bounds of each variable.

+

If filetype is “dua”, the dual problem is written to a file. If +filetype is “emb”, an embedded network problem is written to a +file. If filetype is “ppe”, the perturbed problem is written to a +file. If filetype is “dpe”, the perturbed dual problem is written +to a file.

+

For documentation of the file types, see the CPLEX File Format +Reference Manual.

+

See CPXwriteprob, CPXdualwrite, +CPXembwrite, CPXdperwrite, and +CPXpperwrite in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> c.write("example.lp")
+
+
+
+ +
+
+write_to_stream(stream, filetype='LP', comptype='')[source]
+

Writes a problem to a file-like object in the given file format.

+

The filetype argument can be any of “sav” (a binary format), “lp” +(the default), “mps”, “rew”, “rlp”, or “alp” (see Cplex.write +for an explanation of these).

+

If comptype is “bz2” (for BZip2) or “gz” (for GNU Zip), a +compressed file is written.

+

See CPXwriteprob in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> class NoOpStream():
+...     def __init__(self):
+...         self.was_called = False
+...     def write(self, bytes):
+...         self.was_called = True
+...         pass
+...     def flush(self):
+...         pass
+>>> stream = NoOpStream()
+>>> c.write_to_stream(stream)
+>>> stream.was_called
+True
+
+
+
+ +
+
+write_as_string(filetype='LP', comptype='')[source]
+

Writes a problem as a string in the given file format.

+

For an explanation of the filetype and comptype arguments, see +Cplex.write_to_stream.

+
+
Note

When SAV format is specified for filetype or a compressed file +format is specified for comptype, the return value will be a +byte string.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> lp_str = c.write_as_string("lp")
+>>> len(lp_str) > 0
+True
+
+
+
+ +
+
+read_annotations(filename)[source]
+

Reads annotations from a file.

+

See CPXreadcopyannotations in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> idx = c.double_annotations.add('ann1', 0)
+>>> objtype = c.double_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1) for i in indices])
+>>> c.write_annotations('example.ann')
+>>> c.long_annotations.delete()
+>>> c.double_annotations.delete()
+>>> c.long_annotations.get_num()
+0
+>>> c.double_annotations.get_num()
+0
+>>> c.read_annotations('example.ann')
+>>> c.long_annotations.get_num()
+1
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+write_annotations(filename)[source]
+

Writes the annotations to a file.

+

See CPXwriteannotations in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.write_annotations('example.ann')
+
+
+
+ +
+
+write_benders_annotation(filename)[source]
+

Writes the annotation of the auto-generated decomposition.

+

Writes the annotation of the decompostion CPLEX automatically +generates for the model of the CPLEX problem object to the +specified file.

+

See CPXwritebendersannotation in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read('UFL_25_35_1.mps')
+>>> c.write_benders_annotation('UFL_25_35_1.ann')
+
+
+
+ +
+
+get_problem_type()[source]
+

Returns the problem type.

+

See CPXgetprobtype in the Callable Library Reference +Manual for more detail.

+

The return value is an attribute of problem_type.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.get_problem_type()
+0
+>>> c.problem_type[c.get_problem_type()]
+'LP'
+
+
+
+ +
+
+set_problem_type(type, soln=None)[source]
+

Changes the problem type.

+

If only one argument is given, that argument specifies the new +problem type (see problem_type). It must be one of the +following:

+
    +
  • Cplex.problem_type.LP

  • +
  • Cplex.problem_type.MILP

  • +
  • Cplex.problem_type.fixed_MILP

  • +
  • Cplex.problem_type.QP

  • +
  • Cplex.problem_type.MIQP

  • +
  • Cplex.problem_type.fixed_MIQP

  • +
  • Cplex.problem_type.QCP

  • +
  • Cplex.problem_type.MIQCP

  • +
+

If an optional second argument is given, it is taken to be an +identifier of a member of the solution pool. In this case, the +first argument must be one of the following:

+
    +
  • Cplex.problem_type.fixed_MILP

  • +
  • Cplex.problem_type.fixed_MIQP

  • +
+

See CPXchgprobtype and CPXchgprobtypesolnpool +in the Callable Library Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_type(c.problem_type.LP)
+
+
+
+ +
+
+solve(paramsets=None)[source]
+

Solves the problem.

+

The optional paramsets argument can only be specified when +multiple objectives are present (otherwise, a ValueError is +raised). paramsets must be a sequence containing ParameterSet +objects (see Cplex.create_parameter_set) or None. See +CPXmultiobjopt in the Callable Library Reference Manual +for more detail.

+
+
Note

The solve method returning normally (i.e., without raising an +exception) does not necessarily mean that an optimal or +feasible solution has been found. Use +SolutionInterface.get_status() to query the status of the +current solution.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> status = c.solution.get_status()
+
+
+
+ +
+
+runseeds(cnt=30)[source]
+

Evaluates the variability of the problem.

+

Solves the same problem instance multiple times using different +random seeds allowing the user to evaluate the variability of the +problem class the instance belongs to.

+

The optional cnt argument specifies the number of times +optimization should be performed (the default is 30).

+

A problem must be an MILP, MIQP, or MIQCP and must exist in +memory.

+
+ +
+
+populate_solution_pool()[source]
+

Generates a variety of solutions to a discrete problem (MIP, MIQP, MIQCP).

+

The algorithm that populates the solution pool works in two +phases.

+

In the first phase, it solves the problem to optimality (or +some stopping criterion set by the user) while it sets up a +branch and cut tree for the second phase.

+

In the second phase, it generates multiple solutions by using +the information computed and stored in the first phase and by +continuing to explore the tree.

+

For more information, see the function CPXpopulate in the +Callable Library Reference Manual and the topic solution pool +in the CPLEX User’s Manual.

+
+ +
+
+get_problem_name()[source]
+

Returns the problem name.

+

See CPXgetprobname in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_name("prob1")
+>>> c.get_problem_name()
+'prob1'
+
+
+
+ +
+
+set_problem_name(name)[source]
+

Sets the problem name.

+

See CPXchgprobname in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_name("prob1")
+>>> c.get_problem_name()
+'prob1'
+
+
+
+ +
+
+cleanup(epsilon)[source]
+

Deletes values from the problem data with absolute value +smaller than epsilon.

+

See CPXcleanup in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0, 1e-10, 1.0])
+>>> c.objective.get_linear()
+[1.0, 1e-10, 1.0]
+>>> c.cleanup(epsilon=1e-6)
+>>> c.objective.get_linear()
+[1.0, 0.0, 1.0]
+
+
+
+ +
+
+register_callback(callback_class)[source]
+

Registers a callback class for use during optimization.

+

callback_class must be a proper subclass of one of the callback +classes defined in the module callbacks. To implement custom +logic, override the __call__ method with a method that has +signature __call__(self) -> None. If callback_class is a subclass +of more than one callback class, it will only be called when its +first superclass is called. register_callback returns the +instance of callback_class registered for use. Any previously +registered callback of the same class will no longer be +registered.

+

Returns an instance of callback_class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback):
+...     pass
+>>> cb = c.register_callback(MyMIPInfoCallback)
+
+
+
+ +
+
+unregister_callback(callback_class)[source]
+

Stops a callback class from being used.

+

callback_class must be one of the callback classes defined in the +module callbacks or a subclass of one of them. This method +unregisters any previously registered callback of the same class. +If callback_class is a subclass of more than one callback class, +this method will unregister only the callback of the same type as +its first superclass.

+

Returns the instance of callback_class just unregistered.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback):
+...     pass
+>>> cb = c.register_callback(MyMIPInfoCallback)
+>>> cb = c.unregister_callback(MyMIPInfoCallback)
+
+
+
+ +
+
+set_results_stream(results_file, fn=None)[source]
+

Specifies where results will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which results will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_results_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_warning_stream(warning_file, fn=None)[source]
+

Specifies where warnings will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which warnings will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_warning_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_error_stream(error_file, fn=None)[source]
+

Specifies where errors will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which errors will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_error_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_log_stream(log_file, fn=None)[source]
+

Specifies where the log will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which the log will be written. To write to +this stream, use this object’s write() method.

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_log_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+get_version()[source]
+

Returns a string specifying the version of CPLEX.

+

See CPXversion in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> version = c.get_version()
+
+
+
+ +
+
+get_versionnumber()[source]
+

Returns an integer specifying the version of CPLEX.

+

The version of CPLEX is in the format vvrrmmff, where vv is the +version, rr is the release, mm is the modification, and ff is the +fixpack number. For example, for CPLEX version 12.5.0.1 the +returned value is 12050001.

+

See CPXversionnumber in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> versionnumber = c.get_versionnumber()
+
+
+
+ +
+
+get_num_cores()[source]
+

Returns the number of cores on this machine.

+

See CPXgetnumcores in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> num_cores = c.get_num_cores()
+
+
+
+ +
+
+get_stats()[source]
+

Returns a Stats object containing problem statistics.

+
+
Note

Printing the Stats object will give a nice summary of the +problem statistics in human readable form (e.g. as with the +“display problem statistics” command in the CPLEX interactive).

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> stats = c.get_stats()
+>>> stats.num_variables
+32
+>>> stats.num_linear_constraints
+27
+
+
+
+ +
+
+get_time()[source]
+

Returns a time stamp in seconds.

+

To measure time spent between a starting point and ending point +of an operation, take the result of this method at the starting +point; take the result of this method at the end point; subtract +the starting time stamp from the ending time stamp; the +subtraction yields elapsed time in seconds.

+

The interpretation of this value as wall clock time or CPU time +is controlled by the parameter clocktype.

+

The absolute value of the time stamp is not meaningful.

+

See CPXgettime in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> start = c.get_time()
+>>> c.solve()
+>>> solve_time = c.get_time() - start
+
+
+
+ +
+
+get_dettime()[source]
+

Returns a deterministic time stamp in ticks.

+

To measure elapsed deterministic time in ticks between a starting +point and ending point of an operation, take the deterministic +time stamp at the starting point; take the deterministic time +stamp at the ending point; subtract the starting deterministic +time stamp from the ending deterministic time stamp.

+

The absolute value of the deterministic time stamp is not +meaningful.

+

See CPXgetdettime in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> start = c.get_dettime()
+>>> c.solve()
+>>> solve_dettime = c.get_dettime() - start
+
+
+
+ +
+
+use_aborter(aborter)[source]
+

Use an Aborter to control termination of solve methods.

+

Instructs the invoking object to use the aborter to control +termination of its solving and tuning methods.

+

If another aborter is already being used by the invoking object, +then this method overrides the previously used aborter.

+

Returns the aborter installed in the invoking object or None.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+
+
+
+ +
+
+remove_aborter()[source]
+

Removes the Aborter being used by the invoking object.

+

Returns the aborter that was removed or None.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+>>> aborter = c.remove_aborter()
+
+
+
+ +
+
+get_aborter()[source]
+

Returns the Aborter being used by the invoking object.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+>>> aborter = c.get_aborter()
+
+
+
+ +
+
+set_callback(functor=None, contextmask=0)[source]
+

Set callback function to use during optimization.

+

Sets the callback that CPLEX invokes during optimization. If +functor is None then contextmask will be treated as 0 and the +callback is effectively cleared from CPLEX.

+

In all other cases functor must be a reference to an object that +has a callable member called ‘invoke’ (if that does not exist, or +is not a callable, an exception will occur the first time CPLEX +attempts to invoke the callback). Whenever CPLEX needs to invoke +the callback it calls this member with exactly one argument: an +instance of cplex.callbacks.Context.

+

Note that in the ‘invoke’ function you must not invoke any +functions of the Cplex instance that is performing the current +solve. All functions that can be invoked from a callback are +members of the cplex.callbacks.Context class.

+

contextmask must be the bitwise OR of values from +cplex.callbacks.Context.id and specifies in which contexts +CPLEX shall invoke the callback: the callback is invoked in all +contexts for which the corresponding bit is set in contextmask.

+

Note about cplex.callbacks.Context.id.thread_down: This is +considered a “destructor” function and should not raise any +exception. Any exception raised from the callback in this context +will just be ignored.

+

See cplex.callbacks.Context.

+

See CPXcallbacksetfunc in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class GenericCB():
+...     def invoke(self, context):
+...         pass  # Do something here.
+>>> cb = GenericCB()
+>>> c.set_callback(cb)  # Register callback.
+>>> c.set_callback(None)  # Clear callback.
+
+
+
+ +
+
+set_modeling_assistance_callback(functor=None)[source]
+

Set callback function to use for modeling assistance warnings.

+

Sets the callback that CPLEX invokes before and after +optimization (once for every modeling issue detected). If functor +is None then the callback is effectively cleared from CPLEX. The +callback function will only be invoked if the CPLEX parameter +Cplex.parameters.read.datacheck is set to +Cplex.parameters.read.datacheck.values.assist (2). In addition, +the parameter Cplex.parameters.read.warninglimit controls the +number of times each type of modeling assistance warning will be +reported (the rest will be ignored). See CPX_PARAM_DATACHECK and +CPX_PARAM_WARNLIM in the Parameters of CPLEX Reference Manual.

+

In all other cases functor must be a reference to an object that +has a callable attribute named ‘invoke’ (if that does not exist, +or is not a callable, an exception will occur the first time CPLEX +attempts to invoke the callback). Whenever CPLEX needs to invoke +the callback it calls this member with two argument: the modeling +issue ID and the associated warning message.

+

See model_info.

+

See CPXmodelasstcallbacksetfunc in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.read.datacheck.set(
+...     c.parameters.read.datacheck.values.assist)
+>>> class ModelAsstCB():
+...     def invoke(self, issueid, message):
+...         pass  # Do something here.
+>>> cb = ModelAsstCB()
+>>> c.set_modeling_assistance_callback(cb)  # Register callback.
+>>> c.set_modeling_assistance_callback(None)  # Clear callback.
+
+
+
+ +
+
+create_parameter_set()[source]
+

Returns a new CPLEX parameter set object that is associated +with this CPLEX problem object.

+
+
Note

When this CPLEX problem object is destroyed, the parameter set +object returned by this function will also be destoyed.

+
+
+

See ParameterSet.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+ +
+
+copy_parameter_set(source)[source]
+

Returns a deep copy of a parameter set.

+

In a sense, this a convenience function; it is equivalent to +querying what parameters are in the source parameter set, +querying their values, and then adding those parameters to the +target parameter set.

+
+
Note

The source parameter set must have been created by this CPLEX +problem object. Mixing parameter sets from different CPLEX +problem objects is not supported.

+
+
Note

When this CPLEX problem object is destroyed, the parameter set +object returned by this function will also be destoyed.

+
+
+

See ParameterSet.

+

See CPXparamsetcopy in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> source = c.create_parameter_set()
+>>> source.add(c.parameters.advance,
+...            c.parameters.advance.values.none)
+>>> len(source)
+1
+>>> target = c.copy_parameter_set(source)
+>>> len(target)
+1
+
+
+
+ +
+
+get_parameter_set()[source]
+

Returns a parameter set containing parameters that have been +changed from their default values in the environment.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> ps = c.get_parameter_set()
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+set_parameter_set(source)[source]
+

Applies the parameter values in the paramset to the +environment.

+
+
Note

The source parameter set must have been created by this CPLEX +problem object. Mixing parameter sets from different CPLEX +problem objects is not supported.

+
+
+

See CPXparamsetapply in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> c.set_parameter_set(ps)
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+copylp(numcols, numrows, objsense=1, obj=None, rhs=None, senses='', matbeg=None, matcnt=None, matind=None, matval=None, lb=None, ub=None, range_values=None, colnames=None, rownames=None)[source]
+

Copies LP data into a CPLEX problem object.

+

The arguments define an objective function, constraint matrix, +variable bounds, righthand side, constraint senses, range values, +names of constraints, and names of variables.

+
+
Note

This method can give better performance when building a model, +but it may not be as user friendly as using other methods. To +compare different techniques, see the lpex1.py example.

+
+
Note

Calling this method destroys any existing data associated with +the problem object.

+
+
+

numcols : the number of columns in the constraint matrix, or +equivalently, the number of variables in the problem object.

+

numrows : the number of rows in the constraint matrix, not +including the objective function or bounds on the variables.

+

objsense : sets the sense of the objective function. Must be +either Cplex.objective.sense.minimize or +Cplex.objective.sense.maximize.

+

obj : a list of floats of length at least numcols containing +the objective function coefficients. Required if numcols > 0.

+

rhs : a list of floats of length at least numrows containing +the righthand side value for each constraint in the constraint +matrix. Required if numrows > 0.

+

senses : A list of single-character strings or a string +containing the sense of each constraint in the constraint matrix. +Must be of length at least numrows. Each entry must be one of +‘G’, ‘L’, ‘E’, and ‘R’, indicating greater-than-or-equal-to (>=), +less-than-or-equal-to (<=), equality (=), and ranged constraints, +respectively. Required if numrows > 0.

+

With respect to the arguments matbeg (beginning of the matrix), +matcnt (count of the matrix), matind (indices of the matrix), +and matval (values of the matrix), CPLEX needs to know only the +nonzero coefficients. These arguments are required if +numcols > 0 and numrows > 0.

+

These arrays are accessed as follows. Suppose that CPLEX wants to +access the entries in some column j. These are assumed to be +given by the entries: +matval[matbeg[j]],.., matval[matbeg[j]+matcnt[j]-1]

+

The corresponding row indices are: +matind[matbeg[j]],.., matind[matbeg[j]+matcnt[j]-1]

+

lb : a list of length at least numcols containing the lower +bound on each of the variables. Required if numcols > 0.

+

ub : a list of length at least numcols containing the upper +bound on each of the variables. Required if numcols > 0.

+

range_values : a list of floats, specifying the difference +between lefthand side and righthand side of each linear +constraint. If range_values[i] > 0 (zero) then the constraint i +is defined as rhs[i] <= rhs[i] + range_values[i]. If +range_values[i] < 0 (zero) then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

colnames : a list of strings of length at least numcols +containing the names of the matrix columns or, equivalently, the +constraint names.

+

rownames : a list of strings of length at least numrows +containing the names of the matrix rows or, equivalently, the +constraint names.

+

See CPXcopylpwnames in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.copylp(numcols=3,
+...          numrows=2,
+...          objsense=c.objective.sense.maximize,
+...          obj=[1.0, 2.0, 3.0],
+...          rhs=[20.0, 30.0],
+...          senses="LL",
+...          matbeg=[0, 2, 4],
+...          matcnt=[2, 2, 2],
+...          matind=[0, 1, 0, 1, 0, 1],
+...          matval=[-1.0, 1.0, 1.0, -3.0, 1.0, 1.0],
+...          lb=[0.0, 0.0, 0.0],
+...          ub=[40.0, cplex.infinity, cplex.infinity],
+...          range_values=[0.0, 0.0],
+...          colnames=["x1", "x2", "x3"],
+...          rownames=["c1", "c2"])
+
+
+
+ +
+ +
+
+class Stats[source]
+

Bases: object

+
Inheritance diagram of cplex.Stats
+ + +

A class whose data members reflect statistics about a CPLEX +problem.

+

An instance of this class is returned by the Cplex.get_stats() +method.

+

The __str__ method of this class returns a string containing a +summary of the problem statistics in human readable form.

+

An instance of this class always has the following integer members:

+
    +
  • num_objectives

  • +
  • num_variables

  • +
  • num_nonnegative

  • +
  • num_fixed

  • +
  • num_boxed

  • +
  • num_free

  • +
  • num_other

  • +
  • num_binary

  • +
  • num_integer

  • +
  • num_semicontinuous

  • +
  • num_semiinteger

  • +
  • num_quadratic_variables

  • +
  • num_linear_objective_nz

  • +
  • num_quadratic_objective_nz

  • +
  • num_linear_constraints

  • +
  • num_linear_less

  • +
  • num_linear_equal

  • +
  • num_linear_greater

  • +
  • num_linear_range

  • +
  • num_linear_nz

  • +
  • num_linear_rhs_nz

  • +
  • num_indicator_constraints

  • +
  • num_indicator_less

  • +
  • num_indicator_equal

  • +
  • num_indicator_greater

  • +
  • num_indicator_complemented

  • +
  • num_indicator_nz

  • +
  • num_indicator_rhs_nz

  • +
  • num_quadratic_constraints

  • +
  • num_quadratic_less

  • +
  • num_quadratic_greater

  • +
  • num_quadratic_linear_nz

  • +
  • num_quadratic_nz

  • +
  • num_quadratic_rhs_nz

  • +
  • num_SOS_constraints

  • +
  • num_SOS1

  • +
  • num_SOS1_members

  • +
  • type_SOS1

  • +
  • num_SOS2

  • +
  • num_SOS2_members

  • +
  • type_SOS2

  • +
  • num_lazy_constraints

  • +
  • num_lazy_nnz

  • +
  • num_lazy_lt

  • +
  • num_lazy_eq

  • +
  • num_lazy_gt

  • +
  • num_lazy_rhs_nnz

  • +
  • num_user_cuts

  • +
  • num_user_cuts_nnz

  • +
  • num_user_cuts_lt

  • +
  • num_user_cuts_eq

  • +
  • num_user_cuts_gt

  • +
  • num_user_cuts_rhs_nnz

  • +
  • num_pwl_constraints

  • +
  • num_pwl_breaks

  • +
+

An instance of this class always has the following float members:

+
    +
  • min_lower_bound

  • +
  • max_upper_bound

  • +
  • min_linear_objective

  • +
  • max_linear_objective

  • +
  • min_linear_constraints

  • +
  • max_linear_constraints

  • +
  • min_linear_constraints_rhs

  • +
  • max_linear_constraints_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with a quadratic objective also has the following float +members:

+
    +
  • min_quadratic_objective

  • +
  • max_quadratic_objective

  • +
+

An instance of this class returned by an instance of the Cplex +class with ranged constraints also has the following float +members:

+
    +
  • min_linear_range

  • +
  • max_linear_range

  • +
+

An instance of this class returned by an instance of the Cplex +class with quadratic constraints also has the following float +members:

+
    +
  • min_quadratic_linear

  • +
  • max_quadratic_linear

  • +
  • min_quadratic

  • +
  • max_quadratic

  • +
  • min_quadratic_rhs

  • +
  • max_quadratic_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with indicator constraints also has the following float +members:

+
    +
  • min_indicator

  • +
  • max_indicator

  • +
  • min_indicator_rhs

  • +
  • max_indicator_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with lazy constraints also has the following float members:

+
    +
  • min_lazy_constraint

  • +
  • max_lazy_constraint

  • +
  • min_lazy_constraint_rhs

  • +
  • max_lazy_constraint_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with user cuts also has the following float members:

+
    +
  • min_user_cut

  • +
  • max_user_cut

  • +
  • min_user_cut_rhs

  • +
  • max_user_cut_rhs

  • +
+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(c)[source]
+
+ +
+
+__str__()[source]
+

Returns a string containing a summary of the problem +statistics in human readable form.

+
+ +
+ +
+
+class Aborter[source]
+

Bases: object

+
Inheritance diagram of cplex.Aborter
+ + +

Gracefully terminates the solve and tuning methods of CPLEX.

+

You can pass an instance of this class to one or more Cplex objects.

+

Calling the method abort() will then terminate the solve or tuning +method of the Cplex object.

+
+
+__init__()[source]
+

Constructor of the Aborter class.

+

The Aborter object is a context manager and can be used, like so:

+
+
with Aborter() as aborter:

# do stuff

+
+
+

When the with block is finished, the end() method will be called +automatically.

+
+ +
+
+abort()[source]
+

Aborts the solving and tuning methods.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.abort()
+
+
+
+ +
+
+clear()[source]
+

Clears the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.clear()
+
+
+
+ +
+
+is_aborted()[source]
+

Returns True if the method to abort has been called.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.is_aborted()
+False
+
+
+
+ +
+
+end()[source]
+

Ends the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.end()
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Aborter objects return themselves.

+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+ +
+
+infinity = 1e+20
+

See CPX_INFBOUND in the C API.

+
+ +
+
+class ParameterSet[source]
+

Bases: object

+
Inheritance diagram of cplex.ParameterSet
+ + +

A parameter set object for use with multi-objective optimization.

+

A parameter set consists of key-value pairs where the key is a CPLEX +parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated +parameter value.

+

When adding, getting, or deleting items from a parameter set the +param argument can be either a Parameter object (e.g, +Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND +(1001)).

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+

See Cplex.create_parameter_set and Cplex.copy_parameter_set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance, c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+
+__init__(env)[source]
+

Constructor of the ParameterSet class.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+end()[source]
+

Releases the ParameterSet object.

+

Frees all data structures associated with a ParameterSet. After +a call of the method end(), the invoking object can no longer be +used. Attempts to use them subsequently raise a ValueError.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.end()
+
+
+
+ +
+
+__del__()[source]
+

Destructor of the ParameterSet class.

+

When a ParameterSet object is destoyed, the end() method is +called.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> del ps
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

ParameterSet objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> with c.create_parameter_set():
+...     pass  # do something here
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+
+add(param, value)[source]
+

Add a parameter ID and value to a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+
+
+
+ +
+
+get(param)[source]
+

Gets a parameter value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+get_ids()[source]
+

Gets the parameter IDs contained in a parameter set.

+

Returns an iterator containing the parameter IDs in a parameter +set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> list(ps.get_ids())
+[1001]
+
+
+
+ +
+
+delete(param)[source]
+

Deletes a parameter from a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+>>> ps.delete(c.parameters.advance)
+>>> len(ps)
+0
+
+
+
+ +
+
+clear()[source]
+

Clears all items from the parameter set.

+

Example Usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.clear()
+>>> len(ps)
+0
+
+
+
+ +
+
+__len__()[source]
+

Return the number of items in the parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> len(ps)
+0
+
+
+
+ +
+
+read(filename)[source]
+

Reads parameter names and settings from the file specified by +filename and copies them into the parameter set.

+

Note that the content of the parameter set is not cleared out +before the parameters in the file are copied into the parameter +set. The parameters are read from the file one by one and are +added to the parameter set, or, if the parameter was already +present in the set, then its value is updated.

+

This routine reads and copies files in the PRM format, as created +by Cplex.parameters.write. The PRM format is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> c.parameters.write_file('example.prm')
+>>> ps = c.create_parameter_set()
+>>> ps.read('example.prm')
+>>> value = ps.get(c.parameters.advance)
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+write(filename)[source]
+

Writes a parameter file that contains the parameters in the +parameter set.

+

This routine writes a file in a format suitable for reading by +ParameterSet.read or by Cplex.parameters.read.

+

The file is written in the PRM format which is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.write('example.prm')
+>>> c.parameters.read_file('example.prm')
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+ +
+
+class SparsePair
+

Bases: object

+
Inheritance diagram of cplex.SparsePair
+ + +

A class for storing sparse vector data.

+

An instance of this class has two attributes, ind and val. ind +specifies the indices and val specifies the values. ind and val +must be sequences of the same length. In general, ind may contain +any identifier; for example, when a SparsePair object is passed to +Cplex.linear_constraints.add, its ind attribute may be a list +containing both variable names and variable indices.

+
+
+__init__(ind=None, val=None)[source]
+

Constructor for SparsePair.

+

Takes two arguments, ind and val; ind specifies the indices that +the SparsePair refers to, and val specifies the float values +associated with those indices; ind and val must have the same +length. If ind or val is omitted, they will default to an empty +list.

+
>>> spair = SparsePair(ind=[0], val=[1.0])
+
+
+
+ +
+
+__repr__()[source]
+

Representation method of SparsePair.

+

Example usage:

+
>>> SparsePair(ind=[0], val=[1.0])
+SparsePair(ind = [0], val = [1.0])
+
+
+
+ +
+
+isvalid()[source]
+

Tests that ind and val have the same length.

+

Example usage:

+
>>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0])
+>>> spair.isvalid()
+True
+
+
+
+ +
+
+unpack()[source]
+

Extracts the indices and values sequences as a tuple.

+

Returns ind and val as given in __init__.

+
>>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0])
+>>> ind, val = spair.unpack()
+
+
+
+ +
+ +
+
+class SparseTriple
+

Bases: object

+
Inheritance diagram of cplex.SparseTriple
+ + +

A class for storing sparse matrix data.

+

An instance of this class has three attributes, ind1, ind2, and val. +ind1 and ind2 specify the indices and val specifies the values. +ind1, ind2, and val must be sequences of the same length. In +general, ind1 and ind2 may contain any identifier; for example, when +a SparseTriple object is passed to Cplex.quadratic_constraints.add, +its ind1 attribute may be a list containing both variable names and +variable indices.

+
+
+__init__(ind1=None, ind2=None, val=None)[source]
+

Constructor for SparseTriple.

+

Takes three arguments, ind1, ind2 and val, specifying the +indices that the SparseTriple refers to and the float values +associated with those indices, respectively. ind1, ind2, and +val must all have the same length. If ind1, ind2, or val is +omitted, they will default to an empty list.

+
>>> striple = SparseTriple(ind1=[0], ind2=[0], val=[1.0])
+
+
+
+ +
+
+__repr__()[source]
+

Representation method of SparseTriple.

+

Example usage:

+
>>> SparseTriple(ind1=[0], ind2=[0], val=[1.0])
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+
+
+
+ +
+
+isvalid()[source]
+

Tests that ind1, ind2, and val have the same length.

+

Example usage:

+
>>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1],
+...                        val=[1.0, 1.0])
+>>> striple.isvalid()
+True
+
+
+
+ +
+
+unpack()[source]
+

Extracts the indices and values sequences as a tuple.

+

Returns ind1, ind2, and val as given in __init__.

+
>>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1],
+...                        val=[1.0, 1.0])
+>>> ind1, ind2, val = striple.unpack()
+
+
+
+ +
+ +
+

Subpackages

+
+ +
+
+
+

Submodules

+
+

cplex.aborter module

+

Aborter API

+
+
+class Aborter[source]
+

Bases: object

+
Inheritance diagram of cplex.aborter.Aborter
+ + +

Gracefully terminates the solve and tuning methods of CPLEX.

+

You can pass an instance of this class to one or more Cplex objects.

+

Calling the method abort() will then terminate the solve or tuning +method of the Cplex object.

+
+
+__init__()[source]
+

Constructor of the Aborter class.

+

The Aborter object is a context manager and can be used, like so:

+
+
with Aborter() as aborter:

# do stuff

+
+
+

When the with block is finished, the end() method will be called +automatically.

+
+ +
+
+abort()[source]
+

Aborts the solving and tuning methods.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.abort()
+
+
+
+ +
+
+clear()[source]
+

Clears the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.clear()
+
+
+
+ +
+
+is_aborted()[source]
+

Returns True if the method to abort has been called.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.is_aborted()
+False
+
+
+
+ +
+
+end()[source]
+

Ends the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.end()
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Aborter objects return themselves.

+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+ +
+
+

cplex.callbacks module

+

Callback classes for the CPLEX Python API.

+

This module defines the Context class which provides methods to query +information and perform all actions that can be performed from a generic +callback. See Cplex.set_callback().

+

See the following examples for more information on generic callbacks:

+
+
    +
  • admipex8.py

  • +
  • admipex9.py

  • +
  • bendersatsp2.py

  • +
+
+

This module also defines a hierarchy of classes for legacy callbacks, +many of which can be subclassed to define alternative behavior for the +algorithms in CPLEX. The methods provided by the classes allow you to +query information about the optimization in progress and to control the +optimization algorithm.

+

To use a subclassable legacy callback class, define a subclass of it that +defines a __call__ method. Then pass that class name to the +Cplex.register_callback method. The Cplex class will instantiate the +legacy callback class and return the instance of the class that was +created. If you wish to associate additional data with your callback +class, you may do so after it has been registered with the Cplex object.

+

See the following examples for more information on legacy callbacks:

+
+
    +
  • admipex1.py

  • +
  • admipex2.py

  • +
  • admipex3.py

  • +
  • admipex5.py

  • +
  • admipex6.py

  • +
  • bendersatsp.py

  • +
  • lpex4.py

  • +
  • mipex4.py

  • +
+
+
+
Note

If you operate the CPLEX Python API in parallel mode with callbacks +registered, there will be a single instance of each of your callback +classes shared among all threads.

+
+
+
+
+class Callback[source]
+

Bases: object

+
Inheritance diagram of cplex.callbacks.Callback
+ + +

Base class for Cplex callback classes.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+__call__()[source]
+

Method to be overridden by user-defined callback class.

+

See the Cplex.register_callback method.

+
+ +
+
+abort()[source]
+

Terminates optimization.

+
+
Note

A call to abort should be followed immediately by a return +statement. Calling other callback methods may override the +effect of the abort statement.

+
+
+
+ +
+
+get_end_time()[source]
+

Returns a time stamp for computing the time limit.

+

Subtracting the return value of Callback.get_time() from the +return value of this method yields the time remaining in +seconds.

+

The interpretation of this value as wall clock time or CPU +time is controlled by the parameter clocktype.

+
+ +
+
+get_end_dettime()[source]
+

Returns a deterministic time stamp in ticks.

+

Subtracting the return value of Callback.get_dettime() from the +return value of this method yields the time remaining in +deterministic ticks.

+
+ +
+
+get_start_time()[source]
+

Returns a time stamp specifying when the solving process started.

+

To compute elapsed time in seconds, subtract the result of +Callback.get_time() from the result of this method. This computation +yields either wallclock time (also known as real time) or CPU time, +depending on the clock set by the clocktype parameter.

+
+ +
+
+get_start_dettime()[source]
+

Returns a deterministic time stamp specifying when the solving process started.

+

To compute elapsed deterministic time in ticks, subtract the result of +Callback.get_dettime() from the result of this method.

+
+ +
+
+get_time()[source]
+

Returns a time stamp for the current time.

+

Subtracting the return value of this method from the return +value of Callback.get_end_time() yields the time remaining in +seconds.

+

The interpretation of this value as wall clock time or CPU +time is controlled by the parameter clocktype.

+
+ +
+
+get_dettime()[source]
+

Returns a deterministic time stamp for the current time.

+

Subtracting the return value of this method from the return +value of Callback.get_end_dettime() yields the time remaining in +deterministic ticks.

+
+ +
+ +
+
+class OptimizationCallback[source]
+

Bases: Callback

+
Inheritance diagram of cplex.callbacks.OptimizationCallback
+ + + +

Base class for Cplex optimization callback classes.

+
+
+get_num_quadratic_constraints()[source]
+

Returns the number of quadratic constraints in the problem.

+
+ +
+
+get_num_cols()[source]
+

Returns the number of variables in the problem.

+
+ +
+
+get_num_rows()[source]
+

Returns the number of linear constraints in the problem.

+
+ +
+ +
+
+class ContinuousCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.ContinuousCallback
+ + + + +

Subclassable class for Cplex continuous callbacks.

+

When Cplex is solving a problem by a simplex or barrier method, +this callback will be called after the simplex or barrier +callback, if any such callbacks are registered.

+

During concurrent optimization, CPLEX calls the user-written +callback only in the main thread, not in other concurrent threads.

+
+
Undocumented:
+

__init__, _wherefrom

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_dual_infeasibility()[source]
+

Returns a measure of the dual infeasibility of the problem.

+
+ +
+
+get_primal_infeasibility()[source]
+

Returns a measure of the primal infeasibility of the problem.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations completed.

+
+ +
+
+get_objective_value()[source]
+

Returns the current value of the objective function.

+
+ +
+
+is_dual_feasible()[source]
+

Returns whether or not the current solution is dual feasible.

+
+ +
+
+is_primal_feasible()[source]
+

Returns whether or not the current solution is primal feasible.

+
+ +
+ +
+
+class SimplexCallback[source]
+

Bases: ContinuousCallback

+
Inheritance diagram of cplex.callbacks.SimplexCallback
+ + + + + +

Subclassable class for Cplex simplex callback classes.

+

This callback will be used during execution of the primal simplex, +dual simplex, or quadratic simplex algorithms.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+ +
+
+class BarrierCallback[source]
+

Bases: ContinuousCallback

+
Inheritance diagram of cplex.callbacks.BarrierCallback
+ + + + + +

Subclassable class for Cplex barrier callback classes.

+

This callback will be used during execution of the barrier or +quadratic barrier algorithms.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_dual_objective_value()[source]
+

Returns the current dual value of the objective function.

+
+ +
+ +
+
+class CrossoverCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.CrossoverCallback
+ + + + +

Subclassable class for Cplex crossover callback classes.

+

This callback will be used during execution of a crossover +algorithm.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_num_dual_exchanges()[source]
+

Returns the number of dual exchanges performed so far.

+
+ +
+
+get_num_dual_pushes()[source]
+

Returns the number of dual pushes performed so far.

+
+ +
+
+get_num_primal_exchanges()[source]
+

Returns the number of primal exchanges performed so far.

+
+ +
+
+get_num_primal_pushes()[source]
+

Returns the number of primal pushes performed so far.

+
+ +
+
+get_num_superbasics()[source]
+

Returns the number of superbasic variables in the basis.

+
+ +
+ +
+
+class QualityMetric[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.QualityMetric
+ + + +

Constants defining metrics for the quality of the MIP solve.

+
+
+kappa_stable = 127
+
+ +
+
+kappa_suspicious = 128
+
+ +
+
+kappa_unstable = 129
+
+ +
+
+kappa_illposed = 130
+
+ +
+
+kappa_max = 131
+
+ +
+
+kappa_attention = 132
+
+ +
+ +
+
+class CutType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.CutType
+ + + +

Arguments to MIPInfoCallback.get_num_cuts().

+
+
+cover = 108
+
+ +
+
+GUB_cover = 111
+
+ +
+
+flow_cover = 110
+
+ +
+
+clique = 107
+
+ +
+
+fractional = 115
+
+ +
+
+MIR = 120
+
+ +
+
+flow_path = 119
+
+ +
+
+disjunctive = 117
+
+ +
+
+implied_bound = 112
+
+ +
+
+zero_half = 122
+
+ +
+
+multi_commodity_flow = 126
+
+ +
+
+lift_and_project = 133
+
+ +
+
+user = 134
+
+ +
+
+table = 135
+
+ +
+
+solution_pool = 136
+
+ +
+
+benders = 137
+
+ +
+ +
+
+class MIPInfoCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.MIPInfoCallback
+ + + + +

Subclassable class for MIP informational callback classes.

+

This callback will be used when CPLEX is solving a MIP problem.

+
+
Undocumented:
+

__init__

+
+
+
+
+quality_metric = <cplex.callbacks.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+cut_type = <cplex.callbacks.CutType object>
+

See CutType()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_num_cols()[source]
+

Returns the number of variables in the problem.

+
+ +
+
+get_num_rows()[source]
+

Returns the number of linear constraints in the problem.

+
+ +
+
+get_num_quadratic_constraints()[source]
+

Returns the number of quadratic constraints in the problem.

+
+ +
+
+get_num_cuts(cut_type)[source]
+

Returns the number of cuts of type cut_type added so far.

+
+ +
+
+get_best_objective_value()[source]
+

Returns the best objective value among unexplored nodes.

+
+ +
+
+get_cutoff()[source]
+

Returns the current cutoff value.

+
+ +
+
+get_incumbent_objective_value()[source]
+

Returns the objective value of the incumbent solution.

+
+ +
+
+get_incumbent_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the incumbent solution.

+

Can be called by four forms.

+
+
self.get_incumbent_linear_slacks()

return all linear slack values from the incumbent solution.

+
+
self.get_incumbent_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_incumbent_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_incumbent_linear_slacks(i) for i in s]

+
+
self.get_incumbent_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_incumbent_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_incumbent_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks for the incumbent solution.

+

Can be called by four forms.

+
+
self.get_incumbent_quadratic_slacks()
+
return all quadratic slack values from the incumbent

solution.

+
+
+
+
self.get_incumbent_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_incumbent_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to +[self.get_incumbent_quadratic_slacks(i) for i in s]

+
+
self.get_incumbent_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_incumbent_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_incumbent_values(*args)[source]
+

Returns the variable values of the incumbent solution.

+

There are four forms by which get_incumbent_values may be +called.

+
+
self.get_incumbent_values()

returns the entire incumbent solution

+
+
self.get_incumbent_values(i)

i must be a variable index or name. Returns the value +of the variable with index i in the incumbent solution.

+
+
self.get_incumbent_values(s)

s must be a sequence of variables indices or names. +Returns a list of the values of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_incumbent_values(i) for i in s]

+
+
self.get_incumbent_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the values of the variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_incumbent_values(range(begin, end + 1))

+
+
+
+ +
+
+get_MIP_relative_gap()[source]
+

Returns the current relative MIP gap.

+

Accesses the current relative gap, like the routine +CPXgetmiprelgap in the Callable Library. See CPXgetcallbackinfo +and CPXgetmiprelgap in the Callable Library Reference Manual for +more detail.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations performed so far.

+
+ +
+
+get_num_nodes()[source]
+

Returns the number of nodes processed so far.

+
+ +
+
+get_num_remaining_nodes()[source]
+

Returns the number of unexplored nodes remaining.

+
+ +
+
+has_incumbent()[source]
+

Returns whether or not an incumbent solution has been found.

+
+ +
+
+get_float_quality(which)[source]
+

Returns a measure of the quality of the MIP solution as a floating point value.

+

The measure of the quality of a solution must be an attribute +of self.quality_metric corresponding to a floating point +quality metric. Such metrics include:

+

self.quality_metric.kappa_stable +self.quality_metric.kappa_suspicious +self.quality_metric.kappa_unstable +self.quality_metric.kappa_illposed +self.quality_metric.kappa_max +self.quality_metric.kappa_attention

+
+ +
+
+get_thread_num()[source]
+

Returns the identifier for the thread from which the callback +was invoked.

+

See CPX_CALLBACK_INFO_MY_THREAD_NUM in the Callable Library +Reference Manual for more detail.

+
+ +
+ +
+
+class MIPCallback[source]
+

Bases: MIPInfoCallback

+
Inheritance diagram of cplex.callbacks.MIPCallback
+ + + + + +

Subclassable class for MIP callback classes.

+

This callback will be used when CPLEX is solving a MIP problem.

+
+
Undocumented:
+

__init__, _get_node_info, _get_seq_info

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_objective_coefficients(*args)[source]
+

Returns the coefficients of the linear objective function.

+

There are four forms by which get_objective_coefficients may +be called.

+
+
self.get_objective_coefficients()

returns the entire objective function.

+
+
self.get_objective_coefficients(i)

i must be a variable index or name. Returns the objective +coefficient of the variable with index i.

+
+
self.get_objective_coefficients(s)

s must be a sequence of variable indices or names. Returns +a list of the objective coefficients of the variables with +indices the members of s, in the same order as they appear +in s. Equivalent to [self.get_objective_coefficients(i) +for i in s]

+
+
self.get_objective_coefficients(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the objective coefficients of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_objective_coefficients(range(begin, end + 1))

+
+
+
+ +
+
+get_current_node_depth()[source]
+

Returns the depth of the current node in the search tree.

+

The root node has depth 0 (zero). The depth of other nodes is defined +recursively as the depth of their parent node plus one. In other +words, the depth of a node is its distance in terms of the number of +branches from the root.

+
+ +
+ +
+
+class FeasibilityStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.FeasibilityStatus
+ + + +

Feasibility status codes.

+
+
+feasible = 0
+
+ +
+
+implied_feasible = 2
+
+ +
+
+infeasible = 1
+
+ +
+ +
+
+class ControlCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.ControlCallback
+ + + + + + +

Base class for Cplex MIP control callback classes.

+
+
Undocumented:
+

__init__

+
+
+
+
+feasibility_status = <cplex.callbacks.FeasibilityStatus object>
+

See FeasibilityStatus()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_pseudo_costs(*args)[source]
+

Returns the current pseudo costs.

+

There are four forms by which get_pseudo_costs may be +called.

+
+
self.get_pseudo_costs()
+
returns a list of pairs with the pseudo costs for all the

variables.

+
+
+
+
self.get_pseudo_costs(i)

i must be a variable index or name. Returns a pair (up, +down), where up is the up pseudo cost and down is the down +pseudo cost of branching on the variable i.

+
+
self.get_pseudo_costs(s)

s must be a sequence of variable indices or names. Returns +a list of pairs (up, down) of pseudo costs of branching on +the variables with indices the members of s, in the same +order as they appear in s. Equivalent to +[self.get_pseudo_costs(i) for i in s]

+
+
self.get_pseudo_costs(begin, end)

begin and end must be variable indices or variable names. +Returns a list of pairs (up, down) of pseudo costs of branching +on the variables with indices between begin and end, inclusive +of end. Equivalent to +self.get_pseudo_costs(range(begin, end + 1))

+
+
+
+ +
+
+get_feasibilities(*args)[source]
+

Returns the current integer feasibility status.

+

There are four forms by which get_feasibilities may be +called.

+

The return values are attributes of self.feasibility_status.

+
+
self.get_feasibilities()

returns a list with the feasibility status for all the +variables.

+
+
self.get_feasibilities(i)

i must be a variable index or name. Returns the +feasibility status of the variable with index i.

+
+
self.get_feasibilities(s)

s must be a sequence of variable indices or names. Returns +a list of the feasibility statuses of the variables with +indices the members of s, in the same order as they appear +in s. Equivalent to [self.get_feasibilities(i) for i in s]

+
+
self.get_feasibilities(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the feasibility statuses of the variables +with indices between begin and end, inclusive of end. +Equivalent to self.get_feasibilities(range(begin, end + 1))

+
+
Note

Before you call this method from a solve callback, a +solution must exist. That is, you must first create the +solution by calling a CPLEX optimization method, and then +you must verify that this optimization method generated a +solution by checking its return value before you call the +method get_feasibilities.

+
+
+
+ +
+
+get_lower_bounds(*args)[source]
+

Returns the lower bounds at the current node.

+

There are four forms by which get_lower_bounds may be +called.

+
+
self.get_lower_bounds()

returns a list with the lower bounds for all the variables.

+
+
self.get_lower_bounds(i)

i must be a variable index or name. Returns the lower +bound of the variable with index i.

+
+
self.get_lower_bounds(s)

s must be a sequence of variable indices or names. Returns +a list of the lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_lower_bounds(i) for i in s]

+
+
self.get_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the lower bounds of the variables with +indices between begin and end, inclusive of end. Equivalent +to self.get_lower_bounds(range(begin, end + 1))

+
+
+
+ +
+
+get_upper_bounds(*args)[source]
+

Returns the upper bounds at the current node.

+

There are four forms by which get_upper_bounds may be +called.

+
+
self.get_upper_bounds()

returns a list with the upper bounds for all the variables.

+
+
self.get_upper_bounds(i)

i must be a variable index or name. Returns the upper +bound of the variable with index i.

+
+
self.get_upper_bounds(s)

s must be a sequence of variable indices or names. Returns +a list of the upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_upper_bounds(i) for i in s]

+
+
self.get_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the upper bounds of the variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_upper_bounds(range(begin, end + 1))

+
+
+
+ +
+
+get_node_data()[source]
+

Returns the user handle for the current node.

+

Returns None if no handle is set for the node.

+
+ +
+
+set_node_data(data)[source]
+

Set the user handle for the current node.

+

Returns the user handle previously set for this node (or None +if no handle was set).

+
+ +
+
+get_node_ID()[source]
+

Return the sequence number of this node.

+
+ +
+
+get_objective_value()[source]
+

Returns the value of the objective function at the current node.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_linear_slacks()

return all linear slack values from the problem at the +current node.

+
+
self.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_linear_slacks(i) for i in s]

+
+
self.get_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_quadratic_slacks()

return all quadratic slack values from the problem at the +current node.

+
+
self.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [self.get_quadratic_slacks(i) for i in s]

+
+
self.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_values(*args)[source]
+

Returns the solution values at the current node.

+

In the case that the node LP is unbounded, this method returns +a vector that corresponds to an unbounded direction, scaled so +that at least one of its elements has magnitude +cplex.infinity. Thus, often the vector can be used directly, +for example to separate a lazy constraint. However, due to +the presence of large values in the vector care must be taken +to avoid potential numerical errors. If in doubt, +rescale the vector, and use it as an unbounded ray +rather than a primal vector.

+

There are four forms by which get_values may be called.

+
+
self.get_values()

returns the entire primal solution vector.

+
+
self.get_values(i)

i must be a variable index or name. Returns the solution +value of the variable with index i.

+
+
self.get_values(s)

s must be a sequence of variable indices or names. Returns +a list of the solution values of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_values(i) for i in s]

+
+
self.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_values(range(begin, end + 1))

+
+
+
+ +
+
+get_SOS_feasibilities(*args)[source]
+

Returns the current special ordered set feasibility status.

+

There are four forms by which get_SOS_feasibilities may be +called.

+

Returns 1 if the SOS is feasible and 0 if it is not.

+
+
self.get_SOS_feasibilties()

Returns the feasibility statuses of all the special ordered +sets.

+
+
self.get_SOS_feasibilities(i)

i must be a SOS index or name. Returns the feasibility +status of the special ordered set with index i.

+
+
self.get_SOS_feasibilities(s)

s must be a sequence of SOS indices or names. Returns a +list of the feasibility statuses of the special ordered +sets with indices the members of s, in the same order as +they appear in s. Equivalent to +[self.get_SOS_feasibilities(i) for i in s]

+
+
self.get_SOS_feasibilities(begin, end)

begin and end must be SOS indices or SOS names. Returns a list +of the feasibility statuses of the special ordered sets with +indices between begin and end, inclusive of end. Equivalent to +self.get_SOS_feasibilities(range(begin, end + 1))

+
+
Note

Before you call this method from a solve callback, a +solution must exist. That is, you must first create the +solution by calling a CPLEX optimization method, and then +you must verify that this optimization method generated a +solution by checking its return value before you call the +method get_SOS_feasibilities.

+
+
+
+ +
+ +
+
+class BranchType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.BranchType
+ + + +

Constants defining types of branches.

+
+
+any = 'A'
+
+ +
+
+SOS1 = '1'
+
+ +
+
+SOS2 = '2'
+
+ +
+
+variable = '0'
+
+ +
+ +
+
+class BranchCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.BranchCallback
+ + + + + + + +

Subclassable class for branch callback classes.

+

The user must be careful when using this class. Pruning a valid node +can prune the optimal solution. Also, choosing a different branching +variable can result in placing an invalid bound on a variable, in case +the variable was already restricted to other bounds before.

+

In particular, the user must not branch on variables that are implied +feasible. ImpliedFeasible specifies that the variable has been +presolved out. It will be feasible when all other integer variables +are integer feasible. Branching on such variables can cut off +feasible solutions.

+

If the user intends to branch on continuous variables, the user must +disable dual presolve reductions. To disable dual presolve +reductions, set the parameter to control primal and dual reduction +type, parameters.preprocessing.reduce, either to the value 1 (one) +(that is, CPX_PREREDUCE_PRIMALONLY) or to the value 0 (zero) (that +is, CPX_PREREDUCE_NOPRIMALORDUAL).

+

Also, if the user intends to branch on continuous variables, the user +must turn off reductions that may interfere with crushing or uncrushing. +This is parameters.preprocessing.reformulations.

+

By design, the CPLEX branch callback calculates and provides the +branching decisions that CPLEX would make in case the user does not +create any branches in the callback. Depending on variable selection +and other features of your model, the computation of these candidate +branches can be time-consuming. Consequently, if you know that you +will never use the branching candidates suggested by CPLEX, then you +can save time by disabling such features as strong branching. This +callback will be used prior to branching at a node in the branch and +cut tree.

+
+
Undocumented:
+

__init__

+
+
+
+
+branch_type = <cplex.callbacks.BranchType object>
+

See BranchType()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_branch(which_branch)[source]
+

Returns one of the candidate branches at the current node.

+

which_branch must be an integer such that 0 <= which_branch < +self.get_num_branches().

+

The return value of get_branch is a tuple t with two entries. +The first entry is the node estimate for the specified branch. +The second entry is a list of (var, dir, bnd) triples, where +var is the index of a variable whose bound will change, bnd is +the new bound, and dir is one of “L”, “U”, and “B”, indicating +that the branch will change the lower bound, the upper bound, +or both, respectively.

+
+ +
+
+get_branch_type()[source]
+

Returns the type of the branch.

+

One of the following: +self.branch_type.any +self.branch_type.SOS1 +self.branch_type.SOS2 +self.branch_type.variable

+
+ +
+
+get_num_branches()[source]
+

Return the number of nodes Cplex will create from this branch.

+
+ +
+
+is_integer_feasible()[source]
+

Return whether or not the current node is integer feasible.

+
+ +
+
+make_branch(objective_estimate, variables=None, constraints=None, node_data=None)[source]
+

Makes a new branch with the specified data.

+

objective_estimate is a float representing the estimated +objective value resulting from the specified branch.

+

variables is a sequence of (var, dir, bnd) triples specifying +the variables on which to branch. var must be an index of a +variable, dir must be one of “L” and “U”, indicating that the +bound is a lower or upper bound, respectively, and bnd is an +integer specifying the new bound for the variable.

+

constraints is a sequence of (vec, sense, rhs) triples +specifying the constraints with which to branch. vec must be +either an instance of SparsePair or a sequence with two +entries, the first of which specifies the indices and the +second of which specifies the values of the constraint. rhs +must be a float determining the righthand side of the +constraint. sense must be one of “L”, “G”, or “E”, specifying +whether the constraint is a less-than-or-equal-to (<=), +greater-than-or-equal-to (>=), or equality constraint.

+

node_data may be any object to be associated with the created +node. It can be queried by the get_node_data methods of the +IncumbentCallback class and the NodeCallback class.

+
+ +
+
+make_cplex_branch(which_branch, node_data=None)[source]
+

Replicates a CPLEX branch.

+

This method replicates the n-th branch that CPLEX would create +at the current node. The purpose of this method is to branch +exactly like CPLEX, but at the same time attach a user object to +the newly created node.

+

which_branch must be an integer such that 0 <= which_branch < +self.get_num_branches().

+

node_data may be any object to be associated with the created +node. It can be queried by the get_node_data methods of various +callback classes.

+

This method returns the sequence number of the newly created +node.

+
+ +
+
+prune()[source]
+

Removes the current node from the search tree.

+
+
Note

Prune must not be called in combination with make_branch. +Prune is not compatible with the populate_solution_pool +method of the Cplex class because +that method retains fathomed nodes for subsequent use.

+
+
+
+ +
+ +
+
+class CutCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.CutCallback
+ + + + + + + +

Base class for user cut and lazy constraint callback classes.

+
+
Undocumented:
+

add, add_local

+
+
+
+ +
+
+class UseConstraint[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.UseConstraint
+ + + +

Constants to specify when to use the added constraint

+
+
+force = 0
+
+ +
+
+purge = 1
+
+ +
+ +
+
+class LazyConstraintCallback[source]
+

Bases: CutCallback

+
Inheritance diagram of cplex.callbacks.LazyConstraintCallback
+ + + + + + + + +

Subclassable class for lazy constraint callback classes.

+

This callback will be used when CPLEX finds a new integer +feasible solution and when CPLEX finds that the LP relaxation +at the current node is unbounded.

+
+

Note

+

The lazy constraint callback may be invoked during MIP start +processing. In that case get_solution_source returns +mip_start_solution. When this value is returned some special +considerations apply:

+
+
    +
  • MIP start processing occurs very early in the solution process. +At this point no search tree is setup yet and there are no +search tree nodes yet. Consequently, a lot of the callback +methods that require a node context will fail in this +situation.

  • +
  • Lazy constraints separated when processing a MIP start will be +discarded after that MIP start has been processed. This means +that the callback may have to separate the same constraint +again for the next MIP start or for a solution that is found +later in the solution process.

  • +
+
+
+
+
Undocumented:
+

__init__

+
+
+
+
+use_constraint = <cplex.callbacks.UseConstraint object>
+

See UseConstraint()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+add(constraint, sense, rhs, use=0)[source]
+

Adds a linear constraint to the current subproblem.

+

constraint must be either a SparsePair instance or a list of +two lists, the first of which specifies variables, the second +of which specifies the values of the constraint.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the constraint.

+

use indicates under what circumstances the constraint should +be used. It can take the following values:

+

self.use_constraint.force (default) : force CPLEX to use the constraint +self.use_constraint.purge : allow CPLEX to purge the constraint

+

When you add a lazy constraint with the nondefault value purge, +you authorize CPLEX to purge (that is, to eliminate) the lazy +constraint under certain circumstances, for example, if the +lazy constraint becomes slack. Consequently, in view of such +purging, you must not assume that any previously added constraints +are still in current relaxation. In other words, the purged +lazy constraint may be violated in subsequent relaxations.

+
+ +
+
+add_local(constraint, sense, rhs)[source]
+

Adds a linear local constraint to the current subproblem.

+

A local constraint is a constraint that will only be added to +the problem at the current node and the subtree rooted by the +current node. It will not be added to the constraint matrix of +the original model.

+

constraint must be either a SparsePair instance or a list of +two lists, the first of which specifies variables, the second +of which specifies the values of the constraint.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the constraint.

+
+ +
+
+is_unbounded_node()[source]
+

Returns True if the current LP relaxation is unbounded, False otherwise.

+
+ +
+
+get_solution_source()[source]
+

Returns the source of the solution for which the lazy constraint callback was invoked.

+

The possible return values are:

+

IncumbentCallback.solution_source.node_solution: The integral solution is +the solution to the LP relaxation of a node in the MIP search +tree.

+

IncumbentCallback.solution_source.heuristic_solution: The integral solution +has been found by a CPLEX internal heuristic.

+

IncumbentCallback.solution_source.mipstart_solution: The integral solution has been +found during MIP start processing.

+
+ +
+ +
+
+class UseCut[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.UseCut
+ + + +

Constants to specify when to use the added cut.

+
+
+force = 0
+
+ +
+
+purge = 1
+
+ +
+
+filter = 2
+
+ +
+ +
+
+class UserCutCallback[source]
+

Bases: CutCallback

+
Inheritance diagram of cplex.callbacks.UserCutCallback
+ + + + + + + + +

Subclassable class for lazy constraint callback classes.

+

This callback will be used within the cut loop that CPLEX calls at +each node of the branch and cut algorithm. It will be called once +after CPLEX has ended its own cut generation loop so that the user +can specify additional cuts to be added to the cut pool.

+
+
Undocumented:
+

__init__

+
+
+
+
+use_cut = <cplex.callbacks.UseCut object>
+

See UseCut()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+add(cut, sense, rhs, use=0)[source]
+

Adds a linear cut to to the current subproblem.

+

cut must be either a SparsePair instance or a list of two +lists, the first of which specifies variables, the second of +which specifies the values of the cut.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the cut.

+

use indicates under what circumstances the cut should be used. +It can take the following values

+

self.use_cut.force (default) : force CPLEX to use the cut +self.use_cut.purge : allow CPLEX to purge the cut +self.use_cut.filter : treat as cuts CPLEX creates

+
+ +
+
+add_local(cut, sense, rhs)[source]
+

Adds a linear local cut to the current subproblem.

+

A local cut is a cut that is only valid at the current +node and the subtree rooted by the current node. It does +not need to be globally valid.

+

cut must be either a SparsePair instance or a list of two +lists, the first of which specifies variables, the second of +which specifies the values of the cut.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the cut.

+
+ +
+
+is_after_cut_loop()[source]
+

Returns True if called after the cut loop, False otherwise.

+
+ +
+
+abort_cut_loop()[source]
+

Terminate the cut loop and proceed with branching.

+
+ +
+ +
+
+class MethodType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.MethodType
+ + + +

Constants defining methods for solving the node LP.

+
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+network = 3
+
+ +
+ +
+
+class HSCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.HSCallback
+ + + + + + + +

Base class for heuristic and solve callback classes.

+
+
+status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See _internal._subinterfaces.SolutionStatus()

+
+ +
+
+method = <cplex.callbacks.MethodType object>
+

See MethodType()

+
+ +
+
+get_cplex_status()[source]
+

Returns the solution status of the current subproblem.

+

Returns an attribute of self.status.

+
+ +
+
+is_dual_feasible()[source]
+

Returns whether the solution of the current subproblem is dual feasible.

+
+ +
+
+is_primal_feasible()[source]
+

Returns whether the solution of the current subproblem is primal feasible.

+
+ +
+
+solve(alg=2)[source]
+

Solves the current subproblem.

+

The value of alg, if specified, determines the algorithm to +use to solve the current subproblem.

+

self.method.primal : primal simplex

+

self.method.dual : dual simplex

+

self.method.barrier : barrier

+

self.method.network : network

+

If this method generates a feasible solution it returns True, +otherwise it returns False.

+
+ +
+ +
+
+class HeuristicCallback[source]
+

Bases: HSCallback

+
Inheritance diagram of cplex.callbacks.HeuristicCallback
+ + + + + + + + +

Subclassable class for heuristic callback classes.

+

This callback will be used after solving each subproblem and at +the root node before each round of cuts is added to the problem +and resolved.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+set_bounds(*args)[source]
+

Sets the bounds for a set of variables.

+

Can be called by two forms.

+
+
self.set_bounds(i, lb, ub)

i must be a variable name or index and lb and ub must be +real numbers. Sets the lower bound and upper bound of the +variable whose index or name is i to lb and ub, +respectively.

+
+
self.set_lower_bounds(seq_of_triples)

seq_of_triples must be a list or tuple of tuples (i, lb, ub), +each of which consists of a variable name or index and +two real numbers. Sets the bounds of the specified +variables to the corresponding values. Equivalent to +[self.set_lower_bounds(triple[0], triple[1], triple[2]) for +triple in seq_of_triples].

+
+
Note

The variables specified must not have been removed by +presolve.

+
+
Note

These bound changes affect only the problem at the current +node.

+
+
+
+ +
+
+set_solution(solution, objective_value=None)[source]
+

Sets a solution to be used as the incumbent.

+

solution is either an instance of SparsePair or a sequence of +length two. If it is a sequence, the first entry is a +sequence of variable indices or names whose values are to be +changed and the second entry is a sequence of floats with the +corresponding new solution values. Variables whose indices +are not specified remain unchanged.

+

If objective_value is specified, it is taken as the objective +value of the new solution. Otherwise, the objective value is +computed.

+

Do not call this method multiple times. +Calling it again will overwrite any previously specified solution.

+
+ +
+ +
+
+class SolveCallback[source]
+

Bases: HSCallback

+
Inheritance diagram of cplex.callbacks.SolveCallback
+ + + + + + + + +

Subclassable class for solve callback classes.

+

This callback can be used to solve node relaxations during branch +and cut search.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+set_start(primal=None, dual=None)[source]
+

Sets the starting vectors for the next solve.

+

The arguments primal and dual must either be instances of +SparsePair or sequences of length two. If they are sequences, +the first entry is a sequence of indices or names specifying +the columns or rows whose values are to be set, and the second +entry is a sequence of floats with the corresponding new +values.

+

If primal is specified but dual is not, no dual values will be +stored. If dual is specified but primal is not, no primal +values will be stored.

+

Variables whose indices are not specified will be set to 0.0.

+
+
Note

If presolve is enabled, attempting to set dual values in +this method will raise an exception.

+
+
+
+ +
+
+use_solution()[source]
+

Tell CPLEX to use the resident solution after calling solve.

+
+ +
+ +
+
+class SolutionSource[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.SolutionSource
+ + + +

Attributes defining possible solution sources.

+
+
+node_solution = 111
+
+ +
+
+heuristic_solution = 117
+
+ +
+
+user_solution = 118
+
+ +
+
+mipstart_solution = 119
+
+ +
+ +
+
+class IncumbentCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.IncumbentCallback
+ + + + + + +

Subclassable class for incumbent callback classes.

+

This callback will be used after each new potential incumbent is found. +If the callback is used to reject incumbents, the user must set +the parameter +c.parameters.preprocessing.reduce either to the value +1 (one) to restrict presolve to primal reductions only or to 0 (zero) +to disable all presolve reductions. This setting of the parameter is +not necessary if the incumbent callback is used for other purposes.

+
+
Note

The incumbent callback may be invoked during MIP start processing. +In that case get_solution_source will return mip_start_solution. +In this situation the following special consideration applies:

+
    +
  • MIP start processing occurs very early in the solution process. +At this point no search tree is setup yet and there are no search +tree nodes yet. Consequently, a lot of the callback methods +that require a node context will fail in this situation.

  • +
+
+
+
+
Undocumented:
+

__init__

+
+
+
+
+solution_source = <cplex.callbacks.SolutionSource object>
+

See SolutionSource()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_node_data()[source]
+

Returns the user handle for the current node.

+

Returns None if no handle is set for the node.

+
+ +
+
+set_node_data(data)[source]
+

Set the user handle for the current node.

+

Returns the user handle previously set for this node (or None +if no handle was set).

+
+ +
+
+get_node_ID()[source]
+

Returns the sequence number of the current node.

+
+ +
+
+get_objective_value()[source]
+

Returns the objective value of the potential incumbent.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_linear_slacks()

return all linear slack values from the problem at the +current node.

+
+
self.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_linear_slacks(i) for i in s]

+
+
self.get_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Return a set of quadratic slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_quadratic_slacks()

return all quadratic slack values from the problem at the +current node.

+
+
self.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [self.get_quadratic_slacks(i) for i in s]

+
+
self.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or +quadratic constraint names. Returns the slack values associated +with the quadratic constraints with indices between begin and +end, inclusive of end. Equivalent to +self.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_values(*args)[source]
+

Return the potential incumbent solution values.

+

There are four forms by which get_values may be called.

+
+
self.get_values()

returns the entire potential incumbent.

+
+
self.get_values(i)

i must be a variable index or name. Returns the potential +incumbent value of the variable with index i.

+
+
self.get_values(s)

s must be a sequence of variable indices or names. Returns +a list of the potential incumbent values of the variables +with indices the members of s, in the same order as they +appear in s. Equivalent to [self.get_values(i) for i in s]

+
+
self.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the potential incumbent values of variables +with indices between begin and end, inclusive of end. +Equivalent to self.get_values(range(begin, end + 1))

+
+
+
+ +
+
+get_solution_source()[source]
+

Returns the source of the solution for which the incumbent callback was invoked.

+

The possible return values are:

+

self.solution_source.node_solution: The integral solution is +the solution to the LP relaxation of a node in the MIP search +tree.

+

self.solution_source.heuristic_solution: The integral solution +has been found by a CPLEX internal heuristic.

+

self.solution_source.user_solution: The integral solution has been +found by the user in the heuristic callback.

+

self.solution_source.mipstart_solution: The integral solution has been +found during MIP start processing.

+
+ +
+
+reject()[source]
+

Tells Cplex not to use the potential incumbent.

+
+ +
+ +
+
+class NodeCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.NodeCallback
+ + + + + + +

Subclassable class for node callback classes.

+

This callback will be used before CPLEX enters a node, and can select +a different node to be entered instead.

+
+
Undocumented:
+

__init__, __conditionally_convert

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_branch_variable(which_node)[source]
+

Returns the index of the variable used to branch at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_depth(which_node)[source]
+

Returns the depth in the search tree of node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_current_node_depth()[source]
+

Returns the depth of the current node in the search tree.

+

This method always raises an exception since the node callback is not +invoked in the context of any node.

+
+ +
+
+get_estimated_objective_value(which_node)[source]
+

Returns the estimated objective function value at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_infeasibility_sum(which_node)[source]
+

Returns the sum of infeasibilities at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_num_infeasibilities(which_node)[source]
+

Returns the number of infeasibilities at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_node_data(which_node)[source]
+

Returns the handle set by the user for node which_node.

+

Returns None if no handle was set when the node was created.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+set_node_data(which_node, data)[source]
+

Set the user handle for the specified node.

+

Returns the user handle previously set for that node (or None +if no handle was set).

+
+ +
+
+get_node_ID(which_node)[source]
+

Returns a one-tuple containing the sequence number of node which_node.

+

which_node must be an integer specifying the index +number of the desired node.

+
+ +
+
+get_node_number(which_node)[source]
+

Returns the index number of node which_node.

+

which_node must be a 1-tuple whose entry is an integer +specifying the sequence number of the desired node.

+
+ +
+
+get_objective_value(which_node)[source]
+

Returns the objective function value for node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+select_node(which_node)[source]
+

Tells Cplex to enter node which_node next.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+ +
+
+class TuningCallback[source]
+

Bases: Callback

+
Inheritance diagram of cplex.callbacks.TuningCallback
+ + + +

Subclassable class for tuning callback classes.

+

This callback will be used during tuning.

+

For general information about tuning callbacks, see that topic +in the CPLEX User’s Manual.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_progress()[source]
+

Returns the fraction of the tuning process that is done.

+
+ +
+ +
+
+class ContextType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.ContextType
+ + + +

The different contexts in which a generic callback can be invoked.

+

The values defined here serve two purposes:

+
+

They are returned from Context.get_id() to indicate in which +context a particular callback invocation happened.

+

The bit-wise OR of these values specifies to +Cplex.set_callback() in which contexts CPLEX invokes the +callback.

+
+

See the reference manual of the CPLEX Callable Library (C API) +for a more detailed description of the various contexts.

+
+
+thread_up = 2
+

See CPX_CALLBACKCONTEXT_THREAD_UP in the C API.

+
+ +
+
+thread_down = 4
+

See CPX_CALLBACKCONTEXT_THREAD_DOWN in the C API.

+
+ +
+
+local_progress = 8
+

See CPX_CALLBACKCONTEXT_LOCAL_PROGRESS in the C API.

+
+ +
+
+global_progress = 16
+

See CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS in the C API.

+
+ +
+
+candidate = 32
+

See CPX_CALLBACKCONTEXT_CANDIDATE in the C API.

+
+ +
+
+relaxation = 64
+

See CPX_CALLBACKCONTEXT_RELAXATION in the C API.

+
+ +
+
+branching = 128
+

See CPX_CALLBACKCONTEXT_BRANCHING in the C API.

+
+ +
+ +
+
+class RelaxationFlags[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.RelaxationFlags
+ + + +

The flags that can be passed to Context.get_relaxation_status().

+

See the reference manual of the CPLEX Callable Library (C API) +for a more detailed description of the various contexts.

+
+
+no_solve = 1
+

See CPX_RELAXATION_FLAG_NOSOLVE in the C API.

+
+ +
+ +
+
+class Context[source]
+

Bases: object

+
Inheritance diagram of cplex.callbacks.Context
+ + +

Context for the generic callback.

+

An instance of this class defines the context in which a generic +callback was invoked. It provides methods to query information and +perform all actions that can be performed from a generic callback.

+

Note that an instance of this class is only valid during the +execution of the callback into which it was passed. Don’t store a +reference to the context across callback invocations.

+

See Cplex.set_callback().

+
+
Undocumented:
+

__init__

+
+
+
+
+info = <cplex._internal._callbackinfoenum.CallbackInfo object>
+

See CallbackInfo

+
+ +
+
+solution_strategy = <cplex._internal._solutionstrategyenum.SolutionStrategy object>
+

See SolutionStrategy

+
+ +
+
+id = <cplex.callbacks.ContextType object>
+

See ContextType

+
+ +
+
+relaxation_flags = <cplex.callbacks.RelaxationFlags object>
+

See RelaxationFlags

+
+ +
+
+solution_status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See SolutionStatus

+
+ +
+
+__init__(cpx, contextptr, contextid)[source]
+

non-public

+
+ +
+
+get_id()[source]
+

Returns the context in which the current callback was invoked.

+

The return value will be one of the constants in ContextType.

+
+ +
+
+in_thread_up()[source]
+

Returns True if the callback was invoked in context +ContextType.thread_up.

+

It is a shortcut for checking whether get_id() returns +ContextType.thread_up or not.

+
+ +
+
+in_thread_down()[source]
+

Returns True if the callback was invoked in context +ContextType.thread_down.

+

It is a shortcut for checking whether get_id() returns +ContextType.thread_down or not.

+
+ +
+
+in_local_progress()[source]
+

Returns True if the callback was invoked in context +ContextType.local_progress.

+

It is a shortcut for checking whether get_id() returns +ContextType.local_progress or not.

+
+ +
+
+in_global_progress()[source]
+

Returns True if the callback was invoked in context +ContextType.global_progress.

+

It is a shortcut for checking whether get_id() returns +ContextType.global_progress or not.

+
+ +
+
+in_candidate()[source]
+

Returns True if the callback was invoked in context +ContextType.candidate.

+

It is a shortcut for checking whether get_id() returns +ContextType.candidate or not.

+
+ +
+
+in_relaxation()[source]
+

Returns True if the callback was invoked in context +ContextType.relaxation.

+

It is a shortcut for checking whether get_id() returns +ContextType.relaxation or not.

+
+ +
+
+in_branching()[source]
+

Returns True if the callback was invoked in context +ContextType.branching.

+

It is a shortcut for checking whether get_id() returns +ContextType.branching or not.

+
+ +
+
+get_int_info(what)[source]
+

Returns a 32bit signed information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_long_info(what)[source]
+

Returns a 64bit signed information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfolong in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_double_info(what)[source]
+

Returns a float information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfodbl in the Callable Library +Reference Manual for more detail.

+
+ +
+
+abort()[source]
+

Aborts the optimization.

+

If you call this method then CPLEX will abort optimization at +the next opportunity.

+

See CPXcallbackabort in the Callable Library Reference +Manual for more detail.

+
+ +
+
+get_relaxation_point(*args)[source]
+

Returns the solution to the current relaxation.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

This method returns the values in the solution for the current +relaxation for the variables specified by the arguments.

+

There are four forms by which get_relaxation_point may be called.

+
+
self.get_relaxation_point()

returns the full solution vector.

+
+
self.get_relaxation_point(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the solution to the current +relaxation.

+
+
self.get_relaxation_point(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_relaxation_point(i) for i in s]

+
+
self.get_relaxation_point(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_relaxation_point(range(begin, end + 1)).

+
+
+

See CPXcallbackgetrelaxationpoint in the Callable +Library Reference Manual for more detail.

+
+ +
+
+get_relaxation_objective()[source]
+

Returns the objective value of current relaxation.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

See CPXcallbackgetrelaxationpoint in the Callable +Library Reference Manual for more detail.

+
+ +
+
+get_relaxation_status(flags=0)[source]
+

Returns the solution status of the relaxation LP.

+

Returns the solution status of the LP relaxation at the current +node.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

See CPXcallbackgetrelaxationstatus in the Callable +Library Reference Manual for more detail.

+
+ +
+
+make_branch(objective_estimate, variables=None, constraints=None)[source]
+

Makes a new branch with the specified data.

+

This method can only be invoked if get_id() returns +ContextType.branching. If invoked in a different context it +will raise an exception.

+

objective_estimate is a float representing the estimated +objective value resulting from the specified branch.

+

variables is a sequence of (var, dir, bnd) tuples specifying +the variables on which to branch. var must be an index of a +variable, dir must be one of “L” and “U”, indicating that the +bound is a lower or upper bound, respectively, and bnd is an +integer specifying the new bound for the variable.

+

constraints is a sequence of (vec, sense, rhs) tuples specifying +the constraints with which to branch. vec must be either an +instance of SparsePair or a sequence with two entries, the +first of which specifies the indices and the second of which +specifies the values of the constraint. rhs must be a float +determining the righthand side of the constraint. sense must be +one of “L”, “G”, or “E”, specifying whether the constraint is a +less-than-or-equal-to (<=), greater-than-or-equal-to (>=), or +equality constraint (=).

+

The method returns an integer that uniquely identifies the newly +created child node in the search tree.

+

Note that the children will be dropped if you call +prune_current_node() at the same node.

+

See CPXcallbackmakebranch in the Callable Library +Reference Manual for more detail.

+
+ +
+
+prune_current_node()[source]
+

Ask CPLEX to prune the current node from the search tree.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

The node is marked for pruning. As soon as the callback returns, +CPLEX stops processing the node. In particular, no child nodes +will be created from that node, even if you called +make_branch() to explicitly create new nodes.

+

See CPXcallbackprunenode in the Callable Library +Reference Manual for more detail.

+
+ +
+
+exit_cut_loop()[source]
+

Ask CPLEX to stop cutting plane separatation at the current +node.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

See CPXcallbackexitcutloop in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_incumbent(*args)[source]
+

Returns the current incumbent solution.

+

The method returns the values in the current incumbent solution +for the variables specified by the arguments.

+

There are four forms by which get_incumbent may be called.

+
+
self.get_incumbent()

returns the full incumbent vector.

+
+
self.get_incumbent(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the current incumbent +solution.

+
+
self.get_incumbent(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_incumbent(i) for i in s]

+
+
self.get_incumbent(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_incumbent(range(begin, end + 1)).

+
+
+

See CPXcallbackgetincumbent in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_incumbent_objective()[source]
+

Returns the objective value of the current incumbent.

+

The returned value may be a huge value (such as 1e75) to indicate +that no incumbent was found yet. Consider using get_int_info() +with CallbackInfo.feasible first to check whether there is an +incumbent.

+

See CPXcallbackgetincumbent in the Callable Library +Reference Manual for more detail.

+
+ +
+
+is_candidate_point()[source]
+

Test if the callback was invoked for a candidate feasible +point.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method returns true if the callback was invoked for a +candidate feasible point. In that case the candidate feasible +point can be examined using get_candidate_point() and +get_candidate_objective().

+

See CPXcallbackcandidateispoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_source()[source]
+

Get the source from which the current candidate solution originated.

+

The value returned is from IncumbentCallback.solution_source.

+
+ +
+
+get_candidate_point(*args)[source]
+

Returns the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_point() returns true. +If invoked in a different context it will raise an exception.

+

This method returns the values in the current candidate solution +for the variables specified by the arguments.

+

There are four forms by which get_candidate_point may be called.

+
+
self.get_candidate_point()

returns the full solution vector.

+
+
self.get_candidate_point(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the current candidate +solution.

+
+
self.get_candidate_point(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_candidate_point(i) for i in s]

+
+
self.get_candidate_point(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_candidate_point(range(begin, end + 1))

+
+
+

See CPXcallbackgetcandidatepoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_objective()[source]
+

Returns the objective value of current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_point() returns true. +It will raise an exception if invoked in a different context.

+

See CPXcallbackgetcandidatepoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+is_candidate_ray()[source]
+

Test if the callback was invoked for an unbounded ray.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method returns true if the callback was invoked for an +unbounded relaxation. In that case the unbounded ray can be +obtained using get_candidate_ray() and.

+

See CPXcallbackcandidateisray in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_ray(*args)[source]
+

Returns the current unbounded ray.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_ray() returns true. If +invoked in a different context it will raise an exception.

+

The method returns the values for in the unbounded ray for the +variables specified by the arguments.

+

There are four forms by which get_candidate_ray may be called.

+
+
self.get_candidate_ray()

returns the full ray vector.

+
+
self.get_candidate_ray(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the unbounded ray.

+
+
self.get_candidate_ray(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_candidate_ray(i) for i in s]

+
+
self.get_candidate_ray(begin, end)

begin and end must be variable indices or variable names. +Returns a list of unbounded reay values of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_candidate_ray(range(begin, end + 1)).

+
+
+

See CPXcallbackgetcandidateray in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_local_lower_bounds(*args)[source]
+

Returns the current local lower bounds.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

There are four forms by which get_local_lower_bounds may be +called.

+
+
self.get_local_lower_bounds()

returns local lower bounds for all variables.

+
+
self.get_local_lower_bounds(i)

i must be a variable index or name. Returns the local lower +bound of the variable with index or name i.

+
+
self.get_local_lower_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the local lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_local_lower_bounds(i) for i in s]

+
+
self.get_local_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the local lower bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_local_lower_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetlocallb in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_local_upper_bounds(*args)[source]
+

Returns the current local upper bounds.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

There are four forms by which get_local_upper_bounds may be +called.

+
+
self.get_local_upper_bounds()

returns local upper bounds for all variables.

+
+
self.get_local_upper_bounds(i)

i must be a variable index or name. Returns the local upper +bound of the variable with index or name i.

+
+
self.get_local_upper_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the local upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_local_upper_bounds(i) for i in s]

+
+
self.get_local_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the local upper bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_local_upper_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetlocalub in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_global_lower_bounds(*args)[source]
+

Returns the current globally valid lower bounds.

+

This method cannot be invoked if get_id() returns +ContextType.thread_up or ContextType.thread_down.

+

There are four forms by which get_global_lower_bounds may be +called.

+
+
self.get_global_lower_bounds()

returns global lower bounds for all variables.

+
+
self.get_global_lower_bounds(i)

i must be a variable index or name. Returns the global lower +bound of the variable with index or name i.

+
+
self.get_global_lower_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the global lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_global_lower_bounds(i) for i in s]

+
+
self.get_global_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the global lower bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_global_lower_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetgloballb in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_global_upper_bounds(*args)[source]
+

Returns the current globally valid upper bounds.

+

This method cannot be invoked if get_id() returns +ContextType.thread_up or ContextType.thread_down.

+

There are four forms by which get_global_upper_bounds may be +called.

+
+
self.get_global_upper_bounds()

returns global upper bounds for all variables.

+
+
self.get_global_upper_bounds(i)

i must be a variable index or name. Returns the global upper +bound of the variable with index or name i.

+
+
self.get_global_upper_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the global upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_global_upper_bounds(i) for i in s]

+
+
self.get_global_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the global upper bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_global_upper_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetglobalub in the Callable Library +Reference Manual for more detail.

+
+ +
+
+post_heuristic_solution(x, obj, strategy)[source]
+

Posts a feasible solution vector to CPLEX.

+

This method posts a (possibly partial) feasible solution to +CPLEX. CPLEX may use this vector to find a new incumbent +solution.

+

x is either a SparsePair instance or a list of two lists, the +first of which specifies the variables (by index or name) and the +second of which specifies the values.

+

obj is an estimate for the objective function value of the +solution provided by x.

+

strategy specifies how CPLEX should complete partial solutions. +See SolutionStrategy for further details.

+

See CPXcallbackpostheursoln in the Callable Library +Reference Manual for more detail.

+
+ +
+
+add_user_cuts(cuts, senses, rhs, cutmanagement, local)[source]
+

Adds user cuts.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

This method submits the specified user cuts to CPLEX.

+

cuts, senses, rhs, cutmanagement, local must all be lists of +compatible dimensions. The first three specify the cuts to be +added.

+

cuts must be either a list of SparsePair instances or a list of +lists of two lists, the first of which specifies variables, the +second of which specifies the values of the constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

cutmanagement must be a list of integer values specifying how +CPLEX should treat each cut (see UseCut constants for further +details).

+

local must be a list of boolean values and specifies for each cut +whether it is only locally valid (True) or globally valid +(False).

+

See CPXcallbackaddusercuts in the Callable Library +Reference Manual for more detail.

+
+ +
+
+add_user_cut(cut, sense, rhs, cutmanagement, local)[source]
+

Convenience wrapper for add_user_cuts() that only adds a +single cut.

+
+ +
+
+reject_candidate(constraints=None, senses=None, rhs=None)[source]
+

Rejects the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method marks the current candidate solution as infeasible, +potentially specifying additional constraints that cut it off.

+

If constraints, senses, and rhs are all None then the current +candidate solution is just rejected. If any of the three is not +None then all must be not None and all must have compatible +dimensions. In that case the three arguments specify a set of +constraints that cut off the current candidate solution. CPLEX +may use this information to tighten the problem formulation and +to avoid finding the same solution again. There is however no +guarantee that CPLEX will actually use those additional +constraints.

+

constraints must be either a list of SparsePair instances or a +list of lists of two lists, the first of which specifies +variables, the second of which specifies the values of the +constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

See CPXcallbackrejectcandidate in the Callable Library +Reference Manual for more detail.

+
+ +
+
+reject_candidate_local(constraints=None, senses=None, rhs=None)[source]
+

Rejects the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and if the candidate was invoked for an +integral node. If invoked in a different context it will raise an +exception.

+

This method marks the current candidate solution as infeasible, +potentially specifying additional constraints that cut it off. +The specified constraints are not required to be globally valid. +They are only required to be valid in the subtree in which the +callback was invoked.

+

If constraints, senses, and rhs are all None then the current +candidate solution is just rejected. If any of the three is not +None then all must be not None and all must have compatible +dimensions. In that case the three arguments specify a set of +constraints that cut off the current candidate solution. CPLEX +may use this information to tighten the problem formulation and +to avoid finding the same solution again. There is however no +guarantee that CPLEX will actually use those additional +constraints.

+

constraints must be either a list of SparsePair instances or a +list of lists of two lists, the first of which specifies +variables, the second of which specifies the values of the +constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

See CPXcallbackrejectcandidatelocal in the Callable Library +Reference Manual for more detail.

+
+ +
+ +
+
+

cplex.constant_class module

+

A base class for classes that contain groups of constants.

+
+
+class ConstantClass[source]
+

Bases: object

+
Inheritance diagram of cplex.constant_class.ConstantClass
+ + +

A base class for classes that contain groups of constants.

+
+
+__init__()[source]
+

Creates a new ConstantClass.

+

This constructor is not meant to be used externally.

+
+ +
+
+__getitem__(item)[source]
+

Converts a constant to a string.

+
+ +
+
+__iter__()[source]
+

Iterate over the constants in this class.

+
+ +
+ +
+
+

cplex.exceptions module

+

Error codes and Exceptions raised by the CPLEX Python API.

+

For documentation of CPLEX error codes, see the group +optim.cplex.errorcodes in the reference manual of the CPLEX Callable +Library, and the topic Interpreting Error Codes in the Overview of the +APIs.

+
+
+exception CplexError[source]
+

Bases: Exception

+

Class for exceptions raised by the CPLEX Python API.

+
+ +
+
+exception CplexSolverError[source]
+

Bases: CplexError

+

Class for errors returned by the Callable Library functions.

+

self.args[0] : A string describing the error.

+

self.args[1] : The address of the environment that raised the error.

+

self.args[2] : The integer status code of the error.

+
+ +
+
+exception WrongNumberOfArgumentsError[source]
+

Bases: CplexError, TypeError

+

Class for errors involving the wrong number of arguments.

+

This exception is generally raised by methods that can accept a +dynamic number of arguments, but also enforce certain rules (e.g., to +be grouped in pairs, requires at least one argument, etc.).

+
+ +
+
+exception ErrorChannelMessage[source]
+

Bases: CplexError

+

Class for storing the last message on the error channel.

+

For internal use only.

+
+ +
+
+

cplex.model_info module

+

Modeling information IDs returned by the Callable Library.

+

This module defines symbolic names for the integer modeling information +IDs returned by the Callable Library. The names to which the modeling +information IDs are assigned are the same names used in the Callable +Library, all of which begin with CPXMI. The modeling information IDs are +accessible through the modeling assistance callback. These symbolic names +can be used to test if a particular modeling issue has been detected.

+

See Cplex.set_modeling_assistance_callback.

+
+
+CPXMI_BIGM_COEF = 1040
+

See CPXMI_BIGM_COEF in the C API.

+
+ +
+
+CPXMI_BIGM_TO_IND = 1041
+

See CPXMI_BIGM_TO_IND in the C API.

+
+ +
+
+CPXMI_BIGM_VARBOUND = 1042
+

See CPXMI_BIGM_VARBOUND in the C API.

+
+ +
+
+CPXMI_CANCEL_TOL = 1045
+

See CPXMI_CANCEL_TOL in the C API.

+
+ +
+
+CPXMI_EPGAP_LARGE = 1038
+

See CPXMI_EPGAP_LARGE in the C API.

+
+ +
+
+CPXMI_EPGAP_OBJOFFSET = 1037
+

See CPXMI_EPGAP_OBJOFFSET in the C API.

+
+ +
+
+CPXMI_FEAS_TOL = 1043
+

See CPXMI_FEAS_TOL in the C API.

+
+ +
+
+CPXMI_FRACTION_SCALING = 1047
+

See CPXMI_FRACTION_SCALING in the C API.

+
+ +
+
+CPXMI_IND_NZ_LARGE_NUM = 1019
+

See CPXMI_IND_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_IND_NZ_SMALL_NUM = 1020
+

See CPXMI_IND_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_IND_RHS_LARGE_NUM = 1021
+

See CPXMI_IND_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_IND_RHS_SMALL_NUM = 1022
+

See CPXMI_IND_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_KAPPA_ILLPOSED = 1035
+

See CPXMI_KAPPA_ILLPOSED in the C API.

+
+ +
+
+CPXMI_KAPPA_SUSPICIOUS = 1033
+

See CPXMI_KAPPA_SUSPICIOUS in the C API.

+
+ +
+
+CPXMI_KAPPA_UNSTABLE = 1034
+

See CPXMI_KAPPA_UNSTABLE in the C API.

+
+ +
+
+CPXMI_LB_LARGE_NUM = 1003
+

See CPXMI_LB_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LB_SMALL_NUM = 1004
+

See CPXMI_LB_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_LC_NZ_LARGE_NUM = 1023
+

See CPXMI_LC_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LC_NZ_SMALL_NUM = 1024
+

See CPXMI_LC_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_LC_RHS_LARGE_NUM = 1025
+

See CPXMI_LC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LC_RHS_SMALL_NUM = 1026
+

See CPXMI_LC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_COEFFS = 1062
+

See CPXMI_MULTIOBJ_COEFFS in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_LARGE_NUM = 1058
+

See CPXMI_MULTIOBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_MIX = 1063
+

See CPXMI_MULTIOBJ_MIX in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_OPT_TOL = 1060
+

See CPXMI_MULTIOBJ_OPT_TOL in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_SMALL_NUM = 1059
+

See CPXMI_MULTIOBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_NZ_LARGE_NUM = 1009
+

See CPXMI_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_NZ_SMALL_NUM = 1010
+

See CPXMI_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_OBJ_LARGE_NUM = 1001
+

See CPXMI_OBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_OBJ_SMALL_NUM = 1002
+

See CPXMI_OBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_OPT_TOL = 1044
+

See CPXMI_OPT_TOL in the C API.

+
+ +
+
+CPXMI_PWL_SLOPE_LARGE_NUM = 1064
+

See CPXMI_PWL_SLOPE_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_PWL_SLOPE_SMALL_NUM = 1065
+

See CPXMI_PWL_SLOPE_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_LINNZ_LARGE_NUM = 1015
+

See CPXMI_QC_LINNZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_LINNZ_SMALL_NUM = 1016
+

See CPXMI_QC_LINNZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_QNZ_LARGE_NUM = 1017
+

See CPXMI_QC_QNZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_QNZ_SMALL_NUM = 1018
+

See CPXMI_QC_QNZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_RHS_LARGE_NUM = 1013
+

See CPXMI_QC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_RHS_SMALL_NUM = 1014
+

See CPXMI_QC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QOBJ_LARGE_NUM = 1011
+

See CPXMI_QOBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QOBJ_SMALL_NUM = 1012
+

See CPXMI_QOBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QOPT_TOL = 1046
+

See CPXMI_QOPT_TOL in the C API.

+
+ +
+
+CPXMI_RHS_LARGE_NUM = 1007
+

See CPXMI_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_RHS_SMALL_NUM = 1008
+

See CPXMI_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_COL = 1050
+

See CPXMI_SAMECOEFF_COL in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_IND = 1051
+

See CPXMI_SAMECOEFF_IND in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_LAZY = 1054
+

See CPXMI_SAMECOEFF_LAZY in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_MULTIOBJ = 1061
+

See CPXMI_SAMECOEFF_MULTIOBJ in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_OBJ = 1057
+

See CPXMI_SAMECOEFF_OBJ in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_QLIN = 1052
+

See CPXMI_SAMECOEFF_QLIN in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_QUAD = 1053
+

See CPXMI_SAMECOEFF_QUAD in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_RHS = 1056
+

See CPXMI_SAMECOEFF_RHS in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_ROW = 1049
+

See CPXMI_SAMECOEFF_ROW in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_UCUT = 1055
+

See CPXMI_SAMECOEFF_UCUT in the C API.

+
+ +
+
+CPXMI_SINGLE_PRECISION = 1036
+

See CPXMI_SINGLE_PRECISION in the C API.

+
+ +
+
+CPXMI_SYMMETRY_BREAKING_INEQ = 1039
+

See CPXMI_SYMMETRY_BREAKING_INEQ in the C API.

+
+ +
+
+CPXMI_UB_LARGE_NUM = 1005
+

See CPXMI_UB_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UB_SMALL_NUM = 1006
+

See CPXMI_UB_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_UC_NZ_LARGE_NUM = 1027
+

See CPXMI_UC_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UC_NZ_SMALL_NUM = 1028
+

See CPXMI_UC_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_UC_RHS_LARGE_NUM = 1029
+

See CPXMI_UC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UC_RHS_SMALL_NUM = 1030
+

See CPXMI_UC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_WIDE_COEFF_RANGE = 1048
+

See CPXMI_WIDE_COEFF_RANGE in the C API.

+
+ +
+
+

cplex.paramset module

+

ParameterSet API

+
+
+class ParameterSet[source]
+

Bases: object

+
Inheritance diagram of cplex.paramset.ParameterSet
+ + +

A parameter set object for use with multi-objective optimization.

+

A parameter set consists of key-value pairs where the key is a CPLEX +parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated +parameter value.

+

When adding, getting, or deleting items from a parameter set the +param argument can be either a Parameter object (e.g, +Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND +(1001)).

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+

See Cplex.create_parameter_set and Cplex.copy_parameter_set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance, c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+
+__init__(env)[source]
+

Constructor of the ParameterSet class.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+end()[source]
+

Releases the ParameterSet object.

+

Frees all data structures associated with a ParameterSet. After +a call of the method end(), the invoking object can no longer be +used. Attempts to use them subsequently raise a ValueError.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.end()
+
+
+
+ +
+
+__del__()[source]
+

Destructor of the ParameterSet class.

+

When a ParameterSet object is destoyed, the end() method is +called.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> del ps
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

ParameterSet objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> with c.create_parameter_set():
+...     pass  # do something here
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+
+add(param, value)[source]
+

Add a parameter ID and value to a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+
+
+
+ +
+
+get(param)[source]
+

Gets a parameter value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+get_ids()[source]
+

Gets the parameter IDs contained in a parameter set.

+

Returns an iterator containing the parameter IDs in a parameter +set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> list(ps.get_ids())
+[1001]
+
+
+
+ +
+
+delete(param)[source]
+

Deletes a parameter from a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+>>> ps.delete(c.parameters.advance)
+>>> len(ps)
+0
+
+
+
+ +
+
+clear()[source]
+

Clears all items from the parameter set.

+

Example Usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.clear()
+>>> len(ps)
+0
+
+
+
+ +
+
+__len__()[source]
+

Return the number of items in the parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> len(ps)
+0
+
+
+
+ +
+
+read(filename)[source]
+

Reads parameter names and settings from the file specified by +filename and copies them into the parameter set.

+

Note that the content of the parameter set is not cleared out +before the parameters in the file are copied into the parameter +set. The parameters are read from the file one by one and are +added to the parameter set, or, if the parameter was already +present in the set, then its value is updated.

+

This routine reads and copies files in the PRM format, as created +by Cplex.parameters.write. The PRM format is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> c.parameters.write_file('example.prm')
+>>> ps = c.create_parameter_set()
+>>> ps.read('example.prm')
+>>> value = ps.get(c.parameters.advance)
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+write(filename)[source]
+

Writes a parameter file that contains the parameters in the +parameter set.

+

This routine writes a file in a format suitable for reading by +ParameterSet.read or by Cplex.parameters.read.

+

The file is written in the PRM format which is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.write('example.prm')
+>>> c.parameters.read_file('example.prm')
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/genindex.html b/docs/22.1.2.0/genindex.html new file mode 100644 index 0000000..f586491 --- /dev/null +++ b/docs/22.1.2.0/genindex.html @@ -0,0 +1,4600 @@ + + + + + + + Index — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | H + | I + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | Y + | Z + +
+

_

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + + +
+ +

Y

+ + +
+ +

Z

+ + + +
+ + + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/index.html b/docs/22.1.2.0/index.html new file mode 100644 index 0000000..90d8ee7 --- /dev/null +++ b/docs/22.1.2.0/index.html @@ -0,0 +1,172 @@ + + + + + + + + CPLEX Python API Reference Manual — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

CPLEX Python API Reference Manual

+
+

Contents:

+ +
+
+
+

IBM CPLEX Python API Reference Manual

+

The CPLEX Python API is a Python package named cplex that allows the CPLEX Callable Library to be accessed from the Python programming language. It is equally suitable for interactive use through the Python interpreter or for writing scripts or full-fledged applications.

+

For users of Python, CPLEX offers both a Python application programming interface (API) documented in this reference manual, as well as IBM Decision Optimization CPLEX Modeling for Python, also known as DOcplex. DOcplex is a library composed of two modules:

+
    +
  • Mathematical Programming Modeling for Python using docplex.mp (DOcplex.MP)

  • +
  • Constraint Programming Modeling for Python using docplex.cp (DOcplex.CP)

  • +
+

For more about DOcplex, see the DOcplex landing page.

+

The CPLEX Python API can be installed directly from PyPI or from Anaconda, using the commands pip and conda.

+

If you are using the conda command to install, then you should make sure the correct channel will be searched.

+

You can add the right channel in the active environment with a command like:

+
conda config --add channels ibmdecisionoptimization
+
+
+

The following commands install the Community Edition CPLEX and CP Optimizer run-times as well as the low-level Python interface to CPLEX.

+

PyPI:

+
pip install cplex
+
+
+

Anaconda:

+
conda install cplex
+
+
+

The following commands install the higher-level “docplex” Python package which includes CPLEX and CP Optimizer modeling and solving support. The Community Edition run-times which come as standard are limited in the size of the optimization problems that they can solve. To upgrade the Community Edition runtimes and remove size limitations, use the command “docplex” which was installed when you installed the “docplex” module with pip and conda.

+

PyPI:

+
pip install docplex
+
+
+

Anaconda:

+
conda install docplex
+
+
+

Running:

+
docplex config --upgrade Full_Path_To_This_CPLEX_Studio_Installation
+
+
+

will upgrade the CPLEX and CP Optimizer Python run-times from the Community Edition version to a size-unlimited version.

+
+
+

What you need to know

+

This manual assumes that you are familiar with the Python programming language.

+

This manual also assumes that you are familiar with the operating system on which you are using CPLEX and have the appropriate version of Python installed on your system. For information about supported platforms, see Detailed System Requirements (DSR) on your IBM customer support site.

+

For interactive use, the tab completion functionality provided by the Python module rlcompleter is extremely useful as you browse the CPLEX Python API. GNU/Linux systems typically include this package by default. Mac users are advised to install the package readline for their system. Windows users are advised either to use IDLE, the Python IDE distributed with Python, or to install the package readline for their system.

+
+
+

Structure of the package cplex

+

The CPLEX Python API is an object-oriented API providing most of its functionality through the class Cplex defined in the top level of the package cplex. This class has a number of methods, such as Cplex.read and Cplex.solve for operating on optimization problems, but most of its functionality is provided through methods of data attributes such as Cplex.linear_constraints, Cplex.objective, and Cplex.solution. These objects provide methods for modifying and querying data associated with the corresponding parts of an optimization problem. These objects are instances of classes defined within the subpackage cplex._internal. As its name suggests, classes and other data defined in the package cplex._internal are not to be instantiated or otherwise accessed directly by the user, but rather should only be accessed as attributes of an instance of the object Cplex.

+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/modules.html b/docs/22.1.2.0/modules.html new file mode 100644 index 0000000..4e233d4 --- /dev/null +++ b/docs/22.1.2.0/modules.html @@ -0,0 +1,377 @@ + + + + + + + + cplex — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex

+
+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/objects.inv b/docs/22.1.2.0/objects.inv new file mode 100644 index 0000000..ece9d2d Binary files /dev/null and b/docs/22.1.2.0/objects.inv differ diff --git a/docs/22.1.2.0/py-modindex.html b/docs/22.1.2.0/py-modindex.html new file mode 100644 index 0000000..a874eba --- /dev/null +++ b/docs/22.1.2.0/py-modindex.html @@ -0,0 +1,212 @@ + + + + + + + Python Module Index — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Python Module Index

+ +
+ c +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ c
+ cplex +
    + cplex._internal +
    + cplex._internal._anno +
    + cplex._internal._aux_functions +
    + cplex._internal._baseinterface +
    + cplex._internal._constants +
    + cplex._internal._constantsenum +
    + cplex._internal._matrices +
    + cplex._internal._multiobj +
    + cplex._internal._multiobjsoln +
    + cplex._internal._parameter_classes +
    + cplex._internal._procedural +
    + cplex._internal._pwl +
    + cplex._internal._solutionstrategyenum +
    + cplex._internal._subinterfaces +
    + cplex.aborter +
    + cplex.callbacks +
    + cplex.constant_class +
    + cplex.exceptions +
    + cplex.model_info +
    + cplex.paramset +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/search.html b/docs/22.1.2.0/search.html new file mode 100644 index 0000000..582e2ba --- /dev/null +++ b/docs/22.1.2.0/search.html @@ -0,0 +1,114 @@ + + + + + + + Search — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/22.1.2.0/searchindex.js b/docs/22.1.2.0/searchindex.js new file mode 100644 index 0000000..160f58b --- /dev/null +++ b/docs/22.1.2.0/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles":{"CPLEX Python API Reference Manual":[[2,null]],"Contents:":[[2,null]],"IBM CPLEX Python API Reference Manual":[[2,"ibm-cplex-python-api-reference-manual"]],"Structure of the package cplex":[[2,"structure-of-the-package-cplex"]],"Submodules":[[0,"submodules"],[1,"submodules"]],"Subpackages":[[0,"subpackages"]],"What you need to know":[[2,"what-you-need-to-know"]],"cplex":[[3,null]],"cplex package":[[0,null]],"cplex._internal package":[[1,null]],"cplex._internal._anno module":[[1,"module-cplex._internal._anno"]],"cplex._internal._aux_functions module":[[1,"module-cplex._internal._aux_functions"]],"cplex._internal._baseinterface module":[[1,"module-cplex._internal._baseinterface"]],"cplex._internal._constants module":[[1,"module-cplex._internal._constants"]],"cplex._internal._constantsenum module":[[1,"module-cplex._internal._constantsenum"]],"cplex._internal._matrices module":[[1,"module-cplex._internal._matrices"]],"cplex._internal._multiobj module":[[1,"module-cplex._internal._multiobj"]],"cplex._internal._multiobjsoln module":[[1,"module-cplex._internal._multiobjsoln"]],"cplex._internal._parameter_classes module":[[1,"module-cplex._internal._parameter_classes"]],"cplex._internal._procedural module":[[1,"module-cplex._internal._procedural"]],"cplex._internal._pwl module":[[1,"module-cplex._internal._pwl"]],"cplex._internal._solutionstrategyenum module":[[1,"cplex-internal-solutionstrategyenum-module"]],"cplex._internal._subinterfaces module":[[1,"module-cplex._internal._subinterfaces"]],"cplex.aborter module":[[0,"module-cplex.aborter"]],"cplex.callbacks module":[[0,"module-cplex.callbacks"]],"cplex.constant_class module":[[0,"module-cplex.constant_class"]],"cplex.exceptions module":[[0,"module-cplex.exceptions"]],"cplex.model_info module":[[0,"module-cplex.model_info"]],"cplex.paramset module":[[0,"module-cplex.paramset"]]},"docnames":["cplex","cplex._internal","index","modules"],"envversion":{"sphinx":66,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1},"filenames":["cplex.rst","cplex._internal.rst","index.rst","modules.rst"],"indexentries":{"__call__() (callback method)":[[0,"cplex.callbacks.Callback.__call__",false]],"__call__() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.__call__",false]],"__del__() (cplex method)":[[0,"cplex.Cplex.__del__",false]],"__del__() (environment method)":[[1,"cplex._internal.Environment.__del__",false]],"__del__() (parameterset method)":[[0,"cplex.ParameterSet.__del__",false],[0,"cplex.paramset.ParameterSet.__del__",false]],"__enter__() (aborter method)":[[0,"cplex.Aborter.__enter__",false],[0,"cplex.aborter.Aborter.__enter__",false]],"__enter__() (cplex method)":[[0,"cplex.Cplex.__enter__",false]],"__enter__() (parameterset method)":[[0,"cplex.ParameterSet.__enter__",false],[0,"cplex.paramset.ParameterSet.__enter__",false]],"__exit__() (aborter method)":[[0,"cplex.Aborter.__exit__",false],[0,"cplex.aborter.Aborter.__exit__",false]],"__exit__() (cplex method)":[[0,"cplex.Cplex.__exit__",false]],"__exit__() (parameterset method)":[[0,"cplex.ParameterSet.__exit__",false],[0,"cplex.paramset.ParameterSet.__exit__",false]],"__getitem__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__getitem__",false]],"__getitem__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__getitem__",false]],"__init__() (aborter method)":[[0,"cplex.Aborter.__init__",false],[0,"cplex.aborter.Aborter.__init__",false]],"__init__() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.__init__",false]],"__init__() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.__init__",false]],"__init__() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.__init__",false]],"__init__() (barriercallback method)":[[0,"cplex.callbacks.BarrierCallback.__init__",false]],"__init__() (baseinterface method)":[[1,"cplex._internal._baseinterface.BaseInterface.__init__",false]],"__init__() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.__init__",false]],"__init__() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.__init__",false]],"__init__() (callback method)":[[0,"cplex.callbacks.Callback.__init__",false]],"__init__() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.__init__",false]],"__init__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__init__",false]],"__init__() (context method)":[[0,"cplex.callbacks.Context.__init__",false]],"__init__() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.__init__",false]],"__init__() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.__init__",false]],"__init__() (cplex method)":[[0,"cplex.Cplex.__init__",false]],"__init__() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.__init__",false]],"__init__() (deprecated method)":[[1,"cplex._internal._aux_functions.deprecated.__init__",false]],"__init__() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.__init__",false]],"__init__() (environment method)":[[1,"cplex._internal.Environment.__init__",false]],"__init__() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.__init__",false]],"__init__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__init__",false]],"__init__() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.__init__",false]],"__init__() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.__init__",false]],"__init__() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.__init__",false]],"__init__() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.__init__",false]],"__init__() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.__init__",false]],"__init__() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.__init__",false]],"__init__() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.__init__",false]],"__init__() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.__init__",false]],"__init__() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.__init__",false]],"__init__() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.__init__",false]],"__init__() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.__init__",false]],"__init__() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.__init__",false]],"__init__() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.__init__",false]],"__init__() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.__init__",false]],"__init__() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.__init__",false]],"__init__() (parameterset method)":[[0,"cplex.ParameterSet.__init__",false],[0,"cplex.paramset.ParameterSet.__init__",false]],"__init__() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.__init__",false]],"__init__() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.__init__",false]],"__init__() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.__init__",false]],"__init__() (qualitymetrics method)":[[1,"cplex._internal._subinterfaces.QualityMetrics.__init__",false]],"__init__() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.__init__",false]],"__init__() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.__init__",false]],"__init__() (siginthandler method)":[[1,"cplex._internal._procedural.SigIntHandler.__init__",false]],"__init__() (simplexcallback method)":[[0,"cplex.callbacks.SimplexCallback.__init__",false]],"__init__() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.__init__",false]],"__init__() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.__init__",false]],"__init__() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.__init__",false]],"__init__() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.__init__",false]],"__init__() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.__init__",false]],"__init__() (sparsepair method)":[[0,"cplex.SparsePair.__init__",false]],"__init__() (sparsetriple method)":[[0,"cplex.SparseTriple.__init__",false]],"__init__() (stats method)":[[0,"cplex.Stats.__init__",false]],"__init__() (statuschecker method)":[[1,"cplex._internal._procedural.StatusChecker.__init__",false]],"__init__() (tuningcallback method)":[[0,"cplex.callbacks.TuningCallback.__init__",false]],"__init__() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.__init__",false]],"__init__() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.__init__",false]],"__iter__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__iter__",false]],"__len__() (parameterset method)":[[0,"cplex.ParameterSet.__len__",false],[0,"cplex.paramset.ParameterSet.__len__",false]],"__repr__() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.__repr__",false]],"__repr__() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.__repr__",false]],"__repr__() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.__repr__",false]],"__repr__() (sparsepair method)":[[0,"cplex.SparsePair.__repr__",false]],"__repr__() (sparsetriple method)":[[0,"cplex.SparseTriple.__repr__",false]],"__str__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__str__",false]],"__str__() (qualitymetrics method)":[[1,"cplex._internal._subinterfaces.QualityMetrics.__str__",false]],"__str__() (stats method)":[[0,"cplex.Stats.__str__",false]],"abort (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.abort",false]],"abort() (aborter method)":[[0,"cplex.Aborter.abort",false],[0,"cplex.aborter.Aborter.abort",false]],"abort() (callback method)":[[0,"cplex.callbacks.Callback.abort",false]],"abort() (context method)":[[0,"cplex.callbacks.Context.abort",false]],"abort_cut_loop() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.abort_cut_loop",false]],"abort_dettime_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_dettime_limit",false]],"abort_dual_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_dual_obj_limit",false]],"abort_iteration_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_iteration_limit",false]],"abort_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_obj_limit",false]],"abort_primal_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_primal_obj_limit",false]],"abort_relaxed (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_relaxed",false]],"abort_time_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_time_limit",false]],"abort_user (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_user",false]],"aborter (class in cplex)":[[0,"cplex.Aborter",false]],"aborter (class in cplex.aborter)":[[0,"cplex.aborter.Aborter",false]],"add() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.add",false]],"add() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.add",false]],"add() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.add",false]],"add() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.add",false]],"add() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.add",false]],"add() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.add",false]],"add() (parameterset method)":[[0,"cplex.ParameterSet.add",false],[0,"cplex.paramset.ParameterSet.add",false]],"add() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.add",false]],"add() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.add",false]],"add() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.add",false]],"add() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.add",false]],"add() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.add",false]],"add_batch() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.add_batch",false]],"add_diversity_filter() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.add_diversity_filter",false]],"add_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.add_lazy_constraints",false]],"add_local() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.add_local",false]],"add_local() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.add_local",false]],"add_range_filter() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.add_range_filter",false]],"add_rows() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.add_rows",false]],"add_user_cut() (context method)":[[0,"cplex.callbacks.Context.add_user_cut",false]],"add_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.add_user_cuts",false]],"add_user_cuts() (context method)":[[0,"cplex.callbacks.Context.add_user_cuts",false]],"addcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addcols",false]],"addfuncdest() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addfuncdest",false]],"addindconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addindconstr",false]],"addlazyconstraints() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addlazyconstraints",false]],"addmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addmipstarts",false]],"addpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addpwl",false]],"addqconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addqconstr",false]],"addrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addrows",false]],"addsolnpooldivfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsolnpooldivfilter",false]],"addsolnpoolrngfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsolnpoolrngfilter",false]],"addsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsos",false]],"addusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addusercuts",false]],"advance_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.advance_constants",false]],"advanced (cplex attribute)":[[0,"cplex.Cplex.advanced",false]],"advanced (linearconstraintinterface attribute)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.advanced",false]],"advanced (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.advanced",false]],"advanced (variablesinterface attribute)":[[1,"cplex._internal._subinterfaces.VariablesInterface.advanced",false]],"advancedcplexinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface",false]],"advancedlinearconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface",false]],"advancedsolutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface",false]],"advancedvariablesinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface",false]],"agg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.agg_constants",false]],"aggregated (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.aggregated",false]],"aggregated (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.aggregated",false]],"aggressive (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.aggressive",false]],"aggressive (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.aggressive",false]],"aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.aggressive",false]],"aggressive (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.aggressive",false]],"alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.alg_constants",false]],"all (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.all",false]],"all_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.all_constraints",false]],"all_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.all_constraints",false]],"all_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.all_variables",false]],"alternate (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.alternate",false]],"annotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.AnnotationInterface",false]],"annotationobjecttype (class in cplex._internal._anno)":[[1,"cplex._internal._anno.AnnotationObjectType",false]],"any (branchtype attribute)":[[0,"cplex.callbacks.BranchType.any",false]],"any (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.any",false]],"apply_freeform_one_arg() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_freeform_one_arg",false]],"apply_freeform_two_args() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_freeform_two_args",false]],"apply_pairs() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_pairs",false]],"approx_min_degree (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.approx_min_degree",false]],"approx_min_fill (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.approx_min_fill",false]],"assist (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.assist",false]],"at_all_nodes (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.at_all_nodes",false]],"at_lower_bound (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.at_lower_bound",false]],"at_lower_bound (pivotvarstatus attribute)":[[1,"cplex._internal._subinterfaces.PivotVarStatus.at_lower_bound",false]],"at_root (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.at_root",false]],"at_upper_bound (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.at_upper_bound",false]],"at_upper_bound (pivotvarstatus attribute)":[[1,"cplex._internal._subinterfaces.PivotVarStatus.at_upper_bound",false]],"auto (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.auto",false]],"auto (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.auto",false]],"auto (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.auto",false]],"auto (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.auto",false]],"auto (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.auto",false]],"auto (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.auto",false]],"auto (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.auto",false]],"auto (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.auto",false]],"auto (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.auto",false]],"auto (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.auto",false]],"auto (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.auto",false]],"auto (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.auto",false]],"auto (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.auto",false]],"auto (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.auto",false]],"auto (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.auto",false]],"auto (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.auto",false]],"auto (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.auto",false]],"auto (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.auto",false]],"auto (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.auto",false]],"auto (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.auto",false]],"auto (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.auto",false]],"auto (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.auto",false]],"auto (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.auto",false]],"auto (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.auto",false]],"auto (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.auto",false]],"auto (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.auto",false]],"auto (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.auto",false]],"auto (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.auto",false]],"auto (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.auto",false]],"auto (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.auto",false]],"auto (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.auto",false]],"auto (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.auto",false]],"auto (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.auto",false]],"auto (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.auto",false]],"auto_off_on_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants",false]],"average (measure_constants attribute)":[[1,"cplex._internal._parameter_classes.measure_constants.average",false]],"average_primal_estimated_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.average_primal_estimated_dual",false]],"average_primal_zero_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.average_primal_zero_dual",false]],"balanced (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.balanced",false]],"bar_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_alg_constants",false]],"bar_order_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_order_constants",false]],"bar_start_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants",false]],"baropt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.baropt",false]],"barrier (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.barrier",false]],"barrier (methodtype attribute)":[[0,"cplex.callbacks.MethodType.barrier",false]],"barrier (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.barrier",false]],"barrier (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.barrier",false]],"barrier (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.barrier",false]],"barrier (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.barrier",false]],"barrier (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.barrier",false]],"barriercallback (class in cplex.callbacks)":[[0,"cplex.callbacks.BarrierCallback",false]],"baseinterface (class in cplex._internal._baseinterface)":[[1,"cplex._internal._baseinterface.BaseInterface",false]],"basic (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.basic",false]],"basic (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.basic",false]],"basic (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.basic",false]],"basic_presolve() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.basic_presolve",false]],"basicpresolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.basicpresolve",false]],"basis (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.basis",false]],"basisinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BasisInterface",false]],"basisvarstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BasisVarStatus",false]],"begin (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.begin",false]],"begin_and_end (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.begin_and_end",false]],"benders (cuttype attribute)":[[0,"cplex.callbacks.CutType.benders",false],[1,"cplex._internal._subinterfaces.CutType.benders",false]],"benders_annotation (longannotationinterface attribute)":[[1,"cplex._internal._anno.LongAnnotationInterface.benders_annotation",false]],"benders_mastervalue (longannotationinterface attribute)":[[1,"cplex._internal._anno.LongAnnotationInterface.benders_mastervalue",false]],"benders_num_best (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.benders_num_best",false]],"benders_strategy_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants",false]],"best_bound (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.best_bound",false]],"best_bound (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_bound",false]],"best_estimate (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_estimate",false]],"best_estimate_alt (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_estimate_alt",false]],"best_objective (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.best_objective",false]],"binary (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.binary",false]],"binvacol() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvacol",false]],"binvacol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvacol",false]],"binvarow() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvarow",false]],"binvarow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvarow",false]],"binvcol() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvcol",false]],"binvcol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvcol",false]],"binvrow() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvrow",false]],"binvrow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvrow",false]],"blend (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.blend",false]],"bound_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.bound_constraints",false]],"bounds (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.bounds",false]],"bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.bounds",false]],"boundsa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa",false]],"boundsa_lower() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa_lower",false]],"boundsa_upper() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa_upper",false]],"bqp (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.BQP",false]],"branch_direction (orderinterface attribute)":[[1,"cplex._internal._subinterfaces.OrderInterface.branch_direction",false]],"branch_type (branchcallback attribute)":[[0,"cplex.callbacks.BranchCallback.branch_type",false]],"branchcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.BranchCallback",false]],"branchcallbackbranchascplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.branchcallbackbranchasCPLEX",false]],"branchcallbackbranchgeneral() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.branchcallbackbranchgeneral",false]],"branchdirection (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BranchDirection",false]],"branching (contexttype attribute)":[[0,"cplex.callbacks.ContextType.branching",false]],"branchtype (class in cplex.callbacks)":[[0,"cplex.callbacks.BranchType",false]],"brdir_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.brdir_constants",false]],"btran() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.btran",false]],"btran() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.btran",false]],"callback (class in cplex.callbacks)":[[0,"cplex.callbacks.Callback",false]],"callbackabort() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackabort",false]],"callbackaddusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackaddusercuts",false]],"callbackcandidateispoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackcandidateispoint",false]],"callbackcandidateisray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackcandidateisray",false]],"callbackexitcutloop() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackexitcutloop",false]],"callbackgetcandidateobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidateobj",false]],"callbackgetcandidatepoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidatepoint",false]],"callbackgetcandidateray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidateray",false]],"callbackgetgloballb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetgloballb",false]],"callbackgetglobalub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetglobalub",false]],"callbackgetincumbent() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetincumbent",false]],"callbackgetincumbentobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetincumbentobj",false]],"callbackgetinfodbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfodbl",false]],"callbackgetinfoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfoint",false]],"callbackgetinfolong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfolong",false]],"callbackgetlocallb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetlocallb",false]],"callbackgetlocalub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetlocalub",false]],"callbackgetrelaxationpoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationpoint",false]],"callbackgetrelaxationpointobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationpointobj",false]],"callbackgetrelaxationstatus() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationstatus",false]],"callbackmakebranch() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackmakebranch",false]],"callbackpostheursoln() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackpostheursoln",false]],"callbackprunenode() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackprunenode",false]],"callbackrejectcandidate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackrejectcandidate",false]],"callbackrejectcandidatelocal() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackrejectcandidatelocal",false]],"callbacksetnodeuserhandle() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbacksetnodeuserhandle",false]],"callbacksetuserhandle() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbacksetuserhandle",false]],"candidate (contexttype attribute)":[[0,"cplex.callbacks.ContextType.candidate",false]],"cardls_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.cardls_constants",false]],"cb_geterrorstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cb_geterrorstring",false]],"change() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.change",false]],"chbmatrix() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chbmatrix",false]],"check_feasibility (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.check_feasibility",false]],"check_feasible (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.check_feasible",false]],"chgbds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgbds",false]],"chgcoeflist() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgcoeflist",false]],"chgcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgcolname",false]],"chgctype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgctype",false]],"chgmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgmipstarts",false]],"chgobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobj",false]],"chgobjoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobjoffset",false]],"chgobjsen() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobjsen",false]],"chgprobname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobname",false]],"chgprobtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobtype",false]],"chgprobtypesolnpool() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobtypesolnpool",false]],"chgqpcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgqpcoef",false]],"chgrhs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrhs",false]],"chgrngval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrngval",false]],"chgrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrowname",false]],"chgsense() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgsense",false]],"cleanup() (cplex method)":[[0,"cplex.Cplex.cleanup",false]],"cleanup() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cleanup",false]],"clear() (aborter method)":[[0,"cplex.Aborter.clear",false],[0,"cplex.aborter.Aborter.clear",false]],"clear() (parameterset method)":[[0,"cplex.ParameterSet.clear",false],[0,"cplex.paramset.ParameterSet.clear",false]],"clique (cuttype attribute)":[[0,"cplex.callbacks.CutType.clique",false],[1,"cplex._internal._subinterfaces.CutType.clique",false]],"clocktype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.clocktype_constants",false]],"cloneprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cloneprob",false]],"closecplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.closeCPLEX",false]],"clpwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.clpwrite",false]],"coeffreduce_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants",false]],"col_status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.col_status",false]],"complete() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.complete",false]],"completed (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.completed",false]],"completelp() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.completelp",false]],"concurrent (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.concurrent",false]],"conflict (cplex attribute)":[[0,"cplex.Cplex.conflict",false]],"conflict_abort_contradiction (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_contradiction",false]],"conflict_abort_dettime_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_dettime_limit",false]],"conflict_abort_iteration_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_iteration_limit",false]],"conflict_abort_memory_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_memory_limit",false]],"conflict_abort_node_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_node_limit",false]],"conflict_abort_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_obj_limit",false]],"conflict_abort_time_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_time_limit",false]],"conflict_abort_user (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_user",false]],"conflict_algorithm_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants",false]],"conflict_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_feasible",false]],"conflict_minimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_minimal",false]],"conflictconstrainttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType",false]],"conflictinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictInterface",false]],"conflictstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictStatus",false]],"constantclass (class in cplex.constant_class)":[[0,"cplex.constant_class.ConstantClass",false]],"constraint_type (conflictinterface attribute)":[[1,"cplex._internal._subinterfaces.ConflictInterface.constraint_type",false]],"constraint_type (feasoptinterface attribute)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.constraint_type",false]],"context (class in cplex.callbacks)":[[0,"cplex.callbacks.Context",false]],"contexttype (class in cplex.callbacks)":[[0,"cplex.callbacks.ContextType",false]],"continuous (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.continuous",false]],"continuouscallback (class in cplex.callbacks)":[[0,"cplex.callbacks.ContinuousCallback",false]],"controlcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.ControlCallback",false]],"convert() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.convert",false]],"convert_sequence() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.convert_sequence",false]],"copy_parameter_set() (cplex method)":[[0,"cplex.Cplex.copy_parameter_set",false]],"copylp() (cplex method)":[[0,"cplex.Cplex.copylp",false]],"copylpwnames() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copylpwnames",false]],"copyobjname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyobjname",false]],"copyorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyorder",false]],"copyprotected() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyprotected",false]],"copyqpsep() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyqpsep",false]],"copyquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyquad",false]],"copystart() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copystart",false]],"cost (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.cost",false]],"cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.cover",false],[1,"cplex._internal._subinterfaces.CutType.cover",false]],"cplex":[[0,"module-cplex",false]],"cplex (class in cplex)":[[0,"cplex.Cplex",false]],"cplex._internal":[[1,"module-cplex._internal",false]],"cplex._internal._anno":[[1,"module-cplex._internal._anno",false]],"cplex._internal._aux_functions":[[1,"module-cplex._internal._aux_functions",false]],"cplex._internal._baseinterface":[[1,"module-cplex._internal._baseinterface",false]],"cplex._internal._constants":[[1,"module-cplex._internal._constants",false]],"cplex._internal._constantsenum":[[1,"module-cplex._internal._constantsenum",false]],"cplex._internal._matrices":[[1,"module-cplex._internal._matrices",false]],"cplex._internal._multiobj":[[1,"module-cplex._internal._multiobj",false]],"cplex._internal._multiobjsoln":[[1,"module-cplex._internal._multiobjsoln",false]],"cplex._internal._parameter_classes":[[1,"module-cplex._internal._parameter_classes",false]],"cplex._internal._procedural":[[1,"module-cplex._internal._procedural",false]],"cplex._internal._pwl":[[1,"module-cplex._internal._pwl",false]],"cplex._internal._solutionstrategyenum":[[1,"module-cplex._internal._solutionstrategyenum",false]],"cplex._internal._subinterfaces":[[1,"module-cplex._internal._subinterfaces",false]],"cplex.aborter":[[0,"module-cplex.aborter",false]],"cplex.callbacks":[[0,"module-cplex.callbacks",false]],"cplex.constant_class":[[0,"module-cplex.constant_class",false]],"cplex.exceptions":[[0,"module-cplex.exceptions",false]],"cplex.model_info":[[0,"module-cplex.model_info",false]],"cplex.paramset":[[0,"module-cplex.paramset",false]],"cplexerror":[[0,"cplex.exceptions.CplexError",false]],"cplexsolvererror":[[0,"cplex.exceptions.CplexSolverError",false]],"cpu (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.CPU",false]],"cpxmi_bigm_coef (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_COEF",false]],"cpxmi_bigm_to_ind (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_TO_IND",false]],"cpxmi_bigm_varbound (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_VARBOUND",false]],"cpxmi_cancel_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_CANCEL_TOL",false]],"cpxmi_epgap_large (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_EPGAP_LARGE",false]],"cpxmi_epgap_objoffset (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_EPGAP_OBJOFFSET",false]],"cpxmi_feas_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_FEAS_TOL",false]],"cpxmi_fraction_scaling (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_FRACTION_SCALING",false]],"cpxmi_ind_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_NZ_LARGE_NUM",false]],"cpxmi_ind_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_NZ_SMALL_NUM",false]],"cpxmi_ind_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_RHS_LARGE_NUM",false]],"cpxmi_ind_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_RHS_SMALL_NUM",false]],"cpxmi_kappa_illposed (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_ILLPOSED",false]],"cpxmi_kappa_suspicious (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_SUSPICIOUS",false]],"cpxmi_kappa_unstable (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_UNSTABLE",false]],"cpxmi_lb_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LB_LARGE_NUM",false]],"cpxmi_lb_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LB_SMALL_NUM",false]],"cpxmi_lc_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_NZ_LARGE_NUM",false]],"cpxmi_lc_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_NZ_SMALL_NUM",false]],"cpxmi_lc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_RHS_LARGE_NUM",false]],"cpxmi_lc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_RHS_SMALL_NUM",false]],"cpxmi_multiobj_coeffs (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_COEFFS",false]],"cpxmi_multiobj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_LARGE_NUM",false]],"cpxmi_multiobj_mix (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_MIX",false]],"cpxmi_multiobj_opt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_OPT_TOL",false]],"cpxmi_multiobj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_SMALL_NUM",false]],"cpxmi_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_NZ_LARGE_NUM",false]],"cpxmi_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_NZ_SMALL_NUM",false]],"cpxmi_obj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OBJ_LARGE_NUM",false]],"cpxmi_obj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OBJ_SMALL_NUM",false]],"cpxmi_opt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OPT_TOL",false]],"cpxmi_pwl_slope_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_PWL_SLOPE_LARGE_NUM",false]],"cpxmi_pwl_slope_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_PWL_SLOPE_SMALL_NUM",false]],"cpxmi_qc_linnz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_LINNZ_LARGE_NUM",false]],"cpxmi_qc_linnz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_LINNZ_SMALL_NUM",false]],"cpxmi_qc_qnz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_QNZ_LARGE_NUM",false]],"cpxmi_qc_qnz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_QNZ_SMALL_NUM",false]],"cpxmi_qc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_RHS_LARGE_NUM",false]],"cpxmi_qc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_RHS_SMALL_NUM",false]],"cpxmi_qobj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOBJ_LARGE_NUM",false]],"cpxmi_qobj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOBJ_SMALL_NUM",false]],"cpxmi_qopt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOPT_TOL",false]],"cpxmi_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_RHS_LARGE_NUM",false]],"cpxmi_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_RHS_SMALL_NUM",false]],"cpxmi_samecoeff_col (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_COL",false]],"cpxmi_samecoeff_ind (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_IND",false]],"cpxmi_samecoeff_lazy (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_LAZY",false]],"cpxmi_samecoeff_multiobj (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_MULTIOBJ",false]],"cpxmi_samecoeff_obj (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_OBJ",false]],"cpxmi_samecoeff_qlin (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_QLIN",false]],"cpxmi_samecoeff_quad (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_QUAD",false]],"cpxmi_samecoeff_rhs (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_RHS",false]],"cpxmi_samecoeff_row (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_ROW",false]],"cpxmi_samecoeff_ucut (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_UCUT",false]],"cpxmi_single_precision (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SINGLE_PRECISION",false]],"cpxmi_symmetry_breaking_ineq (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SYMMETRY_BREAKING_INEQ",false]],"cpxmi_ub_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UB_LARGE_NUM",false]],"cpxmi_ub_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UB_SMALL_NUM",false]],"cpxmi_uc_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_NZ_LARGE_NUM",false]],"cpxmi_uc_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_NZ_SMALL_NUM",false]],"cpxmi_uc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_RHS_LARGE_NUM",false]],"cpxmi_uc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_RHS_SMALL_NUM",false]],"cpxmi_wide_coeff_range (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_WIDE_COEFF_RANGE",false]],"create_parameter_set() (cplex method)":[[0,"cplex.Cplex.create_parameter_set",false]],"createprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.createprob",false]],"crossover_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.crossover_constants",false]],"crossovercallback (class in cplex.callbacks)":[[0,"cplex.callbacks.CrossoverCallback",false]],"crush_formula() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_formula",false]],"crush_pi() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_pi",false]],"crush_x() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_x",false]],"crushform() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushform",false]],"crushpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushpi",false]],"crushx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushx",false]],"cut_type (mipinfocallback attribute)":[[0,"cplex.callbacks.MIPInfoCallback.cut_type",false]],"cut_type (mipsolutioninterface attribute)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.cut_type",false]],"cutcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.CutCallback",false]],"cutcallbackadd() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cutcallbackadd",false]],"cutcallbackaddlocal() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cutcallbackaddlocal",false]],"cuttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.CutType",false]],"cuttype (class in cplex.callbacks)":[[0,"cplex.callbacks.CutType",false]],"datacheck_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.datacheck_constants",false]],"default (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.default",false]],"default (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.default",false]],"default (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.default",false]],"default (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.default",false]],"default() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.default",false]],"delcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delcols",false]],"deldblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.deldblanno",false]],"delete() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.delete",false]],"delete() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.delete",false]],"delete() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.delete",false]],"delete() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.delete",false]],"delete() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.delete",false]],"delete() (parameterset method)":[[0,"cplex.ParameterSet.delete",false],[0,"cplex.paramset.ParameterSet.delete",false]],"delete() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.delete",false]],"delete() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.delete",false]],"delete() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.delete",false]],"delete() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.delete",false]],"delete() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.delete",false]],"delete() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.delete",false]],"delete_names() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.delete_names",false]],"delete_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delete_native_int",false]],"delete_set_by_range() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.delete_set_by_range",false]],"delfuncdest() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delfuncdest",false]],"delindconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delindconstrs",false]],"dellonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dellonganno",false]],"delmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delmipstarts",false]],"delnames() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delnames",false]],"delpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delpwl",false]],"delpydel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delpydel",false]],"delqconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delqconstrs",false]],"delrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delrows",false]],"delsolnpoolfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsolnpoolfilters",false]],"delsolnpoolsolns() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsolnpoolsolns",false]],"delsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsos",false]],"dependency_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dependency_constants",false]],"deprecated (class in cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.deprecated",false]],"deprecated_class() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.deprecated_class",false]],"depth_first (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.depth_first",false]],"detailed (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.detailed",false]],"deterministic (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.deterministic",false]],"dettime (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.dettime",false]],"dettime_limit (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.dettime_limit",false]],"devex (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.devex",false]],"devex (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.devex",false]],"dfeas (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.dfeas",false]],"disabled (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.disabled",false]],"discrete_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.discrete_variables",false]],"disjunctive (cuttype attribute)":[[0,"cplex.callbacks.CutType.disjunctive",false],[1,"cplex._internal._subinterfaces.CutType.disjunctive",false]],"disk (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.disk",false]],"disk_compressed (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.disk_compressed",false]],"display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.display_constants",false]],"dive_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dive_constants",false]],"diversity (filtertype attribute)":[[1,"cplex._internal._subinterfaces.FilterType.diversity",false]],"diversity (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.diversity",false]],"djfrompi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.djfrompi",false]],"double_annotations (cplex attribute)":[[0,"cplex.Cplex.double_annotations",false]],"doubleannotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.DoubleAnnotationInterface",false]],"down (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.down",false]],"down (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.down",false]],"dperwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dperwrite",false]],"dual (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.dual",false]],"dual (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.dual",false]],"dual (methodtype attribute)":[[0,"cplex.callbacks.MethodType.dual",false]],"dual (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.dual",false]],"dual (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.dual",false]],"dual (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.dual",false]],"dual (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.dual",false]],"dual (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.dual",false]],"dual (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.dual",false]],"dual_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dual_constants",false]],"dual_farkas() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.dual_farkas",false]],"dual_objective (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.dual_objective",false]],"dual_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants",false]],"dualfarkas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualfarkas",false]],"dualopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualopt",false]],"dualwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualwrite",false]],"dynamic (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.dynamic",false]],"effort_level (mipstartsinterface attribute)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.effort_level",false]],"effortlevel (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.EffortLevel",false]],"embwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.embwrite",false]],"empty_problem (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.empty_problem",false]],"end (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.end",false]],"end() (aborter method)":[[0,"cplex.Aborter.end",false],[0,"cplex.aborter.Aborter.end",false]],"end() (cplex method)":[[0,"cplex.Cplex.end",false]],"end() (parameterset method)":[[0,"cplex.ParameterSet.end",false],[0,"cplex.paramset.ParameterSet.end",false]],"environment (class in cplex._internal)":[[1,"cplex._internal.Environment",false]],"equilibration (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.equilibration",false]],"error (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.error",false]],"error_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.ERROR_CHNL_IDX",false]],"errorchannelmessage":[[0,"cplex.exceptions.ErrorChannelMessage",false]],"estimated_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.estimated_dual",false]],"exact_kappa (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.exact_kappa",false]],"excluded (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.excluded",false]],"exit_cut_loop() (context method)":[[0,"cplex.callbacks.Context.exit_cut_loop",false]],"fail_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_feasible",false]],"fail_feasible_no_tree (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_feasible_no_tree",false]],"fail_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_infeasible",false]],"fail_infeasible_no_tree (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_infeasible_no_tree",false]],"fast (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.fast",false]],"fast_getcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getcolname",false]],"fast_getmipstartname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getmipstartname",false]],"fast_getobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getobj",false]],"fast_getrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getrowname",false]],"fast_getrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getrows",false]],"fast_getsosname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getsosname",false]],"fast_multiobjgetabstol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetabstol",false]],"fast_multiobjgetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetobj",false]],"fast_multiobjgetoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetoffset",false]],"fast_multiobjgetpriority() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetpriority",false]],"fast_multiobjgetreltol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetreltol",false]],"fast_multiobjgetweight() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetweight",false]],"fast_newcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_newcols",false]],"feas (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.feas",false]],"feasibility (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.feasibility",false]],"feasibility_status (controlcallback attribute)":[[0,"cplex.callbacks.ControlCallback.feasibility_status",false]],"feasibilitystatus (class in cplex.callbacks)":[[0,"cplex.callbacks.FeasibilityStatus",false]],"feasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.feasible",false]],"feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible",false]],"feasible_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_inf",false]],"feasible_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_quad",false]],"feasible_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_sum",false]],"feasopt (cplex attribute)":[[0,"cplex.Cplex.feasopt",false]],"feasopt (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.feasopt",false]],"feasopt_mode_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants",false]],"feasoptconstrainttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType",false]],"feasoptext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.feasoptext",false]],"feasoptinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FeasoptInterface",false]],"file_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.file_constants",false]],"filter (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.filter",false]],"filter (usecut attribute)":[[0,"cplex.callbacks.UseCut.filter",false]],"filtertype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FilterType",false]],"finitlock() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.finitlock",false]],"first_order (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.first_order",false]],"first_order (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.first_order",false]],"firstin_firstout (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.firstin_firstout",false]],"fixed (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.fixed",false]],"fixed_milp (problemtype attribute)":[[1,"cplex._internal.ProblemType.fixed_MILP",false]],"fixed_miqp (problemtype attribute)":[[1,"cplex._internal.ProblemType.fixed_MIQP",false]],"fixparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fixparam",false]],"float_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.float_info",false]],"flow_cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.flow_cover",false],[1,"cplex._internal._subinterfaces.CutType.flow_cover",false]],"flow_path (cuttype attribute)":[[0,"cplex.callbacks.CutType.flow_path",false],[1,"cplex._internal._subinterfaces.CutType.flow_path",false]],"fltwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fltwrite",false]],"force (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.force",false]],"force (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.force",false]],"force (useconstraint attribute)":[[0,"cplex.callbacks.UseConstraint.force",false]],"force (usecut attribute)":[[0,"cplex.callbacks.UseCut.force",false]],"fpheur_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.fpheur_constants",false]],"fractional (cuttype attribute)":[[0,"cplex.callbacks.CutType.fractional",false],[1,"cplex._internal._subinterfaces.CutType.fractional",false]],"free() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.free",false]],"free_chbmat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.free_CHBmat",false]],"free_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.free_lazy_constraints",false]],"free_nonbasic (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.free_nonbasic",false]],"free_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.free_user_cuts",false]],"freelazyconstraints() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freelazyconstraints",false]],"freepresolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freepresolve",false]],"freeprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freeprob",false]],"freeusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freeusercuts",false]],"ftran() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.ftran",false]],"ftran() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ftran",false]],"full (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.full",false]],"full (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.full",false]],"full (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.full",false]],"full (linear_constants attribute)":[[1,"cplex._internal._parameter_classes.linear_constants.full",false]],"full (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.full",false]],"full_steep (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.full_steep",false]],"general_scaling (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.general_scaling",false]],"get() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get",false]],"get() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.get",false]],"get() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.get",false]],"get() (parameterset method)":[[0,"cplex.ParameterSet.get",false],[0,"cplex.paramset.ParameterSet.get",false]],"get_aborter() (cplex method)":[[0,"cplex.Cplex.get_aborter",false]],"get_abstol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_abstol",false]],"get_activity_levels() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_activity_levels",false]],"get_all() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.get_all",false]],"get_basic_col_index() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basic_col_index",false]],"get_basic_row_index() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basic_row_index",false]],"get_basis() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basis",false]],"get_basis_dual_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basis_dual_norms",false]],"get_best_objective() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_best_objective",false]],"get_best_objective_value() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_best_objective_value",false]],"get_bounds() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_bounds",false]],"get_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_branch",false]],"get_branch_type() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_branch_type",false]],"get_branch_variable() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_branch_variable",false]],"get_candidate_objective() (context method)":[[0,"cplex.callbacks.Context.get_candidate_objective",false]],"get_candidate_point() (context method)":[[0,"cplex.callbacks.Context.get_candidate_point",false]],"get_candidate_ray() (context method)":[[0,"cplex.callbacks.Context.get_candidate_ray",false]],"get_candidate_source() (context method)":[[0,"cplex.callbacks.Context.get_candidate_source",false]],"get_changed() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.get_changed",false]],"get_coefficients() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_coefficients",false]],"get_col_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_col_status",false]],"get_cols() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_cols",false]],"get_complemented() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_complemented",false]],"get_cplex_status() (hscallback method)":[[0,"cplex.callbacks.HSCallback.get_cplex_status",false]],"get_current_node_depth() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.get_current_node_depth",false]],"get_current_node_depth() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_current_node_depth",false]],"get_cutoff() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_cutoff",false]],"get_cutoff() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_cutoff",false]],"get_default_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_default_values",false]],"get_default_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_default_values",false]],"get_definition() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_definition",false]],"get_definitions() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_definitions",false]],"get_depth() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_depth",false]],"get_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_dettime",false]],"get_dettime() (cplex method)":[[0,"cplex.Cplex.get_dettime",false]],"get_dettime() (environment method)":[[1,"cplex._internal.Environment.get_dettime",false]],"get_diverging_index() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_diverging_index",false]],"get_diversity_filters() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_diversity_filters",false]],"get_double_info() (context method)":[[0,"cplex.callbacks.Context.get_double_info",false]],"get_driebeek_penalties() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_Driebeek_penalties",false]],"get_dual_infeasibility() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_dual_infeasibility",false]],"get_dual_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_dual_norms",false]],"get_dual_objective_value() (barriercallback method)":[[0,"cplex.callbacks.BarrierCallback.get_dual_objective_value",false]],"get_dual_values() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_dual_values",false]],"get_effort_levels() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_effort_levels",false]],"get_end_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_end_dettime",false]],"get_end_time() (callback method)":[[0,"cplex.callbacks.Callback.get_end_time",false]],"get_estimated_objective_value() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_estimated_objective_value",false]],"get_feasibilities() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_feasibilities",false]],"get_float_quality() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_float_quality",false]],"get_float_quality() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_float_quality",false]],"get_float_quality() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_float_quality",false]],"get_global_lower_bounds() (context method)":[[0,"cplex.callbacks.Context.get_global_lower_bounds",false]],"get_global_upper_bounds() (context method)":[[0,"cplex.callbacks.Context.get_global_upper_bounds",false]],"get_gradients() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_gradients",false]],"get_groups() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get_groups",false]],"get_header() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_header",false]],"get_histogram() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_histogram",false]],"get_histogram() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_histogram",false]],"get_id() (context method)":[[0,"cplex.callbacks.Context.get_id",false]],"get_ids() (parameterset method)":[[0,"cplex.ParameterSet.get_ids",false],[0,"cplex.paramset.ParameterSet.get_ids",false]],"get_incumbent() (context method)":[[0,"cplex.callbacks.Context.get_incumbent",false]],"get_incumbent_linear_slacks() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_linear_slacks",false]],"get_incumbent_node() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_incumbent_node",false]],"get_incumbent_objective() (context method)":[[0,"cplex.callbacks.Context.get_incumbent_objective",false]],"get_incumbent_objective_value() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_objective_value",false]],"get_incumbent_quadratic_slacks() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_quadratic_slacks",false]],"get_incumbent_values() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_values",false]],"get_indicator_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_indicator_slacks",false]],"get_indicator_variables() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_indicator_variables",false]],"get_indices() (baseinterface method)":[[1,"cplex._internal._baseinterface.BaseInterface.get_indices",false]],"get_infeasibility_sum() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_infeasibility_sum",false]],"get_info() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_info",false]],"get_int_info() (context method)":[[0,"cplex.callbacks.Context.get_int_info",false]],"get_integer_quality() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_integer_quality",false]],"get_integer_quality() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_integer_quality",false]],"get_linear() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_linear",false]],"get_linear() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_linear",false]],"get_linear_components() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_linear_components",false]],"get_linear_components() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_linear_components",false]],"get_linear_num_nonzeros() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_linear_num_nonzeros",false]],"get_linear_reduced_costs_from_pi() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_linear_reduced_costs_from_pi",false]],"get_linear_slacks() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_linear_slacks",false]],"get_linear_slacks() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_linear_slacks",false]],"get_linear_slacks() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_linear_slacks",false]],"get_linear_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_linear_slacks",false]],"get_linear_slacks_from_x() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_linear_slacks_from_x",false]],"get_local_lower_bounds() (context method)":[[0,"cplex.callbacks.Context.get_local_lower_bounds",false]],"get_local_upper_bounds() (context method)":[[0,"cplex.callbacks.Context.get_local_upper_bounds",false]],"get_long_info() (context method)":[[0,"cplex.callbacks.Context.get_long_info",false]],"get_lower_bounds() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_lower_bounds",false]],"get_lower_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_lower_bounds",false]],"get_mean_objective_value() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_mean_objective_value",false]],"get_method() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_method",false]],"get_mip_relative_gap() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_MIP_relative_gap",false]],"get_mip_relative_gap() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_mip_relative_gap",false]],"get_name() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_name",false]],"get_names() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_names",false]],"get_names() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_names",false]],"get_names() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_names",false]],"get_names() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_names",false]],"get_names() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_names",false]],"get_names() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_names",false]],"get_names() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_names",false]],"get_names() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_names",false]],"get_names() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_names",false]],"get_names() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_names",false]],"get_names() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_names",false]],"get_names() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_names",false]],"get_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.get_native_int",false]],"get_node_data() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_node_data",false]],"get_node_data() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_node_data",false]],"get_node_data() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_data",false]],"get_node_id() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_node_ID",false]],"get_node_id() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_node_ID",false]],"get_node_id() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_ID",false]],"get_node_number() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_number",false]],"get_num() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_num",false]],"get_num() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_num",false]],"get_num() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_num",false]],"get_num() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_num",false]],"get_num() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_num",false]],"get_num() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_num",false]],"get_num() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_num",false]],"get_num() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_num",false]],"get_num() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_num",false]],"get_num() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_num",false]],"get_num() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_num",false]],"get_num() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num",false]],"get_num_barrier_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_barrier_iterations",false]],"get_num_binary() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_binary",false]],"get_num_branches() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_num_branches",false]],"get_num_cols() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_cols",false]],"get_num_cols() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_cols",false]],"get_num_conflict_passes() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_conflict_passes",false]],"get_num_cores() (cplex method)":[[0,"cplex.Cplex.get_num_cores",false]],"get_num_cores() (environment method)":[[1,"cplex._internal.Environment.get_num_cores",false]],"get_num_cuts() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_cuts",false]],"get_num_cuts() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_num_cuts",false]],"get_num_dual_exchange() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_dual_exchange",false]],"get_num_dual_exchanges() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_dual_exchanges",false]],"get_num_dual_push() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_dual_push",false]],"get_num_dual_pushes() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_dual_pushes",false]],"get_num_dual_superbasic() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_num_dual_superbasic",false]],"get_num_entries() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_num_entries",false]],"get_num_groups() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get_num_groups",false]],"get_num_infeasibilities() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_num_infeasibilities",false]],"get_num_integer() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_integer",false]],"get_num_iterations() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_num_iterations",false]],"get_num_iterations() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_iterations",false]],"get_num_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_iterations",false]],"get_num_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.get_num_lazy_constraints",false]],"get_num_members() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_num_members",false]],"get_num_nodes() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_nodes",false]],"get_num_nodes_processed() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_nodes_processed",false]],"get_num_nodes_remaining() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_nodes_remaining",false]],"get_num_nonzeros() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_num_nonzeros",false]],"get_num_nonzeros() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_num_nonzeros",false]],"get_num_nonzeros() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_num_nonzeros",false]],"get_num_phase_one_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_phase_one_iterations",false]],"get_num_primal_exchange() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_primal_exchange",false]],"get_num_primal_exchanges() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_primal_exchanges",false]],"get_num_primal_push() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_primal_push",false]],"get_num_primal_pushes() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_primal_pushes",false]],"get_num_primal_superbasic() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_num_primal_superbasic",false]],"get_num_quadratic_constraints() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_quadratic_constraints",false]],"get_num_quadratic_constraints() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_quadratic_constraints",false]],"get_num_quadratic_nonzeros() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_num_quadratic_nonzeros",false]],"get_num_quadratic_variables() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_num_quadratic_variables",false]],"get_num_remaining_nodes() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_remaining_nodes",false]],"get_num_replaced() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_num_replaced",false]],"get_num_rows() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_rows",false]],"get_num_rows() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_rows",false]],"get_num_semicontinuous() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_semicontinuous",false]],"get_num_semiinteger() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_semiinteger",false]],"get_num_sifting_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_sifting_iterations",false]],"get_num_sifting_phase_one_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_sifting_phase_one_iterations",false]],"get_num_solves() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_num_solves",false]],"get_num_superbasics() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_superbasics",false]],"get_num_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.get_num_user_cuts",false]],"get_objective_coefficients() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.get_objective_coefficients",false]],"get_objective_value() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_objective_value",false]],"get_objective_value() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_objective_value",false]],"get_objective_value() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_objective_value",false]],"get_objective_value() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_objective_value",false]],"get_objective_value() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_objective_value",false]],"get_objective_value() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_objective_value",false]],"get_objective_value() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_objective_value",false]],"get_objval_by_priority() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_objval_by_priority",false]],"get_offset() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_offset",false]],"get_offset() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_offset",false]],"get_parameter_set() (cplex method)":[[0,"cplex.Cplex.get_parameter_set",false]],"get_presolved_col_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_presolved_col_status",false]],"get_presolved_row_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_presolved_row_status",false]],"get_primal_infeasibility() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_primal_infeasibility",false]],"get_primal_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_primal_norms",false]],"get_priority() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_priority",false]],"get_problem_name() (cplex method)":[[0,"cplex.Cplex.get_problem_name",false]],"get_problem_type() (cplex method)":[[0,"cplex.Cplex.get_problem_type",false]],"get_progress() (tuningcallback method)":[[0,"cplex.callbacks.TuningCallback.get_progress",false]],"get_protected() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.get_protected",false]],"get_pseudo_costs() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_pseudo_costs",false]],"get_quad_num_nonzeros() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_quad_num_nonzeros",false]],"get_quadratic() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_quadratic",false]],"get_quadratic_activity_levels() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_activity_levels",false]],"get_quadratic_coefficients() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_quadratic_coefficients",false]],"get_quadratic_components() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_quadratic_components",false]],"get_quadratic_dualslack() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_dualslack",false]],"get_quadratic_indefinite_certificate() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_indefinite_certificate",false]],"get_quadratic_reduced_costs_from_pi() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_reduced_costs_from_pi",false]],"get_quadratic_slacks() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_quadratic_slacks",false]],"get_quadratic_slacks() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_quadratic_slacks",false]],"get_quadratic_slacks() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_quadratic_slacks",false]],"get_quadratic_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_slacks",false]],"get_quadratic_slacks_from_x() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_slacks_from_x",false]],"get_quality_metrics() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_quality_metrics",false]],"get_quality_metrics() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quality_metrics",false]],"get_range_filters() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_range_filters",false]],"get_range_values() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_range_values",false]],"get_ray() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_ray",false]],"get_reduced_costs() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_reduced_costs",false]],"get_relaxation_objective() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_objective",false]],"get_relaxation_point() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_point",false]],"get_relaxation_status() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_status",false]],"get_reltol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_reltol",false]],"get_rhs() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_rhs",false]],"get_rhs() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_rhs",false]],"get_rhs() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_rhs",false]],"get_row_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_row_status",false]],"get_rows() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_rows",false]],"get_sense() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_sense",false]],"get_sense() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_sense",false]],"get_senses() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_senses",false]],"get_senses() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_senses",false]],"get_senses() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_senses",false]],"get_sets() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_sets",false]],"get_solution_source() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_solution_source",false]],"get_solution_source() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.get_solution_source",false]],"get_solution_type() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_solution_type",false]],"get_sos_feasibilities() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_SOS_feasibilities",false]],"get_start_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_start_dettime",false]],"get_start_time() (callback method)":[[0,"cplex.callbacks.Callback.get_start_time",false]],"get_starts() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_starts",false]],"get_stats() (cplex method)":[[0,"cplex.Cplex.get_stats",false]],"get_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_status",false]],"get_status() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_status",false]],"get_status_string() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_status_string",false]],"get_subproblem_status() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_subproblem_status",false]],"get_thread_num() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_thread_num",false]],"get_time() (callback method)":[[0,"cplex.callbacks.Callback.get_time",false]],"get_time() (cplex method)":[[0,"cplex.Cplex.get_time",false]],"get_time() (environment method)":[[1,"cplex._internal.Environment.get_time",false]],"get_types() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_types",false]],"get_types() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_types",false]],"get_types() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_types",false]],"get_types() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_types",false]],"get_upper_bounds() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_upper_bounds",false]],"get_upper_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_upper_bounds",false]],"get_values() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_values",false]],"get_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_values",false]],"get_values() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_values",false]],"get_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_values",false]],"get_values() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_values",false]],"get_values() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_values",false]],"get_variables() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.get_variables",false]],"get_version() (cplex method)":[[0,"cplex.Cplex.get_version",false]],"get_version() (environment method)":[[1,"cplex._internal.Environment.get_version",false]],"get_versionnumber() (cplex method)":[[0,"cplex.Cplex.get_versionnumber",false]],"get_versionnumber() (environment method)":[[1,"cplex._internal.Environment.get_versionnumber",false]],"get_weight() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_weight",false]],"get_wherefrom() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.get_wherefrom",false]],"getax() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getax",false]],"getbaritcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbaritcnt",false]],"getbase() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbase",false]],"getbasednorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbasednorms",false]],"getbestobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbestobjval",false]],"getbhead() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbhead",false]],"getcallbackincumbent() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackincumbent",false]],"getcallbacknodeinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeinfo",false]],"getcallbacknodeintfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeintfeas",false]],"getcallbacknodelb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodelb",false]],"getcallbacknodeobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeobjval",false]],"getcallbacknodeub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeub",false]],"getcallbacknodex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodex",false]],"getcallbackpseudocosts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackpseudocosts",false]],"getcallbackseqinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackseqinfo",false]],"getcallbacksosinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacksosinfo",false]],"getchannels() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getchannels",false]],"getcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcoef",false]],"getcolindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolindex",false]],"getcolinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolinfeas",false]],"getcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolname",false]],"getcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcols",false]],"getconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictext",false]],"getconflictgroups() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictgroups",false]],"getconflictnumgroups() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictnumgroups",false]],"getconflictnumpasses() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictnumpasses",false]],"getcrossdexchcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossdexchcnt",false]],"getcrossdpushcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossdpushcnt",false]],"getcrosspexchcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrosspexchcnt",false]],"getcrossppushcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossppushcnt",false]],"getctype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getctype",false]],"getcutoff() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcutoff",false]],"getdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblanno",false]],"getdblannodefval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannodefval",false]],"getdblannoindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannoindex",false]],"getdblannoname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannoname",false]],"getdblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblparam",false]],"getdblquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblquality",false]],"getdettime() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdettime",false]],"getdj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdj",false]],"getdnorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdnorms",false]],"getdsbcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdsbcnt",false]],"geterrorstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.geterrorstring",false]],"getgrad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getgrad",false]],"gethist() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.gethist",false]],"getijdiv() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getijdiv",false]],"getijrow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getijrow",false]],"getindconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstr",false]],"getindconstr_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstr_constant",false]],"getindconstrindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrindex",false]],"getindconstrinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrinfeas",false]],"getindconstrname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrname",false]],"getindconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrslack",false]],"getintparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getintparam",false]],"getintquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getintquality",false]],"getitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getitcnt",false]],"getlb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlb",false]],"getlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlonganno",false]],"getlongannodefval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannodefval",false]],"getlongannoindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannoindex",false]],"getlongannoname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannoname",false]],"getlongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongparam",false]],"getmethod() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmethod",false]],"getmipitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipitcnt",false]],"getmiprelgap() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmiprelgap",false]],"getmipstartindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstartindex",false]],"getmipstartname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstartname",false]],"getmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts",false]],"getmipstarts_effort() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts_effort",false]],"getmipstarts_size() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts_size",false]],"getnodecnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodecnt",false]],"getnodeint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodeint",false]],"getnodeleftcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodeleftcnt",false]],"getnumbin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumbin",false]],"getnumcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcols",false]],"getnumcores() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcores",false]],"getnumcuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcuts",false]],"getnumdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumdblanno",false]],"getnumindconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumindconstrs",false]],"getnumint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumint",false]],"getnumlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumlonganno",false]],"getnummipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnummipstarts",false]],"getnumnz() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumnz",false]],"getnumobjs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumobjs",false]],"getnumprios() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumprios",false]],"getnumpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumpwl",false]],"getnumqconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumqconstrs",false]],"getnumqpnz() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumqpnz",false]],"getnumquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumquad",false]],"getnumrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumrows",false]],"getnumsemicont() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsemicont",false]],"getnumsemiint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsemiint",false]],"getnumsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsos",false]],"getobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobj",false]],"getobjname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjname",false]],"getobjoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjoffset",false]],"getobjsen() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjsen",false]],"getobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjval",false]],"getorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getorder",false]],"getparamtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getparamtype",false]],"getphase1cnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getphase1cnt",false]],"getpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpi",false]],"getpnorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpnorms",false]],"getprestat_c() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_c",false]],"getprestat_oc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_oc",false]],"getprestat_or() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_or",false]],"getprestat_r() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_r",false]],"getprestat_status() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_status",false]],"getprobname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobname",false]],"getprobstats() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobstats",false]],"getprobtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobtype",false]],"getprotected() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprotected",false]],"getpsbcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpsbcnt",false]],"getpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwl",false]],"getpwlindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwlindex",false]],"getpwlname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwlname",false]],"getqconstr_info() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_info",false]],"getqconstr_lin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_lin",false]],"getqconstr_quad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_quad",false]],"getqconstrdslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrdslack",false]],"getqconstrindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrindex",false]],"getqconstrinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrinfeas",false]],"getqconstrname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrname",false]],"getqconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrslack",false]],"getqpcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqpcoef",false]],"getquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getquad",false]],"getqualitymetrics() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqualitymetrics",false]],"getray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getray",false]],"getrhs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrhs",false]],"getrngval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrngval",false]],"getrowindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowindex",false]],"getrowinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowinfeas",false]],"getrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowname",false]],"getrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrows",false]],"getsense() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsense",false]],"getsiftitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsiftitcnt",false]],"getsiftphase1cnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsiftphase1cnt",false]],"getslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getslack",false]],"getsolnpooldblquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldblquality",false]],"getsolnpooldivfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldivfilter",false]],"getsolnpooldivfilter_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldivfilter_constant",false]],"getsolnpoolfilterindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfilterindex",false]],"getsolnpoolfiltername() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfiltername",false]],"getsolnpoolfiltertype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfiltertype",false]],"getsolnpoolintquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolintquality",false]],"getsolnpoolmeanobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolmeanobjval",false]],"getsolnpoolnumfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumfilters",false]],"getsolnpoolnumreplaced() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumreplaced",false]],"getsolnpoolnumsolns() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumsolns",false]],"getsolnpoolobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolobjval",false]],"getsolnpoolqconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolqconstrslack",false]],"getsolnpoolrngfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolrngfilter",false]],"getsolnpoolrngfilter_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolrngfilter_constant",false]],"getsolnpoolslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolslack",false]],"getsolnpoolsolnindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolsolnindex",false]],"getsolnpoolsolnname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolsolnname",false]],"getsolnpoolx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolx",false]],"getsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsos",false]],"getsos_info() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsos_info",false]],"getsosindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosindex",false]],"getsosinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosinfeas",false]],"getsosname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosname",false]],"getstat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstat",false]],"getstatstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstatstring",false]],"getstrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstrparam",false]],"getsubstat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsubstat",false]],"gettime() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.gettime",false]],"getub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getub",false]],"getx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getx",false]],"getxqxax() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getxqxax",false]],"global_progress (contexttype attribute)":[[0,"cplex.callbacks.ContextType.global_progress",false]],"group_status (conflictinterface attribute)":[[1,"cplex._internal._subinterfaces.ConflictInterface.group_status",false]],"gub_cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.GUB_cover",false],[1,"cplex._internal._subinterfaces.CutType.GUB_cover",false]],"guided (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.guided",false]],"has_incumbent() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.has_incumbent",false]],"has_name() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_name",false]],"has_non_default_lb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_non_default_lb",false]],"has_non_default_ub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_non_default_ub",false]],"has_problem (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.has_problem",false]],"help() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.help",false]],"heuristic (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.heuristic",false]],"heuristic_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.heuristic_solution",false]],"heuristiccallback (class in cplex.callbacks)":[[0,"cplex.callbacks.HeuristicCallback",false]],"hidden_feasibility (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.hidden_feasibility",false]],"histogram (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.Histogram",false]],"hscallback (class in cplex.callbacks)":[[0,"cplex.callbacks.HSCallback",false]],"hybbaropt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.hybbaropt",false]],"hybnetopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.hybnetopt",false]],"id (context attribute)":[[0,"cplex.callbacks.Context.id",false]],"identity() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.identity",false]],"if_ (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.if_",false]],"if_possible (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.if_possible",false]],"iff (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.iff",false]],"iis (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.iis",false]],"implied_bound (cuttype attribute)":[[0,"cplex.callbacks.CutType.implied_bound",false],[1,"cplex._internal._subinterfaces.CutType.implied_bound",false]],"implied_feasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.implied_feasible",false]],"in_branching() (context method)":[[0,"cplex.callbacks.Context.in_branching",false]],"in_candidate() (context method)":[[0,"cplex.callbacks.Context.in_candidate",false]],"in_global_progress() (context method)":[[0,"cplex.callbacks.Context.in_global_progress",false]],"in_local_progress() (context method)":[[0,"cplex.callbacks.Context.in_local_progress",false]],"in_relaxation() (context method)":[[0,"cplex.callbacks.Context.in_relaxation",false]],"in_thread_down() (context method)":[[0,"cplex.callbacks.Context.in_thread_down",false]],"in_thread_up() (context method)":[[0,"cplex.callbacks.Context.in_thread_up",false]],"incumbent (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.incumbent",false]],"incumbentcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.IncumbentCallback",false]],"indicator (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.indicator",false]],"indicator (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.indicator",false]],"indicator_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.indicator_constraint",false]],"indicator_constraints (cplex attribute)":[[0,"cplex.Cplex.indicator_constraints",false]],"indicator_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.indicator_constraints",false]],"indicator_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.indicator_constraints",false]],"indicator_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.indicator_constraints",false]],"indicatorconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface",false]],"indicatortype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.IndicatorType",false]],"infeas_constant (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.infeas_constant",false]],"infeas_estimate (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.infeas_estimate",false]],"infeasibility (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.infeasibility",false]],"infeasibilityinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface",false]],"infeasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.infeasible",false]],"infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.infeasible",false]],"infeasible_or_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.infeasible_or_unbounded",false]],"infinity (in module cplex)":[[0,"cplex.infinity",false]],"info (context attribute)":[[0,"cplex.callbacks.Context.info",false]],"infodblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infodblparam",false]],"infointparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infointparam",false]],"infolongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infolongparam",false]],"infostrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infostrparam",false]],"init_list_args() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.init_list_args",false]],"initialinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.InitialInterface",false]],"initlock() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.initlock",false]],"int_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.int_info",false]],"integer (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.integer",false]],"integer_feasible (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.integer_feasible",false]],"integral (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.integral",false]],"interfere_crush (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.interfere_crush",false]],"interfere_uncrush (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.interfere_uncrush",false]],"is_aborted() (aborter method)":[[0,"cplex.Aborter.is_aborted",false],[0,"cplex.aborter.Aborter.is_aborted",false]],"is_after_cut_loop() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.is_after_cut_loop",false]],"is_candidate_point() (context method)":[[0,"cplex.callbacks.Context.is_candidate_point",false]],"is_candidate_ray() (context method)":[[0,"cplex.callbacks.Context.is_candidate_ray",false]],"is_dual_feasible() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.is_dual_feasible",false]],"is_dual_feasible() (hscallback method)":[[0,"cplex.callbacks.HSCallback.is_dual_feasible",false]],"is_dual_feasible() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.is_dual_feasible",false]],"is_integer_feasible() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.is_integer_feasible",false]],"is_primal_feasible() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.is_primal_feasible",false]],"is_primal_feasible() (hscallback method)":[[0,"cplex.callbacks.HSCallback.is_primal_feasible",false]],"is_primal_feasible() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.is_primal_feasible",false]],"is_unbounded_node() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.is_unbounded_node",false]],"ismultiobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ismultiobj",false]],"isvalid() (sparsepair method)":[[0,"cplex.SparsePair.isvalid",false]],"isvalid() (sparsetriple method)":[[0,"cplex.SparseTriple.isvalid",false]],"kappa (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.kappa",false]],"kappa_attention (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_attention",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_attention",false]],"kappa_illposed (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_illposed",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_illposed",false]],"kappa_max (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_max",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_max",false]],"kappa_stable (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_stable",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_stable",false]],"kappa_suspicious (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_suspicious",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_suspicious",false]],"kappa_unstable (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_unstable",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_unstable",false]],"kappastats_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.kappastats_constants",false]],"lazyconstraintcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.LazyConstraintCallback",false]],"lift_and_project (cuttype attribute)":[[0,"cplex.callbacks.CutType.lift_and_project",false],[1,"cplex._internal._subinterfaces.CutType.lift_and_project",false]],"limitedsolve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.limitedsolve",false]],"linear (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.linear",false]],"linear (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.linear",false]],"linear_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.linear_constants",false]],"linear_constraints (cplex attribute)":[[0,"cplex.Cplex.linear_constraints",false]],"linear_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.linear_constraints",false]],"linear_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.linear_constraints",false]],"linear_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.linear_constraints",false]],"linearconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface",false]],"listify() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.listify",false]],"local_implied_bound (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.local_implied_bound",false]],"local_progress (contexttype attribute)":[[0,"cplex.callbacks.ContextType.local_progress",false]],"log_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.LOG_CHNL_IDX",false]],"logarithmic (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.logarithmic",false]],"logarithmic (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.logarithmic",false]],"long_annotations (cplex attribute)":[[0,"cplex.Cplex.long_annotations",false]],"long_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.long_info",false]],"longannotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.LongAnnotationInterface",false]],"lower_bound (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.lower_bound",false]],"lower_bound (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.lower_bound",false]],"lower_bound (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.lower_bound",false]],"lower_bound_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.lower_bound_constraints",false]],"lower_bound_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.lower_bound_constraints",false]],"lower_bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.lower_bounds",false]],"lp (problemtype attribute)":[[1,"cplex._internal.ProblemType.LP",false]],"lp_all (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.LP_all",false]],"lp_at_node (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.LP_at_node",false]],"lp_root (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.LP_root",false]],"lpopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.lpopt",false]],"make_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.make_branch",false]],"make_branch() (context method)":[[0,"cplex.callbacks.Context.make_branch",false]],"make_cplex_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.make_cplex_branch",false]],"make_group() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.make_group",false]],"make_ranges() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.make_ranges",false]],"max() (numparameter method)":[[1,"cplex._internal._parameter_classes.NumParameter.max",false]],"max_arg_length() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.max_arg_length",false]],"max_comp_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_comp_slack",false]],"max_dual_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_dual_infeasibility",false]],"max_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_dual_residual",false]],"max_indicator_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_indicator_slack_infeasibility",false]],"max_infeasibility (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.max_infeasibility",false]],"max_int_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_int_infeasibility",false]],"max_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_pi",false]],"max_primal_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_primal_infeasibility",false]],"max_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_primal_residual",false]],"max_pwl_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_pwl_slack_infeasibility",false]],"max_quadratic_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_primal_residual",false]],"max_quadratic_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_slack",false]],"max_quadratic_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_slack_infeasibility",false]],"max_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_reduced_cost",false]],"max_scaled_dual_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_dual_infeasibility",false]],"max_scaled_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_dual_residual",false]],"max_scaled_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_pi",false]],"max_scaled_primal_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_primal_infeasibility",false]],"max_scaled_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_primal_residual",false]],"max_scaled_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_reduced_cost",false]],"max_scaled_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_slack",false]],"max_scaled_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_x",false]],"max_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_slack",false]],"max_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_x",false]],"maximize (objsense attribute)":[[1,"cplex._internal._subinterfaces.ObjSense.maximize",false]],"mbasewrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mbasewrite",false]],"mdleave() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mdleave",false]],"measure_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.measure_constants",false]],"mem_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.mem_limit_feasible",false]],"mem_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.mem_limit_infeasible",false]],"member (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.member",false]],"memory (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.memory",false]],"method (hscallback attribute)":[[0,"cplex.callbacks.HSCallback.method",false]],"method (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.method",false]],"method (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.method",false]],"method (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.method",false]],"methodtype (class in cplex.callbacks)":[[0,"cplex.callbacks.MethodType",false]],"mild (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.mild",false]],"milp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MILP",false]],"min() (numparameter method)":[[1,"cplex._internal._parameter_classes.NumParameter.min",false]],"min_inf (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_inf",false]],"min_infeasibility (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.min_infeasibility",false]],"min_quad (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_quad",false]],"min_sum (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_sum",false]],"minimal (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.minimal",false]],"minimize (objsense attribute)":[[1,"cplex._internal._subinterfaces.ObjSense.minimize",false]],"minmax (measure_constants attribute)":[[1,"cplex._internal._parameter_classes.measure_constants.minmax",false]],"mip (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.MIP",false]],"mip (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.MIP",false]],"mip_abort_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_abort_feasible",false]],"mip_abort_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_abort_infeasible",false]],"mip_dettime_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_dettime_limit_feasible",false]],"mip_dettime_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_dettime_limit_infeasible",false]],"mip_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.mip_display_constants",false]],"mip_emph_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.mip_emph_constants",false]],"mip_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible",false]],"mip_feasible_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_inf",false]],"mip_feasible_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_quad",false]],"mip_feasible_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_sum",false]],"mip_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_infeasible",false]],"mip_infeasible_or_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_infeasible_or_unbounded",false]],"mip_interval_nodes (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.mip_interval_nodes",false]],"mip_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal",false]],"mip_optimal_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_infeasible",false]],"mip_optimal_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_inf",false]],"mip_optimal_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_quad",false]],"mip_optimal_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_sum",false]],"mip_starts (cplex attribute)":[[0,"cplex.Cplex.MIP_starts",false]],"mip_time_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_time_limit_feasible",false]],"mip_time_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_time_limit_infeasible",false]],"mip_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_unbounded",false]],"mipcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.MIPCallback",false]],"mipinfocallback (class in cplex.callbacks)":[[0,"cplex.callbacks.MIPInfoCallback",false]],"mipopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mipopt",false]],"mipsolutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface",false]],"mipstart_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.mipstart_solution",false]],"mipstartsinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface",false]],"miqcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MIQCP",false]],"miqcp_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.miqcp_constants",false]],"miqp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MIQP",false]],"mir (cuttype attribute)":[[0,"cplex.callbacks.CutType.MIR",false],[1,"cplex._internal._subinterfaces.CutType.MIR",false]],"modelasstcallbacksetfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.modelasstcallbacksetfunc",false]],"moderate (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.moderate",false]],"moderate (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.moderate",false]],"moderate (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.moderate",false]],"module":[[0,"module-cplex",false],[0,"module-cplex.aborter",false],[0,"module-cplex.callbacks",false],[0,"module-cplex.constant_class",false],[0,"module-cplex.exceptions",false],[0,"module-cplex.model_info",false],[0,"module-cplex.paramset",false],[1,"module-cplex._internal",false],[1,"module-cplex._internal._anno",false],[1,"module-cplex._internal._aux_functions",false],[1,"module-cplex._internal._baseinterface",false],[1,"module-cplex._internal._constants",false],[1,"module-cplex._internal._constantsenum",false],[1,"module-cplex._internal._matrices",false],[1,"module-cplex._internal._multiobj",false],[1,"module-cplex._internal._multiobjsoln",false],[1,"module-cplex._internal._parameter_classes",false],[1,"module-cplex._internal._procedural",false],[1,"module-cplex._internal._pwl",false],[1,"module-cplex._internal._solutionstrategyenum",false],[1,"module-cplex._internal._subinterfaces",false]],"more_aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.more_aggressive",false]],"multi_commodity_flow (cuttype attribute)":[[0,"cplex.callbacks.CutType.multi_commodity_flow",false],[1,"cplex._internal._subinterfaces.CutType.multi_commodity_flow",false]],"multiobj (cplex attribute)":[[0,"cplex.Cplex.multiobj",false]],"multiobj (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.multiobj",false]],"multiobj_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_infeasible",false]],"multiobj_inforunbd (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_inforunbd",false]],"multiobj_non_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_non_optimal",false]],"multiobj_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_optimal",false]],"multiobj_stopped (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_stopped",false]],"multiobj_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_unbounded",false]],"multiobjchgattribs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjchgattribs",false]],"multiobjfloatinfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo",false]],"multiobjgetdblinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetdblinfo",false]],"multiobjgetindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetindex",false]],"multiobjgetintinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetintinfo",false]],"multiobjgetlonginfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetlonginfo",false]],"multiobjgetname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetname",false]],"multiobjgetnumsolves() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetnumsolves",false]],"multiobjgetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobj",false]],"multiobjgetobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobjval",false]],"multiobjgetobjvalbypriority() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobjvalbypriority",false]],"multiobjinterface (class in cplex._internal._multiobj)":[[1,"cplex._internal._multiobj.MultiObjInterface",false]],"multiobjintinfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo",false]],"multiobjlonginfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo",false]],"multiobjopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjopt",false]],"multiobjsetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjsetobj",false]],"multiobjsolninterface (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface",false]],"multiple_partial (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.multiple_partial",false]],"multiple_partial_with_sorting (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.multiple_partial_with_sorting",false]],"nested_dissection (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.nested_dissection",false]],"network (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.network",false]],"network (methodtype attribute)":[[0,"cplex.callbacks.MethodType.network",false]],"network (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.network",false]],"network (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.network",false]],"network (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.network",false]],"network_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_display_constants",false]],"network_netfind_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_netfind_constants",false]],"network_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_pricing_constants",false]],"new_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.new_native_int",false]],"new_root_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.new_root_cuts",false]],"newcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newcols",false]],"newdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newdblanno",false]],"newlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newlonganno",false]],"newrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newrows",false]],"no (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.no",false]],"no (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.no",false]],"no_check (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.no_check",false]],"no_check (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.no_check",false]],"no_reductions (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.no_reductions",false]],"no_solve (relaxationflags attribute)":[[0,"cplex.callbacks.RelaxationFlags.no_solve",false]],"no_variable (advancedcplexinterface attribute)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.no_variable",false]],"node_cuts (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.node_cuts",false]],"node_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.node_limit_feasible",false]],"node_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.node_limit_infeasible",false]],"node_lp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_LP",false]],"node_qcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_QCP",false]],"node_qp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_QP",false]],"node_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.node_solution",false]],"nodecallback (class in cplex.callbacks)":[[0,"cplex.callbacks.NodeCallback",false]],"nodesel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.nodesel_constants",false]],"non_basic (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.non_basic",false]],"nonbasic (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.nonbasic",false]],"none (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.none",false]],"none (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.none",false]],"none (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.none",false]],"none (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.none",false]],"none (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.none",false]],"none (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.none",false]],"none (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.none",false]],"none (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.none",false]],"none (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.none",false]],"none (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.none",false]],"none (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.none",false]],"none (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.none",false]],"none (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.none",false]],"none (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.none",false]],"none (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.none",false]],"none (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.none",false]],"none (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.none",false]],"none (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.none",false]],"none (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.none",false]],"none (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.none",false]],"none (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.none",false]],"nonzero_discrete_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.nonzero_discrete_variables",false]],"nonzero_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.nonzero_variables",false]],"normal (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.normal",false]],"num_barrier_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_barrier_iterations",false]],"num_best (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.num_best",false]],"num_degenerate_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_degenerate_iterations",false]],"num_dual_exchanges (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_dual_exchanges",false]],"num_dual_pushes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_dual_pushes",false]],"num_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_iterations",false]],"num_nodes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_nodes",false]],"num_nodes_left (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_nodes_left",false]],"num_phase1_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_phase1_iterations",false]],"num_primal_exchanges (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_primal_exchanges",false]],"num_primal_pushes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_primal_pushes",false]],"num_sifting_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_sifting_iterations",false]],"num_sifting_phase1_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_sifting_phase1_iterations",false]],"numparameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.NumParameter",false]],"obj_and_feas (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.obj_and_feas",false]],"object_type (annotationinterface attribute)":[[1,"cplex._internal._anno.AnnotationInterface.object_type",false]],"objective (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.objective",false]],"objective (cplex attribute)":[[0,"cplex.Cplex.objective",false]],"objective (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.objective",false]],"objective() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.objective",false]],"objective_gap (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.objective_gap",false]],"objectiveinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface",false]],"objsa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.objsa",false]],"objsense (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ObjSense",false]],"off (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.off",false]],"off (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.off",false]],"off (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.off",false]],"off (off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.off_on_constants.off",false]],"off (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.off",false]],"off (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.off",false]],"off_on_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.off_on_constants",false]],"on (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.on",false]],"on (off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.off_on_constants.on",false]],"only_linear (linear_constants attribute)":[[1,"cplex._internal._parameter_classes.linear_constants.only_linear",false]],"onlyif (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.onlyif",false]],"opencplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.openCPLEX",false]],"opportunistic (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.opportunistic",false]],"opt_inf (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_inf",false]],"opt_quad (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_quad",false]],"opt_sum (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_sum",false]],"optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal",false]],"optimal_convex (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.optimal_convex",false]],"optimal_face_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_face_unbounded",false]],"optimal_global (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.optimal_global",false]],"optimal_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_infeasible",false]],"optimal_populated (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_populated",false]],"optimal_populated_tolerance (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_populated_tolerance",false]],"optimal_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_inf",false]],"optimal_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_quad",false]],"optimal_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_sum",false]],"optimal_tolerance (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_tolerance",false]],"optimality (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.optimality",false]],"optimalitytarget_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants",false]],"optimizationcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.OptimizationCallback",false]],"order (cplex attribute)":[[0,"cplex.Cplex.order",false]],"orderinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.OrderInterface",false]],"ordertype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.ordertype_constants",false]],"ordwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ordwrite",false]],"other (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.other",false]],"other (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.other",false]],"pack_env_lp_ptr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pack_env_lp_ptr",false]],"par_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.par_constants",false]],"parameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.Parameter",false]],"parametergroup (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.ParameterGroup",false]],"parameters (cplex attribute)":[[0,"cplex.Cplex.parameters",false]],"parameterset (class in cplex)":[[0,"cplex.ParameterSet",false]],"parameterset (class in cplex.paramset)":[[0,"cplex.paramset.ParameterSet",false]],"paramsetadd() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetadd",false]],"paramsetadddbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetadddbl",false]],"paramsetaddint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddint",false]],"paramsetaddlong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddlong",false]],"paramsetaddstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddstr",false]],"paramsetapply() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetapply",false]],"paramsetcopy() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetcopy",false]],"paramsetcreate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetcreate",false]],"paramsetdel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetdel",false]],"paramsetfree() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetfree",false]],"paramsetget() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetget",false]],"paramsetgetdbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetdbl",false]],"paramsetgetids() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetids",false]],"paramsetgetint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetint",false]],"paramsetgetlong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetlong",false]],"paramsetgetnum() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetnum",false]],"paramsetgetstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetstr",false]],"paramsetreadcopy() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetreadcopy",false]],"paramsetwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetwrite",false]],"partial (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.partial",false]],"partial (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.partial",false]],"penalized_objective_values (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.penalized_objective_values",false]],"pfeas (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.pfeas",false]],"pivot (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot",false]],"pivot() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot",false]],"pivot() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivot",false]],"pivot_fixed_variables_out() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot_fixed_variables_out",false]],"pivot_in (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot_in",false]],"pivot_out (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot_out",false]],"pivot_slacks_in() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot_slacks_in",false]],"pivotin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivotin",false]],"pivotout() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivotout",false]],"pivotvarstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PivotVarStatus",false]],"pool (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.pool",false]],"populate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.populate",false]],"populate_solution_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.populate_solution_limit",false]],"populate_solution_pool() (cplex method)":[[0,"cplex.Cplex.populate_solution_pool",false]],"possible_member (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.possible_member",false]],"post_heuristic_solution() (context method)":[[0,"cplex.callbacks.Context.post_heuristic_solution",false]],"pperwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pperwrite",false]],"preaddrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.preaddrows",false]],"prechgobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.prechgobj",false]],"prered_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.prered_constants",false]],"prereform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.prereform_constants",false]],"preslvwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.preslvwrite",false]],"presolve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.presolve",false]],"presolve (cplex attribute)":[[0,"cplex.Cplex.presolve",false]],"presolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.presolve",false]],"presolve() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.presolve",false]],"presolve_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.presolve_constants",false]],"presolvecolstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveColStatus",false]],"presolveinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveInterface",false]],"presolvemethod (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveMethod",false]],"presolverowstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus",false]],"presolvestatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveStatus",false]],"primal (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.primal",false]],"primal (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.primal",false]],"primal (methodtype attribute)":[[0,"cplex.callbacks.MethodType.primal",false]],"primal (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.primal",false]],"primal (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.primal",false]],"primal (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.primal",false]],"primal (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.primal",false]],"primal (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.primal",false]],"primal (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.primal",false]],"primal (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.primal",false]],"primal_and_dual (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.primal_and_dual",false]],"primal_objective (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.primal_objective",false]],"primal_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants",false]],"primopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.primopt",false]],"priority (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.priority",false]],"probe (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.probe",false]],"probing (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.probing",false]],"problem_type (cplex attribute)":[[0,"cplex.Cplex.problem_type",false]],"problemtype (class in cplex._internal)":[[1,"cplex._internal.ProblemType",false]],"progress (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.progress",false]],"progressinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ProgressInterface",false]],"propagate (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.propagate",false]],"propagate (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.propagate",false]],"protect() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.protect",false]],"prune() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.prune",false]],"prune_current_node() (context method)":[[0,"cplex.callbacks.Context.prune_current_node",false]],"pseudo_costs (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.pseudo_costs",false]],"pseudo_reduced_costs (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.pseudo_reduced_costs",false]],"pure (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.pure",false]],"purge (useconstraint attribute)":[[0,"cplex.callbacks.UseConstraint.purge",false]],"purge (usecut attribute)":[[0,"cplex.callbacks.UseCut.purge",false]],"pwl (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.pwl",false]],"pwl_constraints (cplex attribute)":[[0,"cplex.Cplex.pwl_constraints",false]],"pwl_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.pwl_constraints",false]],"pwlconstraintinterface (class in cplex._internal._pwl)":[[1,"cplex._internal._pwl.PWLConstraintInterface",false]],"pylolmat_to_chbmat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.Pylolmat_to_CHBmat",false]],"qconstrslackfromx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qconstrslackfromx",false]],"qcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.QCP",false]],"qcp_at_node (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.QCP_at_node",false]],"qcpduals_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.qcpduals_constants",false]],"qp (problemtype attribute)":[[1,"cplex._internal.ProblemType.QP",false]],"qp_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.qp_alg_constants",false]],"qpdjfrompi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpdjfrompi",false]],"qpindefcertificate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpindefcertificate",false]],"qpopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpopt",false]],"quadratic (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.quadratic",false]],"quadratic (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.quadratic",false]],"quadratic_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.quadratic_constraint",false]],"quadratic_constraints (cplex attribute)":[[0,"cplex.Cplex.quadratic_constraints",false]],"quadratic_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.quadratic_constraints",false]],"quadratic_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.quadratic_constraints",false]],"quadratic_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.quadratic_constraints",false]],"quadraticconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface",false]],"quality_metric (mipinfocallback attribute)":[[0,"cplex.callbacks.MIPInfoCallback.quality_metric",false]],"quality_metric (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.quality_metric",false]],"quality_metric (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.quality_metric",false]],"qualitymetric (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QualityMetric",false]],"qualitymetric (class in cplex.callbacks)":[[0,"cplex.callbacks.QualityMetric",false]],"qualitymetrics (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QualityMetrics",false]],"range (filtertype attribute)":[[1,"cplex._internal._subinterfaces.FilterType.range",false]],"read() (cplex method)":[[0,"cplex.Cplex.read",false]],"read() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.read",false]],"read() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.read",false]],"read() (parameterset method)":[[0,"cplex.ParameterSet.read",false],[0,"cplex.paramset.ParameterSet.read",false]],"read() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.read",false]],"read_annotations() (cplex method)":[[0,"cplex.Cplex.read_annotations",false]],"read_basis() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.read_basis",false]],"read_file() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.read_file",false]],"read_start() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.read_start",false]],"readcopyanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyanno",false]],"readcopybase() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopybase",false]],"readcopymipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopymipstarts",false]],"readcopyorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyorder",false]],"readcopyparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyparam",false]],"readcopyprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyprob",false]],"readcopysolnpoolfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopysolnpoolfilters",false]],"readcopystartinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopystartinfo",false]],"reduced (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.reduced",false]],"refine() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.refine",false]],"refine_mip_start() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.refine_MIP_start",false]],"refineconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.refineconflictext",false]],"refinemipstartconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.refinemipstartconflictext",false]],"reflection_scaling (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.reflection_scaling",false]],"register_callback() (cplex method)":[[0,"cplex.Cplex.register_callback",false]],"register_callback() (environment method)":[[1,"cplex._internal.Environment.register_callback",false]],"reject() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.reject",false]],"reject_candidate() (context method)":[[0,"cplex.callbacks.Context.reject_candidate",false]],"reject_candidate_local() (context method)":[[0,"cplex.callbacks.Context.reject_candidate_local",false]],"relaxation (contexttype attribute)":[[0,"cplex.callbacks.ContextType.relaxation",false]],"relaxation_flags (context attribute)":[[0,"cplex.callbacks.Context.relaxation_flags",false]],"relaxation_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.relaxation_unbounded",false]],"relaxationflags (class in cplex.callbacks)":[[0,"cplex.callbacks.RelaxationFlags",false]],"remove_aborter() (cplex method)":[[0,"cplex.Cplex.remove_aborter",false]],"repair (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.repair",false]],"repeatpre_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.repeatpre_constants",false]],"replace_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.replace_constants",false]],"reset() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.reset",false]],"reset() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.reset",false]],"reset() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.reset",false]],"results_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.RESULTS_CHNL_IDX",false]],"rhs() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.rhs",false]],"rhssa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.rhssa",false]],"rlt (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.RLT",false]],"rootparametergroup (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.RootParameterGroup",false]],"row (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.row",false]],"row_status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.row_status",false]],"runseeds() (cplex method)":[[0,"cplex.Cplex.runseeds",false]],"runseeds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.runseeds",false]],"sample (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.sample",false]],"scale_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.scale_constants",false]],"scaled_cost (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.scaled_cost",false]],"search_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.search_constants",false]],"select_node() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.select_node",false]],"semi_continuous (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.semi_continuous",false]],"semi_integer (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.semi_integer",false]],"sense (multiobjinterface attribute)":[[1,"cplex._internal._multiobj.MultiObjInterface.sense",false]],"sense (objectiveinterface attribute)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.sense",false]],"sensitivity (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.sensitivity",false]],"sensitivityinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SensitivityInterface",false]],"set() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.set",false]],"set() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.set",false]],"set_abstol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_abstol",false]],"set_bounds() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.set_bounds",false]],"set_callback() (cplex method)":[[0,"cplex.Cplex.set_callback",false]],"set_coefficients() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_coefficients",false]],"set_definition() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_definition",false]],"set_error_stream() (cplex method)":[[0,"cplex.Cplex.set_error_stream",false]],"set_error_stream() (environment method)":[[1,"cplex._internal.Environment.set_error_stream",false]],"set_linear() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_linear",false]],"set_linear() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_linear",false]],"set_linear_components() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_linear_components",false]],"set_log_stream() (cplex method)":[[0,"cplex.Cplex.set_log_stream",false]],"set_log_stream() (environment method)":[[1,"cplex._internal.Environment.set_log_stream",false]],"set_lower_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_lower_bounds",false]],"set_modeling_assistance_callback() (cplex method)":[[0,"cplex.Cplex.set_modeling_assistance_callback",false]],"set_name() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_name",false]],"set_name() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_name",false]],"set_names() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_names",false]],"set_names() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_names",false]],"set_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.set_native_int",false]],"set_node_data() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.set_node_data",false]],"set_node_data() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.set_node_data",false]],"set_node_data() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.set_node_data",false]],"set_num() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_num",false]],"set_objective() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.set_objective",false]],"set_offset() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_offset",false]],"set_offset() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_offset",false]],"set_parameter_set() (cplex method)":[[0,"cplex.Cplex.set_parameter_set",false]],"set_priority() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_priority",false]],"set_problem_name() (cplex method)":[[0,"cplex.Cplex.set_problem_name",false]],"set_problem_type() (cplex method)":[[0,"cplex.Cplex.set_problem_type",false]],"set_quadratic() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_quadratic",false]],"set_quadratic_coefficients() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_quadratic_coefficients",false]],"set_range_values() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_range_values",false]],"set_reltol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_reltol",false]],"set_results_stream() (cplex method)":[[0,"cplex.Cplex.set_results_stream",false]],"set_results_stream() (environment method)":[[1,"cplex._internal.Environment.set_results_stream",false]],"set_rhs() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_rhs",false]],"set_sense() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_sense",false]],"set_sense() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_sense",false]],"set_senses() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_senses",false]],"set_solution() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.set_solution",false]],"set_start() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.set_start",false]],"set_start() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.set_start",false]],"set_status_checker() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.set_status_checker",false]],"set_types() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_types",false]],"set_upper_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_upper_bounds",false]],"set_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.set_values",false]],"set_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.set_values",false]],"set_warning_stream() (cplex method)":[[0,"cplex.Cplex.set_warning_stream",false]],"set_warning_stream() (environment method)":[[1,"cplex._internal.Environment.set_warning_stream",false]],"set_weight() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_weight",false]],"setbranchcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setbranchcallbackfunc",false]],"setbranchnosolncallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setbranchnosolncallbackfunc",false]],"setdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdblanno",false]],"setdblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdblparam",false]],"setdefaults() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdefaults",false]],"setgenericcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setgenericcallbackfunc",false]],"setheuristiccallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setheuristiccallbackfunc",false]],"setincumbentcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setincumbentcallbackfunc",false]],"setinfocallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setinfocallbackfunc",false]],"setintparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setintparam",false]],"setlazyconstraintcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlazyconstraintcallbackfunc",false]],"setlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlonganno",false]],"setlongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlongparam",false]],"setlpcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlpcallbackfunc",false]],"setmipcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setmipcallbackfunc",false]],"setnetcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnetcallbackfunc",false]],"setnodecallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnodecallbackfunc",false]],"setnumobjs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnumobjs",false]],"setpydel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setpydel",false]],"setsolvecallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setsolvecallbackfunc",false]],"setstrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setstrparam",false]],"setterminate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setterminate",false]],"settings (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.settings",false]],"settings_and_logs (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.settings_and_logs",false]],"settuningcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.settuningcallbackfunc",false]],"setusercutcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setusercutcallbackfunc",false]],"showquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.showquality",false]],"sift_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sift_alg_constants",false]],"sifting (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.sifting",false]],"sifting (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.sifting",false]],"siftopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.siftopt",false]],"siginthandler (class in cplex._internal._procedural)":[[1,"cplex._internal._procedural.SigIntHandler",false]],"simplexcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.SimplexCallback",false]],"slackfromx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.slackfromx",false]],"solninfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solninfo",false]],"solnpoolfilterinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface",false]],"solnpoolinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface",false]],"solution (cplex attribute)":[[0,"cplex.Cplex.solution",false]],"solution_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.solution_limit",false]],"solution_pool (cuttype attribute)":[[0,"cplex.callbacks.CutType.solution_pool",false],[1,"cplex._internal._subinterfaces.CutType.solution_pool",false]],"solution_source (incumbentcallback attribute)":[[0,"cplex.callbacks.IncumbentCallback.solution_source",false]],"solution_status (context attribute)":[[0,"cplex.callbacks.Context.solution_status",false]],"solution_strategy (context attribute)":[[0,"cplex.callbacks.Context.solution_strategy",false]],"solutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionInterface",false]],"solutionmethod (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionMethod",false]],"solutionsource (class in cplex.callbacks)":[[0,"cplex.callbacks.SolutionSource",false]],"solutionstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionStatus",false]],"solutionstrategy (class in cplex._internal._solutionstrategyenum)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy",false]],"solutiontype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionType",false]],"solutiontype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.solutiontype_constants",false]],"solve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.solve",false]],"solve (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.solve",false]],"solve() (cplex method)":[[0,"cplex.Cplex.solve",false]],"solve() (hscallback method)":[[0,"cplex.callbacks.HSCallback.solve",false]],"solve_fixed (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.solve_fixed",false]],"solve_mip (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.solve_MIP",false]],"solvecallback (class in cplex.callbacks)":[[0,"cplex.callbacks.SolveCallback",false]],"solwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwrite",false]],"solwritesolnpool() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwritesolnpool",false]],"solwritesolnpoolall() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwritesolnpoolall",false]],"sos (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.SOS",false]],"sos (cplex attribute)":[[0,"cplex.Cplex.SOS",false]],"sos1 (branchtype attribute)":[[0,"cplex.callbacks.BranchType.SOS1",false]],"sos1 (sostype attribute)":[[1,"cplex._internal._subinterfaces.SOSType.SOS1",false]],"sos1reform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sos1reform_constants",false]],"sos2 (branchtype attribute)":[[0,"cplex.callbacks.BranchType.SOS2",false]],"sos2 (sostype attribute)":[[1,"cplex._internal._subinterfaces.SOSType.SOS2",false]],"sos2reform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sos2reform_constants",false]],"sos_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.sos_constraint",false]],"sos_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.SOS_constraints",false]],"sos_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.SOS_constraints",false]],"sosinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SOSInterface",false]],"sostype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SOSType",false]],"sparsepair (class in cplex)":[[0,"cplex.SparsePair",false]],"sparsetriple (class in cplex)":[[0,"cplex.SparseTriple",false]],"standard (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.standard",false]],"standard (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.standard",false]],"start (cplex attribute)":[[0,"cplex.Cplex.start",false]],"stats (class in cplex)":[[0,"cplex.Stats",false]],"status (basisinterface attribute)":[[1,"cplex._internal._subinterfaces.BasisInterface.status",false]],"status (hscallback attribute)":[[0,"cplex.callbacks.HSCallback.status",false]],"status (initialinterface attribute)":[[1,"cplex._internal._subinterfaces.InitialInterface.status",false]],"status (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.status",false]],"status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.status",false]],"status (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.status",false]],"statuschecker (class in cplex._internal._procedural)":[[1,"cplex._internal._procedural.StatusChecker",false]],"steep (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.steep",false]],"steep (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.steep",false]],"steep_q_start (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.steep_Q_start",false]],"steep_q_start (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.steep_Q_start",false]],"strong_branching (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.strong_branching",false]],"strong_branching() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.strong_branching",false]],"strongbranch() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.strongbranch",false]],"strparameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.StrParameter",false]],"subalg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.subalg_constants",false]],"sum_comp_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_comp_slack",false]],"sum_dual_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_dual_infeasibilities",false]],"sum_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_dual_residual",false]],"sum_indicator_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_indicator_slack_infeasibility",false]],"sum_integer_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_integer_infeasibilities",false]],"sum_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_pi",false]],"sum_primal_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_primal_infeasibilities",false]],"sum_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_primal_residual",false]],"sum_pwl_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_pwl_slack_infeasibility",false]],"sum_quadratic_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_primal_residual",false]],"sum_quadratic_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_slack",false]],"sum_quadratic_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_slack_infeasibility",false]],"sum_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_reduced_cost",false]],"sum_scaled_dual_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_dual_infeasibilities",false]],"sum_scaled_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_dual_residual",false]],"sum_scaled_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_pi",false]],"sum_scaled_primal_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_primal_infeasibilities",false]],"sum_scaled_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_primal_residual",false]],"sum_scaled_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_reduced_cost",false]],"sum_scaled_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_slack",false]],"sum_scaled_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_x",false]],"sum_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_slack",false]],"sum_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_x",false]],"sym_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sym_constants",false]],"table (cuttype attribute)":[[0,"cplex.callbacks.CutType.table",false],[1,"cplex._internal._subinterfaces.CutType.table",false]],"thread_down (contexttype attribute)":[[0,"cplex.callbacks.ContextType.thread_down",false]],"thread_up (contexttype attribute)":[[0,"cplex.callbacks.ContextType.thread_up",false]],"tighten_lower_bounds() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.tighten_lower_bounds",false]],"tighten_upper_bounds() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.tighten_upper_bounds",false]],"tightenbds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tightenbds",false]],"time (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.time",false]],"time_limit (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.time_limit",false]],"traditional (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.traditional",false]],"traditional (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.traditional",false]],"true_objective_values (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.true_objective_values",false]],"tune_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.tune_display_constants",false]],"tune_problem() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tune_problem",false]],"tune_problem_set() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tune_problem_set",false]],"tuneparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tuneparam",false]],"tuneparamprobset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tuneparamprobset",false]],"tuning_status (rootparametergroup attribute)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tuning_status",false]],"tuningcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.TuningCallback",false]],"tuningconstants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.TuningConstants",false]],"type (solnpoolfilterinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.type",false]],"type (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.type",false]],"type (sosinterface attribute)":[[1,"cplex._internal._subinterfaces.SOSInterface.type",false]],"type (variablesinterface attribute)":[[1,"cplex._internal._subinterfaces.VariablesInterface.type",false]],"type() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.type",false]],"type_ (indicatorconstraintinterface attribute)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.type_",false]],"unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.unbounded",false]],"uncrush_formula() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_formula",false]],"uncrush_pi() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_pi",false]],"uncrush_x() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_x",false]],"uncrushform() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushform",false]],"uncrushpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushpi",false]],"uncrushx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushx",false]],"unknown (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.unknown",false]],"unpack() (sparsepair method)":[[0,"cplex.SparsePair.unpack",false]],"unpack() (sparsetriple method)":[[0,"cplex.SparseTriple.unpack",false]],"unpack_pair() (in module cplex._internal._matrices)":[[1,"cplex._internal._matrices.unpack_pair",false]],"unpack_triple() (in module cplex._internal._matrices)":[[1,"cplex._internal._matrices.unpack_triple",false]],"unregister_callback() (cplex method)":[[0,"cplex.Cplex.unregister_callback",false]],"unregister_callback() (environment method)":[[1,"cplex._internal.Environment.unregister_callback",false]],"unzip() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.unzip",false]],"up (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.up",false]],"up (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.up",false]],"upper_bound (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.upper_bound",false]],"upper_bound (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.upper_bound",false]],"upper_bound (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.upper_bound",false]],"upper_bound_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.upper_bound_constraints",false]],"upper_bound_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.upper_bound_constraints",false]],"upper_bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.upper_bounds",false]],"use_aborter() (cplex method)":[[0,"cplex.Cplex.use_aborter",false]],"use_constraint (lazyconstraintcallback attribute)":[[0,"cplex.callbacks.LazyConstraintCallback.use_constraint",false]],"use_cut (usercutcallback attribute)":[[0,"cplex.callbacks.UserCutCallback.use_cut",false]],"use_solution() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.use_solution",false]],"useconstraint (class in cplex.callbacks)":[[0,"cplex.callbacks.UseConstraint",false]],"usecut (class in cplex.callbacks)":[[0,"cplex.callbacks.UseCut",false]],"user (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.user",false]],"user (cuttype attribute)":[[0,"cplex.callbacks.CutType.user",false],[1,"cplex._internal._subinterfaces.CutType.user",false]],"user_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.user_solution",false]],"usercutcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.UserCutCallback",false]],"v_agg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.v_agg_constants",false]],"validate_arg_lengths() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.validate_arg_lengths",false]],"variable (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.variable",false]],"variable (branchtype attribute)":[[0,"cplex.callbacks.BranchType.variable",false]],"variable_status (advancedcplexinterface attribute)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.variable_status",false]],"variables (cplex attribute)":[[0,"cplex.Cplex.variables",false]],"variablesinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.VariablesInterface",false]],"varsel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.varsel_constants",false]],"vartypes (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.VarTypes",false]],"version() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.version",false]],"versionnumber() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.versionnumber",false]],"very_aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.very_aggressive",false]],"very_aggressive (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.very_aggressive",false]],"wall (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.wall",false]],"warn (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.warn",false]],"warning_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.WARNING_CHNL_IDX",false]],"with_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.with_cuts",false]],"without_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.without_cuts",false]],"workers (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.workers",false]],"worst_objective (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.worst_objective",false]],"write() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.write",false]],"write() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.write",false]],"write() (cplex method)":[[0,"cplex.Cplex.write",false]],"write() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.write",false]],"write() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.write",false]],"write() (parameterset method)":[[0,"cplex.ParameterSet.write",false],[0,"cplex.paramset.ParameterSet.write",false]],"write() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.write",false]],"write() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.write",false]],"write() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.write",false]],"write() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.write",false]],"write_annotations() (cplex method)":[[0,"cplex.Cplex.write_annotations",false]],"write_as_string() (cplex method)":[[0,"cplex.Cplex.write_as_string",false]],"write_benders_annotation() (cplex method)":[[0,"cplex.Cplex.write_benders_annotation",false]],"write_file() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.write_file",false]],"write_to_stream() (cplex method)":[[0,"cplex.Cplex.write_to_stream",false]],"writeanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeanno",false]],"writebendersanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writebendersanno",false]],"writelevel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.writelevel_constants",false]],"writemipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writemipstarts",false]],"writeparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeparam",false]],"writeprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeprob",false]],"writeprobdev() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeprobdev",false]],"wrongnumberofargumentserror":[[0,"cplex.exceptions.WrongNumberOfArgumentsError",false]],"yes (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.yes",false]],"zero_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.zero_dual",false]],"zero_half (cuttype attribute)":[[0,"cplex.callbacks.CutType.zero_half",false],[1,"cplex._internal._subinterfaces.CutType.zero_half",false]]},"objects":{"":[[0,0,0,"-","cplex"]],"cplex":[[0,1,1,"","Aborter"],[0,1,1,"","Cplex"],[0,1,1,"","ParameterSet"],[0,1,1,"","SparsePair"],[0,1,1,"","SparseTriple"],[0,1,1,"","Stats"],[1,0,0,"-","_internal"],[0,0,0,"-","aborter"],[0,0,0,"-","callbacks"],[0,0,0,"-","constant_class"],[0,0,0,"-","exceptions"],[0,6,1,"","infinity"],[0,0,0,"-","model_info"],[0,0,0,"-","paramset"]],"cplex.Aborter":[[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","clear"],[0,2,1,"","end"],[0,2,1,"","is_aborted"]],"cplex.Cplex":[[0,3,1,"","MIP_starts"],[0,3,1,"","SOS"],[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,3,1,"","advanced"],[0,2,1,"","cleanup"],[0,3,1,"","conflict"],[0,2,1,"","copy_parameter_set"],[0,2,1,"","copylp"],[0,2,1,"","create_parameter_set"],[0,3,1,"","double_annotations"],[0,2,1,"","end"],[0,3,1,"","feasopt"],[0,2,1,"","get_aborter"],[0,2,1,"","get_dettime"],[0,2,1,"","get_num_cores"],[0,2,1,"","get_parameter_set"],[0,2,1,"","get_problem_name"],[0,2,1,"","get_problem_type"],[0,2,1,"","get_stats"],[0,2,1,"","get_time"],[0,2,1,"","get_version"],[0,2,1,"","get_versionnumber"],[0,3,1,"","indicator_constraints"],[0,3,1,"","linear_constraints"],[0,3,1,"","long_annotations"],[0,3,1,"","multiobj"],[0,3,1,"","objective"],[0,3,1,"","order"],[0,3,1,"","parameters"],[0,2,1,"","populate_solution_pool"],[0,3,1,"","presolve"],[0,3,1,"","problem_type"],[0,3,1,"","pwl_constraints"],[0,3,1,"","quadratic_constraints"],[0,2,1,"","read"],[0,2,1,"","read_annotations"],[0,2,1,"","register_callback"],[0,2,1,"","remove_aborter"],[0,2,1,"","runseeds"],[0,2,1,"","set_callback"],[0,2,1,"","set_error_stream"],[0,2,1,"","set_log_stream"],[0,2,1,"","set_modeling_assistance_callback"],[0,2,1,"","set_parameter_set"],[0,2,1,"","set_problem_name"],[0,2,1,"","set_problem_type"],[0,2,1,"","set_results_stream"],[0,2,1,"","set_warning_stream"],[0,3,1,"","solution"],[0,2,1,"","solve"],[0,3,1,"","start"],[0,2,1,"","unregister_callback"],[0,2,1,"","use_aborter"],[0,3,1,"","variables"],[0,2,1,"","write"],[0,2,1,"","write_annotations"],[0,2,1,"","write_as_string"],[0,2,1,"","write_benders_annotation"],[0,2,1,"","write_to_stream"]],"cplex.ParameterSet":[[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","__len__"],[0,2,1,"","add"],[0,2,1,"","clear"],[0,2,1,"","delete"],[0,2,1,"","end"],[0,2,1,"","get"],[0,2,1,"","get_ids"],[0,2,1,"","read"],[0,2,1,"","write"]],"cplex.SparsePair":[[0,2,1,"","__init__"],[0,2,1,"","__repr__"],[0,2,1,"","isvalid"],[0,2,1,"","unpack"]],"cplex.SparseTriple":[[0,2,1,"","__init__"],[0,2,1,"","__repr__"],[0,2,1,"","isvalid"],[0,2,1,"","unpack"]],"cplex.Stats":[[0,2,1,"","__init__"],[0,2,1,"","__str__"]],"cplex._internal":[[1,1,1,"","Environment"],[1,1,1,"","ProblemType"],[1,0,0,"-","_anno"],[1,0,0,"-","_aux_functions"],[1,0,0,"-","_baseinterface"],[1,0,0,"-","_constants"],[1,0,0,"-","_constantsenum"],[1,0,0,"-","_matrices"],[1,0,0,"-","_multiobj"],[1,0,0,"-","_multiobjsoln"],[1,0,0,"-","_parameter_classes"],[1,0,0,"-","_procedural"],[1,0,0,"-","_pwl"],[1,0,0,"-","_solutionstrategyenum"],[1,0,0,"-","_subinterfaces"]],"cplex._internal.Environment":[[1,3,1,"","ERROR_CHNL_IDX"],[1,3,1,"","LOG_CHNL_IDX"],[1,3,1,"","RESULTS_CHNL_IDX"],[1,3,1,"","WARNING_CHNL_IDX"],[1,2,1,"","__del__"],[1,2,1,"","__init__"],[1,2,1,"","get_dettime"],[1,2,1,"","get_num_cores"],[1,2,1,"","get_time"],[1,2,1,"","get_version"],[1,2,1,"","get_versionnumber"],[1,2,1,"","register_callback"],[1,2,1,"","set_error_stream"],[1,2,1,"","set_log_stream"],[1,2,1,"","set_results_stream"],[1,2,1,"","set_warning_stream"],[1,2,1,"","unregister_callback"]],"cplex._internal.ProblemType":[[1,3,1,"","LP"],[1,3,1,"","MILP"],[1,3,1,"","MIQCP"],[1,3,1,"","MIQP"],[1,3,1,"","QCP"],[1,3,1,"","QP"],[1,3,1,"","fixed_MILP"],[1,3,1,"","fixed_MIQP"],[1,3,1,"","node_LP"],[1,3,1,"","node_QCP"],[1,3,1,"","node_QP"]],"cplex._internal._anno":[[1,1,1,"","AnnotationInterface"],[1,1,1,"","AnnotationObjectType"],[1,1,1,"","DoubleAnnotationInterface"],[1,1,1,"","LongAnnotationInterface"]],"cplex._internal._anno.AnnotationInterface":[[1,3,1,"","object_type"]],"cplex._internal._anno.AnnotationObjectType":[[1,3,1,"","indicator_constraint"],[1,3,1,"","objective"],[1,3,1,"","quadratic_constraint"],[1,3,1,"","row"],[1,3,1,"","sos_constraint"],[1,3,1,"","variable"]],"cplex._internal._anno.DoubleAnnotationInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_default_values"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_values"],[1,2,1,"","set_values"]],"cplex._internal._anno.LongAnnotationInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","benders_annotation"],[1,3,1,"","benders_mastervalue"],[1,2,1,"","delete"],[1,2,1,"","get_default_values"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_values"],[1,2,1,"","set_values"]],"cplex._internal._aux_functions":[[1,4,1,"","apply_freeform_one_arg"],[1,4,1,"","apply_freeform_two_args"],[1,4,1,"","apply_pairs"],[1,4,1,"","convert"],[1,4,1,"","convert_sequence"],[1,4,1,"","delete_set_by_range"],[1,1,1,"","deprecated"],[1,4,1,"","deprecated_class"],[1,4,1,"","identity"],[1,4,1,"","init_list_args"],[1,4,1,"","listify"],[1,4,1,"","make_group"],[1,4,1,"","make_ranges"],[1,4,1,"","max_arg_length"],[1,4,1,"","unzip"],[1,4,1,"","validate_arg_lengths"]],"cplex._internal._aux_functions.deprecated":[[1,2,1,"","__init__"]],"cplex._internal._baseinterface":[[1,1,1,"","BaseInterface"]],"cplex._internal._baseinterface.BaseInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_indices"]],"cplex._internal._matrices":[[1,4,1,"","unpack_pair"],[1,4,1,"","unpack_triple"]],"cplex._internal._multiobj":[[1,1,1,"","MultiObjInterface"]],"cplex._internal._multiobj.MultiObjInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_abstol"],[1,2,1,"","get_definition"],[1,2,1,"","get_linear"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_offset"],[1,2,1,"","get_priority"],[1,2,1,"","get_reltol"],[1,2,1,"","get_sense"],[1,2,1,"","get_weight"],[1,3,1,"","sense"],[1,2,1,"","set_abstol"],[1,2,1,"","set_definition"],[1,2,1,"","set_linear"],[1,2,1,"","set_name"],[1,2,1,"","set_num"],[1,2,1,"","set_offset"],[1,2,1,"","set_priority"],[1,2,1,"","set_reltol"],[1,2,1,"","set_sense"],[1,2,1,"","set_weight"]],"cplex._internal._multiobjsoln":[[1,1,1,"","MultiObjFloatInfo"],[1,1,1,"","MultiObjIntInfo"],[1,1,1,"","MultiObjLongInfo"],[1,1,1,"","MultiObjSolnInterface"]],"cplex._internal._multiobjsoln.MultiObjFloatInfo":[[1,3,1,"","best_objective"],[1,3,1,"","dettime"],[1,3,1,"","objective"],[1,3,1,"","time"]],"cplex._internal._multiobjsoln.MultiObjIntInfo":[[1,3,1,"","blend"],[1,3,1,"","dfeas"],[1,3,1,"","error"],[1,3,1,"","method"],[1,3,1,"","pfeas"],[1,3,1,"","priority"],[1,3,1,"","status"]],"cplex._internal._multiobjsoln.MultiObjLongInfo":[[1,3,1,"","num_barrier_iterations"],[1,3,1,"","num_degenerate_iterations"],[1,3,1,"","num_dual_exchanges"],[1,3,1,"","num_dual_pushes"],[1,3,1,"","num_iterations"],[1,3,1,"","num_nodes"],[1,3,1,"","num_nodes_left"],[1,3,1,"","num_phase1_iterations"],[1,3,1,"","num_primal_exchanges"],[1,3,1,"","num_primal_pushes"],[1,3,1,"","num_sifting_iterations"],[1,3,1,"","num_sifting_phase1_iterations"]],"cplex._internal._multiobjsoln.MultiObjSolnInterface":[[1,2,1,"","__init__"],[1,3,1,"","float_info"],[1,2,1,"","get_info"],[1,2,1,"","get_num_solves"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_objval_by_priority"],[1,3,1,"","int_info"],[1,3,1,"","long_info"]],"cplex._internal._parameter_classes":[[1,1,1,"","NumParameter"],[1,1,1,"","Parameter"],[1,1,1,"","ParameterGroup"],[1,1,1,"","RootParameterGroup"],[1,1,1,"","StrParameter"],[1,1,1,"","TuningConstants"],[1,1,1,"","advance_constants"],[1,1,1,"","agg_constants"],[1,1,1,"","alg_constants"],[1,1,1,"","auto_off_on_constants"],[1,1,1,"","bar_alg_constants"],[1,1,1,"","bar_order_constants"],[1,1,1,"","bar_start_alg_constants"],[1,1,1,"","benders_strategy_constants"],[1,1,1,"","brdir_constants"],[1,1,1,"","cardls_constants"],[1,1,1,"","clocktype_constants"],[1,1,1,"","coeffreduce_constants"],[1,1,1,"","conflict_algorithm_constants"],[1,1,1,"","crossover_constants"],[1,1,1,"","datacheck_constants"],[1,1,1,"","dependency_constants"],[1,1,1,"","display_constants"],[1,1,1,"","dive_constants"],[1,1,1,"","dual_constants"],[1,1,1,"","dual_pricing_constants"],[1,1,1,"","feasopt_mode_constants"],[1,1,1,"","file_constants"],[1,1,1,"","fpheur_constants"],[1,1,1,"","kappastats_constants"],[1,1,1,"","linear_constants"],[1,1,1,"","measure_constants"],[1,1,1,"","mip_display_constants"],[1,1,1,"","mip_emph_constants"],[1,1,1,"","miqcp_constants"],[1,1,1,"","network_display_constants"],[1,1,1,"","network_netfind_constants"],[1,1,1,"","network_pricing_constants"],[1,1,1,"","nodesel_constants"],[1,1,1,"","off_on_constants"],[1,1,1,"","optimalitytarget_constants"],[1,1,1,"","ordertype_constants"],[1,1,1,"","par_constants"],[1,1,1,"","prered_constants"],[1,1,1,"","prereform_constants"],[1,1,1,"","presolve_constants"],[1,1,1,"","primal_pricing_constants"],[1,1,1,"","qcpduals_constants"],[1,1,1,"","qp_alg_constants"],[1,1,1,"","repeatpre_constants"],[1,1,1,"","replace_constants"],[1,1,1,"","scale_constants"],[1,1,1,"","search_constants"],[1,1,1,"","sift_alg_constants"],[1,1,1,"","solutiontype_constants"],[1,1,1,"","sos1reform_constants"],[1,1,1,"","sos2reform_constants"],[1,1,1,"","subalg_constants"],[1,1,1,"","sym_constants"],[1,1,1,"","tune_display_constants"],[1,1,1,"","v_agg_constants"],[1,1,1,"","varsel_constants"],[1,1,1,"","writelevel_constants"]],"cplex._internal._parameter_classes.NumParameter":[[1,2,1,"","max"],[1,2,1,"","min"]],"cplex._internal._parameter_classes.Parameter":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","default"],[1,2,1,"","get"],[1,2,1,"","help"],[1,2,1,"","reset"],[1,2,1,"","set"],[1,2,1,"","type"]],"cplex._internal._parameter_classes.ParameterGroup":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","get_all"],[1,2,1,"","get_changed"],[1,2,1,"","reset"]],"cplex._internal._parameter_classes.RootParameterGroup":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","read_file"],[1,2,1,"","reset"],[1,2,1,"","tune_problem"],[1,2,1,"","tune_problem_set"],[1,3,1,"","tuning_status"],[1,2,1,"","write_file"]],"cplex._internal._parameter_classes.TuningConstants":[[1,3,1,"","abort"],[1,3,1,"","completed"],[1,3,1,"","dettime_limit"],[1,3,1,"","time_limit"]],"cplex._internal._parameter_classes.advance_constants":[[1,3,1,"","alternate"],[1,3,1,"","none"],[1,3,1,"","standard"]],"cplex._internal._parameter_classes.agg_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","moderate"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","concurrent"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"],[1,3,1,"","sifting"]],"cplex._internal._parameter_classes.auto_off_on_constants":[[1,3,1,"","auto"],[1,3,1,"","off"],[1,3,1,"","on"]],"cplex._internal._parameter_classes.bar_alg_constants":[[1,3,1,"","default"],[1,3,1,"","infeas_constant"],[1,3,1,"","infeas_estimate"],[1,3,1,"","standard"]],"cplex._internal._parameter_classes.bar_order_constants":[[1,3,1,"","approx_min_degree"],[1,3,1,"","approx_min_fill"],[1,3,1,"","nested_dissection"]],"cplex._internal._parameter_classes.bar_start_alg_constants":[[1,3,1,"","average_primal_estimated_dual"],[1,3,1,"","average_primal_zero_dual"],[1,3,1,"","estimated_dual"],[1,3,1,"","zero_dual"]],"cplex._internal._parameter_classes.benders_strategy_constants":[[1,3,1,"","auto"],[1,3,1,"","full"],[1,3,1,"","none"],[1,3,1,"","user"],[1,3,1,"","workers"]],"cplex._internal._parameter_classes.brdir_constants":[[1,3,1,"","auto"],[1,3,1,"","down"],[1,3,1,"","up"]],"cplex._internal._parameter_classes.cardls_constants":[[1,3,1,"","at_all_nodes"],[1,3,1,"","at_root"],[1,3,1,"","auto"],[1,3,1,"","disabled"]],"cplex._internal._parameter_classes.clocktype_constants":[[1,3,1,"","CPU"],[1,3,1,"","auto"],[1,3,1,"","wall"]],"cplex._internal._parameter_classes.coeffreduce_constants":[[1,3,1,"","any"],[1,3,1,"","integral"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.conflict_algorithm_constants":[[1,3,1,"","auto"],[1,3,1,"","fast"],[1,3,1,"","iis"],[1,3,1,"","limitedsolve"],[1,3,1,"","presolve"],[1,3,1,"","propagate"],[1,3,1,"","solve"]],"cplex._internal._parameter_classes.crossover_constants":[[1,3,1,"","auto"],[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.datacheck_constants":[[1,3,1,"","assist"],[1,3,1,"","off"],[1,3,1,"","warn"]],"cplex._internal._parameter_classes.dependency_constants":[[1,3,1,"","auto"],[1,3,1,"","begin"],[1,3,1,"","begin_and_end"],[1,3,1,"","end"],[1,3,1,"","off"]],"cplex._internal._parameter_classes.display_constants":[[1,3,1,"","detailed"],[1,3,1,"","none"],[1,3,1,"","normal"]],"cplex._internal._parameter_classes.dive_constants":[[1,3,1,"","auto"],[1,3,1,"","guided"],[1,3,1,"","probing"],[1,3,1,"","traditional"]],"cplex._internal._parameter_classes.dual_constants":[[1,3,1,"","auto"],[1,3,1,"","no"],[1,3,1,"","yes"]],"cplex._internal._parameter_classes.dual_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","devex"],[1,3,1,"","full"],[1,3,1,"","full_steep"],[1,3,1,"","steep"],[1,3,1,"","steep_Q_start"]],"cplex._internal._parameter_classes.feasopt_mode_constants":[[1,3,1,"","min_inf"],[1,3,1,"","min_quad"],[1,3,1,"","min_sum"],[1,3,1,"","opt_inf"],[1,3,1,"","opt_quad"],[1,3,1,"","opt_sum"]],"cplex._internal._parameter_classes.file_constants":[[1,3,1,"","auto"],[1,3,1,"","disk"],[1,3,1,"","disk_compressed"],[1,3,1,"","memory"]],"cplex._internal._parameter_classes.fpheur_constants":[[1,3,1,"","auto"],[1,3,1,"","feas"],[1,3,1,"","none"],[1,3,1,"","obj_and_feas"]],"cplex._internal._parameter_classes.kappastats_constants":[[1,3,1,"","auto"],[1,3,1,"","full"],[1,3,1,"","none"],[1,3,1,"","sample"]],"cplex._internal._parameter_classes.linear_constants":[[1,3,1,"","full"],[1,3,1,"","only_linear"]],"cplex._internal._parameter_classes.measure_constants":[[1,3,1,"","average"],[1,3,1,"","minmax"]],"cplex._internal._parameter_classes.mip_display_constants":[[1,3,1,"","LP_all"],[1,3,1,"","LP_root"],[1,3,1,"","integer_feasible"],[1,3,1,"","mip_interval_nodes"],[1,3,1,"","node_cuts"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.mip_emph_constants":[[1,3,1,"","balanced"],[1,3,1,"","best_bound"],[1,3,1,"","feasibility"],[1,3,1,"","heuristic"],[1,3,1,"","hidden_feasibility"],[1,3,1,"","optimality"]],"cplex._internal._parameter_classes.miqcp_constants":[[1,3,1,"","LP_at_node"],[1,3,1,"","QCP_at_node"],[1,3,1,"","auto"]],"cplex._internal._parameter_classes.network_display_constants":[[1,3,1,"","none"],[1,3,1,"","penalized_objective_values"],[1,3,1,"","true_objective_values"]],"cplex._internal._parameter_classes.network_netfind_constants":[[1,3,1,"","general_scaling"],[1,3,1,"","pure"],[1,3,1,"","reflection_scaling"]],"cplex._internal._parameter_classes.network_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","multiple_partial"],[1,3,1,"","multiple_partial_with_sorting"],[1,3,1,"","partial"]],"cplex._internal._parameter_classes.nodesel_constants":[[1,3,1,"","best_bound"],[1,3,1,"","best_estimate"],[1,3,1,"","best_estimate_alt"],[1,3,1,"","depth_first"]],"cplex._internal._parameter_classes.off_on_constants":[[1,3,1,"","off"],[1,3,1,"","on"]],"cplex._internal._parameter_classes.optimalitytarget_constants":[[1,3,1,"","auto"],[1,3,1,"","first_order"],[1,3,1,"","optimal_convex"],[1,3,1,"","optimal_global"]],"cplex._internal._parameter_classes.ordertype_constants":[[1,3,1,"","bounds"],[1,3,1,"","cost"],[1,3,1,"","default"],[1,3,1,"","scaled_cost"]],"cplex._internal._parameter_classes.par_constants":[[1,3,1,"","auto"],[1,3,1,"","deterministic"],[1,3,1,"","opportunistic"]],"cplex._internal._parameter_classes.prered_constants":[[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"],[1,3,1,"","primal_and_dual"]],"cplex._internal._parameter_classes.prereform_constants":[[1,3,1,"","all"],[1,3,1,"","interfere_crush"],[1,3,1,"","interfere_uncrush"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.presolve_constants":[[1,3,1,"","auto"],[1,3,1,"","force"],[1,3,1,"","none"],[1,3,1,"","probe"]],"cplex._internal._parameter_classes.primal_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","devex"],[1,3,1,"","full"],[1,3,1,"","partial"],[1,3,1,"","steep"],[1,3,1,"","steep_Q_start"]],"cplex._internal._parameter_classes.qcpduals_constants":[[1,3,1,"","force"],[1,3,1,"","if_possible"],[1,3,1,"","no"]],"cplex._internal._parameter_classes.qp_alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.repeatpre_constants":[[1,3,1,"","auto"],[1,3,1,"","new_root_cuts"],[1,3,1,"","off"],[1,3,1,"","with_cuts"],[1,3,1,"","without_cuts"]],"cplex._internal._parameter_classes.replace_constants":[[1,3,1,"","diversity"],[1,3,1,"","firstin_firstout"],[1,3,1,"","worst_objective"]],"cplex._internal._parameter_classes.scale_constants":[[1,3,1,"","aggressive"],[1,3,1,"","equilibration"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.search_constants":[[1,3,1,"","auto"],[1,3,1,"","dynamic"],[1,3,1,"","traditional"]],"cplex._internal._parameter_classes.sift_alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.solutiontype_constants":[[1,3,1,"","auto"],[1,3,1,"","basic"],[1,3,1,"","non_basic"]],"cplex._internal._parameter_classes.sos1reform_constants":[[1,3,1,"","auto"],[1,3,1,"","logarithmic"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.sos2reform_constants":[[1,3,1,"","auto"],[1,3,1,"","logarithmic"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.subalg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"],[1,3,1,"","sifting"]],"cplex._internal._parameter_classes.sym_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","mild"],[1,3,1,"","moderate"],[1,3,1,"","more_aggressive"],[1,3,1,"","off"],[1,3,1,"","very_aggressive"]],"cplex._internal._parameter_classes.tune_display_constants":[[1,3,1,"","minimal"],[1,3,1,"","none"],[1,3,1,"","settings"],[1,3,1,"","settings_and_logs"]],"cplex._internal._parameter_classes.v_agg_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","moderate"],[1,3,1,"","none"],[1,3,1,"","very_aggressive"]],"cplex._internal._parameter_classes.varsel_constants":[[1,3,1,"","default"],[1,3,1,"","max_infeasibility"],[1,3,1,"","min_infeasibility"],[1,3,1,"","pseudo_costs"],[1,3,1,"","pseudo_reduced_costs"],[1,3,1,"","strong_branching"]],"cplex._internal._parameter_classes.writelevel_constants":[[1,3,1,"","all_variables"],[1,3,1,"","auto"],[1,3,1,"","discrete_variables"],[1,3,1,"","nonzero_discrete_variables"],[1,3,1,"","nonzero_variables"]],"cplex._internal._procedural":[[1,4,1,"","Pylolmat_to_CHBmat"],[1,1,1,"","SigIntHandler"],[1,1,1,"","StatusChecker"],[1,4,1,"","addcols"],[1,4,1,"","addfuncdest"],[1,4,1,"","addindconstr"],[1,4,1,"","addlazyconstraints"],[1,4,1,"","addmipstarts"],[1,4,1,"","addpwl"],[1,4,1,"","addqconstr"],[1,4,1,"","addrows"],[1,4,1,"","addsolnpooldivfilter"],[1,4,1,"","addsolnpoolrngfilter"],[1,4,1,"","addsos"],[1,4,1,"","addusercuts"],[1,4,1,"","baropt"],[1,4,1,"","basicpresolve"],[1,4,1,"","binvacol"],[1,4,1,"","binvarow"],[1,4,1,"","binvcol"],[1,4,1,"","binvrow"],[1,4,1,"","boundsa"],[1,4,1,"","boundsa_lower"],[1,4,1,"","boundsa_upper"],[1,4,1,"","branchcallbackbranchasCPLEX"],[1,4,1,"","branchcallbackbranchgeneral"],[1,4,1,"","btran"],[1,4,1,"","callbackabort"],[1,4,1,"","callbackaddusercuts"],[1,4,1,"","callbackcandidateispoint"],[1,4,1,"","callbackcandidateisray"],[1,4,1,"","callbackexitcutloop"],[1,4,1,"","callbackgetcandidateobj"],[1,4,1,"","callbackgetcandidatepoint"],[1,4,1,"","callbackgetcandidateray"],[1,4,1,"","callbackgetgloballb"],[1,4,1,"","callbackgetglobalub"],[1,4,1,"","callbackgetincumbent"],[1,4,1,"","callbackgetincumbentobj"],[1,4,1,"","callbackgetinfodbl"],[1,4,1,"","callbackgetinfoint"],[1,4,1,"","callbackgetinfolong"],[1,4,1,"","callbackgetlocallb"],[1,4,1,"","callbackgetlocalub"],[1,4,1,"","callbackgetrelaxationpoint"],[1,4,1,"","callbackgetrelaxationpointobj"],[1,4,1,"","callbackgetrelaxationstatus"],[1,4,1,"","callbackmakebranch"],[1,4,1,"","callbackpostheursoln"],[1,4,1,"","callbackprunenode"],[1,4,1,"","callbackrejectcandidate"],[1,4,1,"","callbackrejectcandidatelocal"],[1,4,1,"","callbacksetnodeuserhandle"],[1,4,1,"","callbacksetuserhandle"],[1,4,1,"","cb_geterrorstring"],[1,4,1,"","chbmatrix"],[1,4,1,"","chgbds"],[1,4,1,"","chgcoeflist"],[1,4,1,"","chgcolname"],[1,4,1,"","chgctype"],[1,4,1,"","chgmipstarts"],[1,4,1,"","chgobj"],[1,4,1,"","chgobjoffset"],[1,4,1,"","chgobjsen"],[1,4,1,"","chgprobname"],[1,4,1,"","chgprobtype"],[1,4,1,"","chgprobtypesolnpool"],[1,4,1,"","chgqpcoef"],[1,4,1,"","chgrhs"],[1,4,1,"","chgrngval"],[1,4,1,"","chgrowname"],[1,4,1,"","chgsense"],[1,4,1,"","cleanup"],[1,4,1,"","cloneprob"],[1,4,1,"","closeCPLEX"],[1,4,1,"","clpwrite"],[1,4,1,"","completelp"],[1,4,1,"","copylpwnames"],[1,4,1,"","copyobjname"],[1,4,1,"","copyorder"],[1,4,1,"","copyprotected"],[1,4,1,"","copyqpsep"],[1,4,1,"","copyquad"],[1,4,1,"","copystart"],[1,4,1,"","createprob"],[1,4,1,"","crushform"],[1,4,1,"","crushpi"],[1,4,1,"","crushx"],[1,4,1,"","cutcallbackadd"],[1,4,1,"","cutcallbackaddlocal"],[1,4,1,"","delcols"],[1,4,1,"","deldblanno"],[1,4,1,"","delete_native_int"],[1,4,1,"","delfuncdest"],[1,4,1,"","delindconstrs"],[1,4,1,"","dellonganno"],[1,4,1,"","delmipstarts"],[1,4,1,"","delnames"],[1,4,1,"","delpwl"],[1,4,1,"","delpydel"],[1,4,1,"","delqconstrs"],[1,4,1,"","delrows"],[1,4,1,"","delsolnpoolfilters"],[1,4,1,"","delsolnpoolsolns"],[1,4,1,"","delsos"],[1,4,1,"","djfrompi"],[1,4,1,"","dperwrite"],[1,4,1,"","dualfarkas"],[1,4,1,"","dualopt"],[1,4,1,"","dualwrite"],[1,4,1,"","embwrite"],[1,4,1,"","fast_getcolname"],[1,4,1,"","fast_getmipstartname"],[1,4,1,"","fast_getobj"],[1,4,1,"","fast_getrowname"],[1,4,1,"","fast_getrows"],[1,4,1,"","fast_getsosname"],[1,4,1,"","fast_multiobjgetabstol"],[1,4,1,"","fast_multiobjgetobj"],[1,4,1,"","fast_multiobjgetoffset"],[1,4,1,"","fast_multiobjgetpriority"],[1,4,1,"","fast_multiobjgetreltol"],[1,4,1,"","fast_multiobjgetweight"],[1,4,1,"","fast_newcols"],[1,4,1,"","feasoptext"],[1,4,1,"","finitlock"],[1,4,1,"","fixparam"],[1,4,1,"","fltwrite"],[1,4,1,"","free_CHBmat"],[1,4,1,"","freelazyconstraints"],[1,4,1,"","freepresolve"],[1,4,1,"","freeprob"],[1,4,1,"","freeusercuts"],[1,4,1,"","ftran"],[1,4,1,"","get_native_int"],[1,4,1,"","get_wherefrom"],[1,4,1,"","getax"],[1,4,1,"","getbaritcnt"],[1,4,1,"","getbase"],[1,4,1,"","getbasednorms"],[1,4,1,"","getbestobjval"],[1,4,1,"","getbhead"],[1,4,1,"","getcallbackincumbent"],[1,4,1,"","getcallbacknodeinfo"],[1,4,1,"","getcallbacknodeintfeas"],[1,4,1,"","getcallbacknodelb"],[1,4,1,"","getcallbacknodeobjval"],[1,4,1,"","getcallbacknodeub"],[1,4,1,"","getcallbacknodex"],[1,4,1,"","getcallbackpseudocosts"],[1,4,1,"","getcallbackseqinfo"],[1,4,1,"","getcallbacksosinfo"],[1,4,1,"","getchannels"],[1,4,1,"","getcoef"],[1,4,1,"","getcolindex"],[1,4,1,"","getcolinfeas"],[1,4,1,"","getcolname"],[1,4,1,"","getcols"],[1,4,1,"","getconflictext"],[1,4,1,"","getconflictgroups"],[1,4,1,"","getconflictnumgroups"],[1,4,1,"","getconflictnumpasses"],[1,4,1,"","getcrossdexchcnt"],[1,4,1,"","getcrossdpushcnt"],[1,4,1,"","getcrosspexchcnt"],[1,4,1,"","getcrossppushcnt"],[1,4,1,"","getctype"],[1,4,1,"","getcutoff"],[1,4,1,"","getdblanno"],[1,4,1,"","getdblannodefval"],[1,4,1,"","getdblannoindex"],[1,4,1,"","getdblannoname"],[1,4,1,"","getdblparam"],[1,4,1,"","getdblquality"],[1,4,1,"","getdettime"],[1,4,1,"","getdj"],[1,4,1,"","getdnorms"],[1,4,1,"","getdsbcnt"],[1,4,1,"","geterrorstring"],[1,4,1,"","getgrad"],[1,4,1,"","gethist"],[1,4,1,"","getijdiv"],[1,4,1,"","getijrow"],[1,4,1,"","getindconstr"],[1,4,1,"","getindconstr_constant"],[1,4,1,"","getindconstrindex"],[1,4,1,"","getindconstrinfeas"],[1,4,1,"","getindconstrname"],[1,4,1,"","getindconstrslack"],[1,4,1,"","getintparam"],[1,4,1,"","getintquality"],[1,4,1,"","getitcnt"],[1,4,1,"","getlb"],[1,4,1,"","getlonganno"],[1,4,1,"","getlongannodefval"],[1,4,1,"","getlongannoindex"],[1,4,1,"","getlongannoname"],[1,4,1,"","getlongparam"],[1,4,1,"","getmethod"],[1,4,1,"","getmipitcnt"],[1,4,1,"","getmiprelgap"],[1,4,1,"","getmipstartindex"],[1,4,1,"","getmipstartname"],[1,4,1,"","getmipstarts"],[1,4,1,"","getmipstarts_effort"],[1,4,1,"","getmipstarts_size"],[1,4,1,"","getnodecnt"],[1,4,1,"","getnodeint"],[1,4,1,"","getnodeleftcnt"],[1,4,1,"","getnumbin"],[1,4,1,"","getnumcols"],[1,4,1,"","getnumcores"],[1,4,1,"","getnumcuts"],[1,4,1,"","getnumdblanno"],[1,4,1,"","getnumindconstrs"],[1,4,1,"","getnumint"],[1,4,1,"","getnumlonganno"],[1,4,1,"","getnummipstarts"],[1,4,1,"","getnumnz"],[1,4,1,"","getnumobjs"],[1,4,1,"","getnumprios"],[1,4,1,"","getnumpwl"],[1,4,1,"","getnumqconstrs"],[1,4,1,"","getnumqpnz"],[1,4,1,"","getnumquad"],[1,4,1,"","getnumrows"],[1,4,1,"","getnumsemicont"],[1,4,1,"","getnumsemiint"],[1,4,1,"","getnumsos"],[1,4,1,"","getobj"],[1,4,1,"","getobjname"],[1,4,1,"","getobjoffset"],[1,4,1,"","getobjsen"],[1,4,1,"","getobjval"],[1,4,1,"","getorder"],[1,4,1,"","getparamtype"],[1,4,1,"","getphase1cnt"],[1,4,1,"","getpi"],[1,4,1,"","getpnorms"],[1,4,1,"","getprestat_c"],[1,4,1,"","getprestat_oc"],[1,4,1,"","getprestat_or"],[1,4,1,"","getprestat_r"],[1,4,1,"","getprestat_status"],[1,4,1,"","getprobname"],[1,4,1,"","getprobstats"],[1,4,1,"","getprobtype"],[1,4,1,"","getprotected"],[1,4,1,"","getpsbcnt"],[1,4,1,"","getpwl"],[1,4,1,"","getpwlindex"],[1,4,1,"","getpwlname"],[1,4,1,"","getqconstr_info"],[1,4,1,"","getqconstr_lin"],[1,4,1,"","getqconstr_quad"],[1,4,1,"","getqconstrdslack"],[1,4,1,"","getqconstrindex"],[1,4,1,"","getqconstrinfeas"],[1,4,1,"","getqconstrname"],[1,4,1,"","getqconstrslack"],[1,4,1,"","getqpcoef"],[1,4,1,"","getquad"],[1,4,1,"","getqualitymetrics"],[1,4,1,"","getray"],[1,4,1,"","getrhs"],[1,4,1,"","getrngval"],[1,4,1,"","getrowindex"],[1,4,1,"","getrowinfeas"],[1,4,1,"","getrowname"],[1,4,1,"","getrows"],[1,4,1,"","getsense"],[1,4,1,"","getsiftitcnt"],[1,4,1,"","getsiftphase1cnt"],[1,4,1,"","getslack"],[1,4,1,"","getsolnpooldblquality"],[1,4,1,"","getsolnpooldivfilter"],[1,4,1,"","getsolnpooldivfilter_constant"],[1,4,1,"","getsolnpoolfilterindex"],[1,4,1,"","getsolnpoolfiltername"],[1,4,1,"","getsolnpoolfiltertype"],[1,4,1,"","getsolnpoolintquality"],[1,4,1,"","getsolnpoolmeanobjval"],[1,4,1,"","getsolnpoolnumfilters"],[1,4,1,"","getsolnpoolnumreplaced"],[1,4,1,"","getsolnpoolnumsolns"],[1,4,1,"","getsolnpoolobjval"],[1,4,1,"","getsolnpoolqconstrslack"],[1,4,1,"","getsolnpoolrngfilter"],[1,4,1,"","getsolnpoolrngfilter_constant"],[1,4,1,"","getsolnpoolslack"],[1,4,1,"","getsolnpoolsolnindex"],[1,4,1,"","getsolnpoolsolnname"],[1,4,1,"","getsolnpoolx"],[1,4,1,"","getsos"],[1,4,1,"","getsos_info"],[1,4,1,"","getsosindex"],[1,4,1,"","getsosinfeas"],[1,4,1,"","getsosname"],[1,4,1,"","getstat"],[1,4,1,"","getstatstring"],[1,4,1,"","getstrparam"],[1,4,1,"","getsubstat"],[1,4,1,"","gettime"],[1,4,1,"","getub"],[1,4,1,"","getx"],[1,4,1,"","getxqxax"],[1,4,1,"","has_name"],[1,4,1,"","has_non_default_lb"],[1,4,1,"","has_non_default_ub"],[1,4,1,"","hybbaropt"],[1,4,1,"","hybnetopt"],[1,4,1,"","infodblparam"],[1,4,1,"","infointparam"],[1,4,1,"","infolongparam"],[1,4,1,"","infostrparam"],[1,4,1,"","initlock"],[1,4,1,"","ismultiobj"],[1,4,1,"","lpopt"],[1,4,1,"","mbasewrite"],[1,4,1,"","mdleave"],[1,4,1,"","mipopt"],[1,4,1,"","modelasstcallbacksetfunc"],[1,4,1,"","multiobjchgattribs"],[1,4,1,"","multiobjgetdblinfo"],[1,4,1,"","multiobjgetindex"],[1,4,1,"","multiobjgetintinfo"],[1,4,1,"","multiobjgetlonginfo"],[1,4,1,"","multiobjgetname"],[1,4,1,"","multiobjgetnumsolves"],[1,4,1,"","multiobjgetobj"],[1,4,1,"","multiobjgetobjval"],[1,4,1,"","multiobjgetobjvalbypriority"],[1,4,1,"","multiobjopt"],[1,4,1,"","multiobjsetobj"],[1,4,1,"","new_native_int"],[1,4,1,"","newcols"],[1,4,1,"","newdblanno"],[1,4,1,"","newlonganno"],[1,4,1,"","newrows"],[1,4,1,"","objsa"],[1,4,1,"","openCPLEX"],[1,4,1,"","ordwrite"],[1,4,1,"","pack_env_lp_ptr"],[1,4,1,"","paramsetadd"],[1,4,1,"","paramsetadddbl"],[1,4,1,"","paramsetaddint"],[1,4,1,"","paramsetaddlong"],[1,4,1,"","paramsetaddstr"],[1,4,1,"","paramsetapply"],[1,4,1,"","paramsetcopy"],[1,4,1,"","paramsetcreate"],[1,4,1,"","paramsetdel"],[1,4,1,"","paramsetfree"],[1,4,1,"","paramsetget"],[1,4,1,"","paramsetgetdbl"],[1,4,1,"","paramsetgetids"],[1,4,1,"","paramsetgetint"],[1,4,1,"","paramsetgetlong"],[1,4,1,"","paramsetgetnum"],[1,4,1,"","paramsetgetstr"],[1,4,1,"","paramsetreadcopy"],[1,4,1,"","paramsetwrite"],[1,4,1,"","pivot"],[1,4,1,"","pivotin"],[1,4,1,"","pivotout"],[1,4,1,"","populate"],[1,4,1,"","pperwrite"],[1,4,1,"","preaddrows"],[1,4,1,"","prechgobj"],[1,4,1,"","preslvwrite"],[1,4,1,"","presolve"],[1,4,1,"","primopt"],[1,4,1,"","qconstrslackfromx"],[1,4,1,"","qpdjfrompi"],[1,4,1,"","qpindefcertificate"],[1,4,1,"","qpopt"],[1,4,1,"","readcopyanno"],[1,4,1,"","readcopybase"],[1,4,1,"","readcopymipstarts"],[1,4,1,"","readcopyorder"],[1,4,1,"","readcopyparam"],[1,4,1,"","readcopyprob"],[1,4,1,"","readcopysolnpoolfilters"],[1,4,1,"","readcopystartinfo"],[1,4,1,"","refineconflictext"],[1,4,1,"","refinemipstartconflictext"],[1,4,1,"","rhssa"],[1,4,1,"","runseeds"],[1,4,1,"","set_native_int"],[1,4,1,"","set_status_checker"],[1,4,1,"","setbranchcallbackfunc"],[1,4,1,"","setbranchnosolncallbackfunc"],[1,4,1,"","setdblanno"],[1,4,1,"","setdblparam"],[1,4,1,"","setdefaults"],[1,4,1,"","setgenericcallbackfunc"],[1,4,1,"","setheuristiccallbackfunc"],[1,4,1,"","setincumbentcallbackfunc"],[1,4,1,"","setinfocallbackfunc"],[1,4,1,"","setintparam"],[1,4,1,"","setlazyconstraintcallbackfunc"],[1,4,1,"","setlonganno"],[1,4,1,"","setlongparam"],[1,4,1,"","setlpcallbackfunc"],[1,4,1,"","setmipcallbackfunc"],[1,4,1,"","setnetcallbackfunc"],[1,4,1,"","setnodecallbackfunc"],[1,4,1,"","setnumobjs"],[1,4,1,"","setpydel"],[1,4,1,"","setsolvecallbackfunc"],[1,4,1,"","setstrparam"],[1,4,1,"","setterminate"],[1,4,1,"","settuningcallbackfunc"],[1,4,1,"","setusercutcallbackfunc"],[1,4,1,"","showquality"],[1,4,1,"","siftopt"],[1,4,1,"","slackfromx"],[1,4,1,"","solninfo"],[1,4,1,"","solwrite"],[1,4,1,"","solwritesolnpool"],[1,4,1,"","solwritesolnpoolall"],[1,4,1,"","strongbranch"],[1,4,1,"","tightenbds"],[1,4,1,"","tuneparam"],[1,4,1,"","tuneparamprobset"],[1,4,1,"","uncrushform"],[1,4,1,"","uncrushpi"],[1,4,1,"","uncrushx"],[1,4,1,"","version"],[1,4,1,"","versionnumber"],[1,4,1,"","writeanno"],[1,4,1,"","writebendersanno"],[1,4,1,"","writemipstarts"],[1,4,1,"","writeparam"],[1,4,1,"","writeprob"],[1,4,1,"","writeprobdev"]],"cplex._internal._procedural.SigIntHandler":[[1,2,1,"","__init__"]],"cplex._internal._procedural.StatusChecker":[[1,2,1,"","__init__"]],"cplex._internal._pwl":[[1,1,1,"","PWLConstraintInterface"]],"cplex._internal._pwl.PWLConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_definitions"],[1,2,1,"","get_names"],[1,2,1,"","get_num"]],"cplex._internal._solutionstrategyenum":[[1,1,1,"","SolutionStrategy"]],"cplex._internal._solutionstrategyenum.SolutionStrategy":[[1,3,1,"","check_feasible"],[1,3,1,"","no_check"],[1,3,1,"","propagate"],[1,3,1,"","solve"]],"cplex._internal._subinterfaces":[[1,1,1,"","AdvancedCplexInterface"],[1,1,1,"","AdvancedLinearConstraintInterface"],[1,1,1,"","AdvancedSolutionInterface"],[1,1,1,"","AdvancedVariablesInterface"],[1,1,1,"","BasisInterface"],[1,1,1,"","BasisVarStatus"],[1,1,1,"","BranchDirection"],[1,1,1,"","ConflictConstraintType"],[1,1,1,"","ConflictInterface"],[1,1,1,"","ConflictStatus"],[1,1,1,"","CutType"],[1,1,1,"","EffortLevel"],[1,1,1,"","FeasoptConstraintType"],[1,1,1,"","FeasoptInterface"],[1,1,1,"","FilterType"],[1,1,1,"","Histogram"],[1,1,1,"","IndicatorConstraintInterface"],[1,1,1,"","IndicatorType"],[1,1,1,"","InfeasibilityInterface"],[1,1,1,"","InitialInterface"],[1,1,1,"","LinearConstraintInterface"],[1,1,1,"","MIPSolutionInterface"],[1,1,1,"","MIPStartsInterface"],[1,1,1,"","ObjSense"],[1,1,1,"","ObjectiveInterface"],[1,1,1,"","OrderInterface"],[1,1,1,"","PivotVarStatus"],[1,1,1,"","PresolveColStatus"],[1,1,1,"","PresolveInterface"],[1,1,1,"","PresolveMethod"],[1,1,1,"","PresolveRowStatus"],[1,1,1,"","PresolveStatus"],[1,1,1,"","ProgressInterface"],[1,1,1,"","QuadraticConstraintInterface"],[1,1,1,"","QualityMetric"],[1,1,1,"","QualityMetrics"],[1,1,1,"","SOSInterface"],[1,1,1,"","SOSType"],[1,1,1,"","SensitivityInterface"],[1,1,1,"","SolnPoolFilterInterface"],[1,1,1,"","SolnPoolInterface"],[1,1,1,"","SolutionInterface"],[1,1,1,"","SolutionMethod"],[1,1,1,"","SolutionStatus"],[1,1,1,"","SolutionType"],[1,1,1,"","VarTypes"],[1,1,1,"","VariablesInterface"]],"cplex._internal._subinterfaces.AdvancedCplexInterface":[[1,2,1,"","basic_presolve"],[1,2,1,"","complete"],[1,2,1,"","delete_names"],[1,3,1,"","no_variable"],[1,2,1,"","pivot"],[1,2,1,"","pivot_fixed_variables_out"],[1,2,1,"","pivot_slacks_in"],[1,2,1,"","strong_branching"],[1,3,1,"","variable_status"]],"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add_lazy_constraints"],[1,2,1,"","add_user_cuts"],[1,2,1,"","free_lazy_constraints"],[1,2,1,"","free_user_cuts"],[1,2,1,"","get_num_lazy_constraints"],[1,2,1,"","get_num_user_cuts"]],"cplex._internal._subinterfaces.AdvancedSolutionInterface":[[1,2,1,"","__init__"],[1,2,1,"","binvacol"],[1,2,1,"","binvarow"],[1,2,1,"","binvcol"],[1,2,1,"","binvrow"],[1,2,1,"","btran"],[1,2,1,"","dual_farkas"],[1,2,1,"","ftran"],[1,2,1,"","get_Driebeek_penalties"],[1,2,1,"","get_diverging_index"],[1,2,1,"","get_gradients"],[1,2,1,"","get_linear_reduced_costs_from_pi"],[1,2,1,"","get_linear_slacks_from_x"],[1,2,1,"","get_quadratic_indefinite_certificate"],[1,2,1,"","get_quadratic_reduced_costs_from_pi"],[1,2,1,"","get_quadratic_slacks_from_x"],[1,2,1,"","get_ray"]],"cplex._internal._subinterfaces.AdvancedVariablesInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_protected"],[1,2,1,"","protect"],[1,2,1,"","tighten_lower_bounds"],[1,2,1,"","tighten_upper_bounds"]],"cplex._internal._subinterfaces.BasisInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_basic_col_index"],[1,2,1,"","get_basic_row_index"],[1,2,1,"","get_basis"],[1,2,1,"","get_basis_dual_norms"],[1,2,1,"","get_dual_norms"],[1,2,1,"","get_header"],[1,2,1,"","get_num_dual_superbasic"],[1,2,1,"","get_num_primal_superbasic"],[1,2,1,"","get_primal_norms"],[1,3,1,"","status"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.BasisVarStatus":[[1,3,1,"","at_lower_bound"],[1,3,1,"","at_upper_bound"],[1,3,1,"","basic"],[1,3,1,"","free_nonbasic"]],"cplex._internal._subinterfaces.BranchDirection":[[1,3,1,"","default"],[1,3,1,"","down"],[1,3,1,"","up"]],"cplex._internal._subinterfaces.ConflictConstraintType":[[1,3,1,"","SOS"],[1,3,1,"","indicator"],[1,3,1,"","linear"],[1,3,1,"","lower_bound"],[1,3,1,"","pwl"],[1,3,1,"","quadratic"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.ConflictInterface":[[1,2,1,"","SOS_constraints"],[1,2,1,"","__init__"],[1,2,1,"","all_constraints"],[1,3,1,"","constraint_type"],[1,2,1,"","get"],[1,2,1,"","get_groups"],[1,2,1,"","get_num_groups"],[1,3,1,"","group_status"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","lower_bound_constraints"],[1,2,1,"","pwl_constraints"],[1,2,1,"","quadratic_constraints"],[1,2,1,"","refine"],[1,2,1,"","refine_MIP_start"],[1,2,1,"","upper_bound_constraints"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.ConflictStatus":[[1,3,1,"","excluded"],[1,3,1,"","member"],[1,3,1,"","possible_member"]],"cplex._internal._subinterfaces.CutType":[[1,3,1,"","BQP"],[1,3,1,"","GUB_cover"],[1,3,1,"","MIR"],[1,3,1,"","RLT"],[1,3,1,"","benders"],[1,3,1,"","clique"],[1,3,1,"","cover"],[1,3,1,"","disjunctive"],[1,3,1,"","flow_cover"],[1,3,1,"","flow_path"],[1,3,1,"","fractional"],[1,3,1,"","implied_bound"],[1,3,1,"","lift_and_project"],[1,3,1,"","local_implied_bound"],[1,3,1,"","multi_commodity_flow"],[1,3,1,"","solution_pool"],[1,3,1,"","table"],[1,3,1,"","user"],[1,3,1,"","zero_half"]],"cplex._internal._subinterfaces.EffortLevel":[[1,3,1,"","auto"],[1,3,1,"","check_feasibility"],[1,3,1,"","no_check"],[1,3,1,"","repair"],[1,3,1,"","solve_MIP"],[1,3,1,"","solve_fixed"]],"cplex._internal._subinterfaces.FeasoptConstraintType":[[1,3,1,"","indicator"],[1,3,1,"","linear"],[1,3,1,"","lower_bound"],[1,3,1,"","quadratic"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.FeasoptInterface":[[1,2,1,"","__call__"],[1,2,1,"","all_constraints"],[1,3,1,"","constraint_type"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","lower_bound_constraints"],[1,2,1,"","quadratic_constraints"],[1,2,1,"","upper_bound_constraints"]],"cplex._internal._subinterfaces.FilterType":[[1,3,1,"","diversity"],[1,3,1,"","range"]],"cplex._internal._subinterfaces.Histogram":[[1,2,1,"","__getitem__"],[1,2,1,"","__init__"],[1,2,1,"","__str__"]],"cplex._internal._subinterfaces.IndicatorConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","add_batch"],[1,2,1,"","delete"],[1,2,1,"","get_complemented"],[1,2,1,"","get_indicator_variables"],[1,2,1,"","get_linear_components"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_rhs"],[1,2,1,"","get_senses"],[1,2,1,"","get_types"],[1,3,1,"","type_"]],"cplex._internal._subinterfaces.IndicatorType":[[1,3,1,"","if_"],[1,3,1,"","iff"],[1,3,1,"","onlyif"]],"cplex._internal._subinterfaces.InfeasibilityInterface":[[1,2,1,"","SOS_constraints"],[1,2,1,"","__init__"],[1,2,1,"","bound_constraints"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","quadratic_constraints"]],"cplex._internal._subinterfaces.InitialInterface":[[1,2,1,"","read_basis"],[1,2,1,"","read_start"],[1,2,1,"","set_start"],[1,3,1,"","status"]],"cplex._internal._subinterfaces.LinearConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","advanced"],[1,2,1,"","delete"],[1,2,1,"","get_coefficients"],[1,2,1,"","get_histogram"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_range_values"],[1,2,1,"","get_rhs"],[1,2,1,"","get_rows"],[1,2,1,"","get_senses"],[1,2,1,"","set_coefficients"],[1,2,1,"","set_linear_components"],[1,2,1,"","set_names"],[1,2,1,"","set_range_values"],[1,2,1,"","set_rhs"],[1,2,1,"","set_senses"]],"cplex._internal._subinterfaces.MIPSolutionInterface":[[1,2,1,"","__init__"],[1,3,1,"","cut_type"],[1,2,1,"","get_best_objective"],[1,2,1,"","get_cutoff"],[1,2,1,"","get_incumbent_node"],[1,2,1,"","get_mip_relative_gap"],[1,2,1,"","get_num_cuts"],[1,2,1,"","get_subproblem_status"]],"cplex._internal._subinterfaces.MIPStartsInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","change"],[1,2,1,"","delete"],[1,3,1,"","effort_level"],[1,2,1,"","get_effort_levels"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_entries"],[1,2,1,"","get_starts"],[1,2,1,"","read"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.ObjSense":[[1,3,1,"","maximize"],[1,3,1,"","minimize"]],"cplex._internal._subinterfaces.ObjectiveInterface":[[1,2,1,"","get_linear"],[1,2,1,"","get_name"],[1,2,1,"","get_num_quadratic_nonzeros"],[1,2,1,"","get_num_quadratic_variables"],[1,2,1,"","get_offset"],[1,2,1,"","get_quadratic"],[1,2,1,"","get_quadratic_coefficients"],[1,2,1,"","get_sense"],[1,3,1,"","sense"],[1,2,1,"","set_linear"],[1,2,1,"","set_name"],[1,2,1,"","set_offset"],[1,2,1,"","set_quadratic"],[1,2,1,"","set_quadratic_coefficients"],[1,2,1,"","set_sense"]],"cplex._internal._subinterfaces.OrderInterface":[[1,3,1,"","branch_direction"],[1,2,1,"","get"],[1,2,1,"","get_variables"],[1,2,1,"","read"],[1,2,1,"","set"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.PivotVarStatus":[[1,3,1,"","at_lower_bound"],[1,3,1,"","at_upper_bound"]],"cplex._internal._subinterfaces.PresolveColStatus":[[1,3,1,"","aggregated"],[1,3,1,"","fixed"],[1,3,1,"","lower_bound"],[1,3,1,"","other"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.PresolveInterface":[[1,2,1,"","add_rows"],[1,3,1,"","col_status"],[1,2,1,"","crush_formula"],[1,2,1,"","crush_pi"],[1,2,1,"","crush_x"],[1,2,1,"","free"],[1,2,1,"","get_col_status"],[1,2,1,"","get_presolved_col_status"],[1,2,1,"","get_presolved_row_status"],[1,2,1,"","get_row_status"],[1,2,1,"","get_status"],[1,3,1,"","method"],[1,2,1,"","presolve"],[1,3,1,"","row_status"],[1,2,1,"","set_objective"],[1,3,1,"","status"],[1,2,1,"","uncrush_formula"],[1,2,1,"","uncrush_pi"],[1,2,1,"","uncrush_x"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.PresolveMethod":[[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.PresolveRowStatus":[[1,3,1,"","aggregated"],[1,3,1,"","other"],[1,3,1,"","reduced"]],"cplex._internal._subinterfaces.PresolveStatus":[[1,3,1,"","empty_problem"],[1,3,1,"","has_problem"],[1,3,1,"","no_reductions"]],"cplex._internal._subinterfaces.ProgressInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_num_barrier_iterations"],[1,2,1,"","get_num_conflict_passes"],[1,2,1,"","get_num_dual_exchange"],[1,2,1,"","get_num_dual_push"],[1,2,1,"","get_num_iterations"],[1,2,1,"","get_num_nodes_processed"],[1,2,1,"","get_num_nodes_remaining"],[1,2,1,"","get_num_phase_one_iterations"],[1,2,1,"","get_num_primal_exchange"],[1,2,1,"","get_num_primal_push"],[1,2,1,"","get_num_sifting_iterations"],[1,2,1,"","get_num_sifting_phase_one_iterations"]],"cplex._internal._subinterfaces.QuadraticConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_linear_components"],[1,2,1,"","get_linear_num_nonzeros"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_quad_num_nonzeros"],[1,2,1,"","get_quadratic_components"],[1,2,1,"","get_rhs"],[1,2,1,"","get_senses"]],"cplex._internal._subinterfaces.QualityMetric":[[1,3,1,"","dual_objective"],[1,3,1,"","exact_kappa"],[1,3,1,"","kappa"],[1,3,1,"","kappa_attention"],[1,3,1,"","kappa_illposed"],[1,3,1,"","kappa_max"],[1,3,1,"","kappa_stable"],[1,3,1,"","kappa_suspicious"],[1,3,1,"","kappa_unstable"],[1,3,1,"","max_comp_slack"],[1,3,1,"","max_dual_infeasibility"],[1,3,1,"","max_dual_residual"],[1,3,1,"","max_indicator_slack_infeasibility"],[1,3,1,"","max_int_infeasibility"],[1,3,1,"","max_pi"],[1,3,1,"","max_primal_infeasibility"],[1,3,1,"","max_primal_residual"],[1,3,1,"","max_pwl_slack_infeasibility"],[1,3,1,"","max_quadratic_primal_residual"],[1,3,1,"","max_quadratic_slack"],[1,3,1,"","max_quadratic_slack_infeasibility"],[1,3,1,"","max_reduced_cost"],[1,3,1,"","max_scaled_dual_infeasibility"],[1,3,1,"","max_scaled_dual_residual"],[1,3,1,"","max_scaled_pi"],[1,3,1,"","max_scaled_primal_infeasibility"],[1,3,1,"","max_scaled_primal_residual"],[1,3,1,"","max_scaled_reduced_cost"],[1,3,1,"","max_scaled_slack"],[1,3,1,"","max_scaled_x"],[1,3,1,"","max_slack"],[1,3,1,"","max_x"],[1,3,1,"","objective_gap"],[1,3,1,"","primal_objective"],[1,3,1,"","sum_comp_slack"],[1,3,1,"","sum_dual_infeasibilities"],[1,3,1,"","sum_dual_residual"],[1,3,1,"","sum_indicator_slack_infeasibility"],[1,3,1,"","sum_integer_infeasibilities"],[1,3,1,"","sum_pi"],[1,3,1,"","sum_primal_infeasibilities"],[1,3,1,"","sum_primal_residual"],[1,3,1,"","sum_pwl_slack_infeasibility"],[1,3,1,"","sum_quadratic_primal_residual"],[1,3,1,"","sum_quadratic_slack"],[1,3,1,"","sum_quadratic_slack_infeasibility"],[1,3,1,"","sum_reduced_cost"],[1,3,1,"","sum_scaled_dual_infeasibilities"],[1,3,1,"","sum_scaled_dual_residual"],[1,3,1,"","sum_scaled_pi"],[1,3,1,"","sum_scaled_primal_infeasibilities"],[1,3,1,"","sum_scaled_primal_residual"],[1,3,1,"","sum_scaled_reduced_cost"],[1,3,1,"","sum_scaled_slack"],[1,3,1,"","sum_scaled_x"],[1,3,1,"","sum_slack"],[1,3,1,"","sum_x"]],"cplex._internal._subinterfaces.QualityMetrics":[[1,2,1,"","__init__"],[1,2,1,"","__str__"]],"cplex._internal._subinterfaces.SOSInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_members"],[1,2,1,"","get_sets"],[1,2,1,"","get_types"],[1,3,1,"","type"]],"cplex._internal._subinterfaces.SOSType":[[1,3,1,"","SOS1"],[1,3,1,"","SOS2"]],"cplex._internal._subinterfaces.SensitivityInterface":[[1,2,1,"","__init__"],[1,2,1,"","bounds"],[1,2,1,"","lower_bounds"],[1,2,1,"","objective"],[1,2,1,"","rhs"],[1,2,1,"","upper_bounds"]],"cplex._internal._subinterfaces.SolnPoolFilterInterface":[[1,2,1,"","__init__"],[1,2,1,"","add_diversity_filter"],[1,2,1,"","add_range_filter"],[1,2,1,"","delete"],[1,2,1,"","get_bounds"],[1,2,1,"","get_diversity_filters"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_range_filters"],[1,2,1,"","get_types"],[1,2,1,"","read"],[1,3,1,"","type"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolnPoolInterface":[[1,2,1,"","__init__"],[1,2,1,"","delete"],[1,3,1,"","filter"],[1,2,1,"","get_float_quality"],[1,2,1,"","get_integer_quality"],[1,2,1,"","get_linear_slacks"],[1,2,1,"","get_mean_objective_value"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_replaced"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_quadratic_slacks"],[1,2,1,"","get_quality_metrics"],[1,2,1,"","get_values"],[1,3,1,"","incumbent"],[1,3,1,"","quality_metric"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolutionInterface":[[1,3,1,"","MIP"],[1,2,1,"","__init__"],[1,3,1,"","advanced"],[1,3,1,"","basis"],[1,2,1,"","get_activity_levels"],[1,2,1,"","get_dual_values"],[1,2,1,"","get_float_quality"],[1,2,1,"","get_indicator_slacks"],[1,2,1,"","get_integer_quality"],[1,2,1,"","get_linear_slacks"],[1,2,1,"","get_method"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_quadratic_activity_levels"],[1,2,1,"","get_quadratic_dualslack"],[1,2,1,"","get_quadratic_slacks"],[1,2,1,"","get_quality_metrics"],[1,2,1,"","get_reduced_costs"],[1,2,1,"","get_solution_type"],[1,2,1,"","get_status"],[1,2,1,"","get_status_string"],[1,2,1,"","get_values"],[1,3,1,"","infeasibility"],[1,2,1,"","is_dual_feasible"],[1,2,1,"","is_primal_feasible"],[1,3,1,"","method"],[1,3,1,"","multiobj"],[1,3,1,"","pool"],[1,3,1,"","progress"],[1,3,1,"","quality_metric"],[1,3,1,"","sensitivity"],[1,3,1,"","status"],[1,3,1,"","type"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolutionMethod":[[1,3,1,"","MIP"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","feasopt"],[1,3,1,"","none"],[1,3,1,"","pivot"],[1,3,1,"","pivot_in"],[1,3,1,"","pivot_out"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.SolutionStatus":[[1,3,1,"","MIP_abort_feasible"],[1,3,1,"","MIP_abort_infeasible"],[1,3,1,"","MIP_dettime_limit_feasible"],[1,3,1,"","MIP_dettime_limit_infeasible"],[1,3,1,"","MIP_feasible"],[1,3,1,"","MIP_feasible_relaxed_inf"],[1,3,1,"","MIP_feasible_relaxed_quad"],[1,3,1,"","MIP_feasible_relaxed_sum"],[1,3,1,"","MIP_infeasible"],[1,3,1,"","MIP_infeasible_or_unbounded"],[1,3,1,"","MIP_optimal"],[1,3,1,"","MIP_optimal_infeasible"],[1,3,1,"","MIP_optimal_relaxed_inf"],[1,3,1,"","MIP_optimal_relaxed_quad"],[1,3,1,"","MIP_optimal_relaxed_sum"],[1,3,1,"","MIP_time_limit_feasible"],[1,3,1,"","MIP_time_limit_infeasible"],[1,3,1,"","MIP_unbounded"],[1,3,1,"","abort_dettime_limit"],[1,3,1,"","abort_dual_obj_limit"],[1,3,1,"","abort_iteration_limit"],[1,3,1,"","abort_obj_limit"],[1,3,1,"","abort_primal_obj_limit"],[1,3,1,"","abort_relaxed"],[1,3,1,"","abort_time_limit"],[1,3,1,"","abort_user"],[1,3,1,"","benders_num_best"],[1,3,1,"","conflict_abort_contradiction"],[1,3,1,"","conflict_abort_dettime_limit"],[1,3,1,"","conflict_abort_iteration_limit"],[1,3,1,"","conflict_abort_memory_limit"],[1,3,1,"","conflict_abort_node_limit"],[1,3,1,"","conflict_abort_obj_limit"],[1,3,1,"","conflict_abort_time_limit"],[1,3,1,"","conflict_abort_user"],[1,3,1,"","conflict_feasible"],[1,3,1,"","conflict_minimal"],[1,3,1,"","fail_feasible"],[1,3,1,"","fail_feasible_no_tree"],[1,3,1,"","fail_infeasible"],[1,3,1,"","fail_infeasible_no_tree"],[1,3,1,"","feasible"],[1,3,1,"","feasible_relaxed_inf"],[1,3,1,"","feasible_relaxed_quad"],[1,3,1,"","feasible_relaxed_sum"],[1,3,1,"","first_order"],[1,3,1,"","infeasible"],[1,3,1,"","infeasible_or_unbounded"],[1,3,1,"","mem_limit_feasible"],[1,3,1,"","mem_limit_infeasible"],[1,3,1,"","multiobj_infeasible"],[1,3,1,"","multiobj_inforunbd"],[1,3,1,"","multiobj_non_optimal"],[1,3,1,"","multiobj_optimal"],[1,3,1,"","multiobj_stopped"],[1,3,1,"","multiobj_unbounded"],[1,3,1,"","node_limit_feasible"],[1,3,1,"","node_limit_infeasible"],[1,3,1,"","num_best"],[1,3,1,"","optimal"],[1,3,1,"","optimal_face_unbounded"],[1,3,1,"","optimal_infeasible"],[1,3,1,"","optimal_populated"],[1,3,1,"","optimal_populated_tolerance"],[1,3,1,"","optimal_relaxed_inf"],[1,3,1,"","optimal_relaxed_quad"],[1,3,1,"","optimal_relaxed_sum"],[1,3,1,"","optimal_tolerance"],[1,3,1,"","populate_solution_limit"],[1,3,1,"","relaxation_unbounded"],[1,3,1,"","solution_limit"],[1,3,1,"","unbounded"],[1,3,1,"","unknown"]],"cplex._internal._subinterfaces.SolutionType":[[1,3,1,"","basic"],[1,3,1,"","nonbasic"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.VarTypes":[[1,3,1,"","binary"],[1,3,1,"","continuous"],[1,3,1,"","integer"],[1,3,1,"","semi_continuous"],[1,3,1,"","semi_integer"]],"cplex._internal._subinterfaces.VariablesInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","advanced"],[1,2,1,"","delete"],[1,2,1,"","get_cols"],[1,2,1,"","get_histogram"],[1,2,1,"","get_lower_bounds"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_binary"],[1,2,1,"","get_num_integer"],[1,2,1,"","get_num_semicontinuous"],[1,2,1,"","get_num_semiinteger"],[1,2,1,"","get_types"],[1,2,1,"","get_upper_bounds"],[1,2,1,"","set_lower_bounds"],[1,2,1,"","set_names"],[1,2,1,"","set_types"],[1,2,1,"","set_upper_bounds"],[1,3,1,"","type"]],"cplex.aborter":[[0,1,1,"","Aborter"]],"cplex.aborter.Aborter":[[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","clear"],[0,2,1,"","end"],[0,2,1,"","is_aborted"]],"cplex.callbacks":[[0,1,1,"","BarrierCallback"],[0,1,1,"","BranchCallback"],[0,1,1,"","BranchType"],[0,1,1,"","Callback"],[0,1,1,"","Context"],[0,1,1,"","ContextType"],[0,1,1,"","ContinuousCallback"],[0,1,1,"","ControlCallback"],[0,1,1,"","CrossoverCallback"],[0,1,1,"","CutCallback"],[0,1,1,"","CutType"],[0,1,1,"","FeasibilityStatus"],[0,1,1,"","HSCallback"],[0,1,1,"","HeuristicCallback"],[0,1,1,"","IncumbentCallback"],[0,1,1,"","LazyConstraintCallback"],[0,1,1,"","MIPCallback"],[0,1,1,"","MIPInfoCallback"],[0,1,1,"","MethodType"],[0,1,1,"","NodeCallback"],[0,1,1,"","OptimizationCallback"],[0,1,1,"","QualityMetric"],[0,1,1,"","RelaxationFlags"],[0,1,1,"","SimplexCallback"],[0,1,1,"","SolutionSource"],[0,1,1,"","SolveCallback"],[0,1,1,"","TuningCallback"],[0,1,1,"","UseConstraint"],[0,1,1,"","UseCut"],[0,1,1,"","UserCutCallback"]],"cplex.callbacks.BarrierCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_dual_objective_value"]],"cplex.callbacks.BranchCallback":[[0,2,1,"","__init__"],[0,3,1,"","branch_type"],[0,2,1,"","get_branch"],[0,2,1,"","get_branch_type"],[0,2,1,"","get_num_branches"],[0,2,1,"","is_integer_feasible"],[0,2,1,"","make_branch"],[0,2,1,"","make_cplex_branch"],[0,2,1,"","prune"]],"cplex.callbacks.BranchType":[[0,3,1,"","SOS1"],[0,3,1,"","SOS2"],[0,3,1,"","any"],[0,3,1,"","variable"]],"cplex.callbacks.Callback":[[0,2,1,"","__call__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","get_dettime"],[0,2,1,"","get_end_dettime"],[0,2,1,"","get_end_time"],[0,2,1,"","get_start_dettime"],[0,2,1,"","get_start_time"],[0,2,1,"","get_time"]],"cplex.callbacks.Context":[[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","add_user_cut"],[0,2,1,"","add_user_cuts"],[0,2,1,"","exit_cut_loop"],[0,2,1,"","get_candidate_objective"],[0,2,1,"","get_candidate_point"],[0,2,1,"","get_candidate_ray"],[0,2,1,"","get_candidate_source"],[0,2,1,"","get_double_info"],[0,2,1,"","get_global_lower_bounds"],[0,2,1,"","get_global_upper_bounds"],[0,2,1,"","get_id"],[0,2,1,"","get_incumbent"],[0,2,1,"","get_incumbent_objective"],[0,2,1,"","get_int_info"],[0,2,1,"","get_local_lower_bounds"],[0,2,1,"","get_local_upper_bounds"],[0,2,1,"","get_long_info"],[0,2,1,"","get_relaxation_objective"],[0,2,1,"","get_relaxation_point"],[0,2,1,"","get_relaxation_status"],[0,3,1,"","id"],[0,2,1,"","in_branching"],[0,2,1,"","in_candidate"],[0,2,1,"","in_global_progress"],[0,2,1,"","in_local_progress"],[0,2,1,"","in_relaxation"],[0,2,1,"","in_thread_down"],[0,2,1,"","in_thread_up"],[0,3,1,"","info"],[0,2,1,"","is_candidate_point"],[0,2,1,"","is_candidate_ray"],[0,2,1,"","make_branch"],[0,2,1,"","post_heuristic_solution"],[0,2,1,"","prune_current_node"],[0,2,1,"","reject_candidate"],[0,2,1,"","reject_candidate_local"],[0,3,1,"","relaxation_flags"],[0,3,1,"","solution_status"],[0,3,1,"","solution_strategy"]],"cplex.callbacks.ContextType":[[0,3,1,"","branching"],[0,3,1,"","candidate"],[0,3,1,"","global_progress"],[0,3,1,"","local_progress"],[0,3,1,"","relaxation"],[0,3,1,"","thread_down"],[0,3,1,"","thread_up"]],"cplex.callbacks.ContinuousCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_dual_infeasibility"],[0,2,1,"","get_num_iterations"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_primal_infeasibility"],[0,2,1,"","is_dual_feasible"],[0,2,1,"","is_primal_feasible"]],"cplex.callbacks.ControlCallback":[[0,2,1,"","__init__"],[0,3,1,"","feasibility_status"],[0,2,1,"","get_SOS_feasibilities"],[0,2,1,"","get_feasibilities"],[0,2,1,"","get_linear_slacks"],[0,2,1,"","get_lower_bounds"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_pseudo_costs"],[0,2,1,"","get_quadratic_slacks"],[0,2,1,"","get_upper_bounds"],[0,2,1,"","get_values"],[0,2,1,"","set_node_data"]],"cplex.callbacks.CrossoverCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_num_dual_exchanges"],[0,2,1,"","get_num_dual_pushes"],[0,2,1,"","get_num_primal_exchanges"],[0,2,1,"","get_num_primal_pushes"],[0,2,1,"","get_num_superbasics"]],"cplex.callbacks.CutType":[[0,3,1,"","GUB_cover"],[0,3,1,"","MIR"],[0,3,1,"","benders"],[0,3,1,"","clique"],[0,3,1,"","cover"],[0,3,1,"","disjunctive"],[0,3,1,"","flow_cover"],[0,3,1,"","flow_path"],[0,3,1,"","fractional"],[0,3,1,"","implied_bound"],[0,3,1,"","lift_and_project"],[0,3,1,"","multi_commodity_flow"],[0,3,1,"","solution_pool"],[0,3,1,"","table"],[0,3,1,"","user"],[0,3,1,"","zero_half"]],"cplex.callbacks.FeasibilityStatus":[[0,3,1,"","feasible"],[0,3,1,"","implied_feasible"],[0,3,1,"","infeasible"]],"cplex.callbacks.HSCallback":[[0,2,1,"","get_cplex_status"],[0,2,1,"","is_dual_feasible"],[0,2,1,"","is_primal_feasible"],[0,3,1,"","method"],[0,2,1,"","solve"],[0,3,1,"","status"]],"cplex.callbacks.HeuristicCallback":[[0,2,1,"","__init__"],[0,2,1,"","set_bounds"],[0,2,1,"","set_solution"]],"cplex.callbacks.IncumbentCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_linear_slacks"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_quadratic_slacks"],[0,2,1,"","get_solution_source"],[0,2,1,"","get_values"],[0,2,1,"","reject"],[0,2,1,"","set_node_data"],[0,3,1,"","solution_source"]],"cplex.callbacks.LazyConstraintCallback":[[0,2,1,"","__init__"],[0,2,1,"","add"],[0,2,1,"","add_local"],[0,2,1,"","get_solution_source"],[0,2,1,"","is_unbounded_node"],[0,3,1,"","use_constraint"]],"cplex.callbacks.MIPCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_current_node_depth"],[0,2,1,"","get_objective_coefficients"]],"cplex.callbacks.MIPInfoCallback":[[0,2,1,"","__init__"],[0,3,1,"","cut_type"],[0,2,1,"","get_MIP_relative_gap"],[0,2,1,"","get_best_objective_value"],[0,2,1,"","get_cutoff"],[0,2,1,"","get_float_quality"],[0,2,1,"","get_incumbent_linear_slacks"],[0,2,1,"","get_incumbent_objective_value"],[0,2,1,"","get_incumbent_quadratic_slacks"],[0,2,1,"","get_incumbent_values"],[0,2,1,"","get_num_cols"],[0,2,1,"","get_num_cuts"],[0,2,1,"","get_num_iterations"],[0,2,1,"","get_num_nodes"],[0,2,1,"","get_num_quadratic_constraints"],[0,2,1,"","get_num_remaining_nodes"],[0,2,1,"","get_num_rows"],[0,2,1,"","get_thread_num"],[0,2,1,"","has_incumbent"],[0,3,1,"","quality_metric"]],"cplex.callbacks.MethodType":[[0,3,1,"","barrier"],[0,3,1,"","dual"],[0,3,1,"","network"],[0,3,1,"","primal"]],"cplex.callbacks.NodeCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_branch_variable"],[0,2,1,"","get_current_node_depth"],[0,2,1,"","get_depth"],[0,2,1,"","get_estimated_objective_value"],[0,2,1,"","get_infeasibility_sum"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_node_number"],[0,2,1,"","get_num_infeasibilities"],[0,2,1,"","get_objective_value"],[0,2,1,"","select_node"],[0,2,1,"","set_node_data"]],"cplex.callbacks.OptimizationCallback":[[0,2,1,"","get_num_cols"],[0,2,1,"","get_num_quadratic_constraints"],[0,2,1,"","get_num_rows"]],"cplex.callbacks.QualityMetric":[[0,3,1,"","kappa_attention"],[0,3,1,"","kappa_illposed"],[0,3,1,"","kappa_max"],[0,3,1,"","kappa_stable"],[0,3,1,"","kappa_suspicious"],[0,3,1,"","kappa_unstable"]],"cplex.callbacks.RelaxationFlags":[[0,3,1,"","no_solve"]],"cplex.callbacks.SimplexCallback":[[0,2,1,"","__init__"]],"cplex.callbacks.SolutionSource":[[0,3,1,"","heuristic_solution"],[0,3,1,"","mipstart_solution"],[0,3,1,"","node_solution"],[0,3,1,"","user_solution"]],"cplex.callbacks.SolveCallback":[[0,2,1,"","__init__"],[0,2,1,"","set_start"],[0,2,1,"","use_solution"]],"cplex.callbacks.TuningCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_progress"]],"cplex.callbacks.UseConstraint":[[0,3,1,"","force"],[0,3,1,"","purge"]],"cplex.callbacks.UseCut":[[0,3,1,"","filter"],[0,3,1,"","force"],[0,3,1,"","purge"]],"cplex.callbacks.UserCutCallback":[[0,2,1,"","__init__"],[0,2,1,"","abort_cut_loop"],[0,2,1,"","add"],[0,2,1,"","add_local"],[0,2,1,"","is_after_cut_loop"],[0,3,1,"","use_cut"]],"cplex.constant_class":[[0,1,1,"","ConstantClass"]],"cplex.constant_class.ConstantClass":[[0,2,1,"","__getitem__"],[0,2,1,"","__init__"],[0,2,1,"","__iter__"]],"cplex.exceptions":[[0,5,1,"","CplexError"],[0,5,1,"","CplexSolverError"],[0,5,1,"","ErrorChannelMessage"],[0,5,1,"","WrongNumberOfArgumentsError"]],"cplex.model_info":[[0,6,1,"","CPXMI_BIGM_COEF"],[0,6,1,"","CPXMI_BIGM_TO_IND"],[0,6,1,"","CPXMI_BIGM_VARBOUND"],[0,6,1,"","CPXMI_CANCEL_TOL"],[0,6,1,"","CPXMI_EPGAP_LARGE"],[0,6,1,"","CPXMI_EPGAP_OBJOFFSET"],[0,6,1,"","CPXMI_FEAS_TOL"],[0,6,1,"","CPXMI_FRACTION_SCALING"],[0,6,1,"","CPXMI_IND_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_IND_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_IND_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_IND_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_KAPPA_ILLPOSED"],[0,6,1,"","CPXMI_KAPPA_SUSPICIOUS"],[0,6,1,"","CPXMI_KAPPA_UNSTABLE"],[0,6,1,"","CPXMI_LB_LARGE_NUM"],[0,6,1,"","CPXMI_LB_SMALL_NUM"],[0,6,1,"","CPXMI_LC_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_LC_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_LC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_LC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_MULTIOBJ_COEFFS"],[0,6,1,"","CPXMI_MULTIOBJ_LARGE_NUM"],[0,6,1,"","CPXMI_MULTIOBJ_MIX"],[0,6,1,"","CPXMI_MULTIOBJ_OPT_TOL"],[0,6,1,"","CPXMI_MULTIOBJ_SMALL_NUM"],[0,6,1,"","CPXMI_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_OBJ_LARGE_NUM"],[0,6,1,"","CPXMI_OBJ_SMALL_NUM"],[0,6,1,"","CPXMI_OPT_TOL"],[0,6,1,"","CPXMI_PWL_SLOPE_LARGE_NUM"],[0,6,1,"","CPXMI_PWL_SLOPE_SMALL_NUM"],[0,6,1,"","CPXMI_QC_LINNZ_LARGE_NUM"],[0,6,1,"","CPXMI_QC_LINNZ_SMALL_NUM"],[0,6,1,"","CPXMI_QC_QNZ_LARGE_NUM"],[0,6,1,"","CPXMI_QC_QNZ_SMALL_NUM"],[0,6,1,"","CPXMI_QC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_QC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_QOBJ_LARGE_NUM"],[0,6,1,"","CPXMI_QOBJ_SMALL_NUM"],[0,6,1,"","CPXMI_QOPT_TOL"],[0,6,1,"","CPXMI_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_SAMECOEFF_COL"],[0,6,1,"","CPXMI_SAMECOEFF_IND"],[0,6,1,"","CPXMI_SAMECOEFF_LAZY"],[0,6,1,"","CPXMI_SAMECOEFF_MULTIOBJ"],[0,6,1,"","CPXMI_SAMECOEFF_OBJ"],[0,6,1,"","CPXMI_SAMECOEFF_QLIN"],[0,6,1,"","CPXMI_SAMECOEFF_QUAD"],[0,6,1,"","CPXMI_SAMECOEFF_RHS"],[0,6,1,"","CPXMI_SAMECOEFF_ROW"],[0,6,1,"","CPXMI_SAMECOEFF_UCUT"],[0,6,1,"","CPXMI_SINGLE_PRECISION"],[0,6,1,"","CPXMI_SYMMETRY_BREAKING_INEQ"],[0,6,1,"","CPXMI_UB_LARGE_NUM"],[0,6,1,"","CPXMI_UB_SMALL_NUM"],[0,6,1,"","CPXMI_UC_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_UC_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_UC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_UC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_WIDE_COEFF_RANGE"]],"cplex.paramset":[[0,1,1,"","ParameterSet"]],"cplex.paramset.ParameterSet":[[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","__len__"],[0,2,1,"","add"],[0,2,1,"","clear"],[0,2,1,"","delete"],[0,2,1,"","end"],[0,2,1,"","get"],[0,2,1,"","get_ids"],[0,2,1,"","read"],[0,2,1,"","write"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"],"5":["py","exception","Python exception"],"6":["py","data","Python data"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function","5":"py:exception","6":"py:data"},"terms":{"1e":[0,1],"1e75":0,"32bit":0,"64bit":0,"A":[0,1],"After":[0,1],"All":[0,1],"An":[0,1],"As":[0,2],"At":0,"By":[0,1],"Do":0,"Each":[0,1],"For":[0,1,2],"I":1,"If":[0,1,2],"In":[0,1],"It":[0,1,2],"Most":0,"OR":0,"Some":1,"Such":[0,1],"That":[0,1],"The":[0,1,2],"Then":0,"There":[0,1],"These":[0,1,2],"They":0,"This":[0,1,2],"Those":1,"To":[0,1,2],"When":[0,1],"With":0,"You":[0,2],"_":1,"__call__":[0,1],"__conditionally_convert":0,"__del__":[0,1,3],"__enter__":[0,3],"__exit__":[0,3],"__getitem__":[0,1],"__init__":[0,1,3],"__iter__":0,"__len__":[0,3],"__repr__":[0,1,3],"__str__":[0,1,3],"_anno":0,"_aux_funct":0,"_baseinterfac":0,"_c_hb_matrix":1,"_callbackinfoenum":0,"_constant":0,"_constantsenum":0,"_get":1,"_get_info":1,"_get_node_info":0,"_get_seq_info":0,"_group":1,"_hb_matrix":1,"_intern":[0,2,3],"_list_array_util":1,"_matric":0,"_multiobj":0,"_multiobjsoln":0,"_ostream":1,"_parameter_class":0,"_procedur":0,"_pwl":0,"_set":1,"_solutionstrategyenum":0,"_subinterfac":0,"_wherefrom":0,"ab":1,"abnorm":0,"abort":[1,3],"abort_cut_loop":0,"abort_dettime_limit":1,"abort_dual_obj_limit":1,"abort_iteration_limit":1,"abort_obj_limit":1,"abort_primal_obj_limit":1,"abort_relax":1,"abort_time_limit":1,"abort_us":1,"abov":1,"absmipgap":1,"absolut":[0,1],"abstol":1,"accept":[0,1],"access":[0,1,2],"accomplish":1,"across":0,"action":0,"activ":[1,2],"actual":0,"add":[0,1,2,3],"add_batch":1,"add_diversity_filt":1,"add_lazy_constraint":1,"add_loc":0,"add_range_filt":1,"add_row":1,"add_user_cut":[0,1],"addcol":[0,1],"addfuncdest":[0,1],"addindconstr":[0,1],"addit":[0,1],"addlazyconstraint":[0,1],"addmipstart":[0,1],"addpwl":[0,1],"addqconstr":[0,1],"address":0,"addrow":[0,1],"addso":[0,1],"addsolnpooldivfilt":[0,1],"addsolnpoolrngfilt":[0,1],"addusercut":[0,1],"admipex1":0,"admipex2":0,"admipex3":0,"admipex5":0,"admipex6":0,"admipex8":0,"admipex9":0,"advanc":[0,1,3],"advance_const":[0,1],"advancedcplexinterfac":[0,1],"advancedlinearconstraintinterfac":[0,1],"advancedsolutioninterfac":[0,1],"advancedvariablesinterfac":[0,1],"advis":2,"affect":0,"agg_const":[0,1],"aggreg":1,"aggress":1,"aid":1,"alg":0,"alg_const":[0,1],"algorithm":[0,1],"all_constraint":1,"all_vari":1,"allow":[0,1,2],"allow_empti":1,"allslack":1,"allval":1,"alp":0,"alreadi":[0,1],"also":[0,1,2],"alter":0,"altern":[0,1],"alway":[0,1],"among":[0,1],"amount":1,"anaconda":2,"analysi":1,"ani":[0,1],"ann":[0,1],"ann1":[0,1],"ann2":1,"ann3":1,"ann4":1,"ann5":1,"annot":[0,1],"annotationinterfac":[0,1],"annotationobjecttyp":[0,1],"anoth":0,"api":[0,1],"appear":0,"appli":[0,1],"applic":2,"apply_freeform_one_arg":[0,1],"apply_freeform_two_arg":[0,1],"apply_pair":[0,1],"appropri":2,"approx_min_degre":1,"approx_min_fil":1,"arbitrari":1,"arbitrarili":1,"arg":[0,1],"arg_list":1,"argument":[0,1],"array":0,"ask":0,"aspect":0,"assign":[0,1],"assist":[0,1],"associ":[0,1,2],"assum":[0,2],"assumpt":1,"at_all_nod":1,"at_lower_bound":1,"at_root":1,"at_upper_bound":1,"attach":0,"attempt":[0,1],"attribut":[0,1,2],"augment":1,"author":0,"auto":[0,1],"auto_off_on_const":[0,1],"automat":[0,1],"auxiliari":1,"avail":1,"averag":1,"average_primal_estimated_du":1,"average_primal_zero_du":1,"avoid":0,"b":[0,1],"backward":1,"balanc":1,"bar_alg_const":[0,1],"bar_order_const":[0,1],"bar_start_alg_const":[0,1],"baropt":[0,1],"barrier":[0,1],"barriercallback":[0,3],"bas":1,"base":[0,1],"baseinterfac":[0,1],"basi":[0,1],"basic":1,"basic_presolv":1,"basic_vari":1,"basicpresolv":[0,1],"basisinterfac":[0,1],"basisvarstatus":[0,1],"batch":1,"bb":1,"bbtran":1,"bd":1,"becaus":0,"becom":0,"befor":[0,1],"beg":1,"begin":[0,1],"begin_and_end":1,"behavior":0,"belong":0,"bender":[0,1],"benders_annot":1,"benders_mastervalu":1,"benders_num_best":1,"benders_strategy_const":[0,1],"bendersatsp":0,"bendersatsp2":0,"best":[0,1],"best_bound":1,"best_estim":1,"best_estimate_alt":1,"best_obj":1,"best_object":1,"better":0,"binari":[0,1],"bind":0,"binvacol":[0,1],"binvarow":[0,1],"binvcol":[0,1],"binvrow":[0,1],"bit":0,"bitwis":0,"blend":1,"block":0,"bnd":0,"boolean":0,"bound":[0,1],"bound_constraint":1,"boundsa":[0,1],"boundsa_low":[0,1],"boundsa_upp":[0,1],"bqp":1,"branch":[0,1],"branch_direct":1,"branch_typ":0,"branchcallback":[0,3],"branchcallbackbranchascplex":[0,1],"branchcallbackbranchgener":[0,1],"branchdirect":[0,1],"branchtyp":[0,3],"brdir_const":[0,1],"breaki":1,"breakpoint":1,"breakx":1,"brows":2,"btran":[0,1],"build":0,"bupper":1,"byte":0,"bz2":0,"bzip2":0,"c":[0,1],"c0":1,"c1":[0,1],"c10":1,"c13":1,"c2":[0,1],"c21":1,"c3":1,"c4":1,"c5":1,"c6":1,"c7":1,"c8":1,"c9":1,"c_stat":1,"c_type":1,"cach":1,"calcul":0,"call":[0,1],"callabl":[0,1,2],"callback":[1,3],"callback_class":[0,1],"callbackabort":[0,1],"callbackaddusercut":[0,1],"callbackcandidateispoint":[0,1],"callbackcandidateisray":[0,1],"callbackexitcutloop":[0,1],"callbackgetcandidateobj":[0,1],"callbackgetcandidatepoint":[0,1],"callbackgetcandidateray":[0,1],"callbackgetgloballb":[0,1],"callbackgetglobalub":[0,1],"callbackgetincumb":[0,1],"callbackgetincumbentobj":[0,1],"callbackgetinfodbl":[0,1],"callbackgetinfoint":[0,1],"callbackgetinfolong":[0,1],"callbackgetlocallb":[0,1],"callbackgetlocalub":[0,1],"callbackgetrelaxationpoint":[0,1],"callbackgetrelaxationpointobj":[0,1],"callbackgetrelaxationstatus":[0,1],"callbackinfo":0,"callbackmakebranch":[0,1],"callbackpostheursoln":[0,1],"callbackprunenod":[0,1],"callbackrejectcandid":[0,1],"callbackrejectcandidateloc":[0,1],"callbacksetnodeuserhandl":[0,1],"callbacksetuserhandl":[0,1],"caller":1,"can":[0,1,2],"candid":0,"cardls_const":[0,1],"care":0,"case":[0,1],"categori":0,"cb":0,"cb_geterrorstr":[0,1],"cbhandl":1,"cbstruct":1,"ccnt":1,"cdual":1,"certain":0,"chang":[0,1],"channel":[0,1,2],"charact":[0,1],"chbmatrix":[0,1],"check":[0,1],"check_feas":1,"chgbds":[0,1],"chgcoeflist":[0,1],"chgcolnam":[0,1],"chgctype":[0,1],"chgmipstart":[0,1],"chgobj":[0,1],"chgobjoffset":[0,1],"chgobjsen":[0,1],"chgprobnam":[0,1],"chgprobtyp":[0,1],"chgprobtypesolnpool":[0,1],"chgqpcoef":[0,1],"chgrhs":[0,1],"chgrngval":[0,1],"chgrownam":[0,1],"chgsens":[0,1],"child":0,"children":0,"choos":0,"circumst":0,"class":[0,1,2],"claus":0,"cleanup":[0,1,3],"clear":[0,3],"cliqu":[0,1],"clist":1,"clock":0,"clocktyp":0,"clocktype_const":[0,1],"cloneprob":[0,1],"closecplex":[0,1],"clp":1,"clpwrite":[0,1],"cmat":1,"cnt":[0,1],"code":[0,1],"coeffici":[0,1],"coeffreduce_const":[0,1],"col":1,"col_dual":1,"col_prim":1,"col_status":1,"collist":1,"colnam":[0,1],"column":[0,1],"column_complementarity_max":1,"column_complementarity_tot":1,"combin":[0,1],"come":2,"command":[0,1,2],"common":1,"communiti":2,"compar":0,"compat":0,"complement":1,"complementarity_tot":1,"complet":[0,1,2],"completelp":[0,1],"compon":1,"compos":2,"compress":0,"comptyp":0,"comput":[0,1],"concaten":0,"concurr":[0,1],"conda":2,"condit":1,"cone":1,"config":2,"conflict":[0,1,3],"conflict_abort_contradict":1,"conflict_abort_dettime_limit":1,"conflict_abort_iteration_limit":1,"conflict_abort_memory_limit":1,"conflict_abort_node_limit":1,"conflict_abort_obj_limit":1,"conflict_abort_time_limit":1,"conflict_abort_us":1,"conflict_algorithm_const":[0,1],"conflict_feas":1,"conflict_minim":1,"conflictconstrainttyp":[0,1],"conflictinterfac":[0,1],"conflictstatus":[0,1],"confstatus":1,"consecut":1,"consequ":0,"consid":[0,1],"consider":0,"consist":[0,1],"constant":[0,1],"constant_class":[1,3],"constantclass":[0,1,3],"constraint":[0,1,2],"constraint_typ":1,"constructor":[0,1],"consum":[0,1],"contain":[0,1],"content":0,"context":[0,1,3],"contextid":0,"contextmask":[0,1],"contextptr":[0,1],"contexttyp":[0,3],"continu":[0,1],"continuouscallback":[0,3],"control":[0,1],"controlcallback":[0,3],"conv":1,"conveni":0,"convert":[0,1],"convert_sequ":[0,1],"coordin":1,"copi":[0,1],"copy_parameter_set":[0,3],"copylp":[0,3],"copylpwnam":[0,1],"copyobjnam":[0,1],"copyord":[0,1],"copyprotect":[0,1],"copyqpsep":[0,1],"copyquad":[0,1],"copystart":[0,1],"core":[0,1],"correct":2,"correspond":[0,1,2],"cost":[0,1],"count":[0,1],"cover":[0,1],"cp":2,"cplexerror":[0,3],"cplexsolvererror":[0,3],"cprim":1,"cpu":[0,1],"cpx":[0,1],"cpx_callback_info_my_thread_num":0,"cpx_callbackcontext_branch":0,"cpx_callbackcontext_candid":0,"cpx_callbackcontext_global_progress":0,"cpx_callbackcontext_local_progress":0,"cpx_callbackcontext_relax":0,"cpx_callbackcontext_thread_down":0,"cpx_callbackcontext_thread_up":0,"cpx_incumbent_id":1,"cpx_indicator_if":1,"cpx_indicator_ifandonlyif":1,"cpx_indicator_onlyif":1,"cpx_infbound":0,"cpx_max":1,"cpx_min":1,"cpx_multiobj_baritcnt":1,"cpx_multiobj_bestobjv":1,"cpx_multiobj_blend":1,"cpx_multiobj_degcnt":1,"cpx_multiobj_dettim":1,"cpx_multiobj_dexch":1,"cpx_multiobj_dfea":1,"cpx_multiobj_dpush":1,"cpx_multiobj_error":1,"cpx_multiobj_itcnt":1,"cpx_multiobj_method":1,"cpx_multiobj_nodecnt":1,"cpx_multiobj_nodeleftcnt":1,"cpx_multiobj_objv":1,"cpx_multiobj_pexch":1,"cpx_multiobj_pfea":1,"cpx_multiobj_phase1cnt":1,"cpx_multiobj_ppush":1,"cpx_multiobj_prior":1,"cpx_multiobj_siftitcnt":1,"cpx_multiobj_siftphase1cnt":1,"cpx_multiobj_status":1,"cpx_multiobj_tim":1,"cpx_no_vari":1,"cpx_param_advind":0,"cpx_param_datacheck":0,"cpx_param_warnlim":0,"cpx_prereduce_noprimalordu":0,"cpx_prereduce_primalon":0,"cpx_relaxation_flag_nosolv":0,"cpxbasicpresolv":1,"cpxbenderspartit":1,"cpxcallbackabort":0,"cpxcallbackaddusercut":0,"cpxcallbackcandidateispoint":0,"cpxcallbackcandidateisray":0,"cpxcallbackexitcutloop":0,"cpxcallbackgetcandidatepoint":0,"cpxcallbackgetcandidateray":0,"cpxcallbackgetgloballb":0,"cpxcallbackgetglobalub":0,"cpxcallbackgetincumb":0,"cpxcallbackgetinfodbl":0,"cpxcallbackgetinfoint":0,"cpxcallbackgetinfolong":0,"cpxcallbackgetlocallb":0,"cpxcallbackgetlocalub":0,"cpxcallbackgetrelaxationpoint":0,"cpxcallbackgetrelaxationstatus":0,"cpxcallbackmakebranch":0,"cpxcallbackpostheursoln":0,"cpxcallbackprunenod":0,"cpxcallbackrejectcandid":0,"cpxcallbackrejectcandidateloc":0,"cpxcallbacksetfunc":0,"cpxcallbacksolution_checkfea":1,"cpxcallbacksolution_nocheck":1,"cpxcallbacksolution_propag":1,"cpxcallbacksolution_solv":1,"cpxcallbacksolutionstrategi":1,"cpxchgprobnam":0,"cpxchgprobtyp":0,"cpxchgprobtypesolnpool":0,"cpxcleanup":0,"cpxclpwrite":1,"cpxcompletelp":1,"cpxcopylpwnam":0,"cpxdelcol":1,"cpxdeldblannot":1,"cpxdelindconstr":1,"cpxdellongannot":1,"cpxdelmipstart":1,"cpxdelpwl":1,"cpxdelqconstr":1,"cpxdelrow":1,"cpxdelso":1,"cpxdelsolnpoolfilt":1,"cpxdelsolnpoolsoln":1,"cpxdperwrit":0,"cpxdualfarka":1,"cpxdualwrit":0,"cpxembwrit":0,"cpxfeasoptext":1,"cpxgetbas":1,"cpxgetcallbackinfo":0,"cpxgetconflictext":1,"cpxgetconflictgroup":1,"cpxgetconflictnumgroup":1,"cpxgetconflictnumpass":1,"cpxgetdblqual":1,"cpxgetdettim":0,"cpxgetgrad":1,"cpxgetmiprelgap":[0,1],"cpxgetnumcor":0,"cpxgetnumobj":1,"cpxgetobjsen":1,"cpxgetprobnam":0,"cpxgetprobtyp":0,"cpxgetsolnpooldblqu":1,"cpxgetsolnpoolintqu":1,"cpxgettim":0,"cpxmbasewrit":1,"cpxmi":0,"cpxmi_bigm_coef":[0,3],"cpxmi_bigm_to_ind":[0,3],"cpxmi_bigm_varbound":[0,3],"cpxmi_cancel_tol":[0,3],"cpxmi_epgap_larg":[0,3],"cpxmi_epgap_objoffset":[0,3],"cpxmi_feas_tol":[0,3],"cpxmi_fraction_sc":[0,3],"cpxmi_ind_nz_large_num":[0,3],"cpxmi_ind_nz_small_num":[0,3],"cpxmi_ind_rhs_large_num":[0,3],"cpxmi_ind_rhs_small_num":[0,3],"cpxmi_kappa_illpos":[0,3],"cpxmi_kappa_suspici":[0,3],"cpxmi_kappa_unst":[0,3],"cpxmi_lb_large_num":[0,3],"cpxmi_lb_small_num":[0,3],"cpxmi_lc_nz_large_num":[0,3],"cpxmi_lc_nz_small_num":[0,3],"cpxmi_lc_rhs_large_num":[0,3],"cpxmi_lc_rhs_small_num":[0,3],"cpxmi_multiobj_coeff":[0,3],"cpxmi_multiobj_large_num":[0,3],"cpxmi_multiobj_mix":[0,3],"cpxmi_multiobj_opt_tol":[0,3],"cpxmi_multiobj_small_num":[0,3],"cpxmi_nz_large_num":[0,3],"cpxmi_nz_small_num":[0,3],"cpxmi_obj_large_num":[0,3],"cpxmi_obj_small_num":[0,3],"cpxmi_opt_tol":[0,3],"cpxmi_pwl_slope_large_num":[0,3],"cpxmi_pwl_slope_small_num":[0,3],"cpxmi_qc_linnz_large_num":[0,3],"cpxmi_qc_linnz_small_num":[0,3],"cpxmi_qc_qnz_large_num":[0,3],"cpxmi_qc_qnz_small_num":[0,3],"cpxmi_qc_rhs_large_num":[0,3],"cpxmi_qc_rhs_small_num":[0,3],"cpxmi_qobj_large_num":[0,3],"cpxmi_qobj_small_num":[0,3],"cpxmi_qopt_tol":[0,3],"cpxmi_rhs_large_num":[0,3],"cpxmi_rhs_small_num":[0,3],"cpxmi_samecoeff_col":[0,3],"cpxmi_samecoeff_ind":[0,3],"cpxmi_samecoeff_lazi":[0,3],"cpxmi_samecoeff_multiobj":[0,3],"cpxmi_samecoeff_obj":[0,3],"cpxmi_samecoeff_qlin":[0,3],"cpxmi_samecoeff_quad":[0,3],"cpxmi_samecoeff_rh":[0,3],"cpxmi_samecoeff_row":[0,3],"cpxmi_samecoeff_ucut":[0,3],"cpxmi_single_precis":[0,3],"cpxmi_symmetry_breaking_ineq":[0,3],"cpxmi_ub_large_num":[0,3],"cpxmi_ub_small_num":[0,3],"cpxmi_uc_nz_large_num":[0,3],"cpxmi_uc_nz_small_num":[0,3],"cpxmi_uc_rhs_large_num":[0,3],"cpxmi_uc_rhs_small_num":[0,3],"cpxmi_wide_coeff_rang":[0,3],"cpxmodelasstcallbacksetfunc":0,"cpxmultiobjchgattrib":1,"cpxmultiobjgetdblinfo":1,"cpxmultiobjgetintinfo":1,"cpxmultiobjgetlonginfo":1,"cpxmultiobjgetnam":1,"cpxmultiobjgetnumsolv":1,"cpxmultiobjgetobj":1,"cpxmultiobjgetobjv":1,"cpxmultiobjgetobjvalbyprior":1,"cpxmultiobjopt":0,"cpxmultiobjsetobj":1,"cpxparamsetappli":0,"cpxparamsetcopi":0,"cpxpopul":0,"cpxpperwrit":0,"cpxprob_fixedmilp":1,"cpxprob_lp":1,"cpxprob_milp":1,"cpxprob_miqcp":1,"cpxprob_miqp":1,"cpxprob_nodelp":1,"cpxprob_nodeqp":1,"cpxprob_qcp":1,"cpxprob_qp":1,"cpxreadcopyannot":0,"cpxreadcopybas":1,"cpxreadcopyprob":0,"cpxreadcopystartinfo":1,"cpxrefineconflictext":1,"cpxrefinemipstartconflictext":1,"cpxsetnumobj":1,"cpxsolwrit":1,"cpxstrongbranch":1,"cpxversion":0,"cpxversionnumb":0,"cpxwriteannot":0,"cpxwritebendersannot":0,"cpxwriteprob":0,"creat":[0,1],"create_parameter_set":[0,1,3],"createprob":[0,1],"criterion":0,"crossov":0,"crossover_const":[0,1],"crossovercallback":[0,3],"crush":[0,1],"crush_formula":1,"crush_pi":1,"crush_x":1,"crushed_formula":1,"crushform":[0,1],"crushpi":[0,1],"crushx":[0,1],"cstat":1,"ctrl":1,"current":[0,1],"custom":[0,2],"cut":[0,1],"cut2":1,"cut3":1,"cut_typ":[0,1],"cutcallback":[0,3],"cutcallbackadd":[0,1],"cutcallbackaddloc":[0,1],"cutmanag":[0,1],"cutoff":[0,1],"cuttyp":[0,1,3],"d":1,"data":[0,1,2],"datacheck":[0,1],"datacheck_const":[0,1],"dbl_param_valu":1,"deal":1,"debug":1,"decis":[0,2],"decomposit":0,"decompost":0,"decor":1,"deep":0,"def":0,"default":[0,1,2],"defin":[0,1,2],"definit":1,"defval":1,"degre":1,"del":[0,1],"delcol":[0,1],"deldblanno":[0,1],"delet":[0,1,3],"delete_nam":1,"delete_native_int":[0,1],"delete_set_by_rang":[0,1],"delfuncdest":[0,1],"delindconstr":[0,1],"dellonganno":[0,1],"delmipstart":[0,1],"delnam":[0,1],"delpwl":[0,1],"delpydel":[0,1],"delqconstr":[0,1],"delrow":[0,1],"delso":[0,1],"delsolnpoolfilt":[0,1],"delsolnpoolsoln":[0,1],"demonstr":1,"depend":[0,1],"dependency_const":[0,1],"deprec":[0,1],"deprecated_class":[0,1],"depth":0,"depth_first":1,"describ":[0,1],"descript":[0,1],"design":0,"desir":0,"destoy":0,"destroy":0,"destructor":0,"detail":[0,1,2],"detect":[0,1],"determin":[0,1],"determinist":[0,1],"dettim":1,"dettime_limit":1,"devex":1,"dfea":1,"differ":[0,1],"dimens":0,"dir":0,"direct":[0,1,2],"disabl":[0,1],"discard":0,"discontinu":1,"discret":[0,1],"discrete_vari":1,"disjunct":[0,1],"disk":1,"disk_compress":1,"display":[0,1],"display_const":[0,1],"distanc":0,"distribut":2,"div":1,"div0":1,"dive_const":[0,1],"diverg":1,"divers":1,"djfrompi":[0,1],"docplex":2,"document":[0,1,2],"doe":[0,1],"don":0,"done":0,"doubl":1,"double_annot":[0,1,3],"doubleannotationinterfac":[0,1],"doubt":0,"down_penalti":1,"dpe":0,"dperwrit":[0,1],"driebeek":1,"drop":0,"dsr":2,"dua":0,"dual":[0,1],"dual_const":[0,1],"dual_error_max":1,"dual_error_tot":1,"dual_farka":1,"dual_norm_max":1,"dual_norm_tot":1,"dual_normalized_error":1,"dual_object":1,"dual_pi_bound_error_max":1,"dual_pi_bound_error_tot":1,"dual_pricing_const":[0,1],"dual_reduced_cost_bound_error_max":1,"dual_reduced_cost_bound_error_tot":1,"dualfarka":[0,1],"duality_gap":1,"dualopt":[0,1],"dualwrit":[0,1],"due":0,"duplic":1,"dure":[0,1],"dynam":[0,1],"e":[0,1],"earli":0,"edg":1,"edit":2,"ee":1,"effect":0,"effici":1,"effort":1,"effort_level":1,"effortlevel":[0,1],"egl":1,"eight":1,"either":[0,1,2],"elaps":0,"element":0,"elimin":0,"els":1,"emb":0,"embed":0,"embwrit":[0,1],"emit":1,"empti":[0,1],"empty_problem":1,"enabl":0,"encapsul":[0,1],"end":[0,1,3],"enforc":0,"enter":[0,1],"entir":[0,1],"entri":[0,1],"enum":1,"enumer":1,"env":[0,1],"env_lp_ptr":1,"environ":[0,1,2,3],"ep":1,"epsilon":[0,1],"equal":[0,1,2],"equilibr":1,"equival":[0,1],"errcod":1,"error":[0,1],"error_ax_b_max":1,"error_ax_b_tot":1,"error_chnl_idx":[0,1],"error_fil":[0,1],"error_xqx_dx_f_max":1,"error_xqx_dx_f_tot":1,"errorchannelmessag":[0,3],"errorcod":0,"especi":1,"estim":0,"estimated_du":1,"etc":[0,1],"evalu":0,"even":[0,1],"event":1,"everi":[0,1],"exact":0,"exact_kappa":1,"examin":0,"exampl":[0,1],"exc_typ":0,"exc_valu":0,"exceed":1,"except":[1,3],"exchang":[0,1],"exclud":1,"execut":[0,1],"exist":[0,1],"exit":0,"exit_cut_loop":0,"explan":[0,1],"explicit":0,"explor":0,"expos":1,"express":1,"extens":0,"extern":[0,1],"extra_msg":1,"extract":[0,1],"extrem":2,"f":[0,1],"fact":1,"fail":0,"fail_feas":1,"fail_feasible_no_tre":1,"fail_infeas":1,"fail_infeasible_no_tre":1,"fals":[0,1],"familiar":2,"far":[0,1],"farka":1,"fast":1,"fast_getcolnam":[0,1],"fast_getmipstartnam":[0,1],"fast_getobj":[0,1],"fast_getrow":[0,1],"fast_getrownam":[0,1],"fast_getsosnam":[0,1],"fast_multiobjgetabstol":[0,1],"fast_multiobjgetobj":[0,1],"fast_multiobjgetoffset":[0,1],"fast_multiobjgetprior":[0,1],"fast_multiobjgetreltol":[0,1],"fast_multiobjgetweight":[0,1],"fast_newcol":[0,1],"fathom":0,"fea":1,"feasibility_status":0,"feasibilitystatus":[0,3],"feasibl":[0,1],"feasible_relaxed_inf":1,"feasible_relaxed_quad":1,"feasible_relaxed_sum":1,"feasopt":[0,1,3],"feasopt_mode_const":[0,1],"feasoptconstrainttyp":[0,1],"feasoptext":[0,1],"feasoptinterfac":[0,1],"featur":0,"ff":[0,1],"file":[0,1],"file_const":[0,1],"filenam":[0,1],"fileobj":1,"filetyp":[0,1],"filter":[0,1],"filtertyp":[0,1],"final":1,"find":[0,1],"finish":0,"finitlock":[0,1],"first":[0,1],"first_ord":1,"firstin_firstout":1,"five":1,"fix":1,"fixed_milp":[0,1],"fixed_miqp":[0,1],"fixed_parameters_and_valu":1,"fixedmilp":1,"fixpack":[0,1],"fixparam":[0,1],"flag":[0,1],"fledg":2,"float":[0,1],"float_info":1,"flow_cov":[0,1],"flow_path":[0,1],"flt":1,"fltwrite":[0,1],"flush":[0,1],"fn":[0,1],"follow":[0,1,2],"forc":[0,1],"forcibl":1,"form":[0,1],"format":[0,1],"formul":[0,1],"formula":1,"found":[0,1],"four":[0,1],"fpheur_const":[0,1],"fraction":[0,1],"free":[0,1],"free_chbmat":[0,1],"free_lazy_constraint":1,"free_nonbas":1,"free_user_cut":1,"freelazyconstraint":[0,1],"freepresolv":[0,1],"freeprob":[0,1],"freeusercut":[0,1],"friend":0,"ftran":[0,1],"full":[0,1,2],"full_path_to_this_cplex_studio_instal":2,"full_steep":1,"function":[0,1,2],"functor":0,"futur":0,"g":[0,1],"gap":[0,1],"general":0,"general_sc":1,"generat":[0,1],"generic":0,"genericcb":0,"get":[0,1,3],"get_abort":[0,3],"get_abstol":1,"get_activity_level":1,"get_al":1,"get_basi":1,"get_basic_col_index":1,"get_basic_row_index":1,"get_basis_dual_norm":1,"get_best_object":1,"get_best_objective_valu":0,"get_bound":1,"get_branch":0,"get_branch_typ":0,"get_branch_vari":0,"get_candidate_object":0,"get_candidate_point":0,"get_candidate_ray":0,"get_candidate_sourc":0,"get_chang":1,"get_coeffici":1,"get_col":1,"get_col_status":1,"get_compl":1,"get_cplex_status":0,"get_current_node_depth":0,"get_cutoff":[0,1],"get_default_valu":1,"get_definit":1,"get_depth":0,"get_dettim":[0,1,3],"get_diverging_index":1,"get_diversity_filt":1,"get_double_info":0,"get_driebeek_penalti":1,"get_dual_infeas":0,"get_dual_norm":1,"get_dual_objective_valu":0,"get_dual_valu":1,"get_effort_level":1,"get_end_dettim":0,"get_end_tim":0,"get_estimated_objective_valu":0,"get_feas":0,"get_float_qu":[0,1],"get_global_lower_bound":0,"get_global_upper_bound":0,"get_gradi":1,"get_group":1,"get_head":1,"get_histogram":1,"get_id":[0,3],"get_incumb":0,"get_incumbent_linear_slack":0,"get_incumbent_nod":1,"get_incumbent_object":0,"get_incumbent_objective_valu":0,"get_incumbent_quadratic_slack":0,"get_incumbent_valu":0,"get_indic":1,"get_indicator_slack":1,"get_indicator_vari":1,"get_infeasibility_sum":0,"get_info":1,"get_int_info":0,"get_integer_qu":1,"get_linear":[0,1],"get_linear_compon":1,"get_linear_num_nonzero":1,"get_linear_reduced_costs_from_pi":1,"get_linear_slack":[0,1],"get_linear_slacks_from_x":1,"get_local_lower_bound":0,"get_local_upper_bound":0,"get_long_info":0,"get_lower_bound":[0,1],"get_mean_objective_valu":1,"get_method":1,"get_mip_relative_gap":[0,1],"get_nam":1,"get_native_int":[0,1],"get_node_data":0,"get_node_id":0,"get_node_numb":0,"get_num":[0,1],"get_num_barrier_iter":1,"get_num_binari":1,"get_num_branch":0,"get_num_col":0,"get_num_conflict_pass":1,"get_num_cor":[0,1,3],"get_num_cut":[0,1],"get_num_dual_exchang":[0,1],"get_num_dual_push":[0,1],"get_num_dual_superbas":1,"get_num_entri":1,"get_num_group":1,"get_num_infeas":0,"get_num_integ":1,"get_num_iter":[0,1],"get_num_lazy_constraint":1,"get_num_memb":1,"get_num_nod":0,"get_num_nodes_process":1,"get_num_nodes_remain":1,"get_num_nonzero":1,"get_num_phase_one_iter":1,"get_num_primal_exchang":[0,1],"get_num_primal_push":[0,1],"get_num_primal_superbas":1,"get_num_quadratic_constraint":0,"get_num_quadratic_nonzero":1,"get_num_quadratic_vari":1,"get_num_remaining_nod":0,"get_num_replac":1,"get_num_row":0,"get_num_semicontinu":1,"get_num_semiinteg":1,"get_num_sifting_iter":1,"get_num_sifting_phase_one_iter":1,"get_num_solv":1,"get_num_superbas":0,"get_num_user_cut":1,"get_objective_coeffici":0,"get_objective_valu":[0,1],"get_objval_by_prior":1,"get_offset":1,"get_parameter_set":[0,3],"get_presolved_col_status":1,"get_presolved_row_status":1,"get_primal_infeas":0,"get_primal_norm":1,"get_prior":1,"get_problem_nam":[0,3],"get_problem_typ":[0,3],"get_progress":0,"get_protect":1,"get_pseudo_cost":0,"get_quad_num_nonzero":1,"get_quadrat":1,"get_quadratic_activity_level":1,"get_quadratic_coeffici":1,"get_quadratic_compon":1,"get_quadratic_dualslack":1,"get_quadratic_indefinite_certif":1,"get_quadratic_reduced_costs_from_pi":1,"get_quadratic_slack":[0,1],"get_quadratic_slacks_from_x":1,"get_quality_metr":1,"get_range_filt":1,"get_range_valu":1,"get_ray":1,"get_reduced_cost":1,"get_relaxation_object":0,"get_relaxation_point":0,"get_relaxation_status":0,"get_reltol":1,"get_rh":1,"get_row":1,"get_row_status":1,"get_sens":1,"get_set":1,"get_solution_sourc":0,"get_solution_typ":1,"get_sos_feas":0,"get_sos_feasibilti":0,"get_start":1,"get_start_dettim":0,"get_start_tim":0,"get_stat":[0,3],"get_status":[0,1],"get_status_str":1,"get_subproblem_status":1,"get_thread_num":0,"get_tim":[0,1,3],"get_typ":1,"get_upper_bound":[0,1],"get_valu":[0,1],"get_vari":1,"get_vers":[0,1,3],"get_versionnumb":[0,1,3],"get_weight":1,"get_wherefrom":[0,1],"getax":[0,1],"getbaritcnt":[0,1],"getbas":[0,1],"getbasednorm":[0,1],"getbestobjv":[0,1],"getbhead":[0,1],"getcallbackincumb":[0,1],"getcallbacknodeinfo":[0,1],"getcallbacknodeintfea":[0,1],"getcallbacknodelb":[0,1],"getcallbacknodeobjv":[0,1],"getcallbacknodeub":[0,1],"getcallbacknodex":[0,1],"getcallbackpseudocost":[0,1],"getcallbackseqinfo":[0,1],"getcallbacksosinfo":[0,1],"getchannel":[0,1],"getcoef":[0,1],"getcol":[0,1],"getcolindex":[0,1],"getcolinfea":[0,1],"getcolnam":[0,1],"getconflictext":[0,1],"getconflictgroup":[0,1],"getconflictnumgroup":[0,1],"getconflictnumpass":[0,1],"getcrossdexchcnt":[0,1],"getcrossdpushcnt":[0,1],"getcrosspexchcnt":[0,1],"getcrossppushcnt":[0,1],"getctyp":[0,1],"getcutoff":[0,1],"getdblanno":[0,1],"getdblannodefv":[0,1],"getdblannoindex":[0,1],"getdblannonam":[0,1],"getdblparam":[0,1],"getdblqual":[0,1],"getdettim":[0,1],"getdj":[0,1],"getdnorm":[0,1],"getdsbcnt":[0,1],"geterrorstr":[0,1],"getgrad":[0,1],"gethist":[0,1],"getijdiv":[0,1],"getijrow":[0,1],"getindconstr":[0,1],"getindconstr_const":[0,1],"getindconstrindex":[0,1],"getindconstrinfea":[0,1],"getindconstrnam":[0,1],"getindconstrslack":[0,1],"getindexfunc":1,"getintparam":[0,1],"getintqu":[0,1],"getitcnt":[0,1],"getlb":[0,1],"getlonganno":[0,1],"getlongannodefv":[0,1],"getlongannoindex":[0,1],"getlongannonam":[0,1],"getlongparam":[0,1],"getmethod":[0,1],"getmipitcnt":[0,1],"getmiprelgap":[0,1],"getmipstart":[0,1],"getmipstartindex":[0,1],"getmipstartnam":[0,1],"getmipstarts_effort":[0,1],"getmipstarts_s":[0,1],"getnodecnt":[0,1],"getnodeint":[0,1],"getnodeleftcnt":[0,1],"getnumbin":[0,1],"getnumcol":[0,1],"getnumcor":[0,1],"getnumcut":[0,1],"getnumdblanno":[0,1],"getnumindconstr":[0,1],"getnumint":[0,1],"getnumlonganno":[0,1],"getnummipstart":[0,1],"getnumnz":[0,1],"getnumobj":[0,1],"getnumprio":[0,1],"getnumpwl":[0,1],"getnumqconstr":[0,1],"getnumqpnz":[0,1],"getnumquad":[0,1],"getnumrow":[0,1],"getnumsemicont":[0,1],"getnumsemiint":[0,1],"getnumso":[0,1],"getobj":[0,1],"getobjnam":[0,1],"getobjoffset":[0,1],"getobjsen":[0,1],"getobjv":[0,1],"getord":[0,1],"getparamtyp":[0,1],"getphase1cnt":[0,1],"getpi":[0,1],"getpnorm":[0,1],"getprestat_c":[0,1],"getprestat_oc":[0,1],"getprestat_or":[0,1],"getprestat_r":[0,1],"getprestat_status":[0,1],"getprobnam":[0,1],"getprobstat":[0,1],"getprobtyp":[0,1],"getprotect":[0,1],"getpsbcnt":[0,1],"getpwl":[0,1],"getpwlindex":[0,1],"getpwlnam":[0,1],"getqconstr_info":[0,1],"getqconstr_lin":[0,1],"getqconstr_quad":[0,1],"getqconstrdslack":[0,1],"getqconstrindex":[0,1],"getqconstrinfea":[0,1],"getqconstrnam":[0,1],"getqconstrslack":[0,1],"getqpcoef":[0,1],"getquad":[0,1],"getqualitymetr":[0,1],"getray":[0,1],"getrh":[0,1],"getrngval":[0,1],"getrow":[0,1],"getrowindex":[0,1],"getrowinfea":[0,1],"getrownam":[0,1],"getsens":[0,1],"getsiftitcnt":[0,1],"getsiftphase1cnt":[0,1],"getslack":[0,1],"getso":[0,1],"getsolnpooldblqu":[0,1],"getsolnpooldivfilt":[0,1],"getsolnpooldivfilter_const":[0,1],"getsolnpoolfilterindex":[0,1],"getsolnpoolfilternam":[0,1],"getsolnpoolfiltertyp":[0,1],"getsolnpoolintqu":[0,1],"getsolnpoolmeanobjv":[0,1],"getsolnpoolnumfilt":[0,1],"getsolnpoolnumreplac":[0,1],"getsolnpoolnumsoln":[0,1],"getsolnpoolobjv":[0,1],"getsolnpoolqconstrslack":[0,1],"getsolnpoolrngfilt":[0,1],"getsolnpoolrngfilter_const":[0,1],"getsolnpoolslack":[0,1],"getsolnpoolsolnindex":[0,1],"getsolnpoolsolnnam":[0,1],"getsolnpoolx":[0,1],"getsos_info":[0,1],"getsosindex":[0,1],"getsosinfea":[0,1],"getsosnam":[0,1],"getstat":[0,1],"getstatstr":[0,1],"getstrparam":[0,1],"getsubstat":[0,1],"gettim":[0,1],"getub":[0,1],"getx":[0,1],"getxqxax":[0,1],"ggll":1,"give":[0,1],"given":[0,1],"global":0,"global_progress":0,"gnu":[0,2],"goodlist":1,"grace":0,"grad":1,"greater":[0,1],"group":[0,1],"group_status":1,"grpbeg":1,"grpind":1,"grppref":1,"grptype":1,"guarante":0,"gub_cov":[0,1],"guid":1,"gz":0,"half":1,"handl":[0,1],"happen":0,"has_incumb":0,"has_nam":[0,1],"has_non_default_lb":[0,1],"has_non_default_ub":[0,1],"has_problem":1,"head":1,"header":1,"help":1,"heurist":[0,1],"heuristic_solut":0,"heuristiccallback":[0,3],"hidden_feas":1,"hierarchi":[0,1],"higher":2,"histogram":[0,1],"howev":[0,1],"hscallback":[0,3],"huge":0,"human":[0,1],"hybbaropt":[0,1],"hybnetopt":[0,1],"i0":1,"i1":1,"i2":1,"i3":1,"i4":1,"i5":1,"i6":1,"i7":1,"i8":1,"i9":1,"ibmdecisionoptim":2,"iconstraint":1,"id":[0,1],"ide":2,"ident":[0,1],"identifi":[0,1],"idl":2,"idx":[0,1],"idx1":1,"idx2":1,"if_":1,"if_poss":1,"iff":1,"ignor":[0,1],"ii":1,"immedi":[0,1],"implement":0,"impli":[0,1],"implied_bound":[0,1],"implied_feas":0,"impliedfeas":0,"import":[0,1],"in_branch":0,"in_candid":0,"in_global_progress":0,"in_local_progress":0,"in_relax":0,"in_thread_down":0,"in_thread_up":0,"includ":[0,1,2],"inclus":[0,1],"incumb":[0,1],"incumbentcallback":[0,3],"ind":[0,1],"ind1":[0,1],"ind2":[0,1],"indcnt":1,"indefinit":1,"independ":1,"index":[0,1],"indexerror":1,"indic":[0,1],"indicator_constraint":[0,1,3],"indicator_slack_bound_error_max":1,"indicator_slack_bound_error_tot":1,"indicatorconstraintinterfac":[0,1],"indicatortyp":[0,1],"individu":[0,1],"indtyp":1,"indvar":1,"infeas":[0,1],"infeas_const":1,"infeas_estim":1,"infeasibilityinterfac":[0,1],"infeasible_or_unbound":1,"infer":0,"infin":[0,1,3],"infinit":0,"info":0,"infodblparam":[0,1],"infointparam":[0,1],"infolongparam":[0,1],"inform":[0,1,2],"infostrparam":[0,1],"init_list_arg":[0,1],"initi":1,"initialinterfac":[0,1],"initlock":[0,1],"input":[0,1],"instal":[0,2],"instanc":[0,1,2],"instanti":[0,1,2],"instead":[0,1],"instruct":[0,1],"int":1,"int_info":1,"int_param_valu":1,"integ":[0,1],"integer_feas":1,"integr":[0,1],"integrality_error_max":1,"integrality_error_tot":1,"intend":0,"interact":[0,1,2],"interfac":[0,1,2],"interfer":[0,1],"interfere_crush":1,"interfere_uncrush":1,"intern":[0,1],"interpret":[0,1,2],"interv":1,"invalid":0,"invers":1,"invert":1,"invoc":0,"invok":[0,1],"involv":[0,1],"is_abort":[0,3],"is_after_cut_loop":0,"is_candidate_point":0,"is_candidate_ray":0,"is_dual_feas":[0,1],"is_integer_feas":0,"is_primal_feas":[0,1],"is_row_index":1,"is_unbounded_nod":0,"ismultiobj":[0,1],"isn":1,"issu":0,"issueid":0,"isvalid":[0,3],"it_limit":1,"item":[0,1],"iter":[0,1],"ith":1,"itlim":1,"j":[0,1],"jenter":1,"jleav":1,"just":[0,1],"kappa":1,"kappa_attent":[0,1],"kappa_illpos":[0,1],"kappa_max":[0,1],"kappa_st":[0,1],"kappa_suspici":[0,1],"kappa_unst":[0,1],"kappastats_const":[0,1],"key":[0,1],"keyword":1,"know":[0,1],"known":[0,1,2],"l":[0,1],"land":2,"languag":[0,2],"larg":[0,1],"last":[0,1],"later":[0,1],"lazi":[0,1],"lazyconstraintcallback":[0,3],"lb":[0,1],"lconstraint":1,"least":[0,1],"leav":1,"leavestat":1,"left":1,"lefthand":[0,1],"legaci":0,"len":[0,1],"length":[0,1],"less":[0,1],"level":[1,2],"lexicograph":1,"lhs":1,"librari":[0,1,2],"lift_and_project":[0,1],"like":[0,1,2],"limit":[0,1,2],"limitedsolv":1,"lin":1,"lin_expr":1,"line":1,"linear":[0,1],"linear_const":[0,1],"linear_constraint":[0,1,2,3],"linearconstraintinterfac":[0,1],"linind":1,"linmat":1,"linux":2,"linval":1,"list":[0,1],"listifi":[0,1],"ll":[0,1],"local":[0,1],"local_implied_bound":1,"local_progress":0,"lock":1,"log":[0,1],"log_chnl_idx":[0,1],"log_fil":[0,1],"logarithm":1,"logic":0,"lolmat":1,"long":1,"long_annot":[0,1,3],"long_info":1,"longannotationinterfac":[0,1],"longer":[0,1],"loop":[0,1],"lot":0,"low":2,"lower":[0,1],"lower_bound":1,"lower_bound_constraint":1,"lp":[0,1],"lp_all":1,"lp_at_nod":1,"lp_root":1,"lp_str":0,"lpex":[0,1],"lpex1":0,"lpex4":0,"lpmethod":1,"lpopt":[0,1],"lu":1,"lz1":1,"lz2":1,"lz3":1,"m":1,"m1":1,"m2":1,"m3":1,"m4":1,"mac":2,"machin":[0,1],"magnitud":0,"main":0,"make":[0,1,2],"make_branch":0,"make_cplex_branch":0,"make_group":[0,1],"make_rang":[0,1],"manag":0,"mani":[0,1],"manner":1,"manual":[0,1],"map":1,"mark":[0,1],"master":1,"matbeg":[0,1],"match":1,"matcnt":[0,1],"mathemat":2,"matind":[0,1],"matrix":[0,1],"matrix_convers":1,"matval":[0,1],"max":1,"max_arg_length":[0,1],"max_ax_minus_b":1,"max_bound_infea":1,"max_c_minus_bpi":1,"max_comp_slack":1,"max_dual_infeas":1,"max_dual_residu":1,"max_ind":0,"max_indicator_rh":0,"max_indicator_slack_infeas":1,"max_infeas":1,"max_int_infeas":1,"max_kappa":1,"max_lazy_constraint":0,"max_lazy_constraint_rh":0,"max_linear_constraint":0,"max_linear_constraints_rh":0,"max_linear_object":0,"max_linear_rang":0,"max_num":1,"max_pi":1,"max_primal_infeas":1,"max_primal_residu":1,"max_pwl_slack_infeas":1,"max_quadrat":0,"max_quadratic_linear":0,"max_quadratic_object":0,"max_quadratic_primal_residu":1,"max_quadratic_rh":0,"max_quadratic_slack":1,"max_quadratic_slack_infeas":1,"max_reduced_cost":1,"max_reduced_cost_infea":1,"max_scaled_ax_minus_b":1,"max_scaled_bound_infea":1,"max_scaled_c_minus_bpi":1,"max_scaled_dual_infeas":1,"max_scaled_dual_residu":1,"max_scaled_pi":1,"max_scaled_primal_infeas":1,"max_scaled_primal_residu":1,"max_scaled_reduced_cost":1,"max_scaled_reduced_cost_infea":1,"max_scaled_slack":1,"max_scaled_x":1,"max_slack":1,"max_upper_bound":0,"max_user_cut":0,"max_user_cut_rh":0,"max_x":1,"maxim":[0,1],"maximum":1,"maxormin":1,"maxval":1,"may":[0,1],"mbasewrit":[0,1],"mdleav":[0,1],"mean":[0,1],"meaning":[0,1],"meant":[0,1],"measur":[0,1],"measure_const":[0,1],"mem_limit_feas":1,"mem_limit_infeas":1,"member":[0,1],"memori":[0,1],"messag":0,"method":[0,1,2],"methodtyp":[0,3],"metric":[0,1],"middl":1,"mild":1,"milp":[0,1],"min":1,"min_ind":0,"min_indicator_rh":0,"min_inf":1,"min_infeas":1,"min_lazy_constraint":0,"min_lazy_constraint_rh":0,"min_linear_constraint":0,"min_linear_constraints_rh":0,"min_linear_object":0,"min_linear_rang":0,"min_lower_bound":0,"min_quad":1,"min_quadrat":0,"min_quadratic_linear":0,"min_quadratic_object":0,"min_quadratic_rh":0,"min_sum":1,"min_user_cut":0,"min_user_cut_rh":0,"minim":[0,1],"minimum":1,"minmax":1,"mip":[0,1],"mip_abort_feas":1,"mip_abort_infeas":1,"mip_dettime_limit_feas":1,"mip_dettime_limit_infeas":1,"mip_display_const":[0,1],"mip_emph_const":[0,1],"mip_feas":1,"mip_feasible_relaxed_inf":1,"mip_feasible_relaxed_quad":1,"mip_feasible_relaxed_sum":1,"mip_infeas":1,"mip_infeasible_or_unbound":1,"mip_interval_nod":1,"mip_optim":1,"mip_optimal_infeas":1,"mip_optimal_relaxed_inf":1,"mip_optimal_relaxed_quad":1,"mip_optimal_relaxed_sum":1,"mip_start":[0,1,3],"mip_start_solut":0,"mip_time_limit_feas":1,"mip_time_limit_infeas":1,"mip_unbound":1,"mipcallback":[0,3],"mipex4":0,"mipgap":1,"mipinfocallback":[0,3],"mipopt":[0,1],"mipsolutioninterfac":[0,1],"mipstart_solut":0,"mipstartindex":1,"mipstartindic":1,"mipstartnam":1,"mipstartsinterfac":[0,1],"miqcp":[0,1],"miqcp_const":[0,1],"miqp":[0,1],"mir":[0,1],"misi":1,"mix":[0,1],"mixtur":1,"mm":[0,1],"mo1":1,"mode":0,"model":[0,1,2],"model_info":3,"modelasstcallbacksetfunc":[0,1],"modelasstcb":0,"moder":1,"modif":[0,1],"modifi":[0,1,2],"modul":[2,3],"more_aggress":1,"mov":1,"move":1,"mp":2,"mps":[0,1],"mst":1,"mst0":1,"mst1":1,"mst2":1,"mst3":1,"mst4":1,"mst5":1,"mst6":1,"mst7":1,"mst8":1,"mst9":1,"multi":[0,1],"multi_commodity_flow":[0,1],"multiobj":[0,1,3],"multiobj_infeas":1,"multiobj_inforunbd":1,"multiobj_non_optim":1,"multiobj_optim":1,"multiobj_stop":1,"multiobj_unbound":1,"multiobjchgattrib":[0,1],"multiobject":1,"multiobjfloatinfo":[0,1],"multiobjgetdblinfo":[0,1],"multiobjgetindex":[0,1],"multiobjgetintinfo":[0,1],"multiobjgetlonginfo":[0,1],"multiobjgetnam":[0,1],"multiobjgetnumsolv":[0,1],"multiobjgetobj":[0,1],"multiobjgetobjv":[0,1],"multiobjgetobjvalbyprior":[0,1],"multiobjinterfac":[0,1],"multiobjintinfo":[0,1],"multiobjlonginfo":[0,1],"multiobjopt":[0,1],"multiobjsetobj":[0,1],"multiobjsolninterfac":[0,1],"multipl":[0,1],"multiple_parti":1,"multiple_partial_with_sort":1,"multipli":1,"must":[0,1],"my_quad":1,"mymipinfocallback":0,"n":[0,1],"name":[0,1,2],"nan":1,"nb":1,"nbreak":1,"ncut":1,"necessari":[0,1],"necessarili":[0,1],"need":0,"negat":1,"neither":1,"nested_dissect":1,"network":[0,1],"network_display_const":[0,1],"network_netfind_const":[0,1],"network_pricing_const":[0,1],"never":0,"new":[0,1],"new_native_int":[0,1],"new_root_cut":1,"newcol":[0,1],"newdblanno":[0,1],"newli":0,"newlonganno":[0,1],"newnam":1,"newrow":[0,1],"newvalu":1,"next":0,"nice":0,"no_check":1,"no_reduct":1,"no_solv":0,"no_vari":1,"node":[0,1],"node_cut":1,"node_data":0,"node_limit_feas":1,"node_limit_infeas":1,"node_lp":[0,1],"node_qcp":[0,1],"node_qp":[0,1],"node_solut":0,"nodecallback":[0,3],"nodeest":1,"nodeindex":1,"nodelp":1,"nodeqcp":1,"nodeqp":1,"nodesel_const":[0,1],"non":[0,1],"non_bas":1,"nonbas":1,"nondefault":[0,1],"none":[0,1],"nonneg":1,"nonzero":[0,1],"nonzero_discrete_vari":1,"nonzero_vari":1,"noopstream":0,"norm":1,"norm_max":1,"norm_tot":1,"normal":[0,1],"normalized_error_max":1,"notat":1,"note":[0,1],"notimplementederror":1,"null":1,"num":1,"num_barrier_iter":1,"num_best":1,"num_binari":0,"num_box":0,"num_cor":0,"num_degenerate_iter":1,"num_dual_exchang":1,"num_dual_push":1,"num_exch":1,"num_fix":0,"num_fre":0,"num_indicator_compl":0,"num_indicator_constraint":0,"num_indicator_equ":0,"num_indicator_great":0,"num_indicator_less":0,"num_indicator_nz":0,"num_indicator_rhs_nz":0,"num_integ":0,"num_it":1,"num_iter":1,"num_lazy_constraint":0,"num_lazy_eq":0,"num_lazy_gt":0,"num_lazy_lt":0,"num_lazy_nnz":0,"num_lazy_rhs_nnz":0,"num_linear_constraint":0,"num_linear_equ":0,"num_linear_great":0,"num_linear_less":0,"num_linear_nz":0,"num_linear_objective_nz":0,"num_linear_rang":0,"num_linear_rhs_nz":0,"num_nod":1,"num_nodes_left":1,"num_nonneg":0,"num_object":0,"num_oth":0,"num_phase1_iter":1,"num_primal_exchang":1,"num_primal_push":1,"num_push":1,"num_pwl_break":0,"num_pwl_constraint":0,"num_quadratic_constraint":0,"num_quadratic_great":0,"num_quadratic_less":0,"num_quadratic_linear_nz":0,"num_quadratic_nz":0,"num_quadratic_objective_nz":0,"num_quadratic_rhs_nz":0,"num_quadratic_vari":0,"num_semicontinu":0,"num_semiinteg":0,"num_sifting_iter":1,"num_sifting_phase1_iter":1,"num_solut":1,"num_sos1":0,"num_sos1_memb":0,"num_sos2":0,"num_sos2_memb":0,"num_sos_constraint":0,"num_user_cut":0,"num_user_cuts_eq":0,"num_user_cuts_gt":0,"num_user_cuts_lt":0,"num_user_cuts_nnz":0,"num_user_cuts_rhs_nnz":0,"num_vari":0,"number":[0,1,2],"numcol":[0,1],"numer":0,"numobj":1,"numparamet":[0,1],"numrow":[0,1],"nzcnt":1,"o":1,"obj":[0,1],"obj1":1,"obj_and_fea":1,"obj_val":1,"object":[0,1,2,3],"object_typ":[0,1],"objective_estim":0,"objective_gap":1,"objective_valu":0,"objectiveinterfac":[0,1],"objidx":1,"objind":1,"objnam":1,"objsa":[0,1],"objsens":[0,1],"objtyp":[0,1],"objval":1,"obtain":0,"occur":[0,1],"off_on_const":[0,1],"offer":2,"offset":1,"often":0,"old_cpx":0,"omit":0,"onc":[0,1],"one":[0,1],"onli":[0,1,2],"only_linear":1,"onlyif":1,"open":[0,1],"opencplex":[0,1],"oper":[0,1,2],"opportun":0,"opportunist":1,"opposit":1,"opt_inf":1,"opt_quad":1,"opt_sum":1,"optim":[0,1,2],"optimal_convex":1,"optimal_face_unbound":1,"optimal_glob":1,"optimal_infeas":1,"optimal_popul":1,"optimal_populated_toler":1,"optimal_relaxed_inf":1,"optimal_relaxed_quad":1,"optimal_relaxed_sum":1,"optimal_toler":1,"optimalitytarget_const":[0,1],"optimizationcallback":[0,3],"option":[0,1],"order":[0,1,3],"orderinterfac":[0,1],"ordertype_const":[0,1],"ordwrit":[0,1],"orient":[1,2],"origin":[0,1],"otherwis":[0,1,2],"outcom":1,"output":[0,1],"overhead":1,"overrid":[0,1],"overridden":0,"overview":0,"overwrit":[0,1],"p":1,"pack_env_lp_ptr":[0,1],"packag":3,"page":2,"pair":[0,1],"pair_of_list":1,"par_const":[0,1],"parallel":0,"param":0,"param_nam":1,"paramet":[0,1,3],"parametergroup":[0,1],"parameterset":[0,1,3],"paramnum":1,"paramset":[1,3],"paramsetadd":[0,1],"paramsetadddbl":[0,1],"paramsetaddint":[0,1],"paramsetaddlong":[0,1],"paramsetaddstr":[0,1],"paramsetappli":[0,1],"paramsetcopi":[0,1],"paramsetcr":[0,1],"paramsetdel":[0,1],"paramsetfre":[0,1],"paramsetget":[0,1],"paramsetgetdbl":[0,1],"paramsetgetid":[0,1],"paramsetgetint":[0,1],"paramsetgetlong":[0,1],"paramsetgetnum":[0,1],"paramsetgetstr":[0,1],"paramsetreadcopi":[0,1],"paramsetwrit":[0,1],"paramtyp":1,"parent":[0,1],"part":[1,2],"partial":[0,1],"particular":[0,1],"partit":1,"pass":[0,1],"pct_kappa_illpos":1,"pct_kappa_st":1,"pct_kappa_suspici":1,"pct_kappa_unst":1,"penalized_objective_valu":1,"penalti":1,"perform":[0,1],"pertain":1,"perturb":0,"pfea":1,"pgradient":1,"phase":0,"pi":1,"piecewis":1,"piecewise_linear_error_max":1,"piecewise_linear_error_tot":1,"pind":1,"pip":2,"pivot":[0,1],"pivot_fixed_variables_out":1,"pivot_in":1,"pivot_out":1,"pivot_slacks_in":1,"pivotin":[0,1],"pivotout":[0,1],"pivotvarstatus":[0,1],"place":0,"plane":0,"platform":2,"plus":0,"pnorm":1,"point":[0,1],"pool":[0,1],"popul":[0,1],"populate_solution_limit":1,"populate_solution_pool":[0,1,3],"posit":1,"possibl":0,"possible_memb":1,"post":[0,1],"post_heuristic_solut":[0,1],"postslop":1,"potenti":0,"ppe":0,"pperwrit":[0,1],"practic":0,"pre_formula":1,"pre_pi":1,"pre_x":1,"preaddrow":[0,1],"prechgobj":[0,1],"prefer":1,"prepi":1,"preprocess":[0,1],"prered_const":[0,1],"prereform_const":[0,1],"presenc":0,"present":0,"preslop":1,"preslvwrit":[0,1],"presolv":[0,1,3],"presolve_const":[0,1],"presolvecallback":1,"presolvecolstatus":[0,1],"presolveinterfac":[0,1],"presolvemethod":[0,1],"presolverowstatus":[0,1],"presolvestatus":[0,1],"prevent":1,"previous":[0,1],"prex":1,"primal":[0,1],"primal_and_du":1,"primal_error_max":1,"primal_error_tot":1,"primal_norm_max":1,"primal_norm_tot":1,"primal_normalized_error":1,"primal_object":1,"primal_pricing_const":[0,1],"primal_slack_bound_error_max":1,"primal_slack_bound_error_tot":1,"primal_x_bound_error_max":1,"primal_x_bound_error_tot":1,"primopt":[0,1],"print":[0,1],"prior":0,"prioriti":1,"prm":0,"prob1":0,"probe":1,"problem":[0,1,2],"problem_typ":[0,3],"problemtyp":[0,1,3],"probnam":1,"probtyp":1,"procedur":1,"proceed":0,"process":[0,1],"program":[0,1,2],"progress":[0,1],"progressinterfac":[0,1],"project":1,"proof":1,"propag":1,"proper":[0,1],"protect":1,"prove":1,"proven":1,"provid":[0,1,2],"prune":0,"prune_current_nod":0,"ps":[0,1],"pseudo":0,"pseudo_cost":1,"pseudo_reduced_cost":1,"public":[0,1],"pure":1,"purg":0,"purgeabl":1,"purpos":0,"push":[0,1],"pval":1,"pwl":1,"pwl1":1,"pwl_constraint":[0,1,3],"pwlconstraintinterfac":[0,1],"py":0,"pylolmat_to_chbmat":[0,1],"pypi":2,"python":[0,1],"q":1,"q1":1,"q10":1,"q2":1,"q3":1,"q4":1,"q5":1,"q6":1,"q7":1,"q8":1,"q9":1,"qc1":1,"qc3":1,"qconstrslackfromx":[0,1],"qcp":[0,1],"qcp_at_nod":1,"qcpduals_const":[0,1],"qind":1,"qm":1,"qmatbeg":1,"qmatind":1,"qmatval":1,"qp":[0,1],"qp_alg_const":[0,1],"qpdjfrompi":[0,1],"qpindef":1,"qpindefcertif":[0,1],"qpopt":[0,1],"qreducedcost":1,"qsepvec":1,"qslack":1,"quad":1,"quad_expr":1,"quadcol":1,"quadrat":[0,1],"quadratic_constraint":[0,1,3],"quadratic_slack_bound_error_max":1,"quadratic_slack_bound_error_tot":1,"quadratically_constrain":1,"quadraticconstraintinterfac":[0,1],"quadrow":1,"quadval":1,"qual":1,"qualiti":[0,1],"quality_metr":[0,1],"quality_typ":1,"qualitymetr":[0,1,3],"queri":[0,1,2],"querri":1,"qx":1,"r":[0,1],"r_c":1,"rais":[0,1],"random":0,"randomse":1,"rang":[0,1],"range_valu":[0,1],"rather":[0,2],"ratio":1,"ray":[0,1],"rcnt":1,"rdual":1,"read":[0,1,2,3],"read_annot":[0,3],"read_basi":1,"read_fil":[0,1],"read_start":1,"readabl":[0,1],"readcopyanno":[0,1],"readcopybas":[0,1],"readcopymipstart":[0,1],"readcopyord":[0,1],"readcopyparam":[0,1],"readcopyprob":[0,1],"readcopysolnpoolfilt":[0,1],"readcopystartinfo":[0,1],"readlin":2,"real":[0,1],"reay":0,"recurs":0,"redlb":1,"redub":1,"reduc":[0,1],"reducedcost":1,"reduct":[0,1],"redund":1,"ref":1,"refer":[0,1],"refin":1,"refine_mip_start":1,"refineconflictext":[0,1],"refinemipstartconflictext":[0,1],"reflect":0,"reflection_sc":1,"reformul":[0,1],"regist":[0,1],"register_callback":[0,1,3],"regular":1,"reject":0,"reject_candid":0,"reject_candidate_loc":0,"relat":[0,1],"relationship":1,"relax":[0,1],"relaxation_flag":0,"relaxation_unbound":1,"relaxationflag":[0,3],"releas":[0,1],"reltol":1,"remain":[0,1],"remov":[0,1,2],"remove_abort":[0,3],"repair":1,"repeatpre_const":[0,1],"replac":1,"replace_const":[0,1],"replic":0,"report":0,"repres":[0,1],"represent":0,"requir":[0,1,2],"rescal":0,"reset":1,"resid":0,"resolv":0,"respect":[0,1],"rest":0,"restrict":0,"result":[0,1],"results_chnl_idx":[0,1],"results_fil":[0,1],"retain":0,"retreiv":1,"retriev":1,"return":[0,1],"rew":0,"rhs":[0,1],"rhssa":[0,1],"right":2,"righthand":[0,1],"rlcomplet":2,"rlist":1,"rlp":0,"rlt":1,"rmat":1,"rmatbeg":1,"rmatind":1,"rmatval":1,"rng":1,"rng0":1,"rngval":1,"root":0,"rootparametergroup":[0,1],"round":0,"routin":0,"row":[0,1],"row_complementarity_max":1,"row_complementarity_tot":1,"row_dual":1,"row_prim":1,"row_status":1,"rowindex":1,"rowlist":1,"rownam":[0,1],"rprim":1,"rr":[0,1],"rstat":1,"rule":0,"run":[1,2],"runse":[0,1,3],"runtim":[0,2],"s":[0,1],"s1":1,"s2":1,"sampl":1,"satisfi":1,"sav":0,"save":0,"scale":[0,1],"scale_const":[0,1],"scaled_cost":1,"script":2,"search":[0,1,2],"search_const":[0,1],"second":[0,1],"section":[0,1],"see":[0,1,2],"seed":0,"segment":1,"select":0,"select_nod":0,"self":[0,1],"semi":1,"semi_continu":1,"semi_integ":1,"sens":[0,1],"sensit":1,"sensitivityinterfac":[0,1],"sent":[0,1],"separ":[0,1],"separat":0,"seq":1,"seq_of_pair":1,"seq_of_tripl":0,"sequenc":[0,1],"sequence_of_pair":1,"serv":0,"set":[0,1],"set1":1,"set_abstol":1,"set_bound":0,"set_callback":[0,3],"set_coeffici":1,"set_definit":1,"set_error_stream":[0,1,3],"set_linear":1,"set_linear_compon":1,"set_log_stream":[0,1,3],"set_lower_bound":[0,1],"set_modeling_assistance_callback":[0,3],"set_nam":1,"set_native_int":[0,1],"set_node_data":0,"set_num":1,"set_object":1,"set_offset":1,"set_parameter_set":[0,3],"set_prior":1,"set_problem_nam":[0,3],"set_problem_typ":[0,3],"set_quadrat":1,"set_quadratic_coeffici":1,"set_range_valu":1,"set_reltol":1,"set_results_stream":[0,1,3],"set_rh":1,"set_sens":1,"set_solut":0,"set_start":[0,1],"set_status_check":[0,1],"set_typ":1,"set_upper_bound":1,"set_valu":[0,1],"set_warning_stream":[0,1,3],"set_weight":1,"setbranchcallbackfunc":[0,1],"setbranchnosolncallbackfunc":[0,1],"setdblanno":[0,1],"setdblparam":[0,1],"setdefault":[0,1],"setgenericcallbackfunc":[0,1],"setheuristiccallbackfunc":[0,1],"setincumbentcallbackfunc":[0,1],"setinfocallbackfunc":[0,1],"setintparam":[0,1],"setlazyconstraintcallbackfunc":[0,1],"setlonganno":[0,1],"setlongparam":[0,1],"setlpcallbackfunc":[0,1],"setmipcallbackfunc":[0,1],"setnetcallbackfunc":[0,1],"setnodecallbackfunc":[0,1],"setnumobj":[0,1],"setpydel":[0,1],"setsens":1,"setsolvecallbackfunc":[0,1],"setstrparam":[0,1],"settermin":[0,1],"settings_and_log":1,"settuningcallbackfunc":[0,1],"setup":0,"setusercutcallbackfunc":[0,1],"shall":0,"share":[0,1],"shortcut":0,"show":1,"showqual":[0,1],"side":[0,1],"sift":1,"sift_alg_const":[0,1],"siftopt":[0,1],"siginthandl":[0,1],"sign":0,"signatur":[0,1],"similar":1,"simpl":1,"simplex":[0,1],"simplexcallback":[0,3],"sinc":[0,1],"singl":[0,1],"site":2,"situat":0,"size":[1,2],"slack":[0,1],"slack_bound_error_max":1,"slack_bound_error_tot":1,"slackfromx":[0,1],"slice":1,"slope":1,"smaller":0,"sol":1,"sol_val":1,"soln":[0,1],"solninfo":[0,1],"solnpoolfilterinterfac":[0,1],"solnpoolinterfac":[0,1],"solut":[0,1,2,3],"solution_limit":1,"solution_nam":1,"solution_pool":[0,1],"solution_sourc":0,"solution_status":0,"solution_strategi":0,"solutioninterfac":[0,1],"solutionmethod":[0,1],"solutionsourc":[0,3],"solutionstatus":[0,1],"solutionstrategi":[0,1],"solutiontyp":[0,1],"solutiontype_const":[0,1],"solv":[0,1,2,3],"solve_dettim":0,"solve_fix":1,"solve_mip":1,"solve_tim":0,"solvecallback":[0,3],"solver":1,"solwrit":[0,1],"solwritesolnpool":[0,1],"solwritesolnpoolal":[0,1],"someslack":1,"someth":[0,1],"somev":1,"soon":0,"sos":[0,1,3],"sos1":[0,1],"sos10":1,"sos1reform_const":[0,1],"sos2":[0,1],"sos2reform_const":[0,1],"sos3":1,"sos4":1,"sos5":1,"sos6":1,"sos7":1,"sos8":1,"sos9":1,"sos_constraint":1,"sosbeg":1,"sosind":1,"sosindex":1,"sosinterfac":[0,1],"sosnam":1,"sostyp":[0,1],"soswt":1,"sourc":[0,1],"sourcep":1,"sp":1,"space":1,"spair":0,"spars":[0,1],"sparsepair":[0,1,3],"sparsetripl":[0,1,3],"special":[0,1],"specif":1,"specifi":[0,1],"specifif":1,"spent":0,"st":1,"stack":1,"stacklevel":1,"stamp":0,"standard":[1,2],"start":[0,1,3],"stat":[0,3],"statement":0,"statind":1,"statist":[0,1],"status":[0,1],"status_cod":1,"statuscheck":[0,1],"steep":1,"steep_q_start":1,"steepest":1,"still":0,"stop":0,"store":[0,1],"str":1,"str_param_valu":1,"strategi":[0,1],"stream":[0,1],"strengthen":1,"string":[0,1],"stripl":0,"strong":[0,1],"strong_branch":1,"strongbranch":[0,1],"strparamet":[0,1],"structur":[0,1],"stuff":0,"sub":1,"subalg_const":[0,1],"subclass":[0,1],"subinterfac":0,"submit":[0,1],"submodul":3,"subpackag":[2,3],"subprob":1,"subproblem":[0,1],"subsequ":[0,1],"subset":1,"subtract":0,"subtre":0,"success":1,"suggest":[0,2],"suitabl":[0,2],"sum":[0,1],"sum_comp_slack":1,"sum_dual_infeas":1,"sum_dual_residu":1,"sum_indicator_slack_infeas":1,"sum_integer_infeas":1,"sum_pi":1,"sum_primal_infeas":1,"sum_primal_residu":1,"sum_pwl_slack_infeas":1,"sum_quadratic_primal_residu":1,"sum_quadratic_slack":1,"sum_quadratic_slack_infeas":1,"sum_reduced_cost":1,"sum_scaled_dual_infeas":1,"sum_scaled_dual_residu":1,"sum_scaled_pi":1,"sum_scaled_primal_infeas":1,"sum_scaled_primal_residu":1,"sum_scaled_reduced_cost":1,"sum_scaled_slack":1,"sum_scaled_x":1,"sum_slack":1,"sum_x":1,"summari":0,"superbas":[0,1],"superclass":[0,1],"support":[0,2],"suppos":0,"suppress":[0,1],"sure":[1,2],"sym_const":[0,1],"symbol":0,"symmetr":1,"system":[1,2],"t":[0,1],"tab":2,"tabl":[0,1],"tableau":1,"take":[0,1],"taken":[0,1],"target":0,"targetp":1,"techniqu":0,"tell":0,"term":[0,1],"termin":[0,1],"test":[0,1],"test_al":1,"test_four":1,"test_on":1,"th":0,"themselv":0,"third":1,"thread":[0,1],"thread_down":0,"thread_up":0,"three":[0,1],"thus":[0,1],"tick":[0,1],"tight":1,"tighten":[0,1],"tighten_lower_bound":1,"tighten_upper_bound":1,"tightenbd":[0,1],"time":[0,1,2],"time_limit":1,"timestamp":1,"titl":1,"togeth":1,"toler":1,"top":[1,2],"topic":[0,1],"traceback":0,"tradit":1,"treat":[0,1],"tree":[0,1],"tripl":[0,1],"true":[0,1],"true_objective_valu":1,"tune":[0,1],"tune_display_const":[0,1],"tune_problem":1,"tune_problem_set":1,"tuneparam":[0,1],"tuneparamprobset":[0,1],"tuning_status":1,"tuningcallback":[0,3],"tuningconst":[0,1],"tupl":[0,1],"turn":[0,1],"two":[0,1,2],"txt":0,"type":[0,1],"type_":1,"type_on":1,"type_sos1":0,"type_sos2":0,"type_two":1,"typeerror":0,"typic":2,"u":0,"ub":[0,1],"ufl_25_35_1":0,"unblp":1,"unbound":[0,1],"unchang":0,"uncrush":[0,1],"uncrush_formula":1,"uncrush_pi":1,"uncrush_x":1,"uncrushform":[0,1],"uncrushpi":[0,1],"uncrushx":[0,1],"undocu":[0,1],"unexpect":1,"unexplor":[0,1],"uniqu":0,"unknown":1,"unlik":1,"unlimit":2,"unpack":[0,3],"unpack_pair":[0,1],"unpack_singl":1,"unpack_tripl":[0,1],"unregist":[0,1],"unregister_callback":[0,1,3],"unspecifi":1,"unzip":[0,1],"up_penalti":1,"updat":0,"upgrad":2,"upper":[0,1],"upper_bound":1,"upper_bound_constraint":1,"usag":[0,1],"use":[0,1,2],"use_abort":[0,3],"use_constraint":0,"use_cut":0,"use_solut":0,"useconstraint":[0,3],"usecut":[0,3],"user":[0,1,2],"user_solut":0,"usercutcallback":[0,3],"userhandl":1,"usr1":1,"usr2":1,"usr3":1,"v":1,"v1":[0,1],"v12":1,"v2":[0,1],"v3":[0,1],"v_agg_const":[0,1],"val":[0,1],"valid":[0,1],"validate_arg_length":[0,1],"vallist":1,"valu":[0,1],"valueerror":0,"var":[0,1],"vari":1,"variabl":[0,1,3],"variable_status":1,"variablesinterfac":[0,1],"varieti":0,"varind":1,"varindic":1,"various":0,"varsel_const":[0,1],"vartyp":[0,1],"varx":1,"vec":0,"vector":[0,1],"veri":0,"verifi":0,"version":[0,1,2],"versionnumb":[0,1],"very_aggress":1,"via":1,"view":0,"violat":[0,1],"vv":[0,1],"vvrrmmff":[0,1],"w":0,"wall":[0,1],"wallclock":[0,1],"want":0,"warn":[0,1],"warning_chnl_idx":[0,1],"warning_fil":[0,1],"warninglimit":0,"was_cal":0,"weight":1,"well":2,"whenev":0,"whether":[0,1],"which_branch":0,"which_nod":0,"whichparam":1,"whose":[0,1],"will":[0,1,2],"window":2,"wise":0,"wish":0,"with_cut":1,"within":[0,1,2],"without":0,"without_cut":1,"word":[0,1],"work":[0,1],"worker":1,"worst_object":1,"wrap":1,"wrapper":[0,1],"write":[0,1,2,3],"write_annot":[0,3],"write_as_str":[0,3],"write_benders_annot":[0,3],"write_fil":[0,1],"write_to_stream":[0,3],"writeanno":[0,1],"writebendersanno":[0,1],"writelevel_const":[0,1],"writemipstart":[0,1],"writeparam":[0,1],"writeprob":[0,1],"writeprobdev":[0,1],"written":[0,1],"wrong":0,"wrongnumberofargumentserror":[0,3],"wts":1,"x":[0,1],"x0":1,"x1":[0,1],"x10":1,"x2":[0,1],"x3":[0,1],"x4":1,"x5":1,"x6":1,"x7":1,"x8":1,"x9":1,"x_bound_error_max":1,"x_bound_error_tot":1,"x_norm_max":1,"x_norm_tot":1,"xctype":1,"xqxax":1,"y":1,"yes":1,"yet":0,"yield":0,"z":1,"zero":[0,1],"zero_du":1,"zero_half":[0,1],"zip":[0,1]},"titles":["cplex package","cplex._internal package","CPLEX Python API Reference Manual","cplex"],"titleterms":{"What":2,"_anno":1,"_aux_funct":1,"_baseinterfac":1,"_constant":1,"_constantsenum":1,"_intern":1,"_matric":1,"_multiobj":1,"_multiobjsoln":1,"_parameter_class":1,"_procedur":1,"_pwl":1,"_solutionstrategyenum":1,"_subinterfac":1,"abort":0,"api":2,"callback":0,"constant_class":0,"content":2,"cplex":[0,1,2,3],"except":0,"ibm":2,"know":2,"manual":2,"model_info":0,"modul":[0,1],"need":2,"packag":[0,1,2],"paramset":0,"python":2,"refer":2,"structur":2,"submodul":[0,1],"subpackag":0}}) \ No newline at end of file diff --git a/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png b/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png new file mode 100644 index 0000000..e1e198f Binary files /dev/null and b/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png differ diff --git a/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map b/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map new file mode 100644 index 0000000..81faaac --- /dev/null +++ b/docs/_images/inheritance-00d3f2cf80ca6a522c93ff705ea0e6afd8478cd2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png b/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png new file mode 100644 index 0000000..58596ff Binary files /dev/null and b/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png differ diff --git a/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map b/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map new file mode 100644 index 0000000..a984c77 --- /dev/null +++ b/docs/_images/inheritance-03b385b4fa2a575b8158e10ab929fc0387986dee.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png b/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png new file mode 100644 index 0000000..a7909be Binary files /dev/null and b/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png differ diff --git a/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map b/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map new file mode 100644 index 0000000..1bf0e05 --- /dev/null +++ b/docs/_images/inheritance-0493368555650d8a568fd81af76cb1ddb61477eb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png b/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png new file mode 100644 index 0000000..b64ff49 Binary files /dev/null and b/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png differ diff --git a/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map b/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map new file mode 100644 index 0000000..ec2dd7c --- /dev/null +++ b/docs/_images/inheritance-04a405bfc85a7a76a14a37b3c38ee78c7b91c70c.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png b/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png new file mode 100644 index 0000000..86c8538 Binary files /dev/null and b/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png differ diff --git a/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map b/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map new file mode 100644 index 0000000..5dbcf1d --- /dev/null +++ b/docs/_images/inheritance-085b7b86d4b9e28f570802b2cb1dc393202c5612.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png b/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png new file mode 100644 index 0000000..8d37974 Binary files /dev/null and b/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png differ diff --git a/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map b/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map new file mode 100644 index 0000000..eb3b2f8 --- /dev/null +++ b/docs/_images/inheritance-08b35fd8b002dd42efb5abe56d4055c7c9e56902.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png b/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png new file mode 100644 index 0000000..861f207 Binary files /dev/null and b/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png differ diff --git a/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map b/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map new file mode 100644 index 0000000..b14c728 --- /dev/null +++ b/docs/_images/inheritance-0af7fa1eb6168019084d330805bfac962f5a60b6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png b/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png new file mode 100644 index 0000000..80db9ff Binary files /dev/null and b/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png differ diff --git a/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map b/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map new file mode 100644 index 0000000..7d5dfe1 --- /dev/null +++ b/docs/_images/inheritance-0cc7cafa606db25192822833f8f6cd6bd1e75cc1.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png b/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png new file mode 100644 index 0000000..4642db0 Binary files /dev/null and b/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png differ diff --git a/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map b/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map new file mode 100644 index 0000000..a70aa0e --- /dev/null +++ b/docs/_images/inheritance-0d060ea15571e6bf3f94c718843f137bd14c5440.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png b/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png new file mode 100644 index 0000000..820ff1b Binary files /dev/null and b/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png differ diff --git a/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map b/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map new file mode 100644 index 0000000..107d5a0 --- /dev/null +++ b/docs/_images/inheritance-0dfcd23c402ae5990a32e612573f0040aa7ef030.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png b/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png new file mode 100644 index 0000000..8f3df78 Binary files /dev/null and b/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png differ diff --git a/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map b/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map new file mode 100644 index 0000000..5b395ae --- /dev/null +++ b/docs/_images/inheritance-0e7f750da44a58c2af1c7a6b87fbae01932944fb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png b/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png new file mode 100644 index 0000000..74cdca5 Binary files /dev/null and b/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png differ diff --git a/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map b/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map new file mode 100644 index 0000000..ae83296 --- /dev/null +++ b/docs/_images/inheritance-0ef8946d243a47fc7f0e9d326392630b0535657b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png b/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png new file mode 100644 index 0000000..1956548 Binary files /dev/null and b/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png differ diff --git a/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map b/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map new file mode 100644 index 0000000..1e21327 --- /dev/null +++ b/docs/_images/inheritance-1017b5336905f4e025c7b94f52ffe7faa70988e9.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png b/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png new file mode 100644 index 0000000..f869434 Binary files /dev/null and b/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png differ diff --git a/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map b/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map new file mode 100644 index 0000000..e00aab5 --- /dev/null +++ b/docs/_images/inheritance-10a9a987193c5fd1d99d8e8639cde00a0d551781.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png b/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png new file mode 100644 index 0000000..0a09369 Binary files /dev/null and b/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png differ diff --git a/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map b/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map new file mode 100644 index 0000000..0eee586 --- /dev/null +++ b/docs/_images/inheritance-10ae26847fbcf750c931e549d52a15e5c4eb802b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png b/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png new file mode 100644 index 0000000..536a37a Binary files /dev/null and b/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png differ diff --git a/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map b/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map new file mode 100644 index 0000000..cb19945 --- /dev/null +++ b/docs/_images/inheritance-10b03d560a730c8700adf93665578105db221bcc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png b/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png new file mode 100644 index 0000000..fc39a7c Binary files /dev/null and b/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png differ diff --git a/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map b/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map new file mode 100644 index 0000000..e761245 --- /dev/null +++ b/docs/_images/inheritance-11c6805520b17e06b6c6c5d33f44b8dc9831a0a7.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png b/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png new file mode 100644 index 0000000..ea95f96 Binary files /dev/null and b/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png differ diff --git a/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map b/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map new file mode 100644 index 0000000..5d39c52 --- /dev/null +++ b/docs/_images/inheritance-12da58401b30705dcd4bd4579946101c0aaa89b2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png b/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png new file mode 100644 index 0000000..5e5dd15 Binary files /dev/null and b/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png differ diff --git a/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map b/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map new file mode 100644 index 0000000..74fa6ad --- /dev/null +++ b/docs/_images/inheritance-1495729aecc6a056f377377c1e3679edf112cee8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png b/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png new file mode 100644 index 0000000..2e345d1 Binary files /dev/null and b/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png differ diff --git a/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map b/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map new file mode 100644 index 0000000..942c711 --- /dev/null +++ b/docs/_images/inheritance-19457efc11f56344bbc637c725831a1d6ca7f4e7.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png b/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png new file mode 100644 index 0000000..16ae02b Binary files /dev/null and b/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png differ diff --git a/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map b/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map new file mode 100644 index 0000000..d343125 --- /dev/null +++ b/docs/_images/inheritance-1d6cc735b9d18ba97f0a308204ec87ad1e34e37a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png b/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png new file mode 100644 index 0000000..20a3d20 Binary files /dev/null and b/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png differ diff --git a/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map b/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map new file mode 100644 index 0000000..68b608f --- /dev/null +++ b/docs/_images/inheritance-206a20aef4da931952927adb936de9ee5d0b71da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png b/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png new file mode 100644 index 0000000..d2d5111 Binary files /dev/null and b/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png differ diff --git a/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map b/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map new file mode 100644 index 0000000..6c5d31d --- /dev/null +++ b/docs/_images/inheritance-20d09035cbcffe549a3e8bb3123bc4044d236c65.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png b/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png new file mode 100644 index 0000000..e3d5a26 Binary files /dev/null and b/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png differ diff --git a/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map b/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map new file mode 100644 index 0000000..398f4bb --- /dev/null +++ b/docs/_images/inheritance-21dc36b1b39d9fb974551eba01ee6beae26cab97.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png b/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png new file mode 100644 index 0000000..901761f Binary files /dev/null and b/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png differ diff --git a/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map b/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map new file mode 100644 index 0000000..404f3c9 --- /dev/null +++ b/docs/_images/inheritance-23958801228f0f4701083bb92a2205240342d008.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png b/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png new file mode 100644 index 0000000..6121005 Binary files /dev/null and b/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png differ diff --git a/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map b/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map new file mode 100644 index 0000000..0f27d94 --- /dev/null +++ b/docs/_images/inheritance-2423720bfce6cec5836f6aca74da6d80bb61131c.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png b/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png new file mode 100644 index 0000000..afd93c4 Binary files /dev/null and b/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png differ diff --git a/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map b/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map new file mode 100644 index 0000000..be3a2c0 --- /dev/null +++ b/docs/_images/inheritance-24a48835cd99ca38a72caaa719886aa564b914ea.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png b/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png new file mode 100644 index 0000000..0ff8dde Binary files /dev/null and b/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png differ diff --git a/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map b/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map new file mode 100644 index 0000000..9a6f112 --- /dev/null +++ b/docs/_images/inheritance-2729387941e69c4ce7e90047a03c1648b348b8d6.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png b/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png new file mode 100644 index 0000000..0552b1d Binary files /dev/null and b/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png differ diff --git a/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map b/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map new file mode 100644 index 0000000..5823778 --- /dev/null +++ b/docs/_images/inheritance-27885a985b6384fa36815f5b9a721e95cd010dd9.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png b/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png new file mode 100644 index 0000000..eb99507 Binary files /dev/null and b/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png differ diff --git a/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map b/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map new file mode 100644 index 0000000..4cdc121 --- /dev/null +++ b/docs/_images/inheritance-284d4e751f375021a8f6d29ab84adc8a999817b2.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png b/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png new file mode 100644 index 0000000..2c144bc Binary files /dev/null and b/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png differ diff --git a/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map b/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map new file mode 100644 index 0000000..f3c7b58 --- /dev/null +++ b/docs/_images/inheritance-295da13a65877c2534e5ee2a343448f886ae7382.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png b/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png new file mode 100644 index 0000000..30e0d17 Binary files /dev/null and b/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png differ diff --git a/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map b/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map new file mode 100644 index 0000000..8b43bc5 --- /dev/null +++ b/docs/_images/inheritance-2a2dc96fd4b8bf0c0441ed375c5d94cfd5e1325f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png b/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png new file mode 100644 index 0000000..fedd0b6 Binary files /dev/null and b/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png differ diff --git a/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map b/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map new file mode 100644 index 0000000..bf92544 --- /dev/null +++ b/docs/_images/inheritance-2e82882c9d9a050dbec91f80ab42f4d5982a6531.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png b/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png new file mode 100644 index 0000000..ea148bb Binary files /dev/null and b/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png differ diff --git a/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map b/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map new file mode 100644 index 0000000..a2c5ed2 --- /dev/null +++ b/docs/_images/inheritance-2e88f6105809fd4cd11bbf783a4028676b4b5deb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png b/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png new file mode 100644 index 0000000..26487e8 Binary files /dev/null and b/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png differ diff --git a/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map b/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map new file mode 100644 index 0000000..533f2f8 --- /dev/null +++ b/docs/_images/inheritance-2eda378f28000537a5b0d9476221b17df282ae76.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png b/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png new file mode 100644 index 0000000..54c6ce6 Binary files /dev/null and b/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png differ diff --git a/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map b/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map new file mode 100644 index 0000000..6b8b15d --- /dev/null +++ b/docs/_images/inheritance-2ff95b0d773c9f4defbcae4f62024eec7607bce0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png b/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png new file mode 100644 index 0000000..ce2287e Binary files /dev/null and b/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png differ diff --git a/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map b/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map new file mode 100644 index 0000000..849fbea --- /dev/null +++ b/docs/_images/inheritance-3010bb3f8c5f4cf7992dfe5162a73aba16cd7ff8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png b/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png new file mode 100644 index 0000000..03b4fb2 Binary files /dev/null and b/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png differ diff --git a/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map b/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map new file mode 100644 index 0000000..ffaf7f8 --- /dev/null +++ b/docs/_images/inheritance-30d286b74aa4c9d2517966e60460ed510ab9cac6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png b/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png new file mode 100644 index 0000000..146a08d Binary files /dev/null and b/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png differ diff --git a/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map b/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map new file mode 100644 index 0000000..76d5d8e --- /dev/null +++ b/docs/_images/inheritance-3145c1955c629ad86eab8a48492a8d6a5aa912b0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png b/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png new file mode 100644 index 0000000..fa72142 Binary files /dev/null and b/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png differ diff --git a/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map b/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map new file mode 100644 index 0000000..b34a647 --- /dev/null +++ b/docs/_images/inheritance-36cf1567d21427a677ebc9be6ddd9fa2ec32a2cf.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png b/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png new file mode 100644 index 0000000..b5f9239 Binary files /dev/null and b/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png differ diff --git a/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map b/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map new file mode 100644 index 0000000..d5c6ee7 --- /dev/null +++ b/docs/_images/inheritance-3764f235910ce9d746a9b7b9021543a715b3550e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png b/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png new file mode 100644 index 0000000..9595cbc Binary files /dev/null and b/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png differ diff --git a/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map b/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map new file mode 100644 index 0000000..c6ef302 --- /dev/null +++ b/docs/_images/inheritance-39f8e52a21b01dda80e45fb9ec464ce9e09e8f8e.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png b/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png new file mode 100644 index 0000000..d3f9ee0 Binary files /dev/null and b/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png differ diff --git a/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map b/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map new file mode 100644 index 0000000..0f41cc0 --- /dev/null +++ b/docs/_images/inheritance-3b8249a0d4932b128a3eaa72a48e4c0375274e07.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png b/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png new file mode 100644 index 0000000..ba169f5 Binary files /dev/null and b/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png differ diff --git a/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map b/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map new file mode 100644 index 0000000..ca74487 --- /dev/null +++ b/docs/_images/inheritance-3c80bf527eea11f68b622ed438e3a7c5300593bc.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png b/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png new file mode 100644 index 0000000..e2fbf4b Binary files /dev/null and b/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png differ diff --git a/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map b/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map new file mode 100644 index 0000000..1e6bb17 --- /dev/null +++ b/docs/_images/inheritance-3e20a879eefaee41744e61051b191b4b874699e6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png b/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png new file mode 100644 index 0000000..d6f38dd Binary files /dev/null and b/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png differ diff --git a/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map b/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map new file mode 100644 index 0000000..10df119 --- /dev/null +++ b/docs/_images/inheritance-3f02386bd4b599a87f0f81dcdea7325acb6df7c2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png b/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png new file mode 100644 index 0000000..69197c3 Binary files /dev/null and b/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png differ diff --git a/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map b/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map new file mode 100644 index 0000000..b6074e2 --- /dev/null +++ b/docs/_images/inheritance-3f112bf5b46356109f0be875d01188468044bae5.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png b/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png new file mode 100644 index 0000000..5348d7d Binary files /dev/null and b/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png differ diff --git a/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map b/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map new file mode 100644 index 0000000..1c5aafa --- /dev/null +++ b/docs/_images/inheritance-3f32f1b5c326448336b631c2ef5837a2b02afdfa.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png b/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png new file mode 100644 index 0000000..96292e2 Binary files /dev/null and b/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png differ diff --git a/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map b/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map new file mode 100644 index 0000000..3d76e21 --- /dev/null +++ b/docs/_images/inheritance-423c1873f4ce2492d17fa0aad9c294a3ba46eede.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png b/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png new file mode 100644 index 0000000..4c02e5f Binary files /dev/null and b/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png differ diff --git a/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map b/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map new file mode 100644 index 0000000..d934cbd --- /dev/null +++ b/docs/_images/inheritance-445fa069af1b6adc6a9721a753599ddd868b01db.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png b/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png new file mode 100644 index 0000000..8297194 Binary files /dev/null and b/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png differ diff --git a/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map b/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map new file mode 100644 index 0000000..c0c887a --- /dev/null +++ b/docs/_images/inheritance-4481b2dbc35a2a06101dfb5d729e3a3f812732bb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png b/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png new file mode 100644 index 0000000..1093edd Binary files /dev/null and b/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png differ diff --git a/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map b/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map new file mode 100644 index 0000000..7ab2006 --- /dev/null +++ b/docs/_images/inheritance-44c13b1357879428889715e9608c9d690b24d73c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png b/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png new file mode 100644 index 0000000..a709ea4 Binary files /dev/null and b/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png differ diff --git a/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map b/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map new file mode 100644 index 0000000..fa8c961 --- /dev/null +++ b/docs/_images/inheritance-47b70a9ae9f3bbf792be25723905bb4058d14cef.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png b/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png new file mode 100644 index 0000000..9510844 Binary files /dev/null and b/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png differ diff --git a/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map b/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map new file mode 100644 index 0000000..8fa336e --- /dev/null +++ b/docs/_images/inheritance-480daef96f27b44129e498e36df8972e3c91cacb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png b/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png new file mode 100644 index 0000000..00620c5 Binary files /dev/null and b/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png differ diff --git a/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map b/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map new file mode 100644 index 0000000..cfb2df9 --- /dev/null +++ b/docs/_images/inheritance-4cc829db5b19d7820105e15dd47851de4e85ec31.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png b/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png new file mode 100644 index 0000000..5183cb1 Binary files /dev/null and b/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png differ diff --git a/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map b/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map new file mode 100644 index 0000000..547237b --- /dev/null +++ b/docs/_images/inheritance-4ec3f1e8d61dd1e963d22be718c608440254d3df.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png b/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png new file mode 100644 index 0000000..633c64b Binary files /dev/null and b/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png differ diff --git a/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map b/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map new file mode 100644 index 0000000..d59a750 --- /dev/null +++ b/docs/_images/inheritance-4f50710fdaea6648529aeb43e6396c580b80fb4b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png b/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png new file mode 100644 index 0000000..0051d82 Binary files /dev/null and b/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png differ diff --git a/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map b/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map new file mode 100644 index 0000000..bda8e01 --- /dev/null +++ b/docs/_images/inheritance-4fb40ca2ce8322f97d93aad35ef2c319bdc9a1ae.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png b/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png new file mode 100644 index 0000000..f9ed887 Binary files /dev/null and b/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png differ diff --git a/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map b/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map new file mode 100644 index 0000000..4e6396d --- /dev/null +++ b/docs/_images/inheritance-56c1d9217fc6f311a4242e8262fb00010309b373.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png b/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png new file mode 100644 index 0000000..2f1c3b4 Binary files /dev/null and b/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png differ diff --git a/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map b/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map new file mode 100644 index 0000000..d7da03a --- /dev/null +++ b/docs/_images/inheritance-577461b6a06ab14b51e176364f320d1c60ec8908.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png b/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png new file mode 100644 index 0000000..7094f37 Binary files /dev/null and b/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png differ diff --git a/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map b/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map new file mode 100644 index 0000000..0e8ca03 --- /dev/null +++ b/docs/_images/inheritance-5796828bb6dfe5539302c644af1737d9836a1e94.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png b/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png new file mode 100644 index 0000000..421362d Binary files /dev/null and b/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png differ diff --git a/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map b/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map new file mode 100644 index 0000000..a3c46e7 --- /dev/null +++ b/docs/_images/inheritance-57d37513460a4a76b8a8794de3094960e11733f7.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png b/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png new file mode 100644 index 0000000..139a066 Binary files /dev/null and b/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png differ diff --git a/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map b/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map new file mode 100644 index 0000000..851014c --- /dev/null +++ b/docs/_images/inheritance-590d6edd9036f35da519ed142056e59fb1c7b4a2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png b/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png new file mode 100644 index 0000000..8a4519b Binary files /dev/null and b/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png differ diff --git a/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map b/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map new file mode 100644 index 0000000..86b8eaf --- /dev/null +++ b/docs/_images/inheritance-5b6d7622e48a8b74e64417fcd3a96907860489a7.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png b/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png new file mode 100644 index 0000000..8a6a993 Binary files /dev/null and b/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png differ diff --git a/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map b/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map new file mode 100644 index 0000000..b1f2894 --- /dev/null +++ b/docs/_images/inheritance-5cddc79e15e5abbfcf9a3e179e9c7fb8defbf725.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png b/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png new file mode 100644 index 0000000..6ed527a Binary files /dev/null and b/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png differ diff --git a/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map b/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map new file mode 100644 index 0000000..20fb609 --- /dev/null +++ b/docs/_images/inheritance-5d66b4dce922aa1c1b849993fd7e6184aa41b35a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png b/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png new file mode 100644 index 0000000..3e48444 Binary files /dev/null and b/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png differ diff --git a/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map b/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map new file mode 100644 index 0000000..6339d1c --- /dev/null +++ b/docs/_images/inheritance-5f6194e52c941b71ab5180b64ee03819c37a26b8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png b/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png new file mode 100644 index 0000000..a70f440 Binary files /dev/null and b/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png differ diff --git a/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map b/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map new file mode 100644 index 0000000..f0ce79c --- /dev/null +++ b/docs/_images/inheritance-6054b7d3cc2e242b0cb60c51d922f0f06b8db969.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png b/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png new file mode 100644 index 0000000..53ae929 Binary files /dev/null and b/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png differ diff --git a/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map b/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map new file mode 100644 index 0000000..62d7c18 --- /dev/null +++ b/docs/_images/inheritance-63d0569b2d097228ddd2e38dec2d127d4cacd4d5.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png b/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png new file mode 100644 index 0000000..ae39fc2 Binary files /dev/null and b/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png differ diff --git a/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map b/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map new file mode 100644 index 0000000..02d7d56 --- /dev/null +++ b/docs/_images/inheritance-66306b523ba1b553e5d9173c2c7d1905551c68f4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png b/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png new file mode 100644 index 0000000..fd6bb3e Binary files /dev/null and b/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png differ diff --git a/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map b/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map new file mode 100644 index 0000000..f9987d9 --- /dev/null +++ b/docs/_images/inheritance-6bed8a1803c2c0e5f8728a74cecb0ea6edaba83b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png b/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png new file mode 100644 index 0000000..df0bd68 Binary files /dev/null and b/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png differ diff --git a/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map b/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map new file mode 100644 index 0000000..8b2a90f --- /dev/null +++ b/docs/_images/inheritance-6cdc7640993a500bced941308e7a3ecc12f96902.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png b/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png new file mode 100644 index 0000000..c28887d Binary files /dev/null and b/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png differ diff --git a/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map b/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map new file mode 100644 index 0000000..ef32466 --- /dev/null +++ b/docs/_images/inheritance-6f39b417e24de0757b627dc2aa21fe141c6ec6b0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png b/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png new file mode 100644 index 0000000..9905449 Binary files /dev/null and b/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png differ diff --git a/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map b/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map new file mode 100644 index 0000000..ce7ea09 --- /dev/null +++ b/docs/_images/inheritance-6f3da16d23236a02216a30e846a5d8042d37b7cd.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png b/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png new file mode 100644 index 0000000..c38eb01 Binary files /dev/null and b/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png differ diff --git a/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map b/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map new file mode 100644 index 0000000..9e46112 --- /dev/null +++ b/docs/_images/inheritance-71843c53cd69238009362496145d006f42136e8f.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png b/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png new file mode 100644 index 0000000..dc870db Binary files /dev/null and b/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png differ diff --git a/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map b/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map new file mode 100644 index 0000000..fffdaf1 --- /dev/null +++ b/docs/_images/inheritance-719807e6629aeb3cdbbb93c323f8019be1bb3214.png.map @@ -0,0 +1,6 @@ + + + + + + diff --git a/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png b/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png new file mode 100644 index 0000000..c4fd673 Binary files /dev/null and b/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png differ diff --git a/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map b/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map new file mode 100644 index 0000000..f3b759b --- /dev/null +++ b/docs/_images/inheritance-735ad316d3871d9b01bad56bc453ecda28647482.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png b/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png new file mode 100644 index 0000000..4a5bb30 Binary files /dev/null and b/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png differ diff --git a/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map b/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map new file mode 100644 index 0000000..5a9c836 --- /dev/null +++ b/docs/_images/inheritance-761c20aa96fd859ce109c167ee0fcece29c375f8.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png b/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png new file mode 100644 index 0000000..9e94acd Binary files /dev/null and b/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png differ diff --git a/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map b/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map new file mode 100644 index 0000000..8e4a4b0 --- /dev/null +++ b/docs/_images/inheritance-76d134dc56a6eb2a2ba6611f3eb8f54bc81039c4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png b/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png new file mode 100644 index 0000000..f891b73 Binary files /dev/null and b/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png differ diff --git a/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map b/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map new file mode 100644 index 0000000..c333c89 --- /dev/null +++ b/docs/_images/inheritance-79749521dbb42c374fe224a135ab5a35e950147b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png b/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png new file mode 100644 index 0000000..33b1e59 Binary files /dev/null and b/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png differ diff --git a/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map b/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map new file mode 100644 index 0000000..23ddbce --- /dev/null +++ b/docs/_images/inheritance-79f0b349f780ae1596f21e345409e521f1e43a0c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png b/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png new file mode 100644 index 0000000..4084125 Binary files /dev/null and b/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png differ diff --git a/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map b/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map new file mode 100644 index 0000000..0f8506c --- /dev/null +++ b/docs/_images/inheritance-7b1619d6b85d8f31ee5c8fef2fce02c2b1e9e30a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png b/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png new file mode 100644 index 0000000..e79c1bb Binary files /dev/null and b/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png differ diff --git a/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map b/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map new file mode 100644 index 0000000..e206c30 --- /dev/null +++ b/docs/_images/inheritance-7cc898d8449fb254fa6f5dc51df7c5304d90b8c1.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png b/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png new file mode 100644 index 0000000..5ff9e42 Binary files /dev/null and b/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png differ diff --git a/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map b/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map new file mode 100644 index 0000000..9d6e376 --- /dev/null +++ b/docs/_images/inheritance-7f1c433c6266ecfbc200c8ba94ad9bb4e95f4efd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png b/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png new file mode 100644 index 0000000..633c32e Binary files /dev/null and b/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png differ diff --git a/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map b/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map new file mode 100644 index 0000000..e0bbd6c --- /dev/null +++ b/docs/_images/inheritance-81c70b8092d73db49d72dafca81dbb27cd5832c9.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png b/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png new file mode 100644 index 0000000..a882a98 Binary files /dev/null and b/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png differ diff --git a/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map b/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map new file mode 100644 index 0000000..3f2bfe3 --- /dev/null +++ b/docs/_images/inheritance-82201b24263014ea16f348dcca801d75af518df2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png b/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png new file mode 100644 index 0000000..8aa0895 Binary files /dev/null and b/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png differ diff --git a/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map b/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map new file mode 100644 index 0000000..e43e784 --- /dev/null +++ b/docs/_images/inheritance-829d682d342051d807de7e6617e86bd7965be7ce.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png b/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png new file mode 100644 index 0000000..7c132b8 Binary files /dev/null and b/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png differ diff --git a/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map b/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map new file mode 100644 index 0000000..e479009 --- /dev/null +++ b/docs/_images/inheritance-850ff28adcc15f545d724ab78ff84dc7ab3c433e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png b/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png new file mode 100644 index 0000000..b035189 Binary files /dev/null and b/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png differ diff --git a/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map b/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map new file mode 100644 index 0000000..138088f --- /dev/null +++ b/docs/_images/inheritance-85afd5e2f02c4d0732c2aa9947226127fdeac643.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png b/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png new file mode 100644 index 0000000..53ae929 Binary files /dev/null and b/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png differ diff --git a/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map b/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map new file mode 100644 index 0000000..ec3dc8e --- /dev/null +++ b/docs/_images/inheritance-867dafacd0327e4326eb1bcca93c14a3ca073730.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png b/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png new file mode 100644 index 0000000..d727754 Binary files /dev/null and b/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png differ diff --git a/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map b/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map new file mode 100644 index 0000000..de4ef87 --- /dev/null +++ b/docs/_images/inheritance-8b1fe5a1b0bcb09b810edffce7e439d53cef0731.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png b/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png new file mode 100644 index 0000000..3f2e93d Binary files /dev/null and b/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png differ diff --git a/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map b/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map new file mode 100644 index 0000000..323f0b3 --- /dev/null +++ b/docs/_images/inheritance-8c3192526608493f470e5000fcead5b7f8d6145b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png b/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png new file mode 100644 index 0000000..4fc538c Binary files /dev/null and b/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png differ diff --git a/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map b/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map new file mode 100644 index 0000000..852bcd7 --- /dev/null +++ b/docs/_images/inheritance-8d398ffaff86de242a7691d9d5bf10e5fcd65243.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png b/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png new file mode 100644 index 0000000..21a18b2 Binary files /dev/null and b/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png differ diff --git a/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map b/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map new file mode 100644 index 0000000..3be2c95 --- /dev/null +++ b/docs/_images/inheritance-8e79aa839f6a5acbcc2b361513b0bc2b6203389c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png b/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png new file mode 100644 index 0000000..3052e8b Binary files /dev/null and b/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png differ diff --git a/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map b/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map new file mode 100644 index 0000000..572eadd --- /dev/null +++ b/docs/_images/inheritance-90ad069fc9bf514bd484d8e9511d1c9bbcf64b89.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png b/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png new file mode 100644 index 0000000..a6c9f76 Binary files /dev/null and b/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png differ diff --git a/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map b/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map new file mode 100644 index 0000000..84b0ead --- /dev/null +++ b/docs/_images/inheritance-93399482121a3d9f98ba67c601957d1ebeb93fbb.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png b/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png new file mode 100644 index 0000000..35cfc69 Binary files /dev/null and b/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png differ diff --git a/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map b/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map new file mode 100644 index 0000000..a479708 --- /dev/null +++ b/docs/_images/inheritance-939b73b01491319004f336cc08a174fd4dd5d658.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png b/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png new file mode 100644 index 0000000..258e21e Binary files /dev/null and b/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png differ diff --git a/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map b/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map new file mode 100644 index 0000000..2e02969 --- /dev/null +++ b/docs/_images/inheritance-93b37fb15eff3a9620a188626262700c13dad2dc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png b/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png new file mode 100644 index 0000000..9d9ccab Binary files /dev/null and b/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png differ diff --git a/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map b/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map new file mode 100644 index 0000000..8c2723a --- /dev/null +++ b/docs/_images/inheritance-950364b5476547f7db345c3aa26c8584c12de3ab.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png b/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png new file mode 100644 index 0000000..e9ac006 Binary files /dev/null and b/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png differ diff --git a/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map b/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map new file mode 100644 index 0000000..f9e90e1 --- /dev/null +++ b/docs/_images/inheritance-96cb710140d57164350a941623673cd52d423b88.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png b/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png new file mode 100644 index 0000000..b0afaca Binary files /dev/null and b/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png differ diff --git a/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map b/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map new file mode 100644 index 0000000..ec38e42 --- /dev/null +++ b/docs/_images/inheritance-9702482e2aff403d7b006693f90aac8c05b3e73f.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png b/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png new file mode 100644 index 0000000..edfad73 Binary files /dev/null and b/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png differ diff --git a/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map b/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map new file mode 100644 index 0000000..749f410 --- /dev/null +++ b/docs/_images/inheritance-98e0b9c0190611a59795538ee14154fc1846e66b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png b/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png new file mode 100644 index 0000000..1b72401 Binary files /dev/null and b/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png differ diff --git a/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map b/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map new file mode 100644 index 0000000..fa2e462 --- /dev/null +++ b/docs/_images/inheritance-9919bff25c378e09a1f86e68356f0a3d76cb97fe.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png b/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png new file mode 100644 index 0000000..f3c8b20 Binary files /dev/null and b/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png differ diff --git a/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map b/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map new file mode 100644 index 0000000..dba8bec --- /dev/null +++ b/docs/_images/inheritance-9b19bd50c38f2ab53512490f5cd31abc48e624da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png b/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png new file mode 100644 index 0000000..6ab220a Binary files /dev/null and b/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png differ diff --git a/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map b/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map new file mode 100644 index 0000000..199e008 --- /dev/null +++ b/docs/_images/inheritance-9d86f08127ff18b1987fcaa2cda75dcf676f5aab.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png b/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png new file mode 100644 index 0000000..9b155ce Binary files /dev/null and b/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png differ diff --git a/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map b/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map new file mode 100644 index 0000000..fa3a0e0 --- /dev/null +++ b/docs/_images/inheritance-9dda7f06281563a68116a9b503242e1c8b5df62f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png b/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png new file mode 100644 index 0000000..a834b15 Binary files /dev/null and b/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png differ diff --git a/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map b/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map new file mode 100644 index 0000000..9deae5c --- /dev/null +++ b/docs/_images/inheritance-a1d4865f4406465e717b6b1a9871523452da586a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png b/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png new file mode 100644 index 0000000..dfd3b3d Binary files /dev/null and b/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png differ diff --git a/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map b/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map new file mode 100644 index 0000000..2506b53 --- /dev/null +++ b/docs/_images/inheritance-a48803ccc92fd9f5cff7e54721eb420dddcf74cd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png b/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png new file mode 100644 index 0000000..d332b23 Binary files /dev/null and b/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png differ diff --git a/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map b/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map new file mode 100644 index 0000000..844217d --- /dev/null +++ b/docs/_images/inheritance-a68c6bf637bda747a39a4e429787132c9598d7bd.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png b/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png new file mode 100644 index 0000000..2dfec59 Binary files /dev/null and b/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png differ diff --git a/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map b/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map new file mode 100644 index 0000000..54e1e1c --- /dev/null +++ b/docs/_images/inheritance-a797417927b442511029b90cb678e284637d9d6c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png b/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png new file mode 100644 index 0000000..cd92731 Binary files /dev/null and b/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png differ diff --git a/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map b/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map new file mode 100644 index 0000000..51e1a0c --- /dev/null +++ b/docs/_images/inheritance-a7efbf43c9ab7006bca1e2509a375fab7a30e6f2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png b/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png new file mode 100644 index 0000000..78ef13b Binary files /dev/null and b/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png differ diff --git a/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map b/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map new file mode 100644 index 0000000..d1151d5 --- /dev/null +++ b/docs/_images/inheritance-a9224180f6a5735db967c1be6eb384debd96f313.png.map @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png b/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png new file mode 100644 index 0000000..d7fd659 Binary files /dev/null and b/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png differ diff --git a/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map b/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map new file mode 100644 index 0000000..081547a --- /dev/null +++ b/docs/_images/inheritance-aff91be2460f5b99777af3a349ba7136e2540f27.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png b/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png new file mode 100644 index 0000000..0d29c75 Binary files /dev/null and b/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png differ diff --git a/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map b/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map new file mode 100644 index 0000000..9e90315 --- /dev/null +++ b/docs/_images/inheritance-b0e56dda182cc7ef88242f79da9b1cec6d727eab.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png b/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png new file mode 100644 index 0000000..30f3611 Binary files /dev/null and b/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png differ diff --git a/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map b/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map new file mode 100644 index 0000000..3d2c360 --- /dev/null +++ b/docs/_images/inheritance-b14bab6bb2e2bb03fe91f7f51fd2ea77630dcede.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png b/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png new file mode 100644 index 0000000..0f2130f Binary files /dev/null and b/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png differ diff --git a/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map b/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map new file mode 100644 index 0000000..10cc703 --- /dev/null +++ b/docs/_images/inheritance-b216a319c52a24214ad4ba7d27105e22bc9eed76.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png b/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png new file mode 100644 index 0000000..916a450 Binary files /dev/null and b/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png differ diff --git a/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map b/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map new file mode 100644 index 0000000..cd89c75 --- /dev/null +++ b/docs/_images/inheritance-b9f4e1e5e09f544e09ef665355e4c777172b6774.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png b/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png new file mode 100644 index 0000000..46bdfcf Binary files /dev/null and b/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png differ diff --git a/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map b/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map new file mode 100644 index 0000000..41050e9 --- /dev/null +++ b/docs/_images/inheritance-bb3764fe1177f6a1adca116544db63f59a651aa4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png b/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png new file mode 100644 index 0000000..c2e7402 Binary files /dev/null and b/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png differ diff --git a/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map b/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map new file mode 100644 index 0000000..241e845 --- /dev/null +++ b/docs/_images/inheritance-bba166bbd4ec6ab824139beba6bcac8968a9f4f5.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png b/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png new file mode 100644 index 0000000..a4ffdae Binary files /dev/null and b/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png differ diff --git a/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map b/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map new file mode 100644 index 0000000..28d2a5d --- /dev/null +++ b/docs/_images/inheritance-c05b103c4e4511889ed5038ac0ff6ead5eef0154.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png b/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png new file mode 100644 index 0000000..1eb5bb9 Binary files /dev/null and b/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png differ diff --git a/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map b/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map new file mode 100644 index 0000000..43738fb --- /dev/null +++ b/docs/_images/inheritance-c21f24d5c2bfdd6781d8e7c5caf95e5a0ae1dbe0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png b/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png new file mode 100644 index 0000000..d9cdabb Binary files /dev/null and b/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png differ diff --git a/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map b/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map new file mode 100644 index 0000000..01d4e36 --- /dev/null +++ b/docs/_images/inheritance-c3963759dd52744c10847c9ead780b2ccd171d66.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png b/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png new file mode 100644 index 0000000..264d2ed Binary files /dev/null and b/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png differ diff --git a/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map b/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map new file mode 100644 index 0000000..05f3e94 --- /dev/null +++ b/docs/_images/inheritance-c4e59cbe14fd82b426eb1accdb221b826b9a1b54.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png b/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png new file mode 100644 index 0000000..a882a98 Binary files /dev/null and b/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png differ diff --git a/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map b/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map new file mode 100644 index 0000000..3d88bdf --- /dev/null +++ b/docs/_images/inheritance-c587187c951cccf841e5bb45f6657c5c2daebf0a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png b/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png new file mode 100644 index 0000000..54fcb9f Binary files /dev/null and b/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png differ diff --git a/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map b/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map new file mode 100644 index 0000000..e82f948 --- /dev/null +++ b/docs/_images/inheritance-c7e033886f7fae73b4dc4d90e031c4dbc88a8c4c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png b/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png new file mode 100644 index 0000000..ab8a75b Binary files /dev/null and b/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png differ diff --git a/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map b/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map new file mode 100644 index 0000000..8ef2db8 --- /dev/null +++ b/docs/_images/inheritance-c916fe5051ada691288e34ff69a1209c0fc7dbe3.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png b/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png new file mode 100644 index 0000000..e68bd02 Binary files /dev/null and b/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png differ diff --git a/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map b/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map new file mode 100644 index 0000000..d528c30 --- /dev/null +++ b/docs/_images/inheritance-ca13219d9cfd7125d9ddddcbeaafeeecdf59b7b4.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png b/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png new file mode 100644 index 0000000..7049b2e Binary files /dev/null and b/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png differ diff --git a/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map b/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map new file mode 100644 index 0000000..0df06ae --- /dev/null +++ b/docs/_images/inheritance-ca6825d98465bca1a5270ecf0d00afaf11c3a33b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png b/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png new file mode 100644 index 0000000..9905449 Binary files /dev/null and b/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png differ diff --git a/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map b/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map new file mode 100644 index 0000000..ef35c17 --- /dev/null +++ b/docs/_images/inheritance-cbd247b6e5d9d80319ca6d48f431acb43338755d.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png b/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png new file mode 100644 index 0000000..25bf36e Binary files /dev/null and b/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png differ diff --git a/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map b/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map new file mode 100644 index 0000000..16370c3 --- /dev/null +++ b/docs/_images/inheritance-cc533e6c74f74a83497c3dbf904c3d761fbc1e04.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png b/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png new file mode 100644 index 0000000..0205abd Binary files /dev/null and b/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png differ diff --git a/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map b/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map new file mode 100644 index 0000000..9967f0d --- /dev/null +++ b/docs/_images/inheritance-ce4b79ded878c1be1814979c8d144c3b44cc1d1e.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png b/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png new file mode 100644 index 0000000..b61772d Binary files /dev/null and b/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png differ diff --git a/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map b/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map new file mode 100644 index 0000000..758dec1 --- /dev/null +++ b/docs/_images/inheritance-cf839f9d889ba8ef4ab562349b933b6e9d6a86a0.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png b/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png new file mode 100644 index 0000000..1b5f6bc Binary files /dev/null and b/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png differ diff --git a/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map b/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map new file mode 100644 index 0000000..e9835b2 --- /dev/null +++ b/docs/_images/inheritance-cf8b13edbe1951b9261ba0faa8ff60f55badddd4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png b/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png new file mode 100644 index 0000000..1aa5024 Binary files /dev/null and b/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png differ diff --git a/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map b/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map new file mode 100644 index 0000000..dcf59a4 --- /dev/null +++ b/docs/_images/inheritance-d2a23896fc77bb56909c5159a1e071b02a4e1aea.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png b/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png new file mode 100644 index 0000000..dddb82f Binary files /dev/null and b/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png differ diff --git a/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map b/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map new file mode 100644 index 0000000..ab66d51 --- /dev/null +++ b/docs/_images/inheritance-d606a94f1f18e52dd171bb1ce25de4a43f455acc.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png b/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png new file mode 100644 index 0000000..8e1e2f7 Binary files /dev/null and b/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png differ diff --git a/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map b/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map new file mode 100644 index 0000000..1ab4fa2 --- /dev/null +++ b/docs/_images/inheritance-d6808362053b3d0f6b2de36a5f1dfd165208f027.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png b/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png new file mode 100644 index 0000000..fb2e9e9 Binary files /dev/null and b/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png differ diff --git a/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map b/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map new file mode 100644 index 0000000..060d10a --- /dev/null +++ b/docs/_images/inheritance-d8c7f51e87b1ff0406f90767078c4289eb55bf00.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png b/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png new file mode 100644 index 0000000..51c56ad Binary files /dev/null and b/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png differ diff --git a/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map b/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map new file mode 100644 index 0000000..67a8122 --- /dev/null +++ b/docs/_images/inheritance-d98db801419326424446743ef314a5918bc8ba81.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png b/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png new file mode 100644 index 0000000..180f239 Binary files /dev/null and b/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png differ diff --git a/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map b/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map new file mode 100644 index 0000000..ded9365 --- /dev/null +++ b/docs/_images/inheritance-d9e21c3f9aa242b83b0490037a0df765bb64bd70.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png b/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png new file mode 100644 index 0000000..84cdc2b Binary files /dev/null and b/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png differ diff --git a/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map b/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map new file mode 100644 index 0000000..13c0824 --- /dev/null +++ b/docs/_images/inheritance-da2ee735934fca92985ab70ce46681631687a433.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png b/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png new file mode 100644 index 0000000..451d57a Binary files /dev/null and b/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png differ diff --git a/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map b/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map new file mode 100644 index 0000000..dc6b865 --- /dev/null +++ b/docs/_images/inheritance-dc103c0b00e0fe01ab326751bac3a04db0061d0d.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png b/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png new file mode 100644 index 0000000..50dd9b1 Binary files /dev/null and b/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png differ diff --git a/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map b/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map new file mode 100644 index 0000000..f815d0d --- /dev/null +++ b/docs/_images/inheritance-dc17ef6e254c8a2ff5fcc2d96605286ffce0e26f.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png b/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png new file mode 100644 index 0000000..f2f4a56 Binary files /dev/null and b/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png differ diff --git a/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map b/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map new file mode 100644 index 0000000..0ba67a6 --- /dev/null +++ b/docs/_images/inheritance-dc585068cb197fc373f58d0913da4533f0ebbd71.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png b/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png new file mode 100644 index 0000000..cec2cd9 Binary files /dev/null and b/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png differ diff --git a/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map b/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map new file mode 100644 index 0000000..ce71f9a --- /dev/null +++ b/docs/_images/inheritance-de5eee64681483f8d46b9e0063c552bf74f132bf.png.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png b/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png new file mode 100644 index 0000000..a9b0d9a Binary files /dev/null and b/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png differ diff --git a/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map b/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map new file mode 100644 index 0000000..aff8c01 --- /dev/null +++ b/docs/_images/inheritance-e746108df24a3fd44fb3d718ffce69c1d978c23c.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png b/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png new file mode 100644 index 0000000..e602497 Binary files /dev/null and b/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png differ diff --git a/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map b/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map new file mode 100644 index 0000000..bdc963b --- /dev/null +++ b/docs/_images/inheritance-e895f3839c74a3b6aa2ee35acfd964c54f717db2.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png b/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png new file mode 100644 index 0000000..56c7ea9 Binary files /dev/null and b/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png differ diff --git a/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map b/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map new file mode 100644 index 0000000..a44e6ac --- /dev/null +++ b/docs/_images/inheritance-e99c6c7e0880b079344ef63e6d084bc4a11faecf.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png b/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png new file mode 100644 index 0000000..18bd8aa Binary files /dev/null and b/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png differ diff --git a/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map b/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map new file mode 100644 index 0000000..63cd417 --- /dev/null +++ b/docs/_images/inheritance-ebf94e21e347190b6a192cd90afe2d2092855825.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png b/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png new file mode 100644 index 0000000..ed55f29 Binary files /dev/null and b/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png differ diff --git a/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map b/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map new file mode 100644 index 0000000..90c4b46 --- /dev/null +++ b/docs/_images/inheritance-ec16698d67617a8bd6c13d6347fef49a6407a19b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png b/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png new file mode 100644 index 0000000..4b3a35d Binary files /dev/null and b/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png differ diff --git a/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map b/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map new file mode 100644 index 0000000..e397b4f --- /dev/null +++ b/docs/_images/inheritance-ee36f171e75beb2042c2b808b91c010e2ec7a3da.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png b/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png new file mode 100644 index 0000000..8f8e83a Binary files /dev/null and b/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png differ diff --git a/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map b/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map new file mode 100644 index 0000000..5b6ac4f --- /dev/null +++ b/docs/_images/inheritance-ef07ef0a01c9e2273d8f68a219329109651d0ced.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png b/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png new file mode 100644 index 0000000..e681c0c Binary files /dev/null and b/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png differ diff --git a/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map b/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map new file mode 100644 index 0000000..1bcf33f --- /dev/null +++ b/docs/_images/inheritance-ef14f2b3b769dfe08ac4a97568e831269423d5c6.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png b/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png new file mode 100644 index 0000000..e0f52bb Binary files /dev/null and b/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png differ diff --git a/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map b/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map new file mode 100644 index 0000000..01e571b --- /dev/null +++ b/docs/_images/inheritance-f00c4480d0b7d43bea659a444a37c3260bc98999.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png b/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png new file mode 100644 index 0000000..f63fe7f Binary files /dev/null and b/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png differ diff --git a/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map b/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map new file mode 100644 index 0000000..42ff504 --- /dev/null +++ b/docs/_images/inheritance-f14fb24d8b0b8a9ee7ff5aa36258e3c89be18a07.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png b/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png new file mode 100644 index 0000000..9248041 Binary files /dev/null and b/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png differ diff --git a/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map b/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map new file mode 100644 index 0000000..7d3fa54 --- /dev/null +++ b/docs/_images/inheritance-f3d711db93d012fbddac6f9c78446c4ffa66925f.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png b/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png new file mode 100644 index 0000000..d9cdabb Binary files /dev/null and b/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png differ diff --git a/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map b/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map new file mode 100644 index 0000000..13373ca --- /dev/null +++ b/docs/_images/inheritance-f42dc988933b579b046c22d2f38a0f3d1dd20acb.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png b/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png new file mode 100644 index 0000000..fd50942 Binary files /dev/null and b/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png differ diff --git a/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map b/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map new file mode 100644 index 0000000..fac2245 --- /dev/null +++ b/docs/_images/inheritance-f4c60708fef33db21506626df8705efdad9c682b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png b/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png new file mode 100644 index 0000000..d308067 Binary files /dev/null and b/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png differ diff --git a/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map b/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map new file mode 100644 index 0000000..9774d16 --- /dev/null +++ b/docs/_images/inheritance-f5999b3b45a4347237f7d7fbd07fcf022f3c7ed3.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png b/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png new file mode 100644 index 0000000..61f17b6 Binary files /dev/null and b/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png differ diff --git a/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map b/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map new file mode 100644 index 0000000..2a2dd4e --- /dev/null +++ b/docs/_images/inheritance-f892bf31c88a61109f5f553206c74c24c31effd4.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png b/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png new file mode 100644 index 0000000..813a005 Binary files /dev/null and b/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png differ diff --git a/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map b/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map new file mode 100644 index 0000000..03b56fc --- /dev/null +++ b/docs/_images/inheritance-fa0f3808bc13c7c5e8b69f12afe760c810337775.png.map @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png b/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png new file mode 100644 index 0000000..84e1bc8 Binary files /dev/null and b/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png differ diff --git a/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map b/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map new file mode 100644 index 0000000..c6c6888 --- /dev/null +++ b/docs/_images/inheritance-fc160a406cc59035861fa2c3823e7bdab3cdb02e.png.map @@ -0,0 +1,5 @@ + + + + + diff --git a/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png b/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png new file mode 100644 index 0000000..0051e78 Binary files /dev/null and b/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png differ diff --git a/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map b/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map new file mode 100644 index 0000000..6a56305 --- /dev/null +++ b/docs/_images/inheritance-fc8d60366f9c6cc2261682bef1063a483be3bf77.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png b/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png new file mode 100644 index 0000000..1bb5b3a Binary files /dev/null and b/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png differ diff --git a/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map b/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map new file mode 100644 index 0000000..384865f --- /dev/null +++ b/docs/_images/inheritance-fed4c7882b2dd4361c30d8fe9f51645cc73b851a.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png b/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png new file mode 100644 index 0000000..6428979 Binary files /dev/null and b/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png differ diff --git a/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map b/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map new file mode 100644 index 0000000..8b975f2 --- /dev/null +++ b/docs/_images/inheritance-fed5100cb13b129037c05730e72f5a6dcce981e3.png.map @@ -0,0 +1,3 @@ + + + diff --git a/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png b/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png new file mode 100644 index 0000000..9278b9e Binary files /dev/null and b/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png differ diff --git a/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map b/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map new file mode 100644 index 0000000..828d863 --- /dev/null +++ b/docs/_images/inheritance-ffc55696b175f3a1e6bc34bea6eed7a75f5c8d3b.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png b/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png new file mode 100644 index 0000000..02db94c Binary files /dev/null and b/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png differ diff --git a/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map b/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map new file mode 100644 index 0000000..d46dc5b --- /dev/null +++ b/docs/_images/inheritance-ffcf749ae8a09c6057c73aae2d61e1ada0d40c75.png.map @@ -0,0 +1,4 @@ + + + + diff --git a/docs/_modules/cplex.html b/docs/_modules/cplex.html new file mode 100644 index 0000000..2f81b18 --- /dev/null +++ b/docs/_modules/cplex.html @@ -0,0 +1,2350 @@ + + + + + + + cplex — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex

+# --------------------------------------------------------------------------
+# File: __init__.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""The CPLEX Python API.
+
+This package contains classes for accessing CPLEX from the Python
+programming language. The most important class defined by this package
+is the `Cplex` class, which provides methods for creating, modifying,
+querying, or solving an optimization problem, and for querying aspects of
+a solution.
+
+The `exceptions` module defines the exception classes that are raised
+during abnormal operation by the CPLEX Python API.
+
+The `callbacks` module defines callback classes that can be used to alter
+the behavior of the algorithms used by CPLEX.
+
+The constant `infinity`, defined in the cplex package, should be used to
+set infinite upper and lower bounds.
+
+The classes `SparsePair` and `SparseTriple` are used as input and output
+classes for sparse vector and sparse matrix output, respectively. See
+the documentation for individual methods for details about the usage
+of these classes.
+"""
+__all__ = ["Cplex", "Stats", "Aborter", "callbacks", "exceptions",
+           "infinity", "ParameterSet", "SparsePair", "SparseTriple",
+           "model_info", "constant_class"]
+__version__ = "22.1.2.0"
+
+from contextlib import closing
+from io import BytesIO
+import os
+import weakref
+
+from .aborter import Aborter
+from . import callbacks
+from . import model_info
+from .exceptions import CplexError, WrongNumberOfArgumentsError
+from ._internal import ProblemType, Environment
+from ._internal._anno import (DoubleAnnotationInterface,
+                              LongAnnotationInterface)
+from ._internal._aux_functions import (init_list_args,
+                                       validate_arg_lengths)
+from ._internal._matrices import SparsePair, SparseTriple
+from ._internal._subinterfaces import (AdvancedCplexInterface,
+                                       ConflictInterface,
+                                       FeasoptInterface,
+                                       IndicatorConstraintInterface,
+                                       InitialInterface,
+                                       LinearConstraintInterface,
+                                       MIPStartsInterface,
+                                       ObjectiveInterface,
+                                       ObjSense,
+                                       OrderInterface,
+                                       PresolveInterface,
+                                       QuadraticConstraintInterface,
+                                       SolutionInterface,
+                                       SOSInterface,
+                                       VariablesInterface)
+from ._internal import _constants as _const
+from ._internal import _procedural as _proc
+from ._internal._multiobj import MultiObjInterface
+from ._internal._parameter_classes import RootParameterGroup  # noqa: F401
+from ._internal._pwl import PWLConstraintInterface
+from .paramset import ParameterSet
+
+infinity = _const.CPX_INFBOUND
+"""See CPX_INFBOUND in the C API."""
+
+
+
+[docs] +class Stats(): + """A class whose data members reflect statistics about a CPLEX + problem. + + An instance of this class is returned by the `Cplex.get_stats()` + method. + + The __str__ method of this class returns a string containing a + summary of the problem statistics in human readable form. + + An instance of this class always has the following integer members: + + * num_objectives + * num_variables + * num_nonnegative + * num_fixed + * num_boxed + * num_free + * num_other + * num_binary + * num_integer + * num_semicontinuous + * num_semiinteger + * num_quadratic_variables + * num_linear_objective_nz + * num_quadratic_objective_nz + * num_linear_constraints + * num_linear_less + * num_linear_equal + * num_linear_greater + * num_linear_range + * num_linear_nz + * num_linear_rhs_nz + * num_indicator_constraints + * num_indicator_less + * num_indicator_equal + * num_indicator_greater + * num_indicator_complemented + * num_indicator_nz + * num_indicator_rhs_nz + * num_quadratic_constraints + * num_quadratic_less + * num_quadratic_greater + * num_quadratic_linear_nz + * num_quadratic_nz + * num_quadratic_rhs_nz + * num_SOS_constraints + * num_SOS1 + * num_SOS1_members + * type_SOS1 + * num_SOS2 + * num_SOS2_members + * type_SOS2 + * num_lazy_constraints + * num_lazy_nnz + * num_lazy_lt + * num_lazy_eq + * num_lazy_gt + * num_lazy_rhs_nnz + * num_user_cuts + * num_user_cuts_nnz + * num_user_cuts_lt + * num_user_cuts_eq + * num_user_cuts_gt + * num_user_cuts_rhs_nnz + * num_pwl_constraints + * num_pwl_breaks + + An instance of this class always has the following float members: + + * min_lower_bound + * max_upper_bound + * min_linear_objective + * max_linear_objective + * min_linear_constraints + * max_linear_constraints + * min_linear_constraints_rhs + * max_linear_constraints_rhs + + An instance of this class returned by an instance of the Cplex + class with a quadratic objective also has the following float + members: + + * min_quadratic_objective + * max_quadratic_objective + + An instance of this class returned by an instance of the Cplex + class with ranged constraints also has the following float + members: + + * min_linear_range + * max_linear_range + + An instance of this class returned by an instance of the Cplex + class with quadratic constraints also has the following float + members: + + * min_quadratic_linear + * max_quadratic_linear + * min_quadratic + * max_quadratic + * min_quadratic_rhs + * max_quadratic_rhs + + An instance of this class returned by an instance of the Cplex + class with indicator constraints also has the following float + members: + + * min_indicator + * max_indicator + * min_indicator_rhs + * max_indicator_rhs + + An instance of this class returned by an instance of the Cplex + class with lazy constraints also has the following float members: + + * min_lazy_constraint + * max_lazy_constraint + * min_lazy_constraint_rhs + * max_lazy_constraint_rhs + + An instance of this class returned by an instance of the Cplex + class with user cuts also has the following float members: + + * min_user_cut + * max_user_cut + * min_user_cut_rhs + * max_user_cut_rhs + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, c): + self.name = c.get_problem_name() + self.sense = c.objective.sense[c.objective.get_sense()].capitalize() + + raw_stats = _proc.getprobstats(c._env._e, c._lp) + + # multi-objective stats + self.num_objectives = raw_stats.objs + + # counts of problem objects + # variable data + self.num_variables = raw_stats.cols + self.num_nonnegative = raw_stats.ncnt + self.num_fixed = raw_stats.xcnt + self.num_boxed = raw_stats.bcnt + self.num_free = raw_stats.fcnt + self.num_other = raw_stats.ocnt + self.num_binary = raw_stats.bicnt + self.num_integer = raw_stats.icnt + self.num_semicontinuous = raw_stats.scnt + self.num_semiinteger = raw_stats.sicnt + self.num_quadratic_variables = raw_stats.qpcnt + self.num_linear_objective_nz = raw_stats.objcnt + self.num_quadratic_objective_nz = raw_stats.qpnzcnt + + # linear constraint data + self.num_linear_constraints = raw_stats.rows + self.num_linear_less = raw_stats.lcnt + self.num_linear_equal = raw_stats.ecnt + self.num_linear_greater = raw_stats.gcnt + self.num_linear_range = raw_stats.rngcnt + self.num_linear_nz = raw_stats.nzcnt + self.num_linear_rhs_nz = raw_stats.rhscnt + + # indicator data + self.num_indicator_constraints = raw_stats.nindconstr + self.num_indicator_less = raw_stats.indlcnt + self.num_indicator_equal = raw_stats.indecnt + self.num_indicator_greater = raw_stats.indgcnt + self.num_indicator_complemented = raw_stats.indcompcnt + self.num_indicator_nz = raw_stats.indnzcnt + self.num_indicator_rhs_nz = raw_stats.indrhscnt + + # quadratic constraints + self.num_quadratic_constraints = raw_stats.nqconstr + self.num_quadratic_less = raw_stats.qlcnt + self.num_quadratic_greater = raw_stats.qgcnt + self.num_quadratic_linear_nz = raw_stats.linnzcnt + self.num_quadratic_nz = raw_stats.quadnzcnt + self.num_quadratic_rhs_nz = raw_stats.qrhscnt + + # SOS data + self.num_SOS_constraints = raw_stats.nsos + sos_string_list = ["", + "all continuous", + "all binary", + "all integer", + "continuous, binary, and integer", + "continuous and binary", + "continuous and integer", + "binary and integer", ] + self.num_SOS1 = raw_stats.nsos1 + self.num_SOS1_members = raw_stats.sos1nmem + self.type_SOS1 = sos_string_list[raw_stats.sos1type] + self.num_SOS2 = raw_stats.nsos2 + self.num_SOS2_members = raw_stats.sos2nmem + self.type_SOS2 = sos_string_list[raw_stats.sos2type] + + # lazy constraint data + self.num_lazy_constraints = raw_stats.lazycnt + self.num_lazy_nnz = raw_stats.lazynzcnt + self.num_lazy_lt = raw_stats.lazylcnt + self.num_lazy_eq = raw_stats.lazyecnt + self.num_lazy_gt = raw_stats.lazygcnt + self.num_lazy_rhs_nnz = raw_stats.lazyrhscnt + + # user cut data + self.num_user_cuts = raw_stats.ucutcnt + self.num_user_cuts_nnz = raw_stats.ucutnzcnt + self.num_user_cuts_lt = raw_stats.ucutlcnt + self.num_user_cuts_eq = raw_stats.ucutecnt + self.num_user_cuts_gt = raw_stats.ucutgcnt + self.num_user_cuts_rhs_nnz = raw_stats.ucutrhscnt + + # PWL constraints + self.num_pwl_constraints = raw_stats.npwl + self.num_pwl_breaks = raw_stats.npwlbreaks + + # min and max data + # variables + self.min_lower_bound = raw_stats.minlb + self.max_upper_bound = raw_stats.maxub + self.min_linear_objective = raw_stats.minobj + self.max_linear_objective = raw_stats.maxobj + if self.num_quadratic_objective_nz > 0: + self.min_quadratic_objective = raw_stats.minqcoef + self.max_quadratic_objective = raw_stats.maxqcoef + + # linear constraints + self.min_linear_constraints = raw_stats.mincoef + self.max_linear_constraints = raw_stats.maxcoef + self.min_linear_constraints_rhs = raw_stats.minrhs + self.max_linear_constraints_rhs = raw_stats.maxrhs + if self.num_linear_range > 0: + self.min_linear_range = raw_stats.minrng + self.max_linear_range = raw_stats.maxrng + + # quadratic constraints + if self.num_quadratic_constraints > 0: + self.min_quadratic_linear = raw_stats.minqcl + self.max_quadratic_linear = raw_stats.maxqcl + self.min_quadratic = raw_stats.minqcq + self.max_quadratic = raw_stats.maxqcq + self.min_quadratic_rhs = raw_stats.minqcr + self.max_quadratic_rhs = raw_stats.maxqcr + + # indicator constraints + if self.num_indicator_constraints > 0: + self.min_indicator = raw_stats.minind + self.max_indicator = raw_stats.maxind + self.min_indicator_rhs = raw_stats.minindrhs + self.max_indicator_rhs = raw_stats.maxindrhs + + # lazy constraints + if self.num_lazy_constraints > 0: + self.min_lazy_constraint = raw_stats.minlazy + self.max_lazy_constraint = raw_stats.maxlazy + self.min_lazy_constraint_rhs = raw_stats.minlazyrhs + self.max_lazy_constraint_rhs = raw_stats.maxlazyrhs + + # user cuts + if self.num_user_cuts > 0: + self.min_user_cut = raw_stats.minucut + self.max_user_cut = raw_stats.maxucut + self.min_user_cut_rhs = raw_stats.minucutrhs + self.max_user_cut_rhs = raw_stats.maxucutrhs
+ + +
+[docs] + def __str__(self): + """Returns a string containing a summary of the problem + statistics in human readable form. + """ + allinf = "all infinite" + allzero = "all zero" + sep = ", " + ret = "" + ret = ret + "Problem name : " + self.name + "\n" + ret = ret + "Objective sense : " + self.sense + "\n" + ret = ret + "Variables : %7d" % self.num_variables + if self.num_nonnegative != self.num_variables or self.num_quadratic_variables > 0: + ret = ret + " [" + sep_ind = 0 + if self.num_nonnegative > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Nneg: %d" % self.num_nonnegative + sep_ind = 1 + if self.num_fixed > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Fix: %d" % self.num_fixed + sep_ind = 1 + if self.num_boxed > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Box: %d" % self.num_boxed + sep_ind = 1 + if self.num_free > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Free: %d" % self.num_free + sep_ind = 1 + if self.num_binary > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Binary: %d" % self.num_binary + sep_ind = 1 + if self.num_integer > 0: + if sep_ind: + ret = ret + sep + ret = ret + "General Integer: %d" % self.num_integer + sep_ind = 1 + if self.num_semicontinuous > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Semi-continuous: %d" % self.num_semicontinuous + sep_ind = 1 + if self.num_semiinteger > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Semi-integer: %d" % self.num_semiinteger + sep_ind = 1 + if self.num_other > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Other: %d" % self.num_other + sep_ind = 1 + if self.num_quadratic_variables > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Qobj: %d" % self.num_quadratic_variables + sep_ind = 1 + ret = ret + "]" + ret = ret + "\n" + if self.num_objectives > 1: + ret = ret + "Objectives : %7d" % self.num_objectives + "\n" + ret = ret + " Objective nonzeros : %7d" % self.num_linear_objective_nz + "\n" + else: + ret = ret + "Objective nonzeros : %7d" % self.num_linear_objective_nz + "\n" + if self.num_quadratic_objective_nz > 0: + ret = ret + "Objective Q nonzeros : %7d" % self.num_quadratic_objective_nz + "\n" + ret = ret + "Linear constraints : %7d" % self.num_linear_constraints + if self.num_linear_constraints > 0: + ret = ret + " [" + sep_ind = 0 + if self.num_linear_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_linear_less + sep_ind = 1 + if self.num_linear_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_linear_greater + sep_ind = 1 + if self.num_linear_equal > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Equal: %d" % self.num_linear_equal + sep_ind = 1 + if self.num_linear_range > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Range: %d" % self.num_linear_range + sep_ind = 1 + ret = ret + "]" + ret = ret + "\n" + ret = ret + " Nonzeros : %7d\n" % self.num_linear_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_linear_rhs_nz + if self.num_indicator_constraints > 0: + ret = ret + \ + "Indicator constraints: %7d [" % self.num_indicator_constraints + sep_ind = 0 + if self.num_indicator_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_indicator_less + sep_ind = 1 + if self.num_indicator_equal > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Equal: %d" % self.num_indicator_equal + sep_ind = 1 + if self.num_indicator_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_indicator_greater + sep_ind = 1 + ret = ret + "]\n" + if self.num_indicator_complemented: + ret = ret + " Complemented : %7d\n" % self.num_indicator_complemented + ret = ret + " Nonzeros : %7d\n" % self.num_indicator_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_indicator_rhs_nz + if self.num_quadratic_constraints > 0: + ret = ret + \ + "Quadratic constraints: %7d [" % self.num_quadratic_constraints + sep_ind = 0 + if self.num_quadratic_less > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Less: %d" % self.num_quadratic_less + sep_ind = 1 + if self.num_quadratic_greater > 0: + if sep_ind: + ret = ret + sep + ret = ret + "Greater: %d" % self.num_quadratic_greater + sep_ind = 1 + ret = ret + "]\n" + ret = ret + " Linear terms : %7d\n" % self.num_quadratic_linear_nz + ret = ret + " Quadratic terms : %7d\n" % self.num_quadratic_nz + ret = ret + " RHS nonzeros : %7d\n" % self.num_quadratic_rhs_nz + if self.num_SOS_constraints > 0: + ret = ret + \ + "SOS : %7d [" % self.num_SOS_constraints + sep_ind = 0 + if self.num_SOS1 > 0: + if sep_ind: + ret = ret + sep + ret = ret + "SOS1: %d, %d members" % (self.num_SOS1, + self.num_SOS1_members) + if self.type_SOS1: + ret += ", %s" % self.type_SOS1 + sep_ind = 1 + if self.num_SOS2 > 0: + if sep_ind: + ret = ret + "; " + ret = ret + "SOS2: %d, %d members" % (self.num_SOS2, + self.num_SOS2_members) + if self.type_SOS2: + ret += ", %s" % self.type_SOS2 + sep_ind = 1 + ret = ret + "]\n" + if self.num_pwl_constraints > 0: + ret = ret + \ + "PWL : %7d [" % self.num_pwl_constraints + if self.num_pwl_breaks > 0: + ret = ret + "Breaks: %d" % self.num_pwl_breaks + ret = ret + "]\n" + ret = ret + "\n" + if self.min_lower_bound > -infinity: + valstr1 = str("%#-15.7g" % self.min_lower_bound) + else: + valstr1 = allinf + if self.max_upper_bound < infinity: + valstr2 = str("%#-15.7g" % self.max_upper_bound) + else: + valstr2 = allinf + ret = ret + \ + "Variables : Min LB: %-15s Max UB: %-15s\n" % ( + valstr1, valstr2) + if self.min_linear_objective > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_objective) + else: + valstr1 = allzero + if self.max_linear_objective < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_objective) + else: + valstr2 = allzero + ret = ret + \ + "Objective nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_quadratic_objective_nz > 0: + if self.min_quadratic_objective > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_objective) + else: + valstr1 = allzero + if self.max_quadratic_objective < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_objective) + else: + valstr2 = allzero + ret = ret + \ + "Objective Q nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + ret = ret + "Linear constraints :\n" + if self.min_linear_constraints > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_constraints) + else: + valstr1 = allzero + if self.max_linear_constraints < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_constraints) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_linear_constraints_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_linear_constraints_rhs) + else: + valstr1 = allzero + if self.max_linear_constraints_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_linear_constraints_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_linear_range > 0: + ret = ret + " Range values : Min : %#-15.7g Max : %#-15.7g\n" % ( + self.min_linear_range, self.max_linear_range) + if self.num_quadratic_constraints > 0: + ret = ret + "Quadratic constraints:\n" + if self.min_quadratic_linear > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_linear) + else: + valstr1 = allzero + if self.max_quadratic_linear < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_linear) + else: + valstr2 = allzero + ret = ret + \ + " Linear terms : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_quadratic > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic) + else: + valstr1 = allzero + if self.max_quadratic < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic) + else: + valstr2 = allzero + ret = ret + \ + " Quadratic terms : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_quadratic_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_quadratic_rhs) + else: + valstr1 = allzero + if self.max_quadratic_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_quadratic_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_indicator_constraints > 0: + ret = ret + "Indicator constraints:\n" + if self.min_indicator > -infinity: + valstr1 = str("%#-15.7g" % self.min_indicator) + else: + valstr1 = allzero + if self.max_indicator < infinity: + valstr2 = str("%#-15.7g" % self.max_indicator) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_indicator_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_indicator_rhs) + else: + valstr1 = allzero + if self.max_indicator_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_indicator_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_lazy_constraints > 0: + ret = ret + "Lazy constraints :\n" + if self.min_lazy_constraint > -infinity: + valstr1 = str("%#-15.7g" % self.min_lazy_constraint) + else: + valstr1 = allzero + if self.max_lazy_constraint < infinity: + valstr2 = str("%#-15.7g" % self.max_lazy_constraint) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_lazy_constraint_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_lazy_constraint_rhs) + else: + valstr1 = allzero + if self.max_lazy_constraint_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_lazy_constraint_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.num_user_cuts > 0: + ret = ret + "User cuts :\n" + if self.min_user_cut > -infinity: + valstr1 = str("%#-15.7g" % self.min_user_cut) + else: + valstr1 = allzero + if self.max_user_cut < infinity: + valstr2 = str("%#-15.7g" % self.max_user_cut) + else: + valstr2 = allzero + ret = ret + \ + " Nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + if self.min_user_cut_rhs > -infinity: + valstr1 = str("%#-15.7g" % self.min_user_cut_rhs) + else: + valstr1 = allzero + if self.max_user_cut_rhs < infinity: + valstr2 = str("%#-15.7g" % self.max_user_cut_rhs) + else: + valstr2 = allzero + ret = ret + \ + " RHS nonzeros : Min : %-15s Max : %-15s\n" % ( + valstr1, valstr2) + return ret
+
+ + + +def _is_special_filetype(filename, filetype, ext): + if filetype is None or filetype == "": + for extra_ext in ('', '.gz', '.bz2'): + if (isinstance(filename, str) and + filename.endswith('.' + ext + extra_ext)): + return True + else: + if filetype == ext: + return True + return False + + +def _getcplexstudiodir(): + version, release, modification, _ = __version__.split(".") + # There is a small oddity in how the environment variable + # CPLEX_STUDIO_DIR<VERSION> is called: A "0" in MODIFICATION is + # ignored (i.e., instead of "1280" for 12.8.0, we use "128"). + if modification == "0": + modification = "" + return "CPLEX_STUDIO_DIR{0}{1}{2}".format(version, release, modification) + + +def _setcpxchecklicdir(): + # Only try to set CPLEX_CPXCHECKLIC_BINDIR if CPLEX_STUDIO_KEY is set + # and CPLEX_STUDIO_DIR and CPLEX_CPXCHECKLIC_BINDIR are not set. + if ((not os.getenv("CPLEX_STUDIO_KEY")) or os.getenv(_getcplexstudiodir()) or os.getenv("CPLEX_CPXCHECKLIC_BINDIR")): + return + # First, try using shutil.which(). + import shutil + cpxchecklic = shutil.which("cpxchecklic") + if cpxchecklic: + os.environ["CPLEX_CPXCHECKLIC_BINDIR"] = os.path.dirname(cpxchecklic) + return + # Then, if not successful, try using site.getusersitepackages(). + import site + pydir = os.path.dirname(site.getusersitepackages()) + for dirname in ("bin", "Scripts"): + cpxchecklic = os.path.join(pydir, dirname, "cpxchecklic") + if os.path.exists(cpxchecklic): + os.environ["CPLEX_CPXCHECKLIC_BINDIR"] = os.path.dirname(cpxchecklic) + return + # If neither of those works, then give up. + + +# Attempt to set CPLEX_CPXCHECKLIC_BINDIR automatically. This should +# happen once on "import cplex". +_setcpxchecklicdir() + + +
+[docs] +class Cplex(): + """A class encapsulating a CPLEX Problem. + + An instance of the Cplex class provides methods for creating, + modifying, and querying an optimization problem, solving it, and + querying aspects of the solution. + + Most of the methods are provided within subinterfaces: for example, + methods for adding, modifying, and querying data associated with + variables are within the `Cplex.variables` interface, and methods for + querying the solution are within the `Cplex.solution` category. + + :undocumented: __del__ + """ + + problem_type = ProblemType() + """See `ProblemType` """ + +
+[docs] + def __init__(self, *args): + """Constructor of the Cplex class. + + The Cplex constructor accepts four types of argument lists. + + >>> cpx = cplex.Cplex() + + cpx is a new problem with no data + + >>> cpx = cplex.Cplex("filename") + + cpx is a new problem containing the data in filename. If filename + does not exist, an exception is raised. + + >>> cpx = cplex.Cplex("filename", "filetype") + + same as form 2, but cplex reads the file filename as a file of + type filetype, rather than inferring the file type from its + extension. + + >>> cpx = cplex.Cplex(old_cpx) + + cpx contains the same problem data as old_cpx, but is a different + object and contains no solution data. Future changes to one do + not affect the other. + + The Cplex object is a context manager and can be used, like so: + + >>> import cplex + >>> with cplex.Cplex() as cpx: + ... # do stuff + ... pass + + When the with-block is finished, the `end()` method will be + called automatically. + """ + # Declare and initialize attributes + self._disposed = False + self._aborter = None + self._env = None + self._lp = None + self._pslst = [] + # Initialize data strucutures associated with CPLEX + nargs = len(args) + if nargs > 2: + raise WrongNumberOfArgumentsError() + self._env = Environment() + if nargs == 0: + self._lp = _proc.createprob(self._env._e, "") + elif nargs == 1: + if isinstance(args[0], Cplex): + self._lp = _proc.cloneprob(self._env._e, args[0]._lp) + elif isinstance(args[0], str): + self._lp = _proc.createprob(self._env._e, args[0]) + _proc.readcopyprob(self._env._e, self._lp, args[0]) + else: + raise TypeError("invalid argument: {0}".format(args[0])) + else: + assert nargs == 2 + if isinstance(args[0], str) and isinstance(args[1], str): + self._lp = _proc.createprob(self._env._e, args[0]) + _proc.readcopyprob(self._env._e, self._lp, args[0], args[1]) + else: + raise TypeError("invalid arguments: {0}".format(args)) + self._env_lp_ptr = _proc.pack_env_lp_ptr(self._env._e, self._lp) + + self.parameters = self._env.parameters + """See `RootParameterGroup`""" + self.parameters._cplex = weakref.proxy(self) + + self.variables = VariablesInterface(self) + """See `VariablesInterface`""" + + self.linear_constraints = LinearConstraintInterface( + self) + """See `LinearConstraintInterface`""" + + self.quadratic_constraints = QuadraticConstraintInterface(self) + """See `QuadraticConstraintInterface`""" + + self.indicator_constraints = IndicatorConstraintInterface(self) + """See `IndicatorConstraintInterface`""" + + self.SOS = SOSInterface(self) + """See `SOSInterface`""" + + self.objective = ObjectiveInterface(self) + """See `ObjectiveInterface`""" + + self.multiobj = MultiObjInterface(self) + """See `MultiObjInterface`""" + + self.MIP_starts = MIPStartsInterface(self) + """See `MIPStartsInterface`""" + + self.solution = SolutionInterface(self) + """See `SolutionInterface`""" + + self.presolve = PresolveInterface(self) + """See `PresolveInterface`""" + + self.order = OrderInterface(self) + """See `OrderInterface`""" + + self.conflict = ConflictInterface(self) + """See `ConflictInterface`""" + + self.advanced = AdvancedCplexInterface(self) + """See `AdvancedCplexInterface`""" + + self.start = InitialInterface(self) + """See `InitialInterface`""" + + self.feasopt = FeasoptInterface(self) + """See `FeasoptInterface`""" + + self.long_annotations = LongAnnotationInterface(self) + """See `LongAnnotationInterface`""" + + self.double_annotations = DoubleAnnotationInterface(self) + """See `DoubleAnnotationInterface`""" + + self.pwl_constraints = PWLConstraintInterface(self) + """See `PWLConstraintInterface`"""
+ + +
+[docs] + def end(self): + """Releases the Cplex object. + + Frees all data structures associated with CPLEX. After a call of + the method end(), the invoking Cplex object and all objects that + have been created with it (such as variables and constraints) can + no longer be used. Attempts to use them subsequently raise a + ValueError. + + Note + The Cplex object is a context manager. Thus, rather than + calling this method explicitly, the best practice should be to + use a Cplex object in a "with" statement (see `__enter__` and + `__exit__`). + + Example usage: + + >>> import cplex + >>> cpx = cplex.Cplex() + >>> cpx.end() + """ + if self._disposed: + return + self._disposed = True + # free aborter if necc. + if self._aborter: + self.remove_aborter() + # free prob + if self._env and self._lp: + try: + _proc.setgenericcallbackfunc(self._env._e, self._lp, 0, None) + except: # noqa: E722 + # Ignore exception in destructor, in particular we may + # get CPXERR_NOT_ONE_PROBLEM here. + pass + _proc.freeprob(self._env._e, self._lp) + # free parameter sets if necc. + for ps in self._pslst: + ps.end() + # free env + if self._env: + self._env._end()
+ + +
+[docs] + def __del__(self): + """non-public""" + self.end()
+ + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The "with" statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + Cplex objects return themselves. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as cpx: + ... # do stuff + ... pass + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with-block, the `end()` method is called + automatically. + """ + self.end()
+ + +
+[docs] + def read(self, filename, filetype=""): + """Reads a problem from file. + + The first argument is a string specifying the filename from which + the problem will be read. + + If the method is called with two arguments, the second argument + is a string specifying the file type. If this argument is + omitted, filetype is taken to be the extension of the filename. + + See `CPXreadcopyprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopyprob.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + """ + _proc.readcopyprob(self._env._e, self._lp, filename, filetype)
+ + +
+[docs] + def write(self, filename, filetype=""): + """Writes a problem to a file. + + The first argument is a string specifying the filename to which + the problem will be written. + + If the filename ends with .bz2 (for BZip2) or .gz (for GNU Zip), + a compressed file is written. + + If the method is called with two arguments, the second argument + is a string specifying the file type. If this argument is + omitted, filetype is taken to be the extension of the filename. + + If filetype is any of "sav", "mps", "lp", the problem is written + in the corresponding format. If filetype is either "rew" or "rlp" + the problem is written with generic names in mps or lp format, + respectively. If filetype is "alp" the problem is written with + generic names in lp format, where the variable names are + annotated to indicate the type and bounds of each variable. + + If filetype is "dua", the dual problem is written to a file. If + filetype is "emb", an embedded network problem is written to a + file. If filetype is "ppe", the perturbed problem is written to a + file. If filetype is "dpe", the perturbed dual problem is written + to a file. + + For documentation of the file types, see the CPLEX File Format + Reference Manual. + + See `CPXwriteprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeprob.html>`_, `CPXdualwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dualwrite.html>`_, + `CPXembwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/embwrite.html>`_, `CPXdperwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dperwrite.html>`_, and + `CPXpperwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/pperwrite.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> c.write("example.lp") + """ + if _is_special_filetype(filename, filetype, 'dua'): + _proc.dualwrite(self._env._e, self._lp, filename) + elif _is_special_filetype(filename, filetype, 'emb'): + _proc.embwrite(self._env._e, self._lp, filename) + elif _is_special_filetype(filename, filetype, 'dpe'): + epsilon = self.parameters.simplex.perturbation.constant.get() + _proc.dperwrite(self._env._e, self._lp, filename, epsilon) + elif _is_special_filetype(filename, filetype, 'ppe'): + epsilon = self.parameters.simplex.perturbation.constant.get() + _proc.pperwrite(self._env._e, self._lp, filename, epsilon) + else: + _proc.writeprob(self._env._e, self._lp, filename, filetype)
+ + +
+[docs] + def write_to_stream(self, stream, filetype='LP', comptype=''): + """Writes a problem to a file-like object in the given file format. + + The filetype argument can be any of "sav" (a binary format), "lp" + (the default), "mps", "rew", "rlp", or "alp" (see `Cplex.write` + for an explanation of these). + + If comptype is "bz2" (for BZip2) or "gz" (for GNU Zip), a + compressed file is written. + + See `CPXwriteprob <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeprob.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> class NoOpStream(): + ... def __init__(self): + ... self.was_called = False + ... def write(self, bytes): + ... self.was_called = True + ... pass + ... def flush(self): + ... pass + >>> stream = NoOpStream() + >>> c.write_to_stream(stream) + >>> stream.was_called + True + """ + try: + callable(stream.write) + except AttributeError: + raise CplexError("stream must have a write method") + try: + callable(stream.flush) + except AttributeError: + raise CplexError("stream must have a flush method") + # Since there is no filename argument, we validate the + # compression type. + if comptype not in ('', 'bz2', 'gz'): + raise ValueError( + "invalid compression type specified for comptype: {0}".format( + comptype)) + # Any base name will do for the filename. Note that the + # compression type must be specified in the filename (not the + # filetype). + filename = "prob.{0}".format(filetype) + if comptype: + filename += ".{0}".format(comptype) + _proc.writeprobdev(self._env._e, self._lp, stream, + filename, filetype)
+ + +
+[docs] + def write_as_string(self, filetype='LP', comptype=''): + """Writes a problem as a string in the given file format. + + For an explanation of the filetype and comptype arguments, see + `Cplex.write_to_stream`. + + Note + When SAV format is specified for filetype or a compressed file + format is specified for comptype, the return value will be a + byte string. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x1', 'x2', 'x3']) + >>> lp_str = c.write_as_string("lp") + >>> len(lp_str) > 0 + True + """ + fileenc = self.parameters.read.fileencoding.get() + with closing(BytesIO()) as output: + self.write_to_stream(output, filetype, comptype) + result = output.getvalue() + # Never decode for SAV format nor compressed files. + if not (filetype.lower().startswith("sav") or comptype): + result = result.decode(fileenc) + return result
+ + +
+[docs] + def read_annotations(self, filename): + """Reads annotations from a file. + + See `CPXreadcopyannotations <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopyannotations.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> idx = c.double_annotations.add('ann1', 0) + >>> objtype = c.double_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.write_annotations('example.ann') + >>> c.long_annotations.delete() + >>> c.double_annotations.delete() + >>> c.long_annotations.get_num() + 0 + >>> c.double_annotations.get_num() + 0 + >>> c.read_annotations('example.ann') + >>> c.long_annotations.get_num() + 1 + >>> c.double_annotations.get_num() + 1 + """ + _proc.readcopyanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def write_annotations(self, filename): + """Writes the annotations to a file. + + See `CPXwriteannotations <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writeannotations.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.variable + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.write_annotations('example.ann') + """ + _proc.writeanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def write_benders_annotation(self, filename): + """Writes the annotation of the auto-generated decomposition. + + Writes the annotation of the decompostion CPLEX automatically + generates for the model of the CPLEX problem object to the + specified file. + + See `CPXwritebendersannotation <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/writebendersannotation.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read('UFL_25_35_1.mps') + >>> c.write_benders_annotation('UFL_25_35_1.ann') + """ + _proc.writebendersanno(self._env._e, self._lp, filename)
+ + +
+[docs] + def get_problem_type(self): + """Returns the problem type. + + See `CPXgetprobtype <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getprobtype.html>`_ in the Callable Library Reference + Manual for more detail. + + The return value is an attribute of `problem_type`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.get_problem_type() + 0 + >>> c.problem_type[c.get_problem_type()] + 'LP' + """ + return _proc.getprobtype(self._env._e, self._lp)
+ + +
+[docs] + def set_problem_type(self, type, soln=None): + """Changes the problem type. + + If only one argument is given, that argument specifies the new + problem type (see `problem_type`). It must be one of the + following: + + * Cplex.problem_type.LP + * Cplex.problem_type.MILP + * Cplex.problem_type.fixed_MILP + * Cplex.problem_type.QP + * Cplex.problem_type.MIQP + * Cplex.problem_type.fixed_MIQP + * Cplex.problem_type.QCP + * Cplex.problem_type.MIQCP + + If an optional second argument is given, it is taken to be an + identifier of a member of the solution pool. In this case, the + first argument must be one of the following: + + * Cplex.problem_type.fixed_MILP + * Cplex.problem_type.fixed_MIQP + + See `CPXchgprobtype <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobtype.html>`_ and `CPXchgprobtypesolnpool <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobtypesolnpool.html>`_ + in the Callable Library Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_type(c.problem_type.LP) + """ + if soln is None: + _proc.chgprobtype(self._env._e, self._lp, type) + else: + _proc.chgprobtypesolnpool(self._env._e, self._lp, type, soln)
+ + + def _is_MIP(self): + """non-public""" + probtype = self.get_problem_type() + return probtype in (Cplex.problem_type.MILP, + Cplex.problem_type.MIQP, + Cplex.problem_type.MIQCP) + + def _setup_callbacks(self): + """non-public""" + for cb in self._env._callbacks: + cb._env_lp_ptr = self._env_lp_ptr + if hasattr(cb, "_setup"): + cb._setup(self._env._e, self._lp) + +
+[docs] + def solve(self, paramsets=None): + """Solves the problem. + + The optional paramsets argument can only be specified when + multiple objectives are present (otherwise, a ValueError is + raised). paramsets must be a sequence containing `ParameterSet` + objects (see `Cplex.create_parameter_set`) or None. See + `CPXmultiobjopt <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjopt.html>`_ in the Callable Library Reference Manual + for more detail. + + Note + The solve method returning normally (i.e., without raising an + exception) does not necessarily mean that an optimal or + feasible solution has been found. Use + `SolutionInterface.get_status()` to query the status of the + current solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> status = c.solution.get_status() + """ + (paramsets,) = init_list_args(paramsets) + self._setup_callbacks() + ismultiobj = _proc.ismultiobj(self._env._e, self._lp) + if (not ismultiobj and paramsets): + raise ValueError("paramsets argument can only be specified" + " for a multi-objective model") + if ismultiobj: + nprios = _proc.getnumprios(self._env._e, self._lp) + nparamsets = len(paramsets) + if nparamsets > 0 and nprios != nparamsets: + raise ValueError("if specified, len(paramsets) ({0})" + " must be equal to the number of" + " priorities ({1})".format(nparamsets, nprios)) + _proc.multiobjopt(self._env._e, self._lp, + [None if ps is None else ps._ps + for ps in paramsets]) + elif self._is_MIP(): + _proc.mipopt(self._env._e, self._lp) + elif self.quadratic_constraints.get_num() > 0: + lpmethod = self.parameters.lpmethod.get() + if lpmethod in (_const.CPX_ALG_BARRIER, _const.CPX_ALG_AUTOMATIC): + _proc.hybbaropt(self._env._e, self._lp, _const.CPX_ALG_NONE) + else: + _proc.qpopt(self._env._e, self._lp) + elif not self.objective.get_num_quadratic_nonzeros() > 0: + _proc.lpopt(self._env._e, self._lp) + else: + _proc.qpopt(self._env._e, self._lp)
+ + +
+[docs] + def runseeds(self, cnt=30): + """Evaluates the variability of the problem. + + Solves the same problem instance multiple times using different + random seeds allowing the user to evaluate the variability of the + problem class the instance belongs to. + + The optional cnt argument specifies the number of times + optimization should be performed (the default is 30). + + A problem must be an MILP, MIQP, or MIQCP and must exist in + memory. + """ + self._setup_callbacks() + _proc.runseeds(self._env._e, self._lp, cnt)
+ + +
+[docs] + def populate_solution_pool(self): + """Generates a variety of solutions to a discrete problem (MIP, MIQP, MIQCP). + + The algorithm that populates the solution pool works in two + phases. + + In the first phase, it solves the problem to optimality (or + some stopping criterion set by the user) while it sets up a + branch and cut tree for the second phase. + + In the second phase, it generates multiple solutions by using + the information computed and stored in the first phase and by + continuing to explore the tree. + + For more information, see the function `CPXpopulate <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/populate.html>`_ in the + Callable Library Reference Manual and the topic solution pool + in the CPLEX User's Manual. + """ + self._setup_callbacks() + _proc.populate(self._env._e, self._lp)
+ + +
+[docs] + def get_problem_name(self): + """Returns the problem name. + + See `CPXgetprobname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getprobname.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_name("prob1") + >>> c.get_problem_name() + 'prob1' + """ + return _proc.getprobname(self._env._e, self._lp)
+ + +
+[docs] + def set_problem_name(self, name): + """Sets the problem name. + + See `CPXchgprobname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/chgprobname.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.set_problem_name("prob1") + >>> c.get_problem_name() + 'prob1' + """ + _proc.chgprobname(self._env._e, self._lp, name)
+ + +
+[docs] + def cleanup(self, epsilon): + """Deletes values from the problem data with absolute value + smaller than epsilon. + + See `CPXcleanup <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/cleanup.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0, 1e-10, 1.0]) + >>> c.objective.get_linear() + [1.0, 1e-10, 1.0] + >>> c.cleanup(epsilon=1e-6) + >>> c.objective.get_linear() + [1.0, 0.0, 1.0] + """ + _proc.cleanup(self._env._e, self._lp, epsilon)
+ + +
+[docs] + def register_callback(self, callback_class): + """Registers a callback class for use during optimization. + + callback_class must be a proper subclass of one of the callback + classes defined in the module `callbacks`. To implement custom + logic, override the __call__ method with a method that has + signature __call__(self) -> None. If callback_class is a subclass + of more than one callback class, it will only be called when its + first superclass is called. register_callback returns the + instance of callback_class registered for use. Any previously + registered callback of the same class will no longer be + registered. + + Returns an instance of callback_class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback): + ... pass + >>> cb = c.register_callback(MyMIPInfoCallback) + """ + return self._env.register_callback(callback_class)
+ + +
+[docs] + def unregister_callback(self, callback_class): + """Stops a callback class from being used. + + callback_class must be one of the callback classes defined in the + module `callbacks` or a subclass of one of them. This method + unregisters any previously registered callback of the same class. + If callback_class is a subclass of more than one callback class, + this method will unregister only the callback of the same type as + its first superclass. + + Returns the instance of callback_class just unregistered. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback): + ... pass + >>> cb = c.register_callback(MyMIPInfoCallback) + >>> cb = c.unregister_callback(MyMIPInfoCallback) + """ + return self._env.unregister_callback(callback_class)
+ + +
+[docs] + def set_results_stream(self, results_file, fn=None): + """Specifies where results will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which results will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_results_stream(f) + ... output.write("this is an example") + """ + return self._env.set_results_stream(results_file, fn)
+ + +
+[docs] + def set_warning_stream(self, warning_file, fn=None): + """Specifies where warnings will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which warnings will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_warning_stream(f) + ... output.write("this is an example") + """ + return self._env.set_warning_stream(warning_file, fn)
+ + +
+[docs] + def set_error_stream(self, error_file, fn=None): + """Specifies where errors will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which errors will be written. To write to + this stream, use this object's write() method. + + Example usage: + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_error_stream(f) + ... output.write("this is an example") + """ + return self._env.set_error_stream(error_file, fn)
+ + +
+[docs] + def set_log_stream(self, log_file, fn=None): + """Specifies where the log will be printed. + + The first argument must be a file-like object (i.e., an object + with a write method and a flush method). Use None as the first + argument to suppress output. + + The second optional argument is a function that takes a string as + input and returns a string. If specified, strings sent to this + stream will be processed by this function before being written. + + Returns the stream to which the log will be written. To write to + this stream, use this object's write() method. + + >>> import cplex + >>> with cplex.Cplex() as c, open("output.txt", "w") as f: + ... output = c.set_log_stream(f) + ... output.write("this is an example") + """ + return self._env.set_log_stream(log_file, fn)
+ + +
+[docs] + def get_version(self): + """Returns a string specifying the version of CPLEX. + + See `CPXversion <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/version.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> version = c.get_version() + """ + return self._env.get_version()
+ + +
+[docs] + def get_versionnumber(self): + """Returns an integer specifying the version of CPLEX. + + The version of CPLEX is in the format vvrrmmff, where vv is the + version, rr is the release, mm is the modification, and ff is the + fixpack number. For example, for CPLEX version 12.5.0.1 the + returned value is 12050001. + + See `CPXversionnumber <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/versionnumber.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> versionnumber = c.get_versionnumber() + """ + return self._env.get_versionnumber()
+ + +
+[docs] + def get_num_cores(self): + """Returns the number of cores on this machine. + + See `CPXgetnumcores <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getnumcores.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> num_cores = c.get_num_cores() + """ + return self._env.get_num_cores()
+ + +
+[docs] + def get_stats(self): + """Returns a `Stats` object containing problem statistics. + + Note + Printing the `Stats` object will give a nice summary of the + problem statistics in human readable form (e.g. as with the + "display problem statistics" command in the CPLEX interactive). + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> stats = c.get_stats() + >>> stats.num_variables + 32 + >>> stats.num_linear_constraints + 27 + """ + return Stats(self)
+ + +
+[docs] + def get_time(self): + """Returns a time stamp in seconds. + + To measure time spent between a starting point and ending point + of an operation, take the result of this method at the starting + point; take the result of this method at the end point; subtract + the starting time stamp from the ending time stamp; the + subtraction yields elapsed time in seconds. + + The interpretation of this value as wall clock time or CPU time + is controlled by the parameter clocktype. + + The absolute value of the time stamp is not meaningful. + + See `CPXgettime <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/gettime.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> start = c.get_time() + >>> c.solve() + >>> solve_time = c.get_time() - start + """ + return self._env.get_time()
+ + +
+[docs] + def get_dettime(self): + """Returns a deterministic time stamp in ticks. + + To measure elapsed deterministic time in ticks between a starting + point and ending point of an operation, take the deterministic + time stamp at the starting point; take the deterministic time + stamp at the ending point; subtract the starting deterministic + time stamp from the ending deterministic time stamp. + + The absolute value of the deterministic time stamp is not + meaningful. + + See `CPXgetdettime <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getdettime.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> start = c.get_dettime() + >>> c.solve() + >>> solve_dettime = c.get_dettime() - start + """ + return self._env.get_dettime()
+ + +
+[docs] + def use_aborter(self, aborter): + """Use an `Aborter` to control termination of solve methods. + + Instructs the invoking object to use the aborter to control + termination of its solving and tuning methods. + + If another aborter is already being used by the invoking object, + then this method overrides the previously used aborter. + + Returns the aborter installed in the invoking object or None. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + """ + self.remove_aborter() + self._aborter = aborter + if self._aborter is not None: + _proc.setterminate(self._env._e, self._env_lp_ptr, + self._aborter._p) + self._aborter._register(self) + return self._aborter
+ + +
+[docs] + def remove_aborter(self): + """Removes the `Aborter` being used by the invoking object. + + Returns the aborter that was removed or None. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + >>> aborter = c.remove_aborter() + """ + aborter, self._aborter = (self._aborter, None) + _proc.setterminate(self._env._e, self._env_lp_ptr, None) + if aborter is not None: + aborter._unregister(self) + return aborter
+ + +
+[docs] + def get_aborter(self): + """Returns the `Aborter` being used by the invoking object. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> aborter = c.use_aborter(cplex.Aborter()) + >>> aborter = c.get_aborter() + """ + return self._aborter
+ + +
+[docs] + def set_callback(self, functor=None, contextmask=0): + """Set callback function to use during optimization. + + Sets the callback that CPLEX invokes during optimization. If + functor is None then contextmask will be treated as 0 and the + callback is effectively cleared from CPLEX. + + In all other cases functor must be a reference to an object that + has a callable member called 'invoke' (if that does not exist, or + is not a callable, an exception will occur the first time CPLEX + attempts to invoke the callback). Whenever CPLEX needs to invoke + the callback it calls this member with exactly one argument: an + instance of `cplex.callbacks.Context`. + + Note that in the 'invoke' function you must not invoke any + functions of the Cplex instance that is performing the current + solve. All functions that can be invoked from a callback are + members of the `cplex.callbacks.Context` class. + + contextmask must be the bitwise OR of values from + `cplex.callbacks.Context.id` and specifies in which contexts + CPLEX shall invoke the callback: the callback is invoked in all + contexts for which the corresponding bit is set in contextmask. + + Note about cplex.callbacks.Context.id.thread_down: This is + considered a "destructor" function and should not raise any + exception. Any exception raised from the callback in this context + will just be ignored. + + See `cplex.callbacks.Context`. + + See `CPXcallbacksetfunc <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbacksetfunc.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> class GenericCB(): + ... def invoke(self, context): + ... pass # Do something here. + >>> cb = GenericCB() + >>> c.set_callback(cb) # Register callback. + >>> c.set_callback(None) # Clear callback. + """ + # First of all, clear any existing callback + self._genericcallback = None + self._genericcontextmask = None + _proc.setgenericcallbackfunc(self._env._e, self._lp, contextmask, None) + # TODO: Use hasattr() or similar to check whether 'functor' has + # a method called 'invoke'? This is never a complete + # guard since the attribute may be deleted from the instance + # later. So for now we just don't do it. + # FIXME: This is very shaky since the callback will be deleted + # whenever we create a new self._lp :-( So far I don't see us + # deleting/recreating self._lp anywhere, but if that ever + # happens we have to be careful. + if contextmask != 0 and functor is not None: + _proc.setgenericcallbackfunc(self._env._e, self._lp, contextmask, + self) + self._genericcallback = functor + self._genericcontextmask = contextmask
+ + + def _invoke_generic_callback(self, contextptr, contextid): + """non-public""" + # This is invoked by the cpxpygenericcallbackfuncwrap() trampoline + # function in the native code and is responsible for invoking the + # user callback. + context = callbacks.Context(weakref.proxy(self), contextptr, contextid) + if context.get_id() == callbacks.Context.id.thread_down: + # For thread_down we ignore any exception + try: + self._genericcallback.invoke(context) + except: # noqa: E722 + pass + else: + self._genericcallback.invoke(context) + +
+[docs] + def set_modeling_assistance_callback(self, functor=None): + """Set callback function to use for modeling assistance warnings. + + Sets the callback that CPLEX invokes before and after + optimization (once for every modeling issue detected). If functor + is None then the callback is effectively cleared from CPLEX. The + callback function will only be invoked if the CPLEX parameter + Cplex.parameters.read.datacheck is set to + Cplex.parameters.read.datacheck.values.assist (2). In addition, + the parameter Cplex.parameters.read.warninglimit controls the + number of times each type of modeling assistance warning will be + reported (the rest will be ignored). See CPX_PARAM_DATACHECK and + CPX_PARAM_WARNLIM in the Parameters of CPLEX Reference Manual. + + In all other cases functor must be a reference to an object that + has a callable attribute named 'invoke' (if that does not exist, + or is not a callable, an exception will occur the first time CPLEX + attempts to invoke the callback). Whenever CPLEX needs to invoke + the callback it calls this member with two argument: the modeling + issue ID and the associated warning message. + + See `model_info`. + + See `CPXmodelasstcallbacksetfunc <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/modelasstcallbacksetfunc.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.read.datacheck.set( + ... c.parameters.read.datacheck.values.assist) + >>> class ModelAsstCB(): + ... def invoke(self, issueid, message): + ... pass # Do something here. + >>> cb = ModelAsstCB() + >>> c.set_modeling_assistance_callback(cb) # Register callback. + >>> c.set_modeling_assistance_callback(None) # Clear callback. + """ + # First of all, clear any existing callback + self._modelasstcb = None + _proc.modelasstcallbacksetfunc(self._env._e, self._lp, None) + # We could use hasattr() or similar to check whether 'functor' + # has a method called 'invoke'. This is never a complete guard + # since the attribute may be deleted from the instance later. So, + # for now, we just don't check anything. + # FIXME: See FIXME in set_callback above. + if functor is not None: + _proc.modelasstcallbacksetfunc(self._env._e, self._lp, self) + self._modelasstcb = functor
+ + + def _invoke_modelasst_callback(self, issueid, message): + """non-public""" + # This is invoked by the cpxpymodelasstcallbackfuncwrap() + # trampoline function in the native code and is responsible for + # invoking the user callback. + self._modelasstcb.invoke(issueid, message) + +
+[docs] + def create_parameter_set(self): + """Returns a new CPLEX parameter set object that is associated + with this CPLEX problem object. + + Note + When this CPLEX problem object is destroyed, the parameter set + object returned by this function will also be destoyed. + + See `ParameterSet`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(ps) + 1 + """ + ps = ParameterSet(self._env) + self._pslst.append(ps) + return ps
+ + +
+[docs] + def copy_parameter_set(self, source): + """Returns a deep copy of a parameter set. + + In a sense, this a convenience function; it is equivalent to + querying what parameters are in the source parameter set, + querying their values, and then adding those parameters to the + target parameter set. + + Note + The source parameter set must have been created by this CPLEX + problem object. Mixing parameter sets from different CPLEX + problem objects is not supported. + + Note + When this CPLEX problem object is destroyed, the parameter set + object returned by this function will also be destoyed. + + See `ParameterSet`. + + See `CPXparamsetcopy <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/paramsetcopy.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> source = c.create_parameter_set() + >>> source.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(source) + 1 + >>> target = c.copy_parameter_set(source) + >>> len(target) + 1 + """ + if not isinstance(source, ParameterSet): + raise TypeError("source must be a ParameterSet") + if source not in self._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + target = ParameterSet(self._env) + self._pslst.append(target) + _proc.paramsetcopy(self._env._e, target._ps, source._ps) + return target
+ + +
+[docs] + def get_parameter_set(self): + """Returns a parameter set containing parameters that have been + changed from their default values in the environment. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.advance.set(c.parameters.advance.values.none) + >>> ps = c.get_parameter_set() + >>> val = ps.get(c.parameters.advance) + >>> val == c.parameters.advance.values.none + True + """ + ps = ParameterSet(self._env) + self._pslst.append(ps) + for param, value in self.parameters.get_changed(): + ps.add(param._id, value) + return ps
+ + +
+[docs] + def set_parameter_set(self, source): + """Applies the parameter values in the paramset to the + environment. + + Note + The source parameter set must have been created by this CPLEX + problem object. Mixing parameter sets from different CPLEX + problem objects is not supported. + + See `CPXparamsetapply <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/paramsetapply.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> c.set_parameter_set(ps) + >>> value = c.parameters.advance.get() + >>> value == c.parameters.advance.values.none + True + """ + if not isinstance(source, ParameterSet): + raise TypeError("source must be a ParameterSet") + if source not in self._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + _proc.paramsetapply(self._env._e, source._ps)
+ + +
+[docs] + def copylp(self, numcols, numrows, objsense=ObjSense.minimize, + obj=None, rhs=None, senses="", + matbeg=None, matcnt=None, matind=None, matval=None, + lb=None, ub=None, range_values=None, colnames=None, + rownames=None): + """Copies LP data into a CPLEX problem object. + + The arguments define an objective function, constraint matrix, + variable bounds, righthand side, constraint senses, range values, + names of constraints, and names of variables. + + Note + This method can give better performance when building a model, + but it may not be as user friendly as using other methods. To + compare different techniques, see the lpex1.py example. + + Note + Calling this method destroys any existing data associated with + the problem object. + + numcols : the number of columns in the constraint matrix, or + equivalently, the number of variables in the problem object. + + numrows : the number of rows in the constraint matrix, not + including the objective function or bounds on the variables. + + objsense : sets the sense of the objective function. Must be + either Cplex.objective.sense.minimize or + Cplex.objective.sense.maximize. + + obj : a list of floats of length at least ``numcols`` containing + the objective function coefficients. Required if ``numcols`` > 0. + + rhs : a list of floats of length at least ``numrows`` containing + the righthand side value for each constraint in the constraint + matrix. Required if ``numrows`` > 0. + + senses : A list of single-character strings or a string + containing the sense of each constraint in the constraint matrix. + Must be of length at least ``numrows``. Each entry must be one of + 'G', 'L', 'E', and 'R', indicating greater-than-or-equal-to (>=), + less-than-or-equal-to (<=), equality (=), and ranged constraints, + respectively. Required if ``numrows`` > 0. + + With respect to the arguments ``matbeg`` (beginning of the matrix), + ``matcnt`` (count of the matrix), ``matind`` (indices of the matrix), + and ``matval`` (values of the matrix), CPLEX needs to know only the + nonzero coefficients. These arguments are required if + ``numcols`` > 0 and ``numrows`` > 0. + + These arrays are accessed as follows. Suppose that CPLEX wants to + access the entries in some column j. These are assumed to be + given by the entries: + matval[matbeg[j]],.., matval[matbeg[j]+matcnt[j]-1] + + The corresponding row indices are: + matind[matbeg[j]],.., matind[matbeg[j]+matcnt[j]-1] + + lb : a list of length at least ``numcols`` containing the lower + bound on each of the variables. Required if ``numcols`` > 0. + + ub : a list of length at least ``numcols`` containing the upper + bound on each of the variables. Required if ``numcols`` > 0. + + range_values : a list of floats, specifying the difference + between lefthand side and righthand side of each linear + constraint. If range_values[i] > 0 (zero) then the constraint i + is defined as rhs[i] <= rhs[i] + range_values[i]. If + range_values[i] < 0 (zero) then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + colnames : a list of strings of length at least ``numcols`` + containing the names of the matrix columns or, equivalently, the + constraint names. + + rownames : a list of strings of length at least ``numrows`` + containing the names of the matrix rows or, equivalently, the + constraint names. + + See `CPXcopylpwnames <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/copylpwnames.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.copylp(numcols=3, + ... numrows=2, + ... objsense=c.objective.sense.maximize, + ... obj=[1.0, 2.0, 3.0], + ... rhs=[20.0, 30.0], + ... senses="LL", + ... matbeg=[0, 2, 4], + ... matcnt=[2, 2, 2], + ... matind=[0, 1, 0, 1, 0, 1], + ... matval=[-1.0, 1.0, 1.0, -3.0, 1.0, 1.0], + ... lb=[0.0, 0.0, 0.0], + ... ub=[40.0, cplex.infinity, cplex.infinity], + ... range_values=[0.0, 0.0], + ... colnames=["x1", "x2", "x3"], + ... rownames=["c1", "c2"]) + """ + (obj, rhs, senses, matbeg, + matcnt, matind, matval, + lb, ub, range_values, + colnames, rownames) = init_list_args(obj, rhs, senses, matbeg, matcnt, + matind, matval, lb, ub, + range_values, colnames, rownames) + if not isinstance(senses, str): + senses = "".join(senses) + # Check arg lengths to avoid potential segfault in the C API. + validate_arg_lengths([obj, lb, ub, colnames], + extra_msg=": obj, lb, ub, colnames") + # Special case: Check that numcols <= len(obj). + if numcols > 0 and numcols > len(obj): + raise CplexError("inconsistent arguments: numcols > len(obj)") + validate_arg_lengths([rhs, senses, range_values, rownames], + extra_msg=": rhs, senses, range_values, rownames") + # Special case: Check that numrows <= len(rhs). + if numrows > 0 and numrows > len(rhs): + raise CplexError("inconsistent arguments: numrows > len(rhs)") + validate_arg_lengths([matbeg, matcnt], extra_msg=": matbeg, matcnt") + validate_arg_lengths([matind, matval], extra_msg=": matind, matval") + # Check special case: that len(matind) == sum(matcnt). We don't + # have to check matval b/c of validate_arg_lengths check above. + nnz = sum(matcnt) + nmatind = len(matind) + if nmatind > 0 and nmatind != nnz: + raise CplexError( + "inconsistent arguments: len(matind) != sum(matcnt)") + _proc.copylpwnames(self._env._e, self._lp, numcols, numrows, + objsense, obj, rhs, senses, + matbeg, matcnt, matind, matval, + lb, ub, range_values, + colnames, rownames)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal.html b/docs/_modules/cplex/_internal.html new file mode 100644 index 0000000..9a5eb01 --- /dev/null +++ b/docs/_modules/cplex/_internal.html @@ -0,0 +1,523 @@ + + + + + + + cplex._internal — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal

+# --------------------------------------------------------------------------
+# File: __init__.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""
+
+   :undocumented: Environment, _aux_functions, _list_array_utils, _ostream
+
+"""
+import sys
+
+from . import _aux_functions
+from . import _baseinterface
+from . import _list_array_utils
+from . import _ostream
+from . import _procedural
+from . import _constants
+from . import _matrices
+from . import _multiobj
+from . import _multiobjsoln
+from . import _parameter_classes
+from . import _parameter_hierarchy
+from . import _subinterfaces
+from . import _pycplex
+from . import _parameters_auto
+from . import _anno
+from . import _pwl
+from . import _constantsenum
+from . import _callbackinfoenum
+from . import _solutionstrategyenum
+from ..exceptions import CplexError
+from ..constant_class import ConstantClass
+
+__all__ = ["Environment", "_aux_functions", "_baseinterface",
+           "_list_array_utils", "_ostream", "_procedural",
+           "_constants", "_matrices", "_multiobj", "_multiobjsoln",
+           "_parameter_classes", "_subinterfaces", "_pycplex",
+           "_parameters_auto", "_anno", "_pwl", "ProblemType",
+           "_constantsenum", "_constants", "_callbackinfoenum",
+           "_solutionstrategyenum"]
+
+
+
+[docs] +class ProblemType(ConstantClass): + """Types of problems the Cplex object can encapsulate. + + For explanations of the problem types, see those topics in the + CPLEX User's Manual in the topic titled Continuous Optimization + for LP, QP, and QCP or the topic titled Discrete Optimization + for MILP, FIXEDMILP, NODELP, NODEQP, MIQCP, NODEQCP. + """ + LP = _constants.CPXPROB_LP + """See CPXPROB_LP in the C API.""" + + MILP = _constants.CPXPROB_MILP + """See CPXPROB_MILP in the C API.""" + + fixed_MILP = _constants.CPXPROB_FIXEDMILP + """See CPXPROB_FIXEDMILP in the C API.""" + + node_LP = _constants.CPXPROB_NODELP + """See CPXPROB_NODELP in the C API.""" + + QP = _constants.CPXPROB_QP + """See CPXPROB_QP in the C API.""" + + MIQP = _constants.CPXPROB_MIQP + """See CPXPROB_MIQP in the C API.""" + + fixed_MIQP = _constants.CPXPROB_FIXEDMIQP + """See CPXPROB_MIQP in the C API.""" + + node_QP = _constants.CPXPROB_NODEQP + """See CPXPROB_NODEQP in the C API.""" + + QCP = _constants.CPXPROB_QCP + """See CPXPROB_QCP in the C API.""" + + MIQCP = _constants.CPXPROB_MIQCP + """See CPXPROB_MIQCP in the C API.""" + + node_QCP = _constants.CPXPROB_NODEQCP + """See CPXPROB_QCP in the C API."""
+ + + +def _needs_delete_callback(callback_instance): + # If the user has registered any callback that may change + # the user data at a node then we need to register the + # delete callback. + # The Control, Node, and Incumbent callbacks have the set_node_data + # method (and all who inherit from these). + return hasattr(callback_instance, "set_node_data") + + +def _getcbattrname(cb_type_string): + """Returns the attribute name to be used to store the callback + instance. + """ + return "_{0}_callback".format(cb_type_string) + + +def _checkcbcls(obj): + """Checks callback class instance for expected attribute. + + Raises a CplexError if it is not found. + """ + if getattr(obj, "_cb_type_string", None) is None: + raise CplexError(str(obj) + + " is not a subclass of a subclassable Callback class.") + + +
+[docs] +class Environment(): + """non-public""" + RESULTS_CHNL_IDX = 0 + WARNING_CHNL_IDX = 1 + ERROR_CHNL_IDX = 2 + LOG_CHNL_IDX = 3 + +
+[docs] + def __init__(self): + """non-public""" + # Declare and initialize attributes + self._e = None + self._lock = None + self._streams = {self.RESULTS_CHNL_IDX: None, + self.WARNING_CHNL_IDX: None, + self.ERROR_CHNL_IDX: None, + self.LOG_CHNL_IDX: None} + self._callback_exception = None + self._callbacks = [] + self._disposed = False + # Initialize data strucutures associated with CPLEX + self._e = _procedural.openCPLEX() + self.parameters = _parameter_classes.RootParameterGroup( + self, _parameter_hierarchy.root_members) + _procedural.set_status_checker() + self._lock = _procedural.initlock() + self.set_results_stream(sys.stdout) + self.set_warning_stream(sys.stderr) + self.set_error_stream(sys.stderr) + self.set_log_stream(sys.stdout)
+ + + def _end(self): + """Frees all of the data structures associated with CPLEX.""" + if self._disposed: + return + self._disposed = True + for chnl_idx in self._streams: + self._delete_stream(chnl_idx) + if self._lock and self._e: + _procedural.finitlock(self._lock) + if self._e: + _procedural.closeCPLEX(self._e) + self._e = None + +
+[docs] + def __del__(self): + """non-public""" + self._end()
+ + + def _get_num_delete(self): + """Count the callbacks that are installed and require a delete + callback. + """ + return sum(1 for c in self._callbacks + if _needs_delete_callback(c)) + +
+[docs] + def register_callback(self, callback_class): + """Registers a callback for use when solving. + + callback_class must be a proper subclass of one of the + callback classes defined in the module callbacks. It must + override the __call__ method with a method that has signature + __call__(self) -> None. If callback_class is a subclass of + more than one callback class, it will only be called when its + first superclass is called. register_callback returns the + instance of callback_class registered for use. Any previously + registered callback of the same class will no longer be + registered. + """ + cb = callback_class(self) + _checkcbcls(cb) + num_delete = self._get_num_delete() + old_cb = getattr( + self, _getcbattrname(cb._cb_type_string), None) + if old_cb: + self._callbacks.remove(old_cb) + setattr(self, _getcbattrname(cb._cb_type_string), cb) + if cb._cb_type_string == "MIP_info": + # self._MIP_info_callback is set above with the call to + # setattr. So, we are passing the callback instance as the + # second argument here rather than the environment + # (i.e., self). + # pylint: disable=no-member + cb._cb_set_function(self._e, self._MIP_info_callback) + else: + cb._cb_set_function(self._e, self) + self._callbacks.append(cb) + if _needs_delete_callback(cb) and num_delete < 1: + # We need a delete callback and did not have one + # before -> install it. + _procedural.setpydel(self._e) + return cb
+ + +
+[docs] + def unregister_callback(self, callback_class): + """Unregisters a callback. + + callback_class must be one of the callback classes defined in + the module callback or a subclass of one of them. This method + unregisters any previously registered callback of the same + class. If callback_class is a subclass of more than one + callback class, this method unregisters only the callback of the + same type as its first superclass. unregister_callback + returns the instance of callback_class just unregistered. + + """ + cb = callback_class(self) + _checkcbcls(cb) + current_cb = getattr( + self, _getcbattrname(cb._cb_type_string), None) + if current_cb: + if (_needs_delete_callback(current_cb) and + self._get_num_delete() < 2): + # We are about to remove the last callback that requires + # a delete callback. + _procedural.delpydel(self._e) + current_cb._cb_set_function(self._e, None) + self._callbacks.remove(current_cb) + delattr(self, _getcbattrname(current_cb._cb_type_string)) + return current_cb
+ + + def _add_stream(self, which_channel): + """non-public""" + channel = _procedural.getchannels(self._e)[which_channel] + _procedural.addfuncdest(self._e, channel, + self._streams[which_channel]) + + def _delete_stream(self, which_channel): + """non-public""" + if self._streams[which_channel] is None: + return + channel = _procedural.getchannels(self._e)[which_channel] + _procedural.delfuncdest(self._e, channel, + self._streams[which_channel]) + self._streams[which_channel]._end() + + def _set_stream(self, which, outputfile, func=None, initerrstr=False): + self._delete_stream(which) + self._streams[which] = _ostream.OutputStream( + outputfile, self, fn=func, initerrorstr=initerrstr) + self._add_stream(which) + return self._streams[which] + +
+[docs] + def set_results_stream(self, results_file, fn=None): + """Specifies where results will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which results will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.RESULTS_CHNL_IDX, + outputfile=results_file, + func=fn, + initerrstr=False)
+ + +
+[docs] + def set_warning_stream(self, warning_file, fn=None): + """Specifies where warnings will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which warnings will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.WARNING_CHNL_IDX, + outputfile=warning_file, + func=fn, + initerrstr=False)
+ + +
+[docs] + def set_error_stream(self, error_file, fn=None): + """Specifies where errors will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which errors will be written. To write + to this stream, use the write() method of this object. + """ + return self._set_stream(which=self.ERROR_CHNL_IDX, + outputfile=error_file, + func=fn, + initerrstr=True)
+ + +
+[docs] + def set_log_stream(self, log_file, fn=None): + """Specifies where the log will be printed. + + The first argument must be either a file-like object (that is, an + object with a write method and a flush method) or the name of + a file to be written to (the later is deprecated since V12.9.0). + Use None as the first argument to suppress output. + + The second optional argument is a function that takes a string + as input and returns a string. If specified, strings sent to + this stream will be processed by this function before being + written. + + Returns the stream to which the log will be written. To write + to this stream, use this object's write() method. + """ + return self._set_stream(which=self.LOG_CHNL_IDX, + outputfile=log_file, + func=fn, + initerrstr=False)
+ + + def _get_results_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.RESULTS_CHNL_IDX] + + def _get_warning_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.WARNING_CHNL_IDX] + + def _get_error_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.ERROR_CHNL_IDX] + + def _get_log_stream(self): + """non-public. Nice for unit tests.""" + return self._streams[self.LOG_CHNL_IDX] + +
+[docs] + def get_version(self): + """Returns a string specifying the version of CPLEX.""" + return _procedural.version(self._e)
+ + +
+[docs] + def get_versionnumber(self): + """Returns an integer specifying the version of CPLEX. + + The version of CPLEX is in the format vvrrmmff, where vv is + the version, rr is the release, mm is the modification, and ff + is the fixpack number. For example, for CPLEX version 12.5.0.1 + the returned value is 12050001. + """ + return _procedural.versionnumber(self._e)
+ + +
+[docs] + def get_num_cores(self): + """Returns the number of cores on this machine.""" + return _procedural.getnumcores(self._e)
+ + +
+[docs] + def get_time(self): + """Returns a timestamp in CPU or wallclock seconds from CPLEX.""" + return _procedural.gettime(self._e)
+ + +
+[docs] + def get_dettime(self): + """Returns the current deterministic time in ticks.""" + return _procedural.getdettime(self._e)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_anno.html b/docs/_modules/cplex/_internal/_anno.html new file mode 100644 index 0000000..07a8ba8 --- /dev/null +++ b/docs/_modules/cplex/_internal/_anno.html @@ -0,0 +1,753 @@ + + + + + + + cplex._internal._anno — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._anno

+# --------------------------------------------------------------------------
+# File: _anno.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Annotation API"""
+from ._baseinterface import BaseInterface
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+from . import _constants
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class AnnotationObjectType(ConstantClass): + """Constants defining annotation object types.""" + objective = _constants.CPX_ANNOTATIONOBJ_OBJ + variable = _constants.CPX_ANNOTATIONOBJ_COL + row = _constants.CPX_ANNOTATIONOBJ_ROW + sos_constraint = _constants.CPX_ANNOTATIONOBJ_SOS + indicator_constraint = _constants.CPX_ANNOTATIONOBJ_IND + quadratic_constraint = _constants.CPX_ANNOTATIONOBJ_QC
+ + + +
+[docs] +class AnnotationInterface(BaseInterface): + """Methods for adding, querying, and modifying annotations.""" + + object_type = AnnotationObjectType() + """See `AnnotationObjectType()` """ + + def _getnumobjtype(self, objtype): + switcher = { + # NB: For now, it is documented that multiobj is not supported. + self.object_type.objective: lambda env, lp: 1, + self.object_type.variable: _proc.getnumcols, + self.object_type.row: _proc.getnumrows, + self.object_type.sos_constraint: _proc.getnumsos, + self.object_type.indicator_constraint: _proc.getnumindconstrs, + self.object_type.quadratic_constraint: _proc.getnumqconstrs + } + func = switcher[objtype] + return func(self._env._e, self._cplex._lp)
+ + + +
+[docs] +class LongAnnotationInterface(AnnotationInterface): + """Methods for adding, querying, and modifying long annotations.""" + + benders_annotation = _constants.CPX_BENDERS_ANNOTATION + """String constant for the name of the Benders annotation.""" + + benders_mastervalue = _constants.CPX_BENDERS_MASTERVALUE + """Default value for the Benders master partition.""" + +
+[docs] + def __init__(self, cpx): + """Creates a new LongAnnotationInterface. + + The long annotation interface is exposed by the top-level `Cplex` + class as `Cplex.long_annotations`. This constructor is not meant + to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getlongannoindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of long annotations in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.long_annotations.get_num() + 0 + >>> idx = c.long_annotations.add('ann1', 0) + >>> c.long_annotations.get_num() + 1 + """ + return _proc.getnumlonganno(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, name, defval): + """Adds an annotation to the problem. + + name: the name of the annotation. + + defval: the default value for annotation objects. + + Returns the index of the added annotation. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add(name='ann1', defval=0) + >>> c.long_annotations.get_num() + 1 + """ + # For Python 2.7, int() will automatically upconvert to long + # if necessary. For 3.x, there is only int (they have been + # unified). + def _add(name, defval): + _proc.newlonganno( + self._env._e, self._cplex._lp, name, int(defval)) + return self._add_single(self.get_num, _add, name, defval)
+ + +
+[docs] + def delete(self, *args): + """Deletes long annotations from the problem. + + There are four forms by which long_annotations.delete may be + called. + + long_annotations.delete() + deletes all long annotations from the problem. + + long_annotations.delete(i) + i must be an annotation name or index. Deletes the long + annotation whose index or name is i. + + long_annotations.delete(seq) + seq must be a sequence of annotation names or indices. + Deletes the long annotations with names or indices contained + within s. Equivalent to [long_annotations.delete(i) for i in s]. + + long_annotations.delete(begin, end) + begin and end must be annotation indices or annotation names. + Deletes the long annotations with indices between begin and + end, inclusive of end. Equivalent to + long_annotations.delete(range(begin, end + 1)). This will give + the best performance when deleting batches of long annotations. + + See CPXdellongannotations in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> c.long_annotations.get_num() + 1 + >>> c.long_annotations.delete(idx) + >>> c.long_annotations.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.dellonganno(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of long annotations. + + May be called by four forms. + + long_annotations.get_names() + return the names of all long annotations in the problem. + + long_annotations.get_names(i) + i must be an annotation name or index. Returns the name of + long annotation i. + + long_annotations.get_names(seq) + seq must be a sequence of annotation names or indices. + Returns the names of long annotations with names or indices in + s. Equivalent to + [long_annotations.get_names(i) for i in s] + + long_annotations.get_names(begin, end) + begin and end must be annotation indices or annotation names. + Returns the names of long annotations with indices between + begin and end, inclusive of end. Equivalent to + long_annotations.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.long_annotations.add('ann{0}'.format(i), i) + ... for i in range(1, 6)] + [0, 1, 2, 3, 4] + >>> c.long_annotations.get_names() + ['ann1', 'ann2', 'ann3', 'ann4', 'ann5'] + >>> c.long_annotations.get_names(0) + 'ann1' + >>> c.long_annotations.get_names([0, 2, 4]) + ['ann1', 'ann3', 'ann5'] + >>> c.long_annotations.get_names(1, 3) + ['ann2', 'ann3', 'ann4'] + """ + def _get_names(idx): + return _proc.getlongannoname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_default_values(self, *args): + """Returns the default value of a set of long annotations. + + May be called by four forms. + + long_annotations.get_default_values() + return the default values of all long annotations in the + problem. + + long_annotations.get_default_values(i) + i must be an annotation name or index. Returns the default + value of long annotation i. + + long_annotations.get_default_values(seq) + seq must be a sequence of annotation names or indices. + Returns the default values of long annotations with names or + indices in s. Equivalent to + [long_annotations.get_default_values(i) for i in s] + + long_annotations.get_default_values(begin, end) + begin and end must be annotation indices or annotation names. + Returns the default values of long annotations with indices + between begin and end, inclusive of end. Equivalent to + long_annotations.get_default_values(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx1 = c.long_annotations.add(name='ann1', defval=0) + >>> idx2 = c.long_annotations.add(name='ann2', defval=1) + >>> c.long_annotations.get_default_values() + [0, 1] + """ + def _getdefval(idx): + return _proc.getlongannodefval( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _getdefval, self._conv, self.get_num(), args)
+ + +
+[docs] + def set_values(self, idx, objtype, *args): + """Sets the values for objects in the specified long annotation. + + idx: the long annotation index or name. + + objtype: the annotation object type. + + Can be called by two forms: + + long_annotations.set_values(idx, objtype, i, val) + i must be a name or index. Changes the long annotation value + of the object identified by i. + + long_annotations.set_values(idx, objtype, seq) + seq is a sequence of pairs (i, val) as described above. + Changes the long annotation values for the specified objects. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.objective + >>> c.long_annotations.set_values(idx, objtype, 0, 1) + >>> c.long_annotations.get_values(idx, objtype, 0) + 1 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.long_annotations.object_type.variable + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.long_annotations.get_values(idx, objtype) + [1, 1, 1] + """ + def _set_values(ind, val): + _proc.setlonganno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, ind, val) + _aux.apply_pairs(_set_values, self._conv, *args)
+ + +
+[docs] + def get_values(self, idx, objtype, *args): + """Returns the long annotation values for the specified objects. + + idx: the long annotation index or name. + + objtype: the annotation object type. + + Can be called by four forms: + + long_annotations.get_values(idx, objtype) + return the values of all objects for a given annotation. + + long_annotations.get_values(idx, objtype, i) + i must be a name or index. Returns the long annotation value + of the object identified by i. + + long_annotations.get_values(idx, objtype, seq) + seq is a sequence of object names or indices. Returns the + long annotation values for the specified objects. Equivalent + to + [long_annotations.get_values(idx, objtype, i) for i in seq] + + long_annotations.get_values(idx, objtype, begin, end) + begin and end must be object indices or object names. Returns + the long annotation values of objects with indices between + begin and end, inclusive of end. Equivalent to + long_annotations.get_values(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.long_annotations.add('ann1', 0) + >>> objtype = c.long_annotations.object_type.objective + >>> c.long_annotations.set_values(idx, objtype, 0, 1) + >>> c.long_annotations.get_values(idx, objtype, 0) + 1 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.long_annotations.object_type.variable + >>> c.long_annotations.set_values(idx, objtype, + ... [(i, 1) for i in indices]) + >>> c.long_annotations.get_values(idx, objtype, list(indices)) + [1, 1, 1] + """ + def _get_values(begin, end=self._getnumobjtype(objtype) - 1): + return _proc.getlonganno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, + begin, end) + return _aux.apply_freeform_two_args( + _get_values, self._conv, args)
+
+ + + +
+[docs] +class DoubleAnnotationInterface(AnnotationInterface): + """Methods for adding, querying, and modifying double annotations.""" + +
+[docs] + def __init__(self, cpx): + """Creates a new DoubleAnnotationInterface. + + The double annotation interface is exposed by the top-level + `Cplex` class as `Cplex.double_annotations`. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getdblannoindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of double annotations in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.double_annotations.get_num() + 0 + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> c.double_annotations.get_num() + 1 + """ + return _proc.getnumdblanno(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, name, defval): + """Adds an annotation to the problem. + + name: the name of the annotation. + + defval: the default value for annotation objects. + + Returns the index of the added annotation. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add(name='ann1', defval=0.0) + >>> c.double_annotations.get_num() + 1 + """ + def _add(name, defval): + _proc.newdblanno( + self._env._e, self._cplex._lp, name, float(defval)) + return self._add_single(self.get_num, _add, name, defval)
+ + +
+[docs] + def delete(self, *args): + """Deletes double annotations from the problem. + + There are four forms by which double_annotations.delete may be + called. + + double_annotations.delete() + deletes all double annotations from the problem. + + double_annotations.delete(i) + i must be an annotation name or index. Deletes the double + annotation whose index or name is i. + + double_annotations.delete(seq) + seq must be a sequence of annotation names or indices. + Deletes the double annotations with names or indices contained + within s. Equivalent to + [double_annotations.delete(i) for i in s]. + + double_annotations.delete(begin, end) + begin and end must be annotation indices or annotation names. + Deletes the double annotations with indices between begin and + end, inclusive of end. Equivalent to + double_annotations.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of double + annotations. + + See CPXdeldblannotations in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> c.double_annotations.get_num() + 1 + >>> c.double_annotations.delete(idx) + >>> c.double_annotations.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.deldblanno(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of double annotations. + + May be called by four forms. + + double_annotations.get_names() + return the names of all double annotations in the problem. + + double_annotations.get_names(i) + i must be an annotation name or index. Returns the name of + double annotation i. + + double_annotations.get_names(seq) + seq must be a sequence of annotation names or indices. + Returns the names of double annotations with names or indices + in s. Equivalent to + [double_annotations.get_names(i) for i in s] + + double_annotations.get_names(begin, end) + begin and end must be annotation indices or annotation names. + Returns the names of double annotations with indices between + begin and end, inclusive of end. Equivalent to + double_annotations.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.double_annotations.add('ann{0}'.format(i), i) + ... for i in range(1, 6)] + [0, 1, 2, 3, 4] + >>> c.double_annotations.get_names() + ['ann1', 'ann2', 'ann3', 'ann4', 'ann5'] + >>> c.double_annotations.get_names(0) + 'ann1' + >>> c.double_annotations.get_names([0, 2, 4]) + ['ann1', 'ann3', 'ann5'] + >>> c.double_annotations.get_names(1, 3) + ['ann2', 'ann3', 'ann4'] + """ + def _get_names(idx): + return _proc.getdblannoname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_default_values(self, *args): + """Returns the default value of a set of double annotations. + + May be called by four forms. + + double_annotations.get_default_values() + return the default values of all double annotations in the + problem. + + double_annotations.get_default_values(i) + i must be an annotation name or index. Returns the default + value of double annotation i. + + double_annotations.get_default_values(seq) + seq must be a sequence of annotation names or indices. + Returns the default values of double annotations with names or + indices in s. Equivalent to + [double_annotations.get_default_values(i) for i in s] + + double_annotations.get_default_values(begin, end) + begin and end must be annotation indices or annotation names. + Returns the default values of double annotations with indices + between begin and end, inclusive of end. Equivalent to + double_annotations.get_default_values(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx1 = c.double_annotations.add(name='ann1', defval=0.0) + >>> idx2 = c.double_annotations.add(name='ann2', defval=1.0) + >>> c.double_annotations.get_default_values() + [0.0, 1.0] + """ + def _getdefval(idx): + return _proc.getdblannodefval( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _getdefval, self._conv, self.get_num(), args)
+ + +
+[docs] + def set_values(self, idx, objtype, *args): + """Sets the values for objects in the specified double annotation. + + idx: the double annotation index or name. + + objtype: the annotation object type. + + Can be called by two forms: + + double_annotations.set_values(idx, objtype, i, val) + i must be a name or index. Changes the double annotation + value of the object identified by i. + + double_annotations.set_values(idx, objtype, seq) + seq is a sequence of pairs (i, val) as described above. + Changes the double annotation values for the specified + objects. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> objtype = c.double_annotations.object_type.objective + >>> c.double_annotations.set_values(idx, objtype, 0, 1.0) + >>> c.double_annotations.get_values(idx, objtype, 0) + 1.0 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.double_annotations.object_type.variable + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1.0) for i in indices]) + >>> c.double_annotations.get_values(idx, objtype) + [1.0, 1.0, 1.0] + """ + def _set_values(ind, val): + _proc.setdblanno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, ind, val) + _aux.apply_pairs(_set_values, self._conv, *args)
+ + +
+[docs] + def get_values(self, idx, objtype, *args): + """Returns the double annotation values for the specified objects. + + idx: the double annotation index or name. + + objtype: the annotation object type. + + Can be called by four forms: + + double_annotations.get_values(idx, objtype) + return the values of all objects for a given annotation. + + double_annotations.get_values(idx, objtype, i) + i must be a name or index. Returns the double annotation + value of the object identified by i. + + double_annotations.get_values(idx, objtype, seq) + seq is a sequence of object names or indices. Returns the + double annotation values for the specified objects. + Equivalent to + [double_annotations.get_values(idx, objtype, i) for i in seq] + + double_annotations.get_values(idx, objtype, begin, end) + begin and end must be object indices or object names. Returns + the double annotation values of objects with indices between + begin and end, inclusive of end. Equivalent to + double_annotations.get_values(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.double_annotations.add('ann1', 0.0) + >>> objtype = c.double_annotations.object_type.objective + >>> c.double_annotations.set_values(idx, objtype, 0, 1.0) + >>> c.double_annotations.get_values(idx, objtype, 0) + 1.0 + >>> indices = c.variables.add(names=['v1', 'v2', 'v3']) + >>> objtype = c.double_annotations.object_type.variable + >>> c.double_annotations.set_values(idx, objtype, + ... [(i, 1.0) for i in indices]) + >>> c.double_annotations.get_values(idx, objtype, list(indices)) + [1.0, 1.0, 1.0] + """ + def _get_values(begin, end=self._getnumobjtype(objtype) - 1): + return _proc.getdblanno(self._env._e, self._cplex._lp, + self._conv(idx), objtype, + begin, end) + return _aux.apply_freeform_two_args( + _get_values, self._conv, args)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_aux_functions.html b/docs/_modules/cplex/_internal/_aux_functions.html new file mode 100644 index 0000000..992a15c --- /dev/null +++ b/docs/_modules/cplex/_internal/_aux_functions.html @@ -0,0 +1,545 @@ + + + + + + + cplex._internal._aux_functions — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._aux_functions

+# --------------------------------------------------------------------------
+# File: _aux_functions.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Internal auxiliary functions."""
+try:
+    import collections.abc as collections_abc  # For Python >= 3.3
+except ImportError:
+    import collections as collections_abc
+import functools
+import inspect
+import itertools
+import os
+import warnings
+
+from ..exceptions import CplexError, WrongNumberOfArgumentsError
+
+CPLEX_PY_DISABLE_NAME_CONV = os.getenv("CPLEX_PY_DISABLE_NAME_CONV")
+
+
+
+[docs] +class deprecated(): + """A decorator that marks methods/functions as deprecated.""" + +
+[docs] + def __init__(self, version): + self.version = version
+ + + def __call__(self, cls_or_func): + if (inspect.isfunction(cls_or_func) or + inspect.ismethod(cls_or_func)): + fmt = "{0} function or method" + # NOTE: Doesn't work for classes .. haven't figured that out yet. + # Specifically, when a decorated class is used as a base + # class. + # elif inspect.isclass(cls_or_func): + # fmt = "{0} class" + else: + raise TypeError(type(cls_or_func)) + msg = _getdeprecatedmsg(fmt.format(cls_or_func.__name__), + self.version) + + @functools.wraps(cls_or_func) + def wrapped(*args, **kwargs): + warnings.warn(msg, DeprecationWarning, stacklevel=2) + return cls_or_func(*args, **kwargs) + return wrapped
+ + + +
+[docs] +def deprecated_class(name, version, stacklevel=3): + """Emits a warning for a deprecated class. + + This should be called in __init__. + + name - the name of the class (e.g., PresolveCallback). + + version - the version at which the class was deprecated (e.g., + "V12.7.1"). + + stacklevel - indicates how many levels up the stack is the caller. + """ + msg = _getdeprecatedmsg("{0} class".format(name), version) + warnings.warn(msg, DeprecationWarning, stacklevel=stacklevel)
+ + + +def _getdeprecatedmsg(item, version): + return "the {0} is deprecated since {1}".format(item, version) + + +
+[docs] +def max_arg_length(arg_list): + """Returns the max length of the arguments in arg_list.""" + return max([len(x) for x in arg_list])
+ + + +if __debug__: + + # With non-optimzied bytecode, validate_arg_lengths actually does + # something. + def validate_arg_lengths(arg_list, allow_empty=True, extra_msg=""): + """Checks for equivalent argument lengths. + + If allow_empty is True (the default), then empty arguments are not + checked against the max length of non-empty arguments. Some functions + allow NULL arguments in the Callable Library, for example. + """ + arg_lengths = [len(x) for x in arg_list] + if allow_empty: + arg_lengths = [x for x in arg_lengths if x > 0] + if not arg_lengths: + return + max_length = max(arg_lengths) + for arg_length in arg_lengths: + if arg_length != max_length: + raise CplexError("inconsistent argument lengths" + extra_msg) + +else: + +
+[docs] + def validate_arg_lengths( + arg_list, + allow_empty=True, + extra_msg="" + ): # pylint: disable=unused-argument + """A no-op. + + A no-op if using python -O or the PYTHONOPTIMIZE environment + variable is defined as a non-empty string. + """ + pass
+ + + +
+[docs] +def make_ranges(indices): + """non-public""" + i = 0 + j = 0 + while i < len(indices): + while j < len(indices) - 1 and indices[j + 1] == indices[j] + 1: + j += 1 + yield (indices[i], indices[j]) + i = j + 1 + j = i
+ + + +
+[docs] +def identity(x): + """Simple identity function.""" + return x
+ + + +
+[docs] +def apply_freeform_two_args(fn, conv, args, unpack_single=True): + """non-public""" + if conv is None: + conv = identity + nargs = len(args) + if nargs == 2: + conarg0, conarg1 = (conv(args[0]), conv(args[1])) + if (isinstance(conarg0, int) and isinstance(conarg1, int)): + return fn(conarg0, conarg1) + raise TypeError("expecting names or indices") + elif nargs == 1: + if isinstance(args[0], (list, tuple)): + return list(itertools.chain.from_iterable( + fn(i, j) for i, j in make_ranges(conv(args[0])))) + conarg0 = conv(args[0]) + if isinstance(conarg0, int): + result = fn(conarg0, conarg0) + if unpack_single: + return result[0] + return result + raise TypeError("expecting name or index") + elif nargs == 0: + return fn(0) + raise WrongNumberOfArgumentsError()
+ + + +
+[docs] +def apply_freeform_one_arg(fn, conv, maxval, args): + """non-public""" + if conv is None: + conv = identity + nargs = len(args) + if nargs == 2: + conarg0, conarg1 = (conv(args[0]), conv(args[1])) + if (isinstance(conarg0, int) and isinstance(conarg1, int)): + return [fn(x) for x in range(conarg0, conarg1 + 1)] + raise TypeError("expecting names or indices") + elif nargs == 1: + if isinstance(args[0], (list, tuple)): + return [fn(x) for x in conv(args[0])] + conarg0 = conv(args[0]) + if isinstance(conarg0, int): + return fn(conarg0) + raise TypeError("expecting name or index") + elif nargs == 0: + return apply_freeform_one_arg(fn, conv, 0, + (list(range(maxval)),)) + raise WrongNumberOfArgumentsError()
+ + + +
+[docs] +def apply_pairs(fn, conv, *args): + """non-public""" + nargs = len(args) + if nargs == 2: + fn([conv(args[0])], [args[1]]) + return + if nargs == 1: + pair = unzip(args[0]) + # NB: If pair is empty, then we do nothing. + if pair: + fn(conv(pair[0]), list(pair[1])) + return + raise WrongNumberOfArgumentsError(nargs)
+ + + +
+[docs] +def delete_set_by_range(fn, conv, max_num, *args): + """non-public""" + nargs = len(args) + if nargs == 0: + # Delete All: + if max_num > 0: + fn(0, max_num - 1) + elif nargs == 1: + # Delete all items from a possibly unordered list of mixed types: + args = listify(conv(args[0])) + ranges = make_ranges(list(sorted(args))) + for i, j in reversed(list(ranges)): + fn(i, j) + elif nargs == 2: + # Delete range from arg[0] to arg[1]: + fn(conv(args[0]), conv(args[1])) + else: + raise WrongNumberOfArgumentsError()
+ + + +class _group(): + """Object to contain constraint groups""" + + def __init__(self, gp): + """Constructor for the _group object + + gp is a list of tuples of length two (the first entry of which + is the preference for the group (a float), the second of which + is a tuple of pairs (type, id), where type is an attribute of + conflict.constraint_type and id is either an index or a valid + name for the type). + + Example input: [(1.0, ((2, 0),)), (1.0, ((3, 0), (3, 1)))] + """ + self._gp = gp + + def __str__(self): + return str(self._gp) + + +
+[docs] +def make_group(conv, max_num, c_type, *args): + """Returns a _group object + + input: + conv - a function that will convert names to indices + max_num - number of existing constraints of a given type + c_type - constraint type + args - arbitrarily many arguments (see description below) + + If args is empty, every constraint/bound is assigned weight 1.0. + + If args is of length one or more, every constraint/bound is assigned + a weight equal to the float passed in as the first item. + + If args contains additional items, they determine a subset of + constraints/bounds to be included. If one index or name is + specified, it is the only one that will be included. If two indices + or names are specified, all constraints between the first and the + second, inclusive, will be included. If a sequence of names or + indices is passed in, all of their constraints/bounds will be + included. + + See example usage in _subinterfaces.ConflictInterface. + """ + nargs = len(args) + if nargs <= 1: + cons = list(range(max_num)) + if nargs == 0: + weight = 1.0 + else: + weight = args[0] + if nargs == 2: + weight = args[0] + cons = listify(conv(args[1])) + elif nargs == 3: + cons = list(range(conv(args[1]), conv(args[2]) + 1)) + return _group([(weight, ((c_type, i),)) for i in cons])
+ + + +
+[docs] +def init_list_args(*args): + """Initialize default arguments with empty lists if necessary.""" + return tuple([] if a is None else a for a in args)
+ + + +
+[docs] +def listify(x): + """Returns [x] if x isn't already a list. + + This is used to wrap arguments for functions that require lists. + """ + # Assumes name to index conversions already done. + assert not isinstance(x, str) + try: + iter(x) + return x + except TypeError: + return [x]
+ + + +def _cachelookup(item, getindexfunc, cache): + try: + idx = cache[item] + except KeyError: + idx = getindexfunc(item) + cache[item] = idx + return idx + + +# If the CPLEX_PY_DISABLE_NAME_CONV environment variable is defined, +# we will skip name-to-index conversion (i.e., these functions become +# no-ops), which can improve performance. +if CPLEX_PY_DISABLE_NAME_CONV: + + def convert_sequence( + seq, + getindexfunc, + cache=None + ): # pylint: disable=unused-argument + """Returns seq immediately. + + See comments about CPLEX_PY_DISABLE_NAME_CONV. + """ + return seq + + def convert( + name, + getindexfunc, + cache=None + ): # pylint: disable=unused-argument + """Returns name immediately. + + See comments about CPLEX_PY_DISABLE_NAME_CONV. + """ + return name + +else: + + # By default (i.e., if the CPLEX_PY_DISABLE_NAME_CONV environment + # variable is not defined), these functions perform name-to-index + # conversion, which can hurt performance. + +
+[docs] + def convert_sequence(seq, getindexfunc, cache=None): + """Converts a sequence of names to indices as necessary. + + If you are calling `convert` (see below) in a tight loop, but you + know that you are always working with a sequence, then it can be + more efficient to call this method directly (there is no overhead + checking if it is a sequence). + """ + if cache is None: + cache = {} + results = [] + for item in seq: + if isinstance(item, str): + idx = _cachelookup(item, getindexfunc, cache) + results.append(idx) + else: + results.append(item) + return results
+ + +
+[docs] + def convert(name, getindexfunc, cache=None): + """Converts from names to indices as necessary. + + If name is a string, an index is returned. + + If name is a sequence, a sequence of indices is returned. + + If name is neither (i.e., it's an integer), then that is returned + as is. + + getindexfunc is a function that takes a name and returns an index. + + The optional cache argument allows for further localized + caching (e.g., within a loop). + """ + # In some cases, it can be benficial to cache lookups. + if cache is None: + cache = {} + if isinstance(name, str): + return _cachelookup(name, getindexfunc, cache) + if isinstance(name, collections_abc.Sequence): + # It's tempting to use a recursive solution here, but that kills + # performance for the case where all indices are passed in (i.e., + # no names). This is due to the fact that we end up doing the + # extra check for sequence types over and over (above). + return convert_sequence(name, getindexfunc, cache) + return name
+ + + +
+[docs] +def unzip(iterable=None): + """Inverse of the zip function. + + Example usage: + + >>> z = list(zip([1, 2, 3], [4, 5, 6])) + >>> unzip(z) + [(1, 2, 3), (4, 5, 6)] + """ + if iterable is None: + iterable = [] + return list(zip(*iterable))
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_baseinterface.html b/docs/_modules/cplex/_internal/_baseinterface.html new file mode 100644 index 0000000..507b413 --- /dev/null +++ b/docs/_modules/cplex/_internal/_baseinterface.html @@ -0,0 +1,189 @@ + + + + + + + cplex._internal._baseinterface — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._baseinterface

+# --------------------------------------------------------------------------
+# File: _baseinterface.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Base-interface of the CPLEX API"""
+import weakref
+from . import _aux_functions as _aux
+
+
+
+[docs] +class BaseInterface(): + """Common methods for sub-interfaces.""" + +
+[docs] + def __init__(self, cplex, advanced=False, getindexfunc=None): + """Creates a new BaseInterface. + + This class is not meant to be instantiated directly nor used + externally. + """ + if advanced: + self._cplex = cplex + else: + self._cplex = weakref.proxy(cplex) + self._env = weakref.proxy(cplex._env) + self._get_index_function = getindexfunc
+ + + def _conv(self, name, cache=None): + """Converts from names to indices as necessary.""" + return _aux.convert(name, self._get_index, cache) + + @staticmethod + def _add_iter(getnumfun, addfun, *args, **kwargs): + """non-public""" + old = getnumfun() + addfun(*args, **kwargs) + return range(old, getnumfun()) + + @staticmethod + def _add_single(getnumfun, addfun, *args, **kwargs): + """non-public""" + addfun(*args, **kwargs) + return getnumfun() - 1 # minus one for zero-based indices + + def _get_index(self, name): + return self._get_index_function( + self._env._e, self._cplex._lp, name) + +
+[docs] + def get_indices(self, name): + """Converts from names to indices. + + If name is a string, get_indices returns the index of the + object with that name. If no such object exists, an + exception is raised. + + If name is a sequence of strings, get_indices returns a list + of the indices corresponding to the strings in name. + Equivalent to map(self.get_indices, name). + + If the subclass does not provide an index function (i.e., the + interface is not indexed), then a NotImplementedError is raised. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["a", "b"]) + >>> c.variables.get_indices("a") + 0 + >>> c.variables.get_indices(["a", "b"]) + [0, 1] + """ + if self._get_index_function is None: + raise NotImplementedError("This is not an indexed interface") + if isinstance(name, str): + return self._get_index(name) + return [self._get_index(x) for x in name]
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_matrices.html b/docs/_modules/cplex/_internal/_matrices.html new file mode 100644 index 0000000..79b84be --- /dev/null +++ b/docs/_modules/cplex/_internal/_matrices.html @@ -0,0 +1,386 @@ + + + + + + + cplex._internal._matrices — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._matrices

+# -----------------------------------------------------------------------
+# File: _matrices.py
+# -----------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# -----------------------------------------------------------------------
+"""
+:undocumented: _C_HB_Matrix, _HB_Matrix
+"""
+
+from ._aux_functions import init_list_args, validate_arg_lengths
+from ..exceptions import CplexError
+from . import _pycplex as CPX
+
+class SparsePair():
+    """A class for storing sparse vector data.
+
+    An instance of this class has two attributes, ind and val.  ind
+    specifies the indices and val specifies the values.  ind and val
+    must be sequences of the same length.  In general, ind may contain
+    any identifier; for example, when a SparsePair object is passed to
+    Cplex.linear_constraints.add, its ind attribute may be a list
+    containing both variable names and variable indices.
+    """
+
+    __module__ = "cplex"
+
+
+[docs] + def __init__(self, ind=None, val=None): + """Constructor for SparsePair. + + Takes two arguments, ind and val; ind specifies the indices that + the SparsePair refers to, and val specifies the float values + associated with those indices; ind and val must have the same + length. If ind or val is omitted, they will default to an empty + list. + + >>> spair = SparsePair(ind=[0], val=[1.0]) + """ + ind, val = init_list_args(ind, val) + self.ind = ind + self.val = val + if not self.isvalid(): + raise CplexError("Inconsistent input data to SparsePair")
+ + +
+[docs] + def __repr__(self): + """Representation method of SparsePair. + + Example usage: + + >>> SparsePair(ind=[0], val=[1.0]) + SparsePair(ind = [0], val = [1.0]) + """ + return "".join(["SparsePair(ind = ", + repr(self.ind), + ", val = ", + repr(self.val), ")"])
+ + +
+[docs] + def isvalid(self): + """Tests that ind and val have the same length. + + Example usage: + + >>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0]) + >>> spair.isvalid() + True + """ + return len(self.ind) == len(self.val)
+ + +
+[docs] + def unpack(self): + """Extracts the indices and values sequences as a tuple. + + Returns ind and val as given in __init__. + + >>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0]) + >>> ind, val = spair.unpack() + """ + return self.ind, self.val
+ + + +class _HBMatrix(): + """non-public + + :undocumented: __init__, __len__, __getitem__ + """ + + def __init__(self, matrix=None, matbeg=None, matind=None, matval=None): + """non-public""" + self.matbeg = [] + self.matind = [] + self.matval = [] + if matrix is not None: + for vector in matrix: + if isinstance(vector, SparsePair): + ind = vector.ind + val = vector.val + else: + ind = vector[0] + val = vector[1] + validate_arg_lengths([ind, val]) + self.matbeg.append(len(self.matind)) + self.matind.extend(ind) + self.matval.extend(val) + else: + self.matbeg = matbeg + self.matind = matind + self.matval = matval + + def __len__(self): + """non-public""" + return len(self.matbeg) + + def __getitem__(self, key): + """non-public""" + if isinstance(key, int): + if key < 0: + key += len(self) + begin = self.matbeg[key] + if key == len(self) - 1: + end = len(self.matind) + else: + end = self.matbeg[key + 1] + return SparsePair(CPX._getArrayView(self.matind, begin, end), CPX._getArrayView(self.matval, begin, end)) + elif isinstance(key, slice): + start, stop, step = key.start, key.stop, key.step + if start is None: + start = 0 + if stop is None or stop > len(self): + stop = len(self) + if step is None: + step = 1 + return [self[i] for i in range(start, stop, step)] + else: + raise TypeError + + def __iter__(self): + for i in range(len(self)): + yield self[i] + + +class SparseTriple(): + """A class for storing sparse matrix data. + + An instance of this class has three attributes, ind1, ind2, and val. + ind1 and ind2 specify the indices and val specifies the values. + ind1, ind2, and val must be sequences of the same length. In + general, ind1 and ind2 may contain any identifier; for example, when + a SparseTriple object is passed to Cplex.quadratic_constraints.add, + its ind1 attribute may be a list containing both variable names and + variable indices. + """ + + __module__ = "cplex" + +
+[docs] + def __init__(self, ind1=None, ind2=None, val=None): + """Constructor for SparseTriple. + + Takes three arguments, ind1, ind2 and val, specifying the + indices that the SparseTriple refers to and the float values + associated with those indices, respectively. ind1, ind2, and + val must all have the same length. If ind1, ind2, or val is + omitted, they will default to an empty list. + + >>> striple = SparseTriple(ind1=[0], ind2=[0], val=[1.0]) + """ + ind1, ind2, val = init_list_args(ind1, ind2, val) + self.ind1 = ind1 + self.ind2 = ind2 + self.val = val + if not self.isvalid(): + raise CplexError("Inconsistent input data to SparseTriple")
+ + +
+[docs] + def __repr__(self): + """Representation method of SparseTriple. + + Example usage: + + >>> SparseTriple(ind1=[0], ind2=[0], val=[1.0]) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + """ + return "".join(["SparseTriple(ind1 = ", + repr(self.ind1), + ", ind2 = ", + repr(self.ind2), + ", val = ", + repr(self.val), ")"])
+ + +
+[docs] + def isvalid(self): + """Tests that ind1, ind2, and val have the same length. + + Example usage: + + >>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1], + ... val=[1.0, 1.0]) + >>> striple.isvalid() + True + """ + return (len(self.ind1) == len(self.ind2) and + len(self.ind1) == len(self.val))
+ + +
+[docs] + def unpack(self): + """Extracts the indices and values sequences as a tuple. + + Returns ind1, ind2, and val as given in __init__. + + >>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1], + ... val=[1.0, 1.0]) + >>> ind1, ind2, val = striple.unpack() + """ + return self.ind1, self.ind2, self.val
+ + + +
+[docs] +def unpack_pair(item): + """Extracts the indices and values from an object. + + The argument item can either be an instance of SparsePair or a + sequence of length two. + + Example usage: + + >>> sp = SparsePair() + >>> ind, val = unpack_pair(sp) + >>> lin_expr = [[], []] + >>> ind, val = unpack_pair(lin_expr) + """ + try: + assert item.isvalid() + ind, val = item.unpack() + except AttributeError: + ind, val = item[0:2] + validate_arg_lengths([ind, val]) + return ind, val
+ + + +
+[docs] +def unpack_triple(item): + """Extracts the indices and values from an object. + + The argument item can either be an instance of SparseTriple or a + sequence of length three. + + Example usage: + + >>> st = SparseTriple() + >>> ind1, ind2, val = unpack_triple(st) + >>> quad_expr = [[], [], []] + >>> ind1, ind2, val = unpack_triple(quad_expr) + """ + try: + assert item.isvalid() + ind1, ind2, val = item.unpack() + except AttributeError: + ind1, ind2, val = item[0:3] + validate_arg_lengths([ind1, ind2, val]) + return ind1, ind2, val
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_multiobj.html b/docs/_modules/cplex/_internal/_multiobj.html new file mode 100644 index 0000000..6fdc27a --- /dev/null +++ b/docs/_modules/cplex/_internal/_multiobj.html @@ -0,0 +1,772 @@ + + + + + + + cplex._internal._multiobj — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._multiobj

+# --------------------------------------------------------------------------
+# File: _multiobj.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Multi-Objective API"""
+from ._baseinterface import BaseInterface
+from ._subinterfaces import ObjSense
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+from . import _matrices as _mat
+from . import _pycplex as CPX
+
+class _Pair():
+    def __init__(self):
+        self.first = None
+        self.second = None
+
+
+
+[docs] +class MultiObjInterface(BaseInterface): + """Methods for adding, querying, and modifying multiple objectives. + + The methods in this interface can be used to add, query, and modify + objectives in a specified problem. These objectives are used when + multi-objective optimization is initiated. + + See also `MultiObjSolnInterface` where methods for accessing + solutions for multi-objective models can be found. + + For more details see the section on multi-objective optimization in + the CPLEX User's Manual. + """ + + sense = ObjSense() + """See `ObjSense()`""" + +
+[docs] + def __init__(self, cpx): + """Creates a new MultiObjInterface. + + The Multi-Objective interface is exposed by the top-level `Cplex` + class as `Cplex.multiobj`. This constructor is not meant to be + used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.multiobjgetindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of objectives in the problem. + + See `CPXgetnumobjs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getnumobjs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.get_num() + 1 + >>> indices = c.multiobj.set_num(2) + >>> c.multiobj.get_num() + 2 + """ + return _proc.getnumobjs(self._env._e, self._cplex._lp)
+ + +
+[docs] + def set_num(self, numobj): + """Sets the number of objectives in the problem instance. + + There is always at least one objective in the problem instance + (indexed 0) thus numobj must be at least 1. If before calling + this method there were more objectives in the instance than the + specified numobj then the objectives whose index is >= numobj are + removed from the instance. If before calling this method the + number of objectives was <= numobj then new objectives are + created, all with all-zero coefficients and default settings + (like priority, weight, etc). + + See `CPXsetnumobjs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/setnumobjs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_num(2) + >>> c.multiobj.get_num() + 2 + """ + _proc.setnumobjs(self._env._e, self._cplex._lp, numobj)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of objectives. + + There are four forms by which multiobj.get_names may be called. + + multiobj.get_names() + return the names of all objectives from the problem. + + multiobj.get_names(i) + i must be an objective index. Returns the name of row i. + + multiobj.get_names(s) + s must be a sequence of objective indices. Returns the names of + the objectives with indices the members of s. Equivalent to + [multiobj.get_names(i) for i in s] + + multiobj.get_names(begin, end) + begin and end must be objective indices. Returns the names of + the objectives with indices between begin and end, inclusive of + end. Equivalent to multiobj.get_names(range(begin, end + 1)). + + See `CPXmultiobjgetname <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetname.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_definition(0, name='mo1') + >>> c.multiobj.get_names(0) + 'mo1' + """ + def _get_name(objidx): + return _proc.multiobjgetname(self._env._e, self._cplex._lp, + objidx) + return _aux.apply_freeform_one_arg(_get_name, self._conv, + self.get_num(), args)
+ + +
+[docs] + def set_name(self, objidx, name): + """Sets the name of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.set_num(3) + >>> for i in range(3): + ... c.multiobj.set_name(i, str(i)) + >>> c.multiobj.get_names() + ['0', '1', '2'] + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, name=name)
+ + +
+[docs] + def get_definition(self, objidx, begin=None, end=None): + """Returns the definition of an objective. + + Returns an objective definitions, where the definition is a list + containing the following components: obj (a list containing the + linear objective coefficients), offset, weight, priority, abstol, + reltol (see `set_definition`). + + objidx is the name or index of the objective to be accessed. + + The optional begin and end arguments must be variable indices + or names. Together, begin and end specify the range of objective + function coefficients to be returned. By default, the linear + objective coefficients of all variables from the problem will be + returned (i.e., begin will default to the first variable index + and end will default to the last variable index). + + See `CPXmultiobjgetobj <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobj.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> varind = list(c.variables.add(obj=[1.0, 2.0])) + >>> c.multiobj.get_definition(0) + [[1.0, 2.0], 0.0, 1.0, 0, 0.0, 0.0] + """ + objidx = self._conv(objidx) + varconv = self._cplex.variables._conv + if begin is None: + begin = 0 + else: + begin = varconv(begin) + if end is None: + end = self._cplex.variables.get_num() - 1 + else: + end = varconv(end) + return _proc.multiobjgetobj(self._env._e, self._cplex._lp, + objidx, begin, end)
+ + +
+[docs] + def set_definition(self, objidx, obj=None, offset=0.0, weight=1.0, + priority=0, abstol=None, reltol=None, name=None): + """Sets the definition of an objective. + + multiobj.set_definition accepts the keyword arguments objidx, + obj, offset, weight, priority, abstol, reltol, and name. + + objidx is the name or index of the objective to be set. The + objective index must be in the interval + [0, Cplex.multiobj.get_num() - 1]. + + obj can be either a SparsePair or a list of two lists specifying + the linear component of the objective. If not specified, the + coefficients of every variable are set to 0.0. + + Note + obj must not contain duplicate indices. If obj references a + variable more than once, either by index, name, or a + combination of index and name, an exception will be raised. + + offset is the offset of the objective to be set. If not + specififed, the offset is set to 0.0. + + weight is the weight of the objective to be set. For the + definition of the weight see the description of blended objective + in the multi-objective optimization section of the CPLEX User's + Manual. If not specified, the weight is set to 1.0. + + priority is the priority of the objective to be set. It must be a + nonnegative integer. For the definition of the priority see the + description of lexicographic objective in the multi-objective + optimization section of the CPLEX User's Manual. If not + specified, the priority is set to 0. + + abstol is the absolute tolerance of the objective to be set. If + not specified, the absolute tolerance is set to 0.0. + + reltol is the relative tolerance of the objective to be set. If + not specified, the relative tolerance is set to 0.0. + + name is a string representing the name of the objective to be + set. If not specified, the objective name will default to None. + + See `CPXmultiobjsetobj <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjsetobj.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> varind = list(c.variables.add(names=['x1', 'x2'])) + >>> c.multiobj.set_definition( + ... objidx=0, + ... obj=cplex.SparsePair(ind=varind, val=[1.0, 2.0]), + ... offset=0.0, + ... weight=1.0, + ... priority=0, + ... abstol=1e-06, + ... reltol=1e-04, + ... name='obj1') + >>> c.multiobj.get_definition('obj1') + [[1.0, 2.0], 0.0, 1.0, 0, 1e-06, 0.0001] + >>> c.multiobj.get_names(0) + 'obj1' + """ + if obj is None: + obj = _mat.SparsePair() + objind, objval = _mat.unpack_pair(obj) + objind = self._cplex.variables._conv(objind) + if abstol is None: + abstol = self._cplex.parameters.mip.tolerances.absmipgap.default() + if reltol is None: + reltol = self._cplex.parameters.mip.tolerances.mipgap.default() + _proc.multiobjsetobj(self._env._e, self._cplex._lp, objidx, objind, + objval, offset, weight, priority, abstol, reltol, + name)
+ + +
+[docs] + def get_linear(self, objidx, *args): + """Returns the linear coefficients of a set of variables. + + Can be called by four forms each of which requires an objidx + argument. objidx must be an objective name or index. + + multiobj.get_linear(objidx) + return the linear objective coefficients of all variables + from the problem. + + multiobj.get_linear(objidx, i) + i must be a variable name or index. Returns the linear + objective coefficient of the variable whose index or name is i. + + multiobj.get_linear(objidx, s) + s must be a sequence of variable names or indices. Returns the + linear objective coefficient of the variables with indices the + members of s. Equivalent to + [multiobj.get_linear(objidx, i) for i in s] + + multiobj.get_linear(objidx, begin, end) + begin and end must be variable indices or variable names. + Returns the linear objective coefficient of the variables with + indices between begin and end, inclusive of end. Equivalent to + multiobj.get_linear(objidx, range(begin, end + 1)). + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... obj=[1.5 * i for i in range(10)], + ... names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.multiobj.get_linear(0, 8) + 12.0 + >>> c.multiobj.get_linear(0, '1', 3) + [1.5, 3.0, 4.5] + >>> c.multiobj.get_linear(0, [2, '0', 5]) + [3.0, 0.0, 7.5] + >>> c.multiobj.get_linear(0) + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + (coeffs, _, _, _, _, _) = self.get_definition(objidx) + def getcoeffs(begin, end=self._cplex.variables.get_num() - 1): + return CPX._getArrayView(coeffs, begin, end + 1) + return _aux.apply_freeform_two_args( + getcoeffs, self._cplex.variables._conv, args)
+ + +
+[docs] + def set_linear(self, objidx, *args): + """Changes the linear part of an objective function. + + Can be called by two forms each of which requires an objidx + argument. objidx must be an objective name or index. + + multiobj.set_linear(objidx, var, value) + var must be a variable index or name and value must be a float. + Changes the coefficient of the variable identified by var to + value. + + multiobj.set_linear(objidx, sequence) + sequence is a sequence of pairs (var, value) as described + above. Changes the coefficients for the specified variables to + the given values. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(4)]) + >>> c.multiobj.get_linear(0) + [0.0, 0.0, 0.0, 0.0] + >>> c.multiobj.set_linear(0, 0, 1.0) + >>> c.multiobj.get_linear(0) + [1.0, 0.0, 0.0, 0.0] + >>> c.multiobj.set_linear(0, '3', -1.0) + >>> c.multiobj.get_linear(0) + [1.0, 0.0, 0.0, -1.0] + >>> c.multiobj.set_linear(0, [('2', 2.0), (1, 0.5)]) + >>> c.multiobj.get_linear(0) + [1.0, 0.5, 2.0, -1.0] + """ + objidx = self._conv(objidx) + pair = _Pair() + # NB: pair.first and pair.second get set as a side effect of + # running apply_pairs below! + def set_pair(first, second): + pair.first = first + pair.second = second + _aux.apply_pairs(set_pair, self._cplex.variables._conv, *args) + ncols = self._cplex.variables.get_num() + allind = list(range(ncols)) + # To preserve the values that have not been provided, we query + # current objective. This is to maintain consistent semantics + # with Cplex.objective.set_linear. + allval = self._cplex.multiobj.get_linear(objidx) + for idx, val in zip(pair.first, pair.second): + allval[idx] = val + _proc.multiobjsetobj(self._env._e, self._cplex._lp, objidx, + objind=allind, objval=allval)
+ + +
+[docs] + def get_sense(self): + """Returns the sense of all objective functions. + + See `ObjSense`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + >>> c.multiobj.set_sense(c.multiobj.sense.maximize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'maximize' + >>> c.multiobj.set_sense(c.multiobj.sense.minimize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + """ + return self._cplex.objective.get_sense()
+ + +
+[docs] + def set_sense(self, sense): + """Sets the sense of all objective functions. + + Note + All objective functions share the same sense. To model an + objective with a different sense use a negative value for the + weight attribute. See `set_weight`. + + The argument to this method must be either `ObjSense.minimize` + or `ObjSense.maximize`. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + >>> c.multiobj.set_sense(c.multiobj.sense.maximize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'maximize' + >>> c.multiobj.set_sense(c.multiobj.sense.minimize) + >>> c.multiobj.sense[c.multiobj.get_sense()] + 'minimize' + """ + self._cplex.objective.set_sense(sense)
+ + +
+[docs] + def get_offset(self, objidx): + """Returns the constant offset of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_offset(0) + 0.0 + """ + (_, offset, _, _, _, _) = self.get_definition(objidx) + return offset
+ + +
+[docs] + def set_offset(self, objidx, offset): + """Sets the constant offset of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.objective.set_offset(3.14) + >>> c.objective.get_offset() + 3.14 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, offset=offset)
+ + +
+[docs] + def get_weight(self, objidx): + """Returns the weight of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_weight(0) + 1.0 + """ + (_, _, weight, _, _, _) = self.get_definition(objidx) + return weight
+ + +
+[docs] + def set_weight(self, objidx, weight): + """Sets the weight of an objective function. + + objidx must be an objective name or index. + + Note + All objective functions share the same sense. To model an + objective with a different sense use a negative value for the + weight attribute. See `set_sense`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_weight(0, -2.0) + >>> c.multiobj.get_weight(0) + -2.0 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, weight=weight)
+ + +
+[docs] + def get_priority(self, objidx): + """Returns the priority of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_priority(0) + 0 + """ + (_, _, _, priority, _, _) = self.get_definition(objidx) + return priority
+ + +
+[docs] + def set_priority(self, objidx, priority): + """Sets the priority of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_priority(0, 2) + >>> c.multiobj.get_priority(0) + 2 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, priority=priority)
+ + +
+[docs] + def get_abstol(self, objidx): + """Returns the absolute tolerance of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_abstol(0) + 0.0 + """ + (_, _, _, _, abstol, _) = self.get_definition(objidx) + return abstol
+ + +
+[docs] + def set_abstol(self, objidx, abstol): + """Sets the absolute tolerance of an objective function. + + objidx must be an objective name or index. + + abstol should be a float. When specifying a new value, the same + limits apply as with the + Cplex.parameters.mip.tolerances.absmipgap parameter. See the + section on Specifying multiple objective problems in the CPLEX + User's Manual for the details on the meaning of this tolerance. + + See `CPXmultiobjchgattribs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjchgattribs.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_abstol(0, 1e-6) + >>> c.multiobj.get_abstol(0) + 1e-06 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, abstol=abstol)
+ + +
+[docs] + def get_reltol(self, objidx): + """Returns the relative tolerance of an objective function. + + objidx must be an objective name or index. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.get_reltol(0) + 0.0 + """ + (_, _, _, _, _, reltol) = self.get_definition(objidx) + return reltol
+ + +
+[docs] + def set_reltol(self, objidx, reltol): + """Sets the relative tolerance of an objective function. + + objidx must be an objective name or index. + + reltol should be a float. When specifying a new value, the same + limits apply as with the Cplex.parameters.mip.tolerances.mipgap + parameter. Note that a nondefault setting of this parameter only + applies to MIP multiobjective problems. See the section on + Specifying multiple objective problems in the CPLEX User's Manual + for the details on the meaning of this tolerance. + + See `CPXmultiobjchgattribs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjchgattribs.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj=[1.0 for i in range(3)]) + >>> c.multiobj.set_reltol(0, 1e-4) + >>> c.multiobj.get_reltol(0) + 0.0001 + """ + objidx = self._conv(objidx) + _proc.multiobjchgattribs(self._env._e, self._cplex._lp, + objidx, reltol=reltol)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_multiobjsoln.html b/docs/_modules/cplex/_internal/_multiobjsoln.html new file mode 100644 index 0000000..a19c980 --- /dev/null +++ b/docs/_modules/cplex/_internal/_multiobjsoln.html @@ -0,0 +1,444 @@ + + + + + + + cplex._internal._multiobjsoln — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._multiobjsoln

+# --------------------------------------------------------------------------
+# File: _multiobjsoln.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Multi-Objective Solution API"""
+from . import _constants as _const
+from . import _procedural as _proc
+from ._baseinterface import BaseInterface
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class MultiObjFloatInfo(ConstantClass): + """Types of floating point information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + time = _const.CPX_MULTIOBJ_TIME + """See `CPX_MULTIOBJ_TIME <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_TIME.html>`_ in the C API.""" + + dettime = _const.CPX_MULTIOBJ_DETTIME + """See `CPX_MULTIOBJ_DETTIME <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DETTIME.html>`_ in the C API.""" + + objective = _const.CPX_MULTIOBJ_OBJVAL + """See `CPX_MULTIOBJ_OBJVAL <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_OBJVAL.html>`_ in the C API.""" + + best_objective = _const.CPX_MULTIOBJ_BESTOBJVAL + """See `CPX_MULTIOBJ_BESTOBJVAL <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BESTOBJVAL.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjIntInfo(ConstantClass): + """Types of integer information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + error = _const.CPX_MULTIOBJ_ERROR + """See `CPX_MULTIOBJ_ERROR <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_ERROR.html>`_ in the C API.""" + + status = _const.CPX_MULTIOBJ_STATUS + """See `CPX_MULTIOBJ_STATUS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_STATUS.html>`_ in the C API.""" + + method = _const.CPX_MULTIOBJ_METHOD + """See `CPX_MULTIOBJ_METHOD <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_METHOD.html>`_ in the C API.""" + + priority = _const.CPX_MULTIOBJ_PRIORITY + """See `CPX_MULTIOBJ_PRIORITY <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PRIORITY.html>`_ in the C API.""" + + blend = _const.CPX_MULTIOBJ_BLEND + """See `CPX_MULTIOBJ_BLEND <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BLEND.html>`_ in the C API.""" + + pfeas = _const.CPX_MULTIOBJ_PFEAS + """See `CPX_MULTIOBJ_PFEAS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PFEAS.html>`_ in the C API.""" + + dfeas = _const.CPX_MULTIOBJ_DFEAS + """See `CPX_MULTIOBJ_DFEAS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DFEAS.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjLongInfo(ConstantClass): + """Types of long integer information that can be queried for + multi-objective optimization. + + This class contains the types of solution information of type float + that can be retreived from the solution of a sub-problem solved + during multi-objective optimization. + + This information can be querried for each priority level with method + `MultiObjSolnInterface.get_info`. + """ + + num_barrier_iterations = _const.CPX_MULTIOBJ_BARITCNT + """See `CPX_MULTIOBJ_BARITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_BARITCNT.html>`_ in the C API.""" + + num_sifting_iterations = _const.CPX_MULTIOBJ_SIFTITCNT + """See `CPX_MULTIOBJ_SIFTITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_SIFTITCNT.html>`_ in the C API.""" + + num_sifting_phase1_iterations = _const.CPX_MULTIOBJ_SIFTPHASE1CNT + """See `CPX_MULTIOBJ_SIFTPHASE1CNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_SIFTPHASE1CNT.html>`_ in the C API.""" + + num_degenerate_iterations = _const.CPX_MULTIOBJ_DEGCNT + """See `CPX_MULTIOBJ_DEGCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DEGCNT.html>`_ in the C API.""" + + num_iterations = _const.CPX_MULTIOBJ_ITCNT + """See `CPX_MULTIOBJ_ITCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_ITCNT.html>`_ in the C API.""" + + num_phase1_iterations = _const.CPX_MULTIOBJ_PHASE1CNT + """See `CPX_MULTIOBJ_PHASE1CNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PHASE1CNT.html>`_ in the C API.""" + + num_primal_pushes = _const.CPX_MULTIOBJ_PPUSH + """See `CPX_MULTIOBJ_PPUSH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PPUSH.html>`_ in the C API.""" + + num_primal_exchanges = _const.CPX_MULTIOBJ_PEXCH + """See `CPX_MULTIOBJ_PEXCH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_PEXCH.html>`_ in the C API.""" + + num_dual_pushes = _const.CPX_MULTIOBJ_DPUSH + """See `CPX_MULTIOBJ_DPUSH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DPUSH.html>`_ in the C API.""" + + num_dual_exchanges = _const.CPX_MULTIOBJ_DEXCH + """See `CPX_MULTIOBJ_DEXCH <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_DEXCH.html>`_ in the C API.""" + + num_nodes = _const.CPX_MULTIOBJ_NODECNT + """See `CPX_MULTIOBJ_NODECNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_NODECNT.html>`_ in the C API.""" + + num_nodes_left = _const.CPX_MULTIOBJ_NODELEFTCNT + """See `CPX_MULTIOBJ_NODELEFTCNT <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_MULTIOBJ_NODELEFTCNT.html>`_ in the C API."""
+ + + +
+[docs] +class MultiObjSolnInterface(BaseInterface): + """Methods for accessing solutions for multi-objective models. + + The methods in this interface can be used to query solutions for + multi-objective models. + + See also `MultiObjInterface` where methods for adding, querying, and + modifying multiple objectives can be found. + """ + + float_info = MultiObjFloatInfo() + """See `MultiObjFloatInfo()` """ + + int_info = MultiObjIntInfo() + """See `MultiObjIntInfo()` """ + + long_info = MultiObjLongInfo() + """See `MultiObjLongInfo()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new MIPSolutionInterface. + + The multi-objective solution interface is exposed by the + top-level `Cplex` class as Cplex.solution.multiobj. This + constructor is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_objective_value(self, objidx): + """Returns the value of an objective function. + + objidx is the name or index of the objective to be accessed. + + See `CPXmultiobjgetobjval <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobjval.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.solve() + >>> c.solution.multiobj.get_objective_value(0) + -202.5 + >>> c.solution.multiobj.get_objective_value(1) + -202.5 + """ + objidx = self._cplex.multiobj._conv(objidx) + return _proc.multiobjgetobjval( + self._env._e, + self._cplex._lp, + objidx)
+ + +
+[docs] + def get_objval_by_priority(self, priority): + """Returns the value of an objective function by priority. + + After multi-objective optimization, returns the blended objective + value for the specified priority. + + See `CPXmultiobjgetobjvalbypriority <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetobjvalbypriority.html>`_ in the Callable + Library Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> c.solution.multiobj.get_objval_by_priority(1) + -202.5 + >>> c.solution.multiobj.get_objval_by_priority(2) + -202.5 + """ + return _proc.multiobjgetobjvalbypriority( + self._env._e, + self._cplex._lp, + priority)
+ + +
+[docs] + def get_num_solves(self): + """Returns the number of sub-problems that where successfully + solved during the last optimization of a multi-objective problem. + + See `CPXmultiobjgetnumsolves <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetnumsolves.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> c.solution.multiobj.get_num_solves() + 2 + """ + return _proc.multiobjgetnumsolves(self._env._e, self._cplex._lp)
+ + + @staticmethod + def _isintinfo(what): + try: + _ = MultiObjSolnInterface.int_info[what] + return True + except KeyError: + return False + + @staticmethod + def _islonginfo(what): + try: + _ = MultiObjSolnInterface.long_info[what] + return True + except KeyError: + return False + + @staticmethod + def _isdblinfo(what): + try: + _ = MultiObjSolnInterface.float_info[what] + return True + except KeyError: + return False + +
+[docs] + def get_info(self, subprob, what): + """Returns the solution information of a sub-problem of a + multi-objective optimization. + + subprob is the sub-problem of a multi-objective optimization. + + what is an attribute from Cplex.solution.multiobj.float_info + (see `MultiObjFloatInfo`), Cplex.solution.multiobj.int_info + (see `MultiObjIntInfo`), or Cplex.solution.multiobj.long_info + (see `MultiObjLongInfo`). + + See `CPXmultiobjgetdblinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetdblinfo.html>`_, + `CPXmultiobjgetintinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetintinfo.html>`_, + `CPXmultiobjgetlonginfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/multiobjgetlonginfo.html>`_, etc. in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.multiobj.set_num(2) + >>> c.multiobj.set_linear( + ... 1, + ... [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))] + ... ) + >>> c.multiobj.set_priority(0, 1) + >>> c.multiobj.set_priority(1, 2) + >>> c.solve() + >>> num = c.solution.multiobj.get_num_solves() + >>> for i in range(num): + ... priority = c.solution.multiobj.get_info( + ... i, + ... c.solution.multiobj.int_info.priority + ... ) + """ + if MultiObjSolnInterface._isintinfo(what): + return _proc.multiobjgetintinfo(self._env._e, self._cplex._lp, + subprob, what) + if MultiObjSolnInterface._islonginfo(what): + return _proc.multiobjgetlonginfo(self._env._e, self._cplex._lp, + subprob, what) + if MultiObjSolnInterface._isdblinfo(what): + return _proc.multiobjgetdblinfo(self._env._e, self._cplex._lp, + subprob, what) + raise ValueError(what)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_parameter_classes.html b/docs/_modules/cplex/_internal/_parameter_classes.html new file mode 100644 index 0000000..cd05c10 --- /dev/null +++ b/docs/_modules/cplex/_internal/_parameter_classes.html @@ -0,0 +1,1460 @@ + + + + + + + cplex._internal._parameter_classes — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._parameter_classes

+# --------------------------------------------------------------------------
+# File: _parameter_classes.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Parameters for the CPLEX Python API.
+
+This module defines classes for parameters, groups of parameters, and
+parameter constants used in the CPLEX Python API.  For more detail, see also
+the corresponding commands of the Interactive Optimizer documented in the
+CPLEX Parameters Reference Manual.
+"""
+import functools
+import weakref
+
+from ._aux_functions import init_list_args
+from . import _procedural as CPX_PROC
+from . import _constants
+from ..exceptions import CplexError, CplexSolverError, error_codes
+from ..paramset import ParameterSet
+from ..constant_class import ConstantClass
+
+
+def _get_info_wrapper(func):
+    """Decorator to lazily load parameter info.
+
+    We have to lazily load parameter info in several methods of the
+    Parameter class. This decorator makes it easy and consistent to do
+    this.
+    """
+    @functools.wraps(func)
+    def wrap(self, *args, **kwargs):
+        # First, lazily load parameter info if necc.
+        self._get_info()
+        # Then call the function.
+        return func(self, *args, **kwargs)
+    return wrap
+
+
+
+[docs] +class Parameter(): + """Base class for Cplex parameters. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env, about, parent, name, constants=None): + """non-public""" + self._env = weakref.proxy(env) + self._id, self._help, self._type = about + self._parent = parent + self._name = name + if constants is not None: + self.values = constants() + self._has_info = False + # self._defval gets set lazily by self._get_info(). + self._defval = None
+ + +
+[docs] + def __repr__(self): + """Returns the name of the parameter within the hierarchy.""" + return "".join([self._parent.__repr__(), '.', self._name])
+ + + def _check_value(self, value): + """Checks the validity of the parameter value.""" + raise NotImplementedError + +
+[docs] + def set(self, value): + """Sets the parameter to value.""" + self._check_value(value) + try: + self._env.parameters._set(self._id, value, self._type) + except TypeError: + # Replace ugly TypeError message from the SWIG layer with + # something more informative. + raise TypeError("invalid parameter value: {0}".format(value))
+ + +
+[docs] + def get(self): + """Returns the current value of the parameter.""" + return self._env.parameters._get(self._id, self._type)
+ + +
+[docs] + def reset(self): + """Sets the parameter to its default value.""" + try: + self.set(self.default()) + except CplexSolverError as cse: + if ((self._id == _constants.CPX_PARAM_CPUMASK) and + cse.args[2] == error_codes.CPXERR_UNSUPPORTED_OPERATION): + pass + else: + raise
+ + + def _get_info(self): + """Lazily load the default, min, and max values.""" + raise NotImplementedError + +
+[docs] + @_get_info_wrapper + def default(self): + """Returns the default value of the parameter.""" + return self._defval
+ + +
+[docs] + def type(self): + """Returns the type of the parameter. + + Allowed types are float, int, and str. + """ + return type(self.default())
+ + +
+[docs] + def help(self): + """Returns the documentation for the parameter.""" + return self._help
+
+ + + +
+[docs] +class NumParameter(Parameter): + """Class for integer and float parameters. + + :undocumented: __init__ + """ + + @_get_info_wrapper + def _check_value(self, value): + """Checks the validity of the parameter value.""" + # As we define a special min value for CPX_PARAM_CLONELOG in the Python API + # we have to have special handling for it. + if (self._id == _constants.CPX_PARAM_CLONELOG and + value < self._minval): + raise ValueError("invalid {0} parameter value: {1}".format( + self._name, value)) + + def _get_info(self): + """Lazily load the default, min, and max values.""" + if self._has_info: + return + self._has_info = True + (self._defval, + self._minval, + self._maxval) = self._env.parameters._get_info(self._id, self._type) + # Override some default values for the Python API. + if self._id == _constants.CPX_PARAM_CLONELOG: + self._minval = 0 + elif self._id == _constants.CPX_PARAM_DATACHECK: + self._defval = _constants.CPX_DATACHECK_WARN + +
+[docs] + @_get_info_wrapper + def min(self): + """Returns the minimum value for the parameter.""" + return self._minval
+ + +
+[docs] + @_get_info_wrapper + def max(self): + """Returns the maximum value for the parameter.""" + return self._maxval
+
+ + + +
+[docs] +class StrParameter(Parameter): + """Class for string parameters. + + :undocumented: __init__ + """ + + def _check_value(self, value): + """Checks the validity of the parameter value.""" + + def _get_info(self): + """Lazily load the default value. + + Note + For string parameters there is no min and max value. + """ + if self._has_info: + return + self._has_info = True + self._defval = self._env.parameters._get_info(self._id, self._type)
+ + + +
+[docs] +class ParameterGroup(): + """Class containing a group of Cplex parameters. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env, members, parent): + """non-public""" + self._env = weakref.proxy(env) + self._parent = parent + # self._name gets set dynamically below when we call + # self.__dict__.update() (see _parameter_hierarchy.py). + self._name = None + self.__dict__.update(members(env, self))
+ + +
+[docs] + def __repr__(self): + """Returns the name of the parameter group within the hierarchy.""" + return "".join([self._parent.__repr__(), '.', self._name])
+ + +
+[docs] + def reset(self): + """Sets the parameters in the group to their default values.""" + for member in self.__dict__.values(): + if (isinstance(member, (ParameterGroup, Parameter)) and + member != self._parent): + member.reset()
+ + + def _get_params(self, filterfunc): + """non-public""" + retval = [] + for member in self.__dict__.values(): + if isinstance(member, ParameterGroup) and member != self._parent: + retval.extend(member._get_params(filterfunc)) + if isinstance(member, Parameter): + if filterfunc(member): + retval.append((member, member.get())) + return retval + +
+[docs] + def get_changed(self): + """Returns a list of the changed parameters in the group. + + Returns a list of (parameter, value) pairs. Each parameter is + an instance of the Parameter class, and thus the parameter + value can be changed via its set method, or this object can be + passed to the tuning functions. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.read.datacheck.set( + ... c.parameters.read.datacheck.values.assist) + >>> for parameter, value in c.parameters.get_changed(): + ... pass # do something + """ + return self._get_params(lambda x: x.get() != x.default())
+ + +
+[docs] + def get_all(self): + """Returns a list of all the parameters in the group. + + Returns a list of (parameter, value) pairs. Each parameter is + an instance of the Parameter class, and thus the parameter + value can be changed via its set method, or this object can be + passed to the tuning functions. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> for parameter, value in c.parameters.get_all(): + ... pass # do something + """ + return self._get_params(lambda x: True)
+
+ + + +
+[docs] +class TuningConstants(ConstantClass): + """Status codes returned by tuning methods. + + For an explanation of tuning, see that topic in + the CPLEX User's Manual. + """ + + completed = 0 # There is no constant for this. + abort = _constants.CPX_TUNE_ABORT + time_limit = _constants.CPX_TUNE_TILIM + dettime_limit = _constants.CPX_TUNE_DETTILIM
+ + + +
+[docs] +class RootParameterGroup(ParameterGroup): + """Class containing all the Cplex parameters. + + :undocumented: __init__, _set, _get, _get_info + """ + + tuning_status = TuningConstants() + """See `TuningConstants()`""" + +
+[docs] + def __init__(self, env, members): + if env is None and members is None: + return + env.parameters = self + super().__init__(env, members, None) + # At the C-level, the apiencoding parameter is always UTF-8 in + # the Python API. + self._set(_constants.CPX_PARAM_APIENCODING, "UTF-8", + _constants.CPX_PARAMTYPE_STRING) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_APIENCODING) + # Turn off access to presolved problem in callbacks in the Python API. + # CPX_PARAM_MIPCBREDLP is hidden so we have to set it via the + # parameter ID. + self._set(_constants.CPX_PARAM_MIPCBREDLP, 0, + _constants.CPX_PARAMTYPE_INT) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_MIPCBREDLP) + # Fix CPX_PARAM_SCRIND to "off" (see RTC-36832). + self._set(_constants.CPX_PARAM_SCRIND, _constants.CPX_OFF, + _constants.CPX_PARAMTYPE_INT) + CPX_PROC.fixparam(self._env._e, _constants.CPX_PARAM_SCRIND) + # By default, the datacheck parameter is "on" in the Python API. + self.read.datacheck.set(_constants.CPX_DATACHECK_WARN)
+ + +
+[docs] + def reset(self): + """Sets the parameters in the group to their default values.""" + # Rather than calling ParameterGroup.reset(self), we can just + # reset using CPXXsetdefaults, which should be much faster. We + # still allow users to call reset() on individual parameters or + # parameter groups, though. + CPX_PROC.setdefaults(self._env._e) + # By default, the datacheck parameter is "on" in the Python API. + self.read.datacheck.set(_constants.CPX_DATACHECK_WARN)
+ + +
+[docs] + def __repr__(self): + """Return 'parameters'.""" + return self._name
+ + + def _set(self, which_parameter, value, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + if paramtype == _constants.CPX_PARAMTYPE_INT: + if isinstance(value, float): + value = int(value) # will upconvert to long, if necc. + CPX_PROC.setintparam(self._env._e, which_parameter, value) + elif paramtype == _constants.CPX_PARAMTYPE_DOUBLE: + if isinstance(value, int): + value = float(value) + CPX_PROC.setdblparam(self._env._e, which_parameter, value) + elif paramtype == _constants.CPX_PARAMTYPE_STRING: + CPX_PROC.setstrparam(self._env._e, which_parameter, value) + else: + assert paramtype == _constants.CPX_PARAMTYPE_LONG + if isinstance(value, float): + value = int(value) # will upconvert to long, if necc. + CPX_PROC.setlongparam(self._env._e, which_parameter, value) + + def _get(self, which_parameter, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + switcher = { + _constants.CPX_PARAMTYPE_INT: CPX_PROC.getintparam, + _constants.CPX_PARAMTYPE_DOUBLE: CPX_PROC.getdblparam, + _constants.CPX_PARAMTYPE_STRING: CPX_PROC.getstrparam, + _constants.CPX_PARAMTYPE_LONG: CPX_PROC.getlongparam + } + func = switcher[paramtype] + return func(self._env._e, which_parameter) + + def _get_info(self, which_parameter, paramtype=None): + # RTC-34595 + if paramtype is None: + paramtype = CPX_PROC.getparamtype(self._env._e, + which_parameter) + switcher = { + _constants.CPX_PARAMTYPE_INT: CPX_PROC.infointparam, + _constants.CPX_PARAMTYPE_DOUBLE: CPX_PROC.infodblparam, + _constants.CPX_PARAMTYPE_STRING: CPX_PROC.infostrparam, + _constants.CPX_PARAMTYPE_LONG: CPX_PROC.infolongparam + } + func = switcher[paramtype] + return func(self._env._e, which_parameter) + + def _validate_fixed_args(self, fixed_parameters_and_values): + if isinstance(fixed_parameters_and_values, ParameterSet): + if fixed_parameters_and_values not in self._cplex._pslst: + raise ValueError("parameter set must have been created" + " by this CPLEX problem object") + else: + return # done checking + valid = False # guilty until proven innocent + try: + paramset = set() + for (param, _) in fixed_parameters_and_values: + param_id, _ = param._id, param._type + if param_id in paramset: + raise CplexError("duplicate parameters detected") + else: + paramset.add(param_id) + # If we can iterate over fixed_parameters_and_values and + # access the _id and _type attributes of the parameters, + # then it's considered valid. + valid = True + except (AttributeError, TypeError): + pass + if not valid: + raise TypeError("invalid fixed_parameters_and_values arg detected") + + def _get_fixed_args_iter(self, arg): + if isinstance(arg, ParameterSet): + for param_id in arg.get_ids(): + param_type = CPX_PROC.getparamtype(self._env._e, param_id) + param_value = arg.get(param_id) + yield param_id, param_type, param_value + else: + for (param, value) in arg: + yield param._id, param._type, value + + def _process_fixed_args(self, fixed_parameters_and_values): + """non-public""" + if __debug__: + self._validate_fixed_args(fixed_parameters_and_values) + int_params_and_values = [] + dbl_params_and_values = [] + str_params_and_values = [] + has_datacheck = False + for (param_id, param_type, value) in self._get_fixed_args_iter( + fixed_parameters_and_values): + if param_id == _constants.CPX_PARAM_DATACHECK: + has_datacheck = True + if param_type in (_constants.CPX_PARAMTYPE_INT, + _constants.CPX_PARAMTYPE_LONG): + int_params_and_values.append((param_id, value)) + elif param_type == _constants.CPX_PARAMTYPE_DOUBLE: + dbl_params_and_values.append((param_id, value)) + else: + assert param_type == _constants.CPX_PARAMTYPE_STRING, \ + "unexpected parameter type" + str_params_and_values.append((param_id, value)) + # In the Python API, the datacheck parameter defaults to "on". + # When calling the tuning functions the datacheck parameter can + # be changed as a side effect. Here, we ensure that the value of + # the datacheck parameter is the same before and after. That is, + # _unless_ the user overrides it here, explicitly, by passing the + # datacheck parameter in as a fixed parameter. + if not has_datacheck: + int_params_and_values.append( + (_constants.CPX_PARAM_DATACHECK, + self.read.datacheck.get())) + return (int_params_and_values, dbl_params_and_values, + str_params_and_values) + +
+[docs] + def tune_problem_set(self, filenames, filetypes=None, + fixed_parameters_and_values=None): + """Tunes parameters for a set of problems. + + filenames must be a sequence of strings specifying a set of + problems to tune. + + If filetypes is given, it must be a sequence of the same + length as filenames also consisting of strings that specify + the types of the corresponding files. + + If fixed_parameters_and_values is given, it may be either a + ParameterSet instance or a sequence of sequences of length 2 + containing instances of the Parameter class that are to be fixed + during the tuning process and the values at which they are to be + fixed. + + tune_problem_set returns the status of the tuning procedure, + which is an attribute of parameters.tuning_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto) + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"], + ... fixed_parameters_and_values=ps) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"], + ... fixed_parameters_and_values=[ + ... (c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto)]) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem_set( + ... filenames=["lpex.mps", "example.mps"]) + >>> c.parameters.tuning_status[status] + 'completed' + """ + filetypes, fixed_parameters_and_values = init_list_args( + filetypes, fixed_parameters_and_values) + (int_params_and_values, + dbl_params_and_values, + str_params_and_values) = self._process_fixed_args( + fixed_parameters_and_values) + return CPX_PROC.tuneparamprobset(self._env._e, + filenames, filetypes, + int_params_and_values, + dbl_params_and_values, + str_params_and_values)
+ + +
+[docs] + def tune_problem(self, fixed_parameters_and_values=None): + """Tunes parameters for a Cplex problem. + + If fixed_parameters_and_values is given, it may be either a + ParameterSet instance or a sequence of sequences of length 2 + containing instances of the Parameter class that are to be fixed + during the tuning process and the values at which they are to be + fixed. + + tune_problem returns the status of the tuning procedure, which + is an attribute of parameters.tuning_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto) + >>> status = c.parameters.tune_problem(ps) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem([ + ... (c.parameters.lpmethod, + ... c.parameters.lpmethod.values.auto)]) + >>> c.parameters.tuning_status[status] + 'completed' + >>> status = c.parameters.tune_problem() + >>> c.parameters.tuning_status[status] + 'completed' + """ + (fixed_parameters_and_values,) = init_list_args( + fixed_parameters_and_values) + (int_params_and_values, + dbl_params_and_values, + str_params_and_values) = self._process_fixed_args( + fixed_parameters_and_values) + return CPX_PROC.tuneparam(self._env._e, self._cplex._lp, + int_params_and_values, + dbl_params_and_values, + str_params_and_values)
+ + +
+[docs] + def read_file(self, filename): + """Reads a set of parameters from the file filename.""" + CPX_PROC.readcopyparam(self._env._e, filename)
+ + +
+[docs] + def write_file(self, filename): + """Writes a set of parameters to the file filename.""" + CPX_PROC.writeparam(self._env._e, filename)
+
+ + + +
+[docs] +class off_on_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + off = _constants.CPX_OFF + on = _constants.CPX_ON
+ + + +
+[docs] +class auto_off_on_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_AUTO + off = _constants.CPX_OFF + on = _constants.CPX_ON
+ + + +
+[docs] +class writelevel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_WRITELEVEL_AUTO + all_variables = _constants.CPX_WRITELEVEL_ALLVARS + discrete_variables = _constants.CPX_WRITELEVEL_DISCRETEVARS + nonzero_variables = _constants.CPX_WRITELEVEL_NONZEROVARS + nonzero_discrete_variables = _constants.CPX_WRITELEVEL_NONZERODISCRETEVARS
+ + + +
+[docs] +class scale_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + equilibration = 0 + aggressive = 1
+ + + +
+[docs] +class mip_emph_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + balanced = _constants.CPX_MIPEMPHASIS_BALANCED + optimality = _constants.CPX_MIPEMPHASIS_OPTIMALITY + feasibility = _constants.CPX_MIPEMPHASIS_FEASIBILITY + best_bound = _constants.CPX_MIPEMPHASIS_BESTBOUND + hidden_feasibility = _constants.CPX_MIPEMPHASIS_HIDDENFEAS + heuristic = _constants.CPX_MIPEMPHASIS_HEURISTIC
+ + + +
+[docs] +class brdir_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + down = _constants.CPX_BRDIR_DOWN + auto = _constants.CPX_BRDIR_AUTO + up = _constants.CPX_BRDIR_UP
+ + + +
+[docs] +class search_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_MIPSEARCH_AUTO + traditional = _constants.CPX_MIPSEARCH_TRADITIONAL + dynamic = _constants.CPX_MIPSEARCH_DYNAMIC
+ + + +
+[docs] +class subalg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + network = _constants.CPX_ALG_NET + barrier = _constants.CPX_ALG_BARRIER + sifting = _constants.CPX_ALG_SIFTING
+ + + +
+[docs] +class nodesel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + depth_first = _constants.CPX_NODESEL_DFS + best_bound = _constants.CPX_NODESEL_BESTBOUND + best_estimate = _constants.CPX_NODESEL_BESTEST + best_estimate_alt = _constants.CPX_NODESEL_BESTEST_ALT
+ + + +
+[docs] +class alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + sifting = _constants.CPX_ALG_SIFTING + network = _constants.CPX_ALG_NET + concurrent = _constants.CPX_ALG_CONCURRENT
+ + + +
+[docs] +class varsel_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + min_infeasibility = _constants.CPX_VARSEL_MININFEAS + default = _constants.CPX_VARSEL_DEFAULT + max_infeasibility = _constants.CPX_VARSEL_MAXINFEAS + pseudo_costs = _constants.CPX_VARSEL_PSEUDO + strong_branching = _constants.CPX_VARSEL_STRONG + pseudo_reduced_costs = _constants.CPX_VARSEL_PSEUDOREDUCED
+ + + +
+[docs] +class dive_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + traditional = 1 + probing = 2 + guided = 3
+ + + +
+[docs] +class file_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + memory = 1 + disk = 2 + disk_compressed = 3
+ + + +
+[docs] +class fpheur_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + feas = 1 + obj_and_feas = 2
+ + + +
+[docs] +class cardls_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + disabled = -1 + auto = 0 + at_root = 1 + at_all_nodes = 2
+ + + +
+[docs] +class miqcp_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + QCP_at_node = 1 + LP_at_node = 2
+ + + +
+[docs] +class presolve_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + force = 1 + probe = 2
+ + + +
+[docs] +class v_agg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + moderate = 1 + aggressive = 2 + very_aggressive = 3
+ + + +
+[docs] +class kappastats_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + sample = 1 + full = 2
+ + + +
+[docs] +class agg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + moderate = 1 + aggressive = 2
+ + + +
+[docs] +class replace_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + firstin_firstout = _constants.CPX_SOLNPOOL_FIFO + worst_objective = _constants.CPX_SOLNPOOL_OBJ + diversity = _constants.CPX_SOLNPOOL_DIV
+ + + +
+[docs] +class ordertype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + default = 0 + cost = _constants.CPX_MIPORDER_COST + bounds = _constants.CPX_MIPORDER_BOUNDS + scaled_cost = _constants.CPX_MIPORDER_SCALEDCOST
+ + + +
+[docs] +class mip_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + integer_feasible = 1 + mip_interval_nodes = 2 + node_cuts = 3 + LP_root = 4 + LP_all = 5
+ + + +
+[docs] +class conflict_algorithm_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_CONFLICTALG_AUTO + fast = _constants.CPX_CONFLICTALG_FAST + propagate = _constants.CPX_CONFLICTALG_PROPAGATE + presolve = _constants.CPX_CONFLICTALG_PRESOLVE + iis = _constants.CPX_CONFLICTALG_IIS + limitedsolve = _constants.CPX_CONFLICTALG_LIMITSOLVE + solve = _constants.CPX_CONFLICTALG_SOLVE
+ + + +
+[docs] +class dual_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_DPRIIND_AUTO + full = _constants.CPX_DPRIIND_FULL + steep = _constants.CPX_DPRIIND_STEEP + full_steep = _constants.CPX_DPRIIND_FULLSTEEP + steep_Q_start = _constants.CPX_DPRIIND_STEEPQSTART + devex = _constants.CPX_DPRIIND_DEVEX
+ + + +
+[docs] +class primal_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + partial = _constants.CPX_PPRIIND_PARTIAL + auto = _constants.CPX_PPRIIND_AUTO + devex = _constants.CPX_PPRIIND_DEVEX + steep = _constants.CPX_PPRIIND_STEEP + steep_Q_start = _constants.CPX_PPRIIND_STEEPQSTART + full = _constants.CPX_PPRIIND_FULL
+ + + +
+[docs] +class display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + normal = 1 + detailed = 2
+ + + +
+[docs] +class prered_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_PREREDUCE_NOPRIMALORDUAL + primal = _constants.CPX_PREREDUCE_PRIMALONLY + dual = _constants.CPX_PREREDUCE_DUALONLY + primal_and_dual = _constants.CPX_PREREDUCE_PRIMALANDDUAL
+ + +
+[docs] +class prereform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_PREREFORM_NONE + interfere_crush = _constants.CPX_PREREFORM_INTERFERE_CRUSH + interfere_uncrush = _constants.CPX_PREREFORM_INTERFERE_UNCRUSH + all = _constants.CPX_PREREFORM_ALL
+ + + +
+[docs] +class sos1reform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + logarithmic = 1
+ + + +
+[docs] +class sos2reform_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = -1 + auto = 0 + logarithmic = 1
+ + + +
+[docs] +class coeffreduce_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + integral = 1 + any = 2
+ + + +
+[docs] +class dependency_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + begin = 1 + end = 2 + begin_and_end = 3
+ + + +
+[docs] +class dual_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + no = -1 + auto = 0 + yes = 1
+ + + +
+[docs] +class linear_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + only_linear = 0 + full = 1
+ + + +
+[docs] +class repeatpre_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + without_cuts = 1 + with_cuts = 2 + new_root_cuts = 3
+ + + +
+[docs] +class sym_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = -1 + off = 0 + mild = 1 + moderate = 2 + aggressive = 3 + more_aggressive = 4 + very_aggressive = 5
+ + + +
+[docs] +class qcpduals_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + no = 0 + if_possible = 1 + force = 2
+ + + +
+[docs] +class sift_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + network = _constants.CPX_ALG_NET
+ + + +
+[docs] +class feasopt_mode_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + min_sum = _constants.CPX_FEASOPT_MIN_SUM + opt_sum = _constants.CPX_FEASOPT_OPT_SUM + min_inf = _constants.CPX_FEASOPT_MIN_INF + opt_inf = _constants.CPX_FEASOPT_OPT_INF + min_quad = _constants.CPX_FEASOPT_MIN_QUAD + opt_quad = _constants.CPX_FEASOPT_OPT_QUAD
+ + + +
+[docs] +class measure_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + average = _constants.CPX_TUNE_AVERAGE + minmax = _constants.CPX_TUNE_MINMAX
+ + + +
+[docs] +class tune_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + minimal = 1 + settings = 2 + settings_and_logs = 3
+ + + +
+[docs] +class bar_order_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + approx_min_degree = _constants.CPX_BARORDER_AMD + approx_min_fill = _constants.CPX_BARORDER_AMF + nested_dissection = _constants.CPX_BARORDER_ND
+ + + +
+[docs] +class crossover_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_ALG_NONE + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL
+ + + +
+[docs] +class bar_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + default = 0 + infeas_estimate = 1 + infeas_constant = 2 + standard = 3
+ + + +
+[docs] +class bar_start_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + zero_dual = 1 + estimated_dual = 2 + average_primal_zero_dual = 3 + average_primal_estimated_dual = 4
+ + + +
+[docs] +class par_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + opportunistic = _constants.CPX_PARALLEL_OPPORTUNISTIC + auto = _constants.CPX_PARALLEL_AUTO + deterministic = _constants.CPX_PARALLEL_DETERMINISTIC
+ + + +
+[docs] +class qp_alg_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_ALG_AUTOMATIC + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + network = _constants.CPX_ALG_NET + barrier = _constants.CPX_ALG_BARRIER
+ + + +
+[docs] +class advance_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = 0 + standard = 1 + alternate = 2
+ + + +
+[docs] +class clocktype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + CPU = 1 + wall = 2
+ + + +
+[docs] +class solutiontype_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPX_AUTO_SOLN + basic = _constants.CPX_BASIC_SOLN + non_basic = _constants.CPX_NONBASIC_SOLN
+ + + +
+[docs] +class optimalitytarget_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = 0 + optimal_convex = 1 + first_order = 2 + optimal_global = 3
+ + + +
+[docs] +class datacheck_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + off = _constants.CPX_DATACHECK_OFF + warn = _constants.CPX_DATACHECK_WARN + assist = _constants.CPX_DATACHECK_ASSIST
+ + + +
+[docs] +class benders_strategy_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPX_BENDERSSTRATEGY_OFF + auto = _constants.CPX_BENDERSSTRATEGY_AUTO + user = _constants.CPX_BENDERSSTRATEGY_USER + workers = _constants.CPX_BENDERSSTRATEGY_WORKERS + full = _constants.CPX_BENDERSSTRATEGY_FULL
+ + + +
+[docs] +class network_display_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + none = _constants.CPXNET_NO_DISPLAY_OBJECTIVE + true_objective_values = _constants.CPXNET_TRUE_OBJECTIVE + penalized_objective_values = _constants.CPXNET_PENALIZED_OBJECTIVE
+ + + +
+[docs] +class network_netfind_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + pure = _constants.CPX_NETFIND_PURE + reflection_scaling = _constants.CPX_NETFIND_REFLECT + general_scaling = _constants.CPX_NETFIND_SCALE
+ + + +
+[docs] +class network_pricing_constants(ConstantClass): + # pylint: disable=invalid-name + # pylint: disable=missing-docstring + # pylint: disable=too-few-public-methods + auto = _constants.CPXNET_PRICE_AUTO + partial = _constants.CPXNET_PRICE_PARTIAL + multiple_partial = _constants.CPXNET_PRICE_MULT_PART + multiple_partial_with_sorting = _constants.CPXNET_PRICE_SORT_MULT_PART
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_procedural.html b/docs/_modules/cplex/_internal/_procedural.html new file mode 100644 index 0000000..fa0c695 --- /dev/null +++ b/docs/_modules/cplex/_internal/_procedural.html @@ -0,0 +1,5529 @@ + + + + + + + cplex._internal._procedural — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._procedural

+# --------------------------------------------------------------------------
+# File: _procedural.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Wrapper functions for the CPLEX C Callable Library"""
+from collections import namedtuple
+from contextlib import contextmanager
+import os
+
+from . import _constants as _const
+from . import _list_array_utils as LAU
+from . import _pycplex as CR
+
+from ..exceptions import CplexSolverError, CplexError, ErrorChannelMessage
+
+CPLEX_PY_DISABLE_SIGHANDLER = os.getenv("CPLEX_PY_DISABLE_SIGHANDLER")
+
+# pylint: disable=missing-docstring
+
+
+def _safeDoubleArray(arraylen):
+    # Make sure that we never request a zero-length array.  This results in
+    # a malloc(0) call in the SWIG layer.  On AIX this returns NULL which
+    # causes problems.  By ensuring that the array is at least size 1, we
+    # avoid these problems and the overhead should be negligable.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.doubleArray(arraylen)
+
+
+def _safeIntArray(arraylen):
+    # See comment for _safeDoubleArray above.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.intArray(arraylen)
+
+
+def _safeLongArray(arraylen):
+    # See comment for _safeDoubleArray above.
+    if arraylen <= 0:
+        arraylen = 1
+    return CR.longArray(arraylen)
+
+
+def _arraylen(seq):
+    """If seq is None, return 0, else len(seq).
+
+    CPLEX often requires a count argument to specify the length of
+    subsequent array arguments. This function allows us to return a
+    length of 0 for None (i.e., NULL) arrays.
+    """
+    if seq is None:
+        return 0
+    return len(seq)
+
+
+def _rangelen(begin, end):
+    """Returns length of the range specified by begin and end.
+
+    As this is typically used to calculate the length of a buffer, it
+    always returns a result >= 0.
+
+    See functions like `_safeDoubleArray` and `safeLongArray`.
+    """
+    # We allow arguments like begin=0, end=-1 on purpose. This represents
+    # an empty range; the callable library should do nothing in this case
+    # (see RTC-31484).
+    result = end - begin + 1
+    if result < 0:
+        return 0
+    return result
+
+
+
+[docs] +def getstatstring(env, statind): + output = [] + CR.CPXXgetstatstring(env, statind, output) + return output[0]
+ + + +
+[docs] +def geterrorstring(env, errcode): + output = [] + CR.CPXXgeterrorstring(env, errcode, output) + return output[0]
+ + + +
+[docs] +def cb_geterrorstring(env, status): + return CR.cb_geterrorstring(env, status)
+ + + +
+[docs] +def new_native_int(): + return CR.new_native_int()
+ + + +
+[docs] +def delete_native_int(p): + CR.delete_native_int(p)
+ + + +
+[docs] +def set_native_int(p, v): + CR.set_native_int(p, v)
+ + + +
+[docs] +def get_native_int(p): + return CR.get_native_int(p)
+ + + +
+[docs] +def setterminate(env, env_lp_ptr, p): + status = CR.setterminate(env_lp_ptr, p) + check_status(env, status)
+ + + +# If the CPLEX_PY_DISABLE_SIGHANDLER environment variable is defined, +# we will not install our SIGINT handler (i.e., for Ctrl+C handling). +# This may be useful if the user wants to install their own handler. +if CPLEX_PY_DISABLE_SIGHANDLER: + + class SigIntHandler(): + """A no-op signal handler (no handler installed). + + :undocumented + """ + + def __init__(self): + pass + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass + +else: + + # By default (i.e., if the CPLEX_PY_DISABLE_SIGHANDLER environment + # variable is not defined), then we install a custom SIGINT handler + # around long running CPLEX operations. This allows the user to abort + # the current optimization with a Ctrl+C. + +
+[docs] + class SigIntHandler(): + """Handle Ctrl-C events during long running processes. + + :undocumented + """ + +
+[docs] + def __init__(self): + CR.sigint_register()
+ + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + CR.sigint_unregister()
+ + + +
+[docs] +def pack_env_lp_ptr(env, lp): + return CR.pack_env_lp_ptr(env, lp)
+ + + +
+[docs] +@contextmanager +def chbmatrix(lolmat, env_lp_ptr, r_c): + """See matrix_conversion.c:Pylolmat_to_CHBmat().""" + mat = Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c) + try: + # yields ([matbeg, matind, matval], nnz) + yield mat[:-1], mat[-1] + finally: + free_CHBmat(mat)
+ + + +
+[docs] +def Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c): + return CR.Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c)
+ + + +
+[docs] +def free_CHBmat(lolmat): + CR.free_CHBmat(lolmat)
+ + + +def _handle_cb_error(env, cberror): + """Handle the callback exception. + + These can be triggered either in the SWIG Python C API layer + (e.g., SWIG_callback.c) or in _ostream.py. + """ + if isinstance(cberror, Exception): + # If cberror is already an exception, then just throw it as is. + # We can only get here from: _ostream.py:_write_wrap. + raise cberror + if isinstance(cberror[1], Exception): + # In this case the first item is the type of exception and + # the second item is the exception. This is raised from the + # SWIG C layer (e.g., SWIG_callback.c:). + cberror = cberror[1] + elif isinstance(cberror[1], tuple): + # The second item is a tuple containing the error string and + # the error number. We can get this from, for example: + # SWIG_callback.c:fast_getcallbackinfo. + assert len(cberror[1]) == 2 + cberror = cberror[0](cberror[1][0], env, cberror[1][1]) + else: + # The second item is the error string or perhaps None. + # See code in SWIG_callback.c where the _callback_exception + # attribute is set. + cberror = cberror[0](cberror[1]) + raise cberror + + +
+[docs] +class StatusChecker(): + """A callable object used for checking status codes. + + :undocumented + """ + +
+[docs] + def __init__(self): + class NoOp(): + pass + self._pyenv = NoOp() + self._pyenv._callback_exception = None
+ + + def __call__(self, env, status, from_cb=False): + error_string = None + try: + if self._pyenv._callback_exception is not None: + callback_exception = self._pyenv._callback_exception + self._pyenv._callback_exception = None + if isinstance(callback_exception, ErrorChannelMessage): + # We can only get here from _ostream.py:_write_wrap. + # If we encounter an error, we use the last message + # from the error channel for the message (i.e., rather + # than calling CPXXgeterrorstring). + error_string = callback_exception.args[0] + else: + _handle_cb_error(env, callback_exception) + except ReferenceError: + pass + if status == CR.CPXERR_NO_ENVIRONMENT: + raise ValueError('illegal method invocation after Cplex.end()') + elif status != 0: + if error_string is None: + if from_cb: + error_string = cb_geterrorstring(env, status) + else: + error_string = geterrorstring(env, status) + raise CplexSolverError(error_string, env, status)
+ + + +check_status = StatusChecker() + + +
+[docs] +def set_status_checker(): + CR.set_status_checker(check_status)
+ + +# Environment + + +
+[docs] +def version(env): + return CR.CPXXversion(env)
+ + + +
+[docs] +def versionnumber(env): + ver = CR.intPtr() + status = CR.CPXXversionnumber(env, ver) + check_status(env, status) + return ver.value()
+ + + +
+[docs] +def openCPLEX(): + status = CR.intPtr() + env = CR.CPXXopenCPLEX(status) + check_status(env, status.value()) + # Always set the pyterminate flag immediately when initializing + # a CPLEX environment. + CR.setpyterminate(env) + return env
+ + + +
+[docs] +def closeCPLEX(env): + envp = CR.CPXENVptrPtr() + envp.assign(env) + status = CR.CPXXcloseCPLEX(envp) + check_status(env, status)
+ + + +
+[docs] +def getchannels(env): + results = CR.CPXCHANNELptrPtr() + warning = CR.CPXCHANNELptrPtr() + error = CR.CPXCHANNELptrPtr() + log = CR.CPXCHANNELptrPtr() + status = CR.CPXXgetchannels(env, results, warning, error, log) + check_status(env, status) + return (results.value(), warning.value(), error.value(), log.value())
+ + + +
+[docs] +def addfuncdest(env, channel, fileobj): + status = CR.CPXXaddfuncdest(env, channel, fileobj) + check_status(env, status)
+ + + +
+[docs] +def delfuncdest(env, channel, fileobj): + status = CR.CPXXdelfuncdest(env, channel, fileobj) + check_status(env, status)
+ + + +
+[docs] +def setlpcallbackfunc(env, cbhandle): + status = CR.CPXXsetlpcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setnetcallbackfunc(env, cbhandle): + status = CR.CPXXsetnetcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def settuningcallbackfunc(env, cbhandle): + status = CR.CPXXsettuningcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setheuristiccallbackfunc(env, cbhandle): + status = CR.CPXXsetheuristiccallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setlazyconstraintcallbackfunc(env, cbhandle): + status = CR.CPXXsetlazyconstraintcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setusercutcallbackfunc(env, cbhandle): + status = CR.CPXXsetusercutcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setincumbentcallbackfunc(env, cbhandle): + status = CR.CPXXsetincumbentcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setnodecallbackfunc(env, cbhandle): + status = CR.CPXXsetnodecallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setbranchcallbackfunc(env, cbhandle): + status = CR.CPXXsetbranchcallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setbranchnosolncallbackfunc(env, cbhandle): + status = CR.CPXXsetbranchnosolncallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setsolvecallbackfunc(env, cbhandle): + status = CR.CPXXsetsolvecallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setinfocallbackfunc(env, cbhandle): + status = CR.CPXXsetinfocallbackfunc(env, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def setmipcallbackfunc(env, cbhandle): + status = CR.CPXXsetmipcallbackfunc(env, cbhandle) + check_status(env, status)
+ + +# Parameters + +
+[docs] +def setdefaults(env): + status = CR.CPXXsetdefaults(env) + check_status(env, status)
+ + + +
+[docs] +def setintparam(env, whichparam, newvalue): + status = CR.CPXXsetintparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setlongparam(env, whichparam, newvalue): + status = CR.CPXXsetlongparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setdblparam(env, whichparam, newvalue): + status = CR.CPXXsetdblparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def setstrparam(env, whichparam, newvalue): + status = CR.CPXXsetstrparam(env, whichparam, newvalue) + check_status(env, status)
+ + + +
+[docs] +def getintparam(env, whichparam): + curval = CR.intPtr() + status = CR.CPXXgetintparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getlongparam(env, whichparam): + curval = CR.cpxlongPtr() + status = CR.CPXXgetlongparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getdblparam(env, whichparam): + curval = CR.doublePtr() + status = CR.CPXXgetdblparam(env, whichparam, curval) + check_status(env, status) + return curval.value()
+ + + +
+[docs] +def getstrparam(env, whichparam): + output = [] + status = CR.CPXXgetstrparam(env, whichparam, output) + check_status(env, status) + return output[0]
+ + + +
+[docs] +def infointparam(env, whichparam): + default = CR.intPtr() + minimum = CR.intPtr() + maximum = CR.intPtr() + status = CR.CPXXinfointparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infolongparam(env, whichparam): + default = CR.cpxlongPtr() + minimum = CR.cpxlongPtr() + maximum = CR.cpxlongPtr() + status = CR.CPXXinfolongparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infodblparam(env, whichparam): + default = CR.doublePtr() + minimum = CR.doublePtr() + maximum = CR.doublePtr() + status = CR.CPXXinfodblparam(env, whichparam, default, minimum, maximum) + check_status(env, status) + return (default.value(), minimum.value(), maximum.value())
+ + + +
+[docs] +def infostrparam(env, whichparam): + output = [] + status = CR.CPXXinfostrparam(env, whichparam, output) + check_status(env, status) + return output[0]
+ + + +
+[docs] +def getparamtype(env, param_name): + output = CR.intPtr() + status = CR.CPXXgetparamtype(env, param_name, output) + check_status(env, status) + return output.value()
+ + + +
+[docs] +def readcopyparam(env, filename): + status = CR.CPXXreadcopyparam(env, filename) + check_status(env, status)
+ + + +
+[docs] +def writeparam(env, filename): + status = CR.CPXXwriteparam(env, filename) + check_status(env, status)
+ + + +
+[docs] +def tuneparam(env, lp, int_param_values, dbl_param_values, str_param_values): + tuning_status = CR.intPtr() + intcnt = len(int_param_values) + dblcnt = len(dbl_param_values) + strcnt = len(str_param_values) + intnum = [int_param_values[i][0] for i in range(intcnt)] + intval = [int_param_values[i][1] for i in range(intcnt)] + dblnum = [dbl_param_values[i][0] for i in range(dblcnt)] + dblval = [dbl_param_values[i][1] for i in range(dblcnt)] + strnum = [str_param_values[i][0] for i in range(strcnt)] + strval = [str_param_values[i][1] for i in range(strcnt)] + with SigIntHandler(): + status = CR.CPXXtuneparam( + env, lp, intcnt, + LAU.int_list_to_array(intnum), + LAU.int_list_to_array_trunc_int32(intval), + dblcnt, + LAU.int_list_to_array(dblnum), + LAU.double_list_to_array(dblval), + strcnt, + LAU.int_list_to_array(strnum), + strval, + tuning_status) + check_status(env, status) + return tuning_status.value()
+ + + +
+[docs] +def tuneparamprobset(env, filenames, filetypes, int_param_values, + dbl_param_values, str_param_values): + tuning_status = CR.intPtr() + intcnt = len(int_param_values) + dblcnt = len(dbl_param_values) + strcnt = len(str_param_values) + intnum = [int_param_values[i][0] for i in range(intcnt)] + intval = [int_param_values[i][1] for i in range(intcnt)] + dblnum = [dbl_param_values[i][0] for i in range(dblcnt)] + dblval = [dbl_param_values[i][1] for i in range(dblcnt)] + strnum = [str_param_values[i][0] for i in range(strcnt)] + strval = [str_param_values[i][1] for i in range(strcnt)] + with SigIntHandler(): + status = CR.CPXXtuneparamprobset( + env, len(filenames), + filenames, + filetypes, + intcnt, LAU.int_list_to_array(intnum), + LAU.int_list_to_array_trunc_int32(intval), + dblcnt, LAU.int_list_to_array(dblnum), + LAU.double_list_to_array(dblval), + strcnt, LAU.int_list_to_array(strnum), + strval, + tuning_status) + check_status(env, status) + return tuning_status.value()
+ + + +
+[docs] +def fixparam(env, paramnum): + status = CR.CPXXEfixparam(env, paramnum) + check_status(env, status)
+ + +######################################################################## +# Parameter Set API +######################################################################## + +
+[docs] +def paramsetadd(env, ps, whichparam, newvalue, paramtype=None): + if paramtype is None: + paramtype = getparamtype(env, whichparam) + if paramtype == _const.CPX_PARAMTYPE_INT: + if isinstance(newvalue, float): + newvalue = int(newvalue) # will upconvert to long, if necc. + paramsetaddint(env, ps, whichparam, newvalue) + elif paramtype == _const.CPX_PARAMTYPE_DOUBLE: + if isinstance(newvalue, int): + newvalue = float(newvalue) + paramsetadddbl(env, ps, whichparam, newvalue) + elif paramtype == _const.CPX_PARAMTYPE_STRING: + paramsetaddstr(env, ps, whichparam, newvalue) + else: + assert paramtype == _const.CPX_PARAMTYPE_LONG + if isinstance(newvalue, float): + newvalue = int(newvalue) # will upconvert to long, if necc. + paramsetaddlong(env, ps, whichparam, newvalue)
+ + + +
+[docs] +def paramsetadddbl(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetadddbl(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddint(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddint(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddlong(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddlong(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetaddstr(env, ps, whichparam, newvalue): + status = CR.CPXXparamsetaddstr(env, ps, whichparam, newvalue) + check_status(env, status)
+ + +
+[docs] +def paramsetapply(env, ps): + status = CR.CPXXparamsetapply(env, ps) + check_status(env, status)
+ + +
+[docs] +def paramsetcopy(env, targetps, sourceps): + status = CR.CPXXparamsetcopy(env, targetps, sourceps) + check_status(env, status)
+ + +
+[docs] +def paramsetcreate(env): + status = CR.intPtr() + ps = CR.CPXXparamsetcreate(env, status) + check_status(env, status.value()) + return ps
+ + +
+[docs] +def paramsetdel(env, ps, whichparam): + status = CR.CPXXparamsetdel(env, ps, whichparam) + check_status(env, status)
+ + +
+[docs] +def paramsetfree(env, ps): + ps_p = CR.CPXPARAMSETptrPtr() + ps_p.assign(ps) + status = CR.CPXXparamsetfree(env, ps_p) + check_status(env, status)
+ + +
+[docs] +def paramsetget(env, ps, whichparam, paramtype=None): + if paramtype is None: + paramtype = getparamtype(env, whichparam) + switcher = { + _const.CPX_PARAMTYPE_INT: paramsetgetint, + _const.CPX_PARAMTYPE_DOUBLE: paramsetgetdbl, + _const.CPX_PARAMTYPE_STRING: paramsetgetstr, + _const.CPX_PARAMTYPE_LONG: paramsetgetlong + } + func = switcher[paramtype] + return func(env, ps, whichparam)
+ + +
+[docs] +def paramsetgetdbl(env, ps, whichparam): + value = CR.doublePtr() + status = CR.CPXXparamsetgetdbl(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetint(env, ps, whichparam): + value = CR.intPtr() + status = CR.CPXXparamsetgetint(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetlong(env, ps, whichparam): + value = CR.cpxlongPtr() + status = CR.CPXXparamsetgetlong(env, ps, whichparam, value) + check_status(env, status) + return value.value()
+ + +
+[docs] +def paramsetgetstr(env, ps, whichparam): + output = [] + status = CR.CPXXparamsetgetstr(env, ps, whichparam, output) + check_status(env, status) + return output[0]
+ + +
+[docs] +def paramsetgetids(env, ps): + cnt = paramsetgetnum(env, ps) + if cnt == 0: + return [] + inout_list = [cnt] + status = CR.CPXXparamsetgetids(env, ps, inout_list) + check_status(env, status) + # We expect to get [whichparams] + assert len(inout_list) == 1 + return inout_list[0]
+ + +
+[docs] +def paramsetreadcopy(env, ps, filename): + status = CR.CPXXparamsetreadcopy(env, ps, filename) + check_status(env, status)
+ + +
+[docs] +def paramsetwrite(env, ps, filename): + status = CR.CPXXparamsetwrite(env, ps, filename) + check_status(env, status)
+ + +
+[docs] +def paramsetgetnum(env, ps): + inout_list = [0] + status = CR.CPXXparamsetgetids(env, ps, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return inout_list[0]
+ + +######################################################################## +# Runseeds +######################################################################## + +
+[docs] +def runseeds(env, lp, cnt): + with SigIntHandler(): + status = CR.CPXErunseeds(env, lp, cnt) + check_status(env, status)
+ + +# Cplex + + +
+[docs] +def createprob(env, probname): + status = CR.intPtr() + lp = CR.CPXXcreateprob(env, status, probname) + check_status(env, status.value()) + return lp
+ + + +
+[docs] +def readcopyprob(env, lp, filename, filetype=""): + if filetype == "": + status = CR.CPXXreadcopyprob(env, lp, filename) + else: + status = CR.CPXXreadcopyprob(env, lp, filename, filetype) + check_status(env, status)
+ + + +
+[docs] +def cloneprob(env, lp): + status = CR.intPtr() + lp = CR.CPXXcloneprob(env, lp, status) + check_status(env, status.value()) + return lp
+ + + +
+[docs] +def freeprob(env, lp): + lpp = CR.CPXLPptrPtr() + lpp.assign(lp) + status = CR.CPXXfreeprob(env, lpp) + check_status(env, status)
+ + + +
+[docs] +def mipopt(env, lp): + with SigIntHandler(): + status = CR.CPXXmipopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def qpopt(env, lp): + with SigIntHandler(): + status = CR.CPXXqpopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def baropt(env, lp): + with SigIntHandler(): + status = CR.CPXXbaropt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def hybbaropt(env, lp, method): + with SigIntHandler(): + status = CR.CPXXhybbaropt(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def hybnetopt(env, lp, method): + with SigIntHandler(): + status = CR.CPXXhybnetopt(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def lpopt(env, lp): + with SigIntHandler(): + status = CR.CPXXlpopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def primopt(env, lp): + status = CR.CPXXprimopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def dualopt(env, lp): + status = CR.CPXXdualopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def siftopt(env, lp): + status = CR.CPXXsiftopt(env, lp) + check_status(env, status)
+ + + +
+[docs] +def feasoptext(env, lp, grppref, grpbeg, grpind, grptype): + grpcnt = len(grppref) + concnt = len(grpind) + with SigIntHandler(), \ + LAU.double_c_array(grppref) as c_grppref, \ + LAU.long_c_array(grpbeg) as c_grpbeg, \ + LAU.int_c_array(grpind) as c_grpind: + status = CR.CPXXfeasoptext(env, lp, grpcnt, concnt, + c_grppref, c_grpbeg, + c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def delnames(env, lp): + status = CR.CPXXdelnames(env, lp) + check_status(env, status)
+ + + +
+[docs] +def writeprob(env, lp, filename, filetype=""): + if filetype == "": + status = CR.CPXXwriteprob(env, lp, filename) + else: + status = CR.CPXXwriteprob(env, lp, filename, filetype) + check_status(env, status)
+ + + +
+[docs] +def writeprobdev(env, lp, stream, filename, filetype): + arg_list = [stream, filename, filetype] + status = CR.CPXEwriteprobdev(env, lp, arg_list) + check_status(env, status)
+ + + +
+[docs] +def embwrite(env, lp, filename): + status = CR.CPXXembwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def dperwrite(env, lp, filename, epsilon): + status = CR.CPXXdperwrite(env, lp, filename, epsilon) + check_status(env, status)
+ + + +
+[docs] +def pperwrite(env, lp, filename, epsilon): + status = CR.CPXXpperwrite(env, lp, filename, epsilon) + check_status(env, status)
+ + + +
+[docs] +def preslvwrite(env, lp, filename): + objoff = CR.doublePtr() + status = CR.CPXXpreslvwrite(env, lp, filename, objoff) + check_status(env, status) + return objoff.value()
+ + + +
+[docs] +def dualwrite(env, lp, filename): + objshift = CR.doublePtr() + status = CR.CPXXdualwrite(env, lp, filename, objshift) + check_status(env, status) + return objshift.value()
+ + + +
+[docs] +def chgprobtype(env, lp, probtype): + status = CR.CPXXchgprobtype(env, lp, probtype) + check_status(env, status)
+ + + +
+[docs] +def chgprobtypesolnpool(env, lp, probtype, soln): + status = CR.CPXXchgprobtypesolnpool(env, lp, probtype, soln) + check_status(env, status)
+ + + +
+[docs] +def getprobtype(env, lp): + return CR.CPXXgetprobtype(env, lp)
+ + + +
+[docs] +def chgprobname(env, lp, probname): + status = CR.CPXXchgprobname(env, lp, probname) + check_status(env, status)
+ + + +
+[docs] +def getprobname(env, lp): + namefn = CR.CPXXgetprobname + return _getnamesingle(env, lp, namefn)
+ + + +
+[docs] +def getnumcols(env, lp): + return CR.CPXXgetnumcols(env, lp)
+ + + +
+[docs] +def getnumint(env, lp): + return CR.CPXXgetnumint(env, lp)
+ + + +
+[docs] +def getnumbin(env, lp): + return CR.CPXXgetnumbin(env, lp)
+ + + +
+[docs] +def getnumsemicont(env, lp): + return CR.CPXXgetnumsemicont(env, lp)
+ + + +
+[docs] +def getnumsemiint(env, lp): + return CR.CPXXgetnumsemiint(env, lp)
+ + + +
+[docs] +def getnumrows(env, lp): + return CR.CPXXgetnumrows(env, lp)
+ + + +
+[docs] +def populate(env, lp): + with SigIntHandler(): + status = CR.CPXXpopulate(env, lp) + check_status(env, status)
+ + + +def _getnumusercuts(env, lp): + return CR.CPXXgetnumusercuts(env, lp) + + +def _getnumlazyconstraints(env, lp): + return CR.CPXXgetnumlazyconstraints(env, lp) + + +
+[docs] +def getnumqconstrs(env, lp): + return CR.CPXXgetnumqconstrs(env, lp)
+ + + +
+[docs] +def getnumindconstrs(env, lp): + return CR.CPXXgetnumindconstrs(env, lp)
+ + + +
+[docs] +def getnumsos(env, lp): + return CR.CPXXgetnumsos(env, lp)
+ + + +
+[docs] +def cleanup(env, lp, eps): + status = CR.CPXXcleanup(env, lp, eps) + check_status(env, status)
+ + + +
+[docs] +def basicpresolve(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + redlb = _safeDoubleArray(numcols) + redub = _safeDoubleArray(numcols) + rstat = _safeIntArray(numrows) + status = CR.CPXXbasicpresolve(env, lp, redlb, redub, rstat) + check_status(env, status) + return (LAU.array_to_list(redlb, numcols), + LAU.array_to_list(redub, numcols), + LAU.array_to_list(rstat, numrows))
+ + + +
+[docs] +def pivotin(env, lp, rlist): + status = CR.CPXXpivotin(env, lp, + LAU.int_list_to_array(rlist), + len(rlist)) + check_status(env, status)
+ + + +
+[docs] +def pivotout(env, lp, clist): + status = CR.CPXXpivotout(env, lp, + LAU.int_list_to_array(clist), + len(clist)) + check_status(env, status)
+ + + +
+[docs] +def pivot(env, lp, jenter, jleave, leavestat): + status = CR.CPXXpivot(env, lp, jenter, jleave, leavestat) + check_status(env, status)
+ + + +
+[docs] +def strongbranch(env, lp, goodlist, itlim): + goodlen = len(goodlist) + downpen = _safeDoubleArray(goodlen) + uppen = _safeDoubleArray(goodlen) + with SigIntHandler(): + status = CR.CPXXstrongbranch( + env, lp, LAU.int_list_to_array(goodlist), goodlen, + downpen, uppen, itlim) + check_status(env, status) + return (LAU.array_to_list(downpen, goodlen), + LAU.array_to_list(uppen, goodlen))
+ + + +
+[docs] +def completelp(env, lp): + status = CR.CPXXcompletelp(env, lp) + check_status(env, status)
+ + +# Variables +
+[docs] +@contextmanager +def fast_getrows(env, lp): + env_lp_ptr = pack_env_lp_ptr(env, lp) + rows = CR.CPXX_fast_get_rows(env_lp_ptr) + try: + yield rows + finally: + CR.CPXX_free_rows(rows)
+ + +
+[docs] +@contextmanager +def fast_getcolname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getcolname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getrowname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getrowname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getsosname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getsosname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getmipstartname(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + names = CR.CPXX_fast_getmipstartname(env_lp_ptr, begin, end) + try: + yield names + finally: + CR.CPXX_free_getname(names)
+ + +
+[docs] +@contextmanager +def fast_getobj(env, lp, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + coefs = CR.CPXX_fast_getobj(env_lp_ptr, begin, end) + try: + yield coefs + finally: + CR.CPXX_free_getobj(coefs)
+ +
+[docs] +@contextmanager +def fast_multiobjgetobj(env, lp, objidx, begin, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + coefs = CR.CPXX_fast_multiobjgetobj(env_lp_ptr, objidx, begin, end) + try: + yield coefs + finally: + CR.CPXX_free_getobj(coefs)
+ + +
+[docs] +def fast_multiobjgetoffset(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetoffset(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetweight(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetweight(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetpriority(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetpriority(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetabstol(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetabstol(env_lp_ptr, objidx)
+ +
+[docs] +def fast_multiobjgetreltol(env, lp, objidx): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return CR.CPXX_fast_multiobjgetreltol(env_lp_ptr, objidx)
+ + + +
+[docs] +def fast_newcols(env, lp, nb, lb, ub, xctype): + env_lp_ptr = pack_env_lp_ptr(env, lp) + CR.CPXX_fast_newcols(env_lp_ptr, nb, lb, ub, xctype)
+ + +
+[docs] +def has_name(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_name(env_lp_ptr, start, end) != 0 else False
+ +
+[docs] +def has_non_default_lb(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_non_default_lb(env_lp_ptr, start, end) != 0 else False
+ +
+[docs] +def has_non_default_ub(env, lp, start, end): + env_lp_ptr = pack_env_lp_ptr(env, lp) + return True if CR.CPXX_has_non_default_ub(env_lp_ptr, start, end) != 0 else False
+ + + +
+[docs] +def newcols(env, lp, obj, lb, ub, xctype, colname): + ccnt = max(len(obj), len(lb), len(ub), len(xctype), len(colname)) + with LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub: + status = CR.CPXXnewcols( + env, lp, ccnt, c_obj, c_lb, c_ub, + xctype, colname) + check_status(env, status)
+ + + +
+[docs] +def addcols(env, lp, ccnt, nzcnt, obj, cmat, lb, ub, colname): + with LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub: + status = CR.CPXXaddcols( + env, lp, ccnt, nzcnt, + c_obj, cmat, c_lb, c_ub, colname) + check_status(env, status)
+ + + +
+[docs] +def delcols(env, lp, begin, end): + delfn = CR.CPXXdelcols + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def chgbds(env, lp, indices, lu, bd): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(bd) as c_bd: + status = CR.CPXXchgbds(env, lp, len(indices), + c_ind, lu, c_bd) + check_status(env, status)
+ + + +
+[docs] +def chgcolname(env, lp, indices, newnames): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgcolname(env, lp, len(indices), + c_indices, newnames) + check_status(env, status)
+ + + +
+[docs] +def chgctype(env, lp, indices, xctype): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgctype(env, lp, len(indices), + c_indices, xctype) + check_status(env, status)
+ + + +
+[docs] +def getcolindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetcolindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getcolname(env, lp, begin, end): + namefn = CR.CPXXgetcolname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getctype(env, lp, begin, end): + inout_list = [begin, end] + status = CR.CPXXgetctype(env, lp, inout_list) + check_status(env, status) + # We expect to get [sense] + assert len(inout_list) == 1 + return inout_list[0]
+ + + +
+[docs] +def getlb(env, lp, begin, end): + lblen = _rangelen(begin, end) + lb = _safeDoubleArray(lblen) + status = CR.CPXXgetlb(env, lp, lb, begin, end) + check_status(env, status) + return LAU.array_to_list(lb, lblen)
+ + + +
+[docs] +def getub(env, lp, begin, end): + ublen = _rangelen(begin, end) + ub = _safeDoubleArray(ublen) + status = CR.CPXXgetub(env, lp, ub, begin, end) + check_status(env, status) + return LAU.array_to_list(ub, ublen)
+ + + +
+[docs] +def getcols(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetcols(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetcols(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +
+[docs] +def copyprotected(env, lp, indices): + status = CR.CPXXcopyprotected(env, lp, len(indices), + LAU.int_list_to_array(indices)) + check_status(env, status)
+ + + +
+[docs] +def getprotected(env, lp): + count = CR.intPtr() + surplus = CR.intPtr() + indices = LAU.int_list_to_array([]) + pspace = 0 + status = CR.CPXXgetprotected(env, lp, count, indices, pspace, surplus) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return [] + pspace = -surplus.value() + indices = _safeIntArray(pspace) + status = CR.CPXXgetprotected(env, lp, count, indices, pspace, surplus) + check_status(env, status) + return LAU.array_to_list(indices, pspace)
+ + + +
+[docs] +def tightenbds(env, lp, indices, lu, bd): + status = CR.CPXXtightenbds(env, lp, len(indices), + LAU.int_list_to_array(indices), + lu, LAU.double_list_to_array(bd)) + check_status(env, status)
+ + +# Linear Constraints + + +
+[docs] +def newrows(env, lp, rhs, sense, rngval, rowname): + rcnt = max(len(rhs), len(sense), len(rngval), len(rowname)) + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.double_c_array(rngval) as c_rng: + status = CR.CPXXnewrows(env, lp, rcnt, c_rhs, sense, + c_rng, rowname) + check_status(env, status)
+ + + +
+[docs] +def addrows(env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmat, colname, rowname): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXaddrows( + env, lp, ccnt, rcnt, nzcnt, c_rhs, + sense, rmat, colname, rowname) + check_status(env, status)
+ + + +
+[docs] +def delrows(env, lp, begin, end): + delfn = CR.CPXXdelrows + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def chgrowname(env, lp, indices, newnames): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgrowname(env, lp, len(indices), c_indices, + newnames) + check_status(env, status)
+ + + +
+[docs] +def chgcoeflist(env, lp, rowlist, collist, vallist): + with LAU.int_c_array(rowlist) as c_rowlist, \ + LAU.int_c_array(collist) as c_collist, \ + LAU.double_c_array(vallist) as c_vallist: + status = CR.CPXXchgcoeflist(env, lp, len(rowlist), + c_rowlist, c_collist, c_vallist) + check_status(env, status)
+ + + +
+[docs] +def chgrhs(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgrhs(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgrngval(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgrngval(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgsense(env, lp, indices, senses): + with LAU.int_c_array(indices) as c_indices: + status = CR.CPXXchgsense(env, lp, len(indices), c_indices, + senses) + check_status(env, status)
+ + + +
+[docs] +def getrhs(env, lp, begin, end): + rhslen = _rangelen(begin, end) + rhs = _safeDoubleArray(rhslen) + status = CR.CPXXgetrhs(env, lp, rhs, begin, end) + check_status(env, status) + return LAU.array_to_list(rhs, rhslen)
+ + + +
+[docs] +def getsense(env, lp, begin, end): + inout_list = [begin, end] + status = CR.CPXXgetsense(env, lp, inout_list) + check_status(env, status) + # We expect to get [sense] + assert len(inout_list) == 1 + return inout_list[0]
+ + + +
+[docs] +def getrngval(env, lp, begin, end): + rngvallen = _rangelen(begin, end) + rngval = _safeDoubleArray(rngvallen) + status = CR.CPXXgetrngval(env, lp, rngval, begin, end) + check_status(env, status) + return LAU.array_to_list(rngval, rngvallen)
+ + + +
+[docs] +def getrowname(env, lp, begin, end): + namefn = CR.CPXXgetrowname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getcoef(env, lp, i, j): + coef = CR.doublePtr() + status = CR.CPXXgetcoef(env, lp, i, j, coef) + check_status(env, status) + return coef.value()
+ + + +
+[docs] +def getrowindex(env, lp, rowname): + index = CR.intPtr() + status = CR.CPXXgetrowindex(env, lp, rowname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getrows(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetrows(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetrows(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +
+[docs] +def getnumnz(env, lp): + return CR.CPXXgetnumnz(env, lp)
+ + + +
+[docs] +def addlazyconstraints(env, lp, rhs, sense, lin_expr, names): + env_lp_ptr = pack_env_lp_ptr(env, lp) + with chbmatrix(lin_expr, env_lp_ptr, 0) as (rmat, nnz), \ + LAU.double_c_array(rhs) as c_rhs: + rmatbeg, rmatind, rmatval = rmat + status = CR.CPXXaddlazyconstraints( + env, lp, len(rhs), nnz, + c_rhs, sense, + rmatbeg, rmatind, rmatval, + names) + check_status(env, status)
+ + + +
+[docs] +def addusercuts(env, lp, rhs, sense, lin_expr, names): + env_lp_ptr = pack_env_lp_ptr(env, lp) + with chbmatrix(lin_expr, env_lp_ptr, 0) as (rmat, nnz), \ + LAU.double_c_array(rhs) as c_rhs: + rmatbeg, rmatind, rmatval = rmat + status = CR.CPXXaddusercuts( + env, lp, len(rhs), nnz, + c_rhs, sense, + rmatbeg, rmatind, rmatval, + names) + check_status(env, status)
+ + + +
+[docs] +def freelazyconstraints(env, lp): + status = CR.CPXXfreelazyconstraints(env, lp) + check_status(env, status)
+ + + +
+[docs] +def freeusercuts(env, lp): + status = CR.CPXXfreeusercuts(env, lp) + check_status(env, status)
+ + + +# CPXLIBAPI int CPXPUBLIC +# CPXXcopylpwnames (CPXCENVptr env, +# CPXLPptr lp, +# CPXDIM numcols, +# CPXDIM numrows, +# int objsense, +# const double *objective, +# const double *rhs, +# const char *sense, +# CPXNNZ int *matbeg, +# CPXDIM int *matcnt, +# CPXDIM int *matind, +# const double *matval, +# const double *lb, +# const double *ub, +# const double *rngval, +# char const *const *colname, +# char const *const *rowname); +
+[docs] +def copylpwnames(env, lp, numcols, numrows, objsense, obj, rhs, sense, + matbeg, matcnt, matind, matval, lb, ub, rngval, colname, + rowname): + with LAU.long_c_array(matbeg) as c_matbeg, \ + LAU.int_c_array(matcnt) as c_matcnt, \ + LAU.int_c_array(matind) as c_matind, \ + LAU.double_c_array(matval) as c_matval, \ + LAU.double_c_array(obj) as c_obj, \ + LAU.double_c_array(rhs) as c_rhs, \ + LAU.double_c_array(lb) as c_lb, \ + LAU.double_c_array(ub) as c_ub, \ + LAU.double_c_array(rngval) as c_rngval: # noqa: E126 + status = CR.CPXXcopylpwnames(env, lp, numcols, numrows, objsense, + c_obj, c_rhs, sense, + c_matbeg, c_matcnt, c_matind, c_matval, + c_lb, c_ub, c_rngval, + colname, rowname) + check_status(env, status)
+ + + +######################################################################## +# SOS API +######################################################################## + + +
+[docs] +def addsos(env, lp, sostype, sosbeg, sosind, soswt, sosnames): + with LAU.long_c_array(sosbeg) as c_sosbeg, \ + LAU.int_c_array(sosind) as c_sosind, \ + LAU.double_c_array(soswt) as c_soswt: + status = CR.CPXXaddsos(env, lp, len(sosbeg), len(sosind), sostype, + c_sosbeg, c_sosind, c_soswt, + sosnames) + check_status(env, status)
+ + + +
+[docs] +def delsos(env, lp, begin, end): + delfn = CR.CPXXdelsos + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsos_info(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetsos(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [sostype, surplus] + assert len(inout_list) == 2 + return tuple(inout_list)
+ + + +
+[docs] +def getsos(env, lp, begin, end): + numsos = _rangelen(begin, end) + _, surplus = getsos_info(env, lp, begin, end) + if surplus == 0: + return ([0] * numsos, [], []) + inout_list = [surplus, begin, end] + status = CR.CPXXgetsos(env, lp, inout_list) + check_status(env, status) + # We expect to get [sosbeg, sosind, soswt] + assert len(inout_list) == 3 + return tuple(inout_list)
+ + + +
+[docs] +def getsosindex(env, lp, name): + indexfn = CR.CPXXgetsosindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getsosname(env, lp, begin, end): + namefn = CR.CPXXgetsosname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + +######################################################################## +# Indicator Constraint API +######################################################################## + + +
+[docs] +def addindconstr(env, lp, indcnt, indvar, complemented, rhs, sense, linmat, + indtype, name, nzcnt): + with LAU.int_c_array(indtype) as c_indtype, \ + LAU.int_c_array(indvar) as c_indvar, \ + LAU.int_c_array(complemented) as c_complemented, \ + LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXaddindconstraints( + env, lp, indcnt, c_indtype, c_indvar, + c_complemented, nzcnt, c_rhs, + sense, linmat, + name) + check_status(env, status)
+ + + +
+[docs] +def getindconstr(env, lp, begin, end): + _, _, _, _, _, surplus = getindconstr_constant(env, lp, begin, end) + if surplus == 0: + return ([0] * _rangelen(begin, end), [], []) + # inout_list contains the linspace, begin, and end args to + # CPXXgetindconstraints. + inout_list = [surplus, begin, end] + status = CR.CPXXgetindconstraints(env, lp, inout_list) + check_status(env, status) + # We expect to get [linbeg, linind, linval] + assert len(inout_list) == 3 + return tuple(inout_list)
+ + + +
+[docs] +def getindconstr_constant(env, lp, begin, end): + # inout_list contains the linspace, begin, and end args to + # CPXXgetindconstraints. + inout_list = [0, begin, end] + status = CR.CPXXgetindconstraints(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get: + # [type, indvar, complemented, rhs, sense, surplus] + assert len(inout_list) == 6 + return tuple(inout_list)
+ + + +
+[docs] +def getindconstrindex(env, lp, name): + indexfn = CR.CPXXgetindconstrindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def delindconstrs(env, lp, begin, end): + delfn = CR.CPXXdelindconstrs + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getindconstrslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slacks = _safeDoubleArray(slacklen) + status = CR.CPXXgetindconstrslack(env, lp, slacks, begin, end) + check_status(env, status) + return LAU.array_to_list(slacks, slacklen)
+ + + +
+[docs] +def getindconstrname(env, lp, which): + namefn = CR.CPXXgetindconstrname + return _getname(env, lp, which, namefn, index_first=False)
+ + +######################################################################## +# Quadratic Constraints +######################################################################## + + +
+[docs] +def addqconstr(env, lp, rhs, sense, linind, linval, quadrow, quadcol, + quadval, name): + with LAU.int_c_array(linind) as c_linind, \ + LAU.double_c_array(linval) as c_linval, \ + LAU.int_c_array(quadrow) as c_quadrow, \ + LAU.int_c_array(quadcol) as c_quadcol, \ + LAU.double_c_array(quadval) as c_quadval: + status = CR.CPXXaddqconstr(env, lp, len(linind), len(quadrow), + rhs, sense, + c_linind, c_linval, + c_quadrow, c_quadcol, c_quadval, + name) + check_status(env, status)
+ + + +
+[docs] +def getqconstr_info(env, lp, which): + inout_list = [0, 0, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [rhs, sense, linsurplus, quadsurplus] + assert len(inout_list) == 4 + assert len(inout_list[1]) == 1 # sense string should be one char + return tuple(inout_list)
+ + + +
+[docs] +def getqconstr_lin(env, lp, which): + _, _, linsurplus, _ = getqconstr_info(env, lp, which) + if linsurplus == 0: + return ([], []) + inout_list = [linsurplus, 0, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [linind, linval, quadrow, quadcol, quadval] + assert len(inout_list) == 5 + return tuple(inout_list[:2]) # slice off the quad info
+ + + +
+[docs] +def getqconstr_quad(env, lp, which): + _, _, _, quadsurplus = getqconstr_info(env, lp, which) + if quadsurplus == 0: + return ([], [], []) + inout_list = [0, quadsurplus, which] + status = CR.CPXXgetqconstr(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [linind, linval, quadrow, quadcol, quadval] + assert len(inout_list) == 5 + return tuple(inout_list[2:]) # slice off the lin info
+ + + +
+[docs] +def delqconstrs(env, lp, begin, end): + delfn = CR.CPXXdelqconstrs + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getqconstrindex(env, lp, name): + indexfn = CR.CPXXgetqconstrindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getqconstrslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slacks = _safeDoubleArray(slacklen) + status = CR.CPXXgetqconstrslack(env, lp, slacks, begin, end) + check_status(env, status) + return LAU.array_to_list(slacks, slacklen)
+ + + +
+[docs] +def getqconstrname(env, lp, which): + namefn = CR.CPXXgetqconstrname + return _getname(env, lp, which, namefn, index_first=False)
+ + +######################################################################## +# Generic helper methods +######################################################################## + + +def _delbyrange(delfn, env, lp, begin, end=None): + if end is None: + end = begin + status = delfn(env, lp, begin, end) + check_status(env, status) + + +def _getindex(env, lp, name, indexfn): + idx = CR.intPtr() + status = indexfn(env, lp, name, idx) + check_status(env, status) + return idx.value() + + +def _getname(env, lp, idx, namefn, index_first=True): + # Some name functions have the index argument first and some have it + # last. Thus, we do this little dance, so things are called in the + # right way depending on index_first. + def _namefn(env, lp, idx, inoutlist): + if index_first: + return namefn(env, lp, idx, inoutlist) + return namefn(env, lp, inoutlist, idx) + inoutlist = [0] + # NB: inoutlist will be modified as a side effect + status = _namefn(env, lp, idx, inoutlist) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inoutlist == [0]: + return None + status = _namefn(env, lp, idx, inoutlist) + check_status(env, status) + return inoutlist[0] + + +def _getnamebyrange(env, lp, begin, end, namefn): + inout_list = [0, begin, end] + status = namefn(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return [None] * _rangelen(begin, end) + inout_list.extend([begin, end]) + status = namefn(env, lp, inout_list) + check_status(env, status) + return inout_list + + +def _getnamesingle(env, lp, namefn): + inoutlist = [0] + status = namefn(env, lp, inoutlist) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inoutlist == [0]: + return None + status = namefn(env, lp, inoutlist) + check_status(env, status) + return inoutlist[0] + +######################################################################## +# Annotation API +######################################################################## + + +def _newanno(env, lp, name, defval, newfn): + status = newfn(env, lp, name, defval) + check_status(env, status) + + +
+[docs] +def newlonganno(env, lp, name, defval): + newfn = CR.CPXXnewlongannotation + _newanno(env, lp, name, defval, newfn)
+ + + +
+[docs] +def newdblanno(env, lp, name, defval): + newfn = CR.CPXXnewdblannotation + _newanno(env, lp, name, defval, newfn)
+ + + +
+[docs] +def dellonganno(env, lp, begin, end): + delfn = CR.CPXXdellongannotations + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def deldblanno(env, lp, begin, end): + delfn = CR.CPXXdeldblannotations + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getlongannoindex(env, lp, name): + indexfn = CR.CPXXgetlongannotationindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getdblannoindex(env, lp, name): + indexfn = CR.CPXXgetdblannotationindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getlongannoname(env, lp, idx): + namefn = CR.CPXXgetlongannotationname + return _getname(env, lp, idx, namefn)
+ + + +
+[docs] +def getdblannoname(env, lp, idx): + namefn = CR.CPXXgetdblannotationname + return _getname(env, lp, idx, namefn)
+ + + +
+[docs] +def getnumlonganno(env, lp): + return CR.CPXXgetnumlongannotations(env, lp)
+ + + +
+[docs] +def getnumdblanno(env, lp): + return CR.CPXXgetnumdblannotations(env, lp)
+ + + +
+[docs] +def getlongannodefval(env, lp, idx): + defval = CR.cpxlongPtr() + status = CR.CPXXgetlongannotationdefval(env, lp, idx, defval) + check_status(env, status) + return int(defval.value())
+ + + +
+[docs] +def getdblannodefval(env, lp, idx): + defval = CR.doublePtr() + status = CR.CPXXgetdblannotationdefval(env, lp, idx, defval) + check_status(env, status) + return defval.value()
+ + + +
+[docs] +def setlonganno(env, lp, idx, objtype, ind, val): + assert len(ind) == len(val) + cnt = len(ind) + status = CR.CPXXsetlongannotations(env, lp, idx, objtype, cnt, + LAU.int_list_to_array(ind), + LAU.long_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def setdblanno(env, lp, idx, objtype, ind, val): + assert len(ind) == len(val) + cnt = len(ind) + status = CR.CPXXsetdblannotations(env, lp, idx, objtype, cnt, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def getlonganno(env, lp, idx, objtype, begin, end): + annolen = _rangelen(begin, end) + val = _safeLongArray(annolen) + status = CR.CPXXgetlongannotations(env, lp, idx, objtype, val, + begin, end) + check_status(env, status) + return [int(i) for i in LAU.array_to_list(val, annolen)]
+ + + +
+[docs] +def getdblanno(env, lp, idx, objtype, begin, end): + annolen = _rangelen(begin, end) + val = _safeDoubleArray(annolen) + status = CR.CPXXgetdblannotations(env, lp, idx, objtype, val, + begin, end) + check_status(env, status) + return LAU.array_to_list(val, annolen)
+ + + +
+[docs] +def readcopyanno(env, lp, filename): + status = CR.CPXXreadcopyannotations(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def writeanno(env, lp, filename): + status = CR.CPXXwriteannotations(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def writebendersanno(env, lp, filename): + status = CR.CPXXwritebendersannotation(env, lp, filename) + check_status(env, status)
+ + +######################################################################## +# PWL API +######################################################################## + + +
+[docs] +def addpwl(env, lp, vary, varx, preslope, postslope, nbreaks, + breakx, breaky, name): + assert len(breakx) == nbreaks + assert len(breaky) == nbreaks + with LAU.double_c_array(breakx) as c_breakx, \ + LAU.double_c_array(breaky) as c_breaky: + status = CR.CPXXaddpwl(env, lp, vary, varx, preslope, postslope, + nbreaks, c_breakx, c_breaky, name) + check_status(env, status)
+ + + +
+[docs] +def delpwl(env, lp, begin, end): + delfn = CR.CPXXdelpwl + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getnumpwl(env, lp): + return CR.CPXXgetnumpwl(env, lp)
+ + + +
+[docs] +def getpwl(env, lp, idx): + # Initially, the inout_list contains the pwlindex and breakspace args + # to CPXXgetpwl. We use zero (0) for breakspace to query the + # surplus. + inout_list = [idx, 0] + status = CR.CPXXgetpwl(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + # We expect to get [vary, varx, preslope, postslope, surplus] + assert len(inout_list) == 5 + vary, varx, preslope, postslope, surplus = inout_list + # FIXME: Should we assert surplus is > 0? + inout_list = [idx, surplus] + status = CR.CPXXgetpwl(env, lp, inout_list) + check_status(env, status) + # We expect to get [breakx, breaky] + assert len(inout_list) == 2 + breakx, breaky = inout_list + return [vary, varx, preslope, postslope, breakx, breaky]
+ + + +
+[docs] +def getpwlindex(env, lp, name): + indexfn = CR.CPXXgetpwlindex + return _getindex(env, lp, name, indexfn)
+ + + +
+[docs] +def getpwlname(env, lp, idx): + namefn = CR.CPXXgetpwlname + return _getname(env, lp, idx, namefn, index_first=False)
+ + +######################################################################## +# Objective API +######################################################################## + + +
+[docs] +def copyobjname(env, lp, objname): + status = CR.CPXXcopyobjname(env, lp, objname) + check_status(env, status)
+ + + +
+[docs] +def chgobj(env, lp, indices, values): + with LAU.int_c_array(indices) as c_ind, \ + LAU.double_c_array(values) as c_val: + status = CR.CPXXchgobj(env, lp, len(indices), c_ind, c_val) + check_status(env, status)
+ + + +
+[docs] +def chgobjsen(env, lp, maxormin): + status = CR.CPXXchgobjsen(env, lp, maxormin) + check_status(env, status)
+ + + +
+[docs] +def getobjsen(env, lp): + return CR.CPXXgetobjsen(env, lp)
+ + + +
+[docs] +def getobjoffset(env, lp): + objoffset = CR.doublePtr() + status = CR.CPXXgetobjoffset(env, lp, objoffset) + check_status(env, status) + return objoffset.value()
+ + + +
+[docs] +def chgobjoffset(env, lp, offset): + status = CR.CPXXchgobjoffset(env, lp, offset) + check_status(env, status)
+ + + +
+[docs] +def getobj(env, lp, begin, end): + objlen = _rangelen(begin, end) + obj = _safeDoubleArray(objlen) + status = CR.CPXXgetobj(env, lp, obj, begin, end) + check_status(env, status) + return LAU.array_to_list(obj, objlen)
+ + + +
+[docs] +def getobjname(env, lp): + namefn = CR.CPXXgetobjname + return _getnamesingle(env, lp, namefn)
+ + + +
+[docs] +def copyquad(env, lp, qmatbeg, qmatind, qmatval): + nqmatbeg = len(qmatbeg) + if nqmatbeg > 0: + qmatcnt = [qmatbeg[i + 1] - qmatbeg[i] + for i in range(nqmatbeg - 1)] + qmatcnt.append(len(qmatind) - qmatbeg[-1]) + else: + qmatcnt = [] + with LAU.long_c_array(qmatbeg) as c_qmatbeg, \ + LAU.int_c_array(qmatcnt) as c_qmatcnt, \ + LAU.int_c_array(qmatind) as c_qmatind, \ + LAU.double_c_array(qmatval) as c_qmatval: + status = CR.CPXXcopyquad(env, lp, c_qmatbeg, c_qmatcnt, + c_qmatind, c_qmatval) + check_status(env, status)
+ + + +
+[docs] +def copyqpsep(env, lp, qsepvec): + with LAU.double_c_array(qsepvec) as c_qsepvec: + status = CR.CPXXcopyqpsep(env, lp, c_qsepvec) + check_status(env, status)
+ + + +
+[docs] +def chgqpcoef(env, lp, row, col, value): + status = CR.CPXXchgqpcoef(env, lp, row, col, value) + check_status(env, status)
+ + + +
+[docs] +def getquad(env, lp, begin, end): + nzcnt = CR.cpxlongPtr() + ncols = _rangelen(begin, end) + qmatbeg = _safeLongArray(ncols) + qmatind = LAU.int_list_to_array([]) + qmatval = LAU.double_list_to_array([]) + space = 0 + surplus = CR.cpxlongPtr() + status = CR.CPXXgetquad(env, lp, nzcnt, qmatbeg, qmatind, qmatval, + space, surplus, begin, end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([], [], []) + space = -surplus.value() + qmatind = _safeIntArray(space) + qmatval = _safeDoubleArray(space) + status = CR.CPXXgetquad(env, lp, nzcnt, qmatbeg, qmatind, qmatval, + space, surplus, begin, end) + check_status(env, status) + return (LAU.array_to_list(qmatbeg, ncols), + LAU.array_to_list(qmatind, space), + LAU.array_to_list(qmatval, space))
+ + + +
+[docs] +def getqpcoef(env, lp, row, col): + val = CR.doublePtr() + status = CR.CPXXgetqpcoef(env, lp, row, col, val) + check_status(env, status) + return val.value()
+ + + +
+[docs] +def getnumquad(env, lp): + return CR.CPXXgetnumquad(env, lp)
+ + + +
+[docs] +def getnumqpnz(env, lp): + return CR.CPXXgetnumqpnz(env, lp)
+ + +######################################################################## +# Multi-Objective API +######################################################################## + +
+[docs] +def getnumobjs(env, lp): + return CR.CPXXgetnumobjs(env, lp)
+ + +
+[docs] +def multiobjchgattribs(env, lp, objidx, + offset=_const.CPX_NO_OFFSET_CHANGE, + weight=_const.CPX_NO_WEIGHT_CHANGE, + priority=_const.CPX_NO_PRIORITY_CHANGE, + abstol=_const.CPX_NO_ABSTOL_CHANGE, + reltol=_const.CPX_NO_RELTOL_CHANGE, + name=None): + status = CR.CPXXmultiobjchgattribs(env, lp, objidx, offset, weight, + priority, abstol, reltol, + name) + check_status(env, status)
+ + +
+[docs] +def multiobjgetindex(env, lp, name): + indexfn = CR.CPXXmultiobjgetindex + return _getindex(env, lp, name, indexfn)
+ + +
+[docs] +def multiobjgetname(env, lp, objidx): + namefn = CR.CPXXmultiobjgetname + return _getname(env, lp, objidx, namefn, index_first=True)
+ + +
+[docs] +def multiobjgetobj(env, lp, objidx, begin, end): + coeffslen = _rangelen(begin, end) + coeffs = _safeDoubleArray(coeffslen) + offset = CR.doublePtr() + weight = CR.doublePtr() + priority = CR.intPtr() + abstol = CR.doublePtr() + reltol = CR.doublePtr() + status = CR.CPXXmultiobjgetobj(env, lp, objidx, coeffs, begin, end, + offset, weight, priority, abstol, reltol) + check_status(env, status) + return [LAU.array_to_list(coeffs, coeffslen), offset.value(), + weight.value(), priority.value(), abstol.value(), + reltol.value()]
+ + +
+[docs] +def multiobjsetobj(env, lp, objidx, objind, objval, + offset=_const.CPX_NO_OFFSET_CHANGE, + weight=_const.CPX_NO_WEIGHT_CHANGE, + priority=_const.CPX_NO_PRIORITY_CHANGE, + abstol=_const.CPX_NO_ABSTOL_CHANGE, + reltol=_const.CPX_NO_RELTOL_CHANGE, + objname=None): + objnz = len(objind) + assert len(objval) == objnz + with LAU.int_c_array(objind) as c_objind, \ + LAU.double_c_array(objval) as c_objval: # noqa: E127 + status = CR.CPXXmultiobjsetobj(env, lp, objidx, objnz, c_objind, + c_objval, offset, weight, + priority, abstol, reltol, + objname) + check_status(env, status)
+ + +
+[docs] +def setnumobjs(env, lp, n): + status = CR.CPXXsetnumobjs(env, lp, n) + check_status(env, status)
+ + +
+[docs] +def multiobjopt(env, lp, paramsets): + with SigIntHandler(): + status = CR.CPXXmultiobjopt(env, lp, paramsets) + check_status(env, status)
+ + +
+[docs] +def multiobjgetobjval(env, lp, objidx): + objval_p = CR.doublePtr() + status = CR.CPXXmultiobjgetobjval(env, lp, objidx, objval_p) + check_status(env, status) + return objval_p.value()
+ + +
+[docs] +def multiobjgetobjvalbypriority(env, lp, priority): + objval_p = CR.doublePtr() + status = CR.CPXXmultiobjgetobjvalbypriority(env, lp, priority, objval_p) + check_status(env, status) + return objval_p.value()
+ + +def _multiobjgetinfo(fn, env, lp, subprob, info_p, what): + status = fn(env, lp, subprob, info_p, what) + check_status(env, status) + return info_p.value() + +
+[docs] +def multiobjgetdblinfo(env, lp, subprob, what): + info_p = CR.doublePtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetdblinfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetintinfo(env, lp, subprob, what): + info_p = CR.intPtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetintinfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetlonginfo(env, lp, subprob, what): + info_p = CR.cpxlongPtr() + return _multiobjgetinfo(CR.CPXXmultiobjgetlonginfo, env, lp, subprob, + info_p, what)
+ + +
+[docs] +def multiobjgetnumsolves(env, lp): + return CR.CPXXmultiobjgetnumsolves(env, lp)
+ + +
+[docs] +def getnumprios(env, lp): + return CR.CPXEgetnumprios(env, lp)
+ + +
+[docs] +def ismultiobj(env, lp): + return CR.CPXEismultiobj(env, lp) != 0
+ + +# Optimizing Problems + +# Accessing LP results + +
+[docs] +def solninfo(env, lp): + lpstat = CR.intPtr() + stype = CR.intPtr() + pfeas = CR.intPtr() + dfeas = CR.intPtr() + status = CR.CPXXsolninfo(env, lp, lpstat, stype, pfeas, dfeas) + check_status(env, status) + return (lpstat.value(), stype.value(), pfeas.value(), dfeas.value())
+ + + +
+[docs] +def getstat(env, lp): + return CR.CPXXgetstat(env, lp)
+ + + +
+[docs] +def getmethod(env, lp): + return CR.CPXXgetmethod(env, lp)
+ + + +
+[docs] +def getobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getx(env, lp, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetx(env, lp, x, begin, end) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getnumcores(env): + numcores = CR.intPtr() + status = CR.CPXXgetnumcores(env, numcores) + check_status(env, status) + return numcores.value()
+ + + +
+[docs] +def getax(env, lp, begin, end): + axlen = _rangelen(begin, end) + ax = _safeDoubleArray(axlen) + status = CR.CPXXgetax(env, lp, ax, begin, end) + check_status(env, status) + return LAU.array_to_list(ax, axlen)
+ + + +
+[docs] +def getxqxax(env, lp, begin, end): + qaxlen = _rangelen(begin, end) + qax = _safeDoubleArray(qaxlen) + status = CR.CPXXgetxqxax(env, lp, qax, begin, end) + check_status(env, status) + return LAU.array_to_list(qax, qaxlen)
+ + + +
+[docs] +def getpi(env, lp, begin, end): + pilen = _rangelen(begin, end) + pi = _safeDoubleArray(pilen) + status = CR.CPXXgetpi(env, lp, pi, begin, end) + check_status(env, status) + return LAU.array_to_list(pi, pilen)
+ + + +
+[docs] +def getslack(env, lp, begin, end): + slacklen = _rangelen(begin, end) + slack = _safeDoubleArray(slacklen) + status = CR.CPXXgetslack(env, lp, slack, begin, end) + check_status(env, status) + return LAU.array_to_list(slack, slacklen)
+ + + +
+[docs] +def getdj(env, lp, begin, end): + djlen = _rangelen(begin, end) + dj = _safeDoubleArray(djlen) + status = CR.CPXXgetdj(env, lp, dj, begin, end) + check_status(env, status) + return LAU.array_to_list(dj, djlen)
+ + + +
+[docs] +def getqconstrdslack(env, lp, qind): + inout_list = [0, qind] + status = CR.CPXXgetqconstrdslack(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([], []) + inout_list.extend([qind]) + status = CR.CPXXgetqconstrdslack(env, lp, inout_list) + check_status(env, status) + return tuple(inout_list)
+ + + +# Infeasibility + +
+[docs] +def getrowinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetrowinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getcolinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetcolinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getqconstrinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetqconstrinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getindconstrinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetindconstrinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + + +
+[docs] +def getsosinfeas(env, lp, x, begin, end): + infeasoutlen = _rangelen(begin, end) + infeasout = _safeDoubleArray(infeasoutlen) + status = CR.CPXXgetsosinfeas(env, lp, LAU.double_list_to_array(x), + infeasout, begin, end) + check_status(env, status) + return LAU.array_to_list(infeasout, infeasoutlen)
+ + +# Basis + + +
+[docs] +def getbase(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cstat = _safeIntArray(numcols) + rstat = _safeIntArray(numrows) + status = CR.CPXXgetbase(env, lp, cstat, rstat) + check_status(env, status) + return (LAU.array_to_list(cstat, numcols), + LAU.array_to_list(rstat, numrows))
+ + + +
+[docs] +def getbhead(env, lp): + headlen = CR.CPXXgetnumrows(env, lp) + head = _safeIntArray(headlen) + x = _safeDoubleArray(headlen) + status = CR.CPXXgetbhead(env, lp, head, x) + check_status(env, status) + return (LAU.array_to_list(head, headlen), + LAU.array_to_list(x, headlen))
+ + + +
+[docs] +def mbasewrite(env, lp, filename): + status = CR.CPXXmbasewrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getijrow(env, lp, idx, is_row_index): + row = CR.intPtr() + if is_row_index: + i, j = (idx, -1) # Seek a basic row. + else: + i, j = (-1, idx) # Seek a basic column. + status = CR.CPXXgetijrow(env, lp, i, j, row) + if status == CR.CPXERR_INDEX_NOT_BASIC: + return -1 + check_status(env, status) + return row.value()
+ + + +
+[docs] +def getpnorms(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cnorm = _safeDoubleArray(numcols) + rnorm = _safeDoubleArray(numrows) + length = CR.intPtr() + status = CR.CPXXgetpnorms(env, lp, cnorm, rnorm, length) + check_status(env, status) + return (LAU.array_to_list(cnorm, length.value()), + LAU.array_to_list(rnorm, numrows))
+ + + +
+[docs] +def getdnorms(env, lp): + numrows = CR.CPXXgetnumrows(env, lp) + norm = _safeDoubleArray(numrows) + head = _safeIntArray(numrows) + length = CR.intPtr() + status = CR.CPXXgetdnorms(env, lp, norm, head, length) + check_status(env, status) + return (LAU.array_to_list(norm, length.value()), + LAU.array_to_list(head, length.value()))
+ + + +
+[docs] +def getbasednorms(env, lp): + numcols = CR.CPXXgetnumcols(env, lp) + numrows = CR.CPXXgetnumrows(env, lp) + cstat = _safeIntArray(numcols) + rstat = _safeIntArray(numrows) + dnorm = _safeDoubleArray(numrows) + status = CR.CPXXgetbasednorms(env, lp, cstat, rstat, dnorm) + check_status(env, status) + return (LAU.array_to_list(cstat, numcols), + LAU.array_to_list(rstat, numrows), + LAU.array_to_list(dnorm, numrows))
+ + + +
+[docs] +def getpsbcnt(env, lp): + return CR.CPXXgetpsbcnt(env, lp)
+ + + +
+[docs] +def getdsbcnt(env, lp): + return CR.CPXXgetdsbcnt(env, lp)
+ + + +
+[docs] +def getdblquality(env, lp, what): + quality = CR.doublePtr() + status = CR.CPXXgetdblquality(env, lp, quality, what) + check_status(env, status) + return quality.value()
+ + + +
+[docs] +def getintquality(env, lp, what): + quality = CR.intPtr() + status = CR.CPXXgetintquality(env, lp, quality, what) + check_status(env, status) + return quality.value()
+ + + +# Sensitivity Analysis Results + +
+[docs] +def boundsa_lower(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = _safeDoubleArray(listlen) + lbupper = _safeDoubleArray(listlen) + ublower = LAU.double_list_to_array([]) + ubupper = LAU.double_list_to_array([]) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(lblower, listlen), + LAU.array_to_list(lbupper, listlen))
+ + + +
+[docs] +def boundsa_upper(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = LAU.double_list_to_array([]) + lbupper = LAU.double_list_to_array([]) + ublower = _safeDoubleArray(listlen) + ubupper = _safeDoubleArray(listlen) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(ublower, listlen), + LAU.array_to_list(ubupper, listlen))
+ + + +
+[docs] +def boundsa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lblower = _safeDoubleArray(listlen) + lbupper = _safeDoubleArray(listlen) + ublower = _safeDoubleArray(listlen) + ubupper = _safeDoubleArray(listlen) + status = CR.CPXXboundsa(env, lp, begin, end, lblower, lbupper, + ublower, ubupper) + check_status(env, status) + return (LAU.array_to_list(lblower, listlen), + LAU.array_to_list(lbupper, listlen), + LAU.array_to_list(ublower, listlen), + LAU.array_to_list(ubupper, listlen))
+ + + +
+[docs] +def objsa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lower = _safeDoubleArray(listlen) + upper = _safeDoubleArray(listlen) + status = CR.CPXXobjsa(env, lp, begin, end, lower, upper) + check_status(env, status) + return (LAU.array_to_list(lower, listlen), + LAU.array_to_list(upper, listlen))
+ + + +
+[docs] +def rhssa(env, lp, begin, end): + listlen = _rangelen(begin, end) + lower = _safeDoubleArray(listlen) + upper = _safeDoubleArray(listlen) + status = CR.CPXXrhssa(env, lp, begin, end, lower, upper) + check_status(env, status) + return (LAU.array_to_list(lower, listlen), + LAU.array_to_list(upper, listlen))
+ + + +# Conflicts + +
+[docs] +def refinemipstartconflictext(env, lp, mipstartindex, grppref, grpbeg, + grpind, grptype): + grpcnt = _arraylen(grppref) + concnt = _arraylen(grpind) + with SigIntHandler(), \ + LAU.double_c_array_or_none(grppref) as c_grppref, \ + LAU.long_c_array_or_none(grpbeg) as c_grpbeg, \ + LAU.int_c_array_or_none(grpind) as c_grpind: + status = CR.CPXXrefinemipstartconflictext( + env, lp, mipstartindex, grpcnt, concnt, + c_grppref, c_grpbeg, c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def refineconflictext(env, lp, grppref, grpbeg, grpind, grptype): + grpcnt = _arraylen(grppref) + concnt = _arraylen(grpind) + with SigIntHandler(), \ + LAU.double_c_array_or_none(grppref) as c_grppref, \ + LAU.long_c_array_or_none(grpbeg) as c_grpbeg, \ + LAU.int_c_array_or_none(grpind) as c_grpind: + status = CR.CPXXrefineconflictext( + env, lp, grpcnt, concnt, + c_grppref, c_grpbeg, c_grpind, grptype) + check_status(env, status)
+ + + +
+[docs] +def getconflictext(env, lp, begin, end): + grpstatlen = _rangelen(begin, end) + grpstat = _safeIntArray(grpstatlen) + status = CR.CPXXgetconflictext(env, lp, grpstat, begin, end) + check_status(env, status) + return LAU.array_to_list(grpstat, grpstatlen)
+ + + +
+[docs] +def getconflictnumgroups(env, lp): + return CR.CPXXgetconflictnumgroups(env, lp)
+ + + +
+[docs] +def getconflictgroups(env, lp, begin, end): + inout_list = [0, begin, end] + status = CR.CPXXgetconflictgroups(env, lp, inout_list) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if inout_list == [0]: + return ([], [0] * _rangelen(begin, end), [], []) + inout_list.extend([begin, end]) + status = CR.CPXXgetconflictgroups(env, lp, inout_list) + check_status(env, status) + # We expect to get [grppref, grpbeg, grpind, grptype]. + assert len(inout_list) == 4, str(inout_list) + return tuple(inout_list)
+ + + +
+[docs] +def getconflictnumpasses(env, lp): + return CR.CPXXgetconflictnumpasses(env, lp)
+ + + +
+[docs] +def clpwrite(env, lp, filename): + status = CR.CPXXclpwrite(env, lp, filename) + check_status(env, status)
+ + +# Problem Modification Routines + +# File Reading Routines + +# File Writing Routines + + +
+[docs] +def solwrite(env, lp, filename): + status = CR.CPXXsolwrite(env, lp, filename) + check_status(env, status)
+ + +# Message Handling Routines + +# Advanced LP Routines + + +
+[docs] +def binvcol(env, lp, j): + xlen = CR.CPXXgetnumrows(env, lp) + x = _safeDoubleArray(xlen) + status = CR.CPXXbinvcol(env, lp, j, x) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def binvrow(env, lp, i): + ylen = CR.CPXXgetnumrows(env, lp) + y = _safeDoubleArray(ylen) + status = CR.CPXXbinvrow(env, lp, i, y) + check_status(env, status) + return LAU.array_to_list(y, ylen)
+ + + +
+[docs] +def binvacol(env, lp, j): + xlen = CR.CPXXgetnumrows(env, lp) + x = _safeDoubleArray(xlen) + status = CR.CPXXbinvacol(env, lp, j, x) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def binvarow(env, lp, i): + zlen = CR.CPXXgetnumcols(env, lp) + z = _safeDoubleArray(zlen) + status = CR.CPXXbinvarow(env, lp, i, z) + check_status(env, status) + return LAU.array_to_list(z, zlen)
+ + + +
+[docs] +def ftran(env, lp, x): + x_array = LAU.double_list_to_array(x) + status = CR.CPXXftran(env, lp, x_array) + check_status(env, status) + return LAU.array_to_list(x_array, len(x))
+ + + +
+[docs] +def btran(env, lp, y): + y_array = LAU.double_list_to_array(y) + status = CR.CPXXbtran(env, lp, y_array) + check_status(env, status) + return LAU.array_to_list(y_array, len(y))
+ + + +# Advanced Solution functions + +
+[docs] +def getgrad(env, lp, j): + numrows = CR.CPXXgetnumrows(env, lp) + head = _safeIntArray(numrows) + y = _safeDoubleArray(numrows) + status = CR.CPXXgetgrad(env, lp, j, head, y) + check_status(env, status) + return (LAU.array_to_list(head, numrows), + LAU.array_to_list(y, numrows))
+ + + +
+[docs] +def slackfromx(env, lp, x): + numrows = CR.CPXXgetnumrows(env, lp) + slack = _safeDoubleArray(numrows) + status = CR.CPXXslackfromx(env, lp, LAU.double_list_to_array(x), slack) + check_status(env, status) + return LAU.array_to_list(slack, numrows)
+ + + +
+[docs] +def qconstrslackfromx(env, lp, x): + numqcon = CR.CPXXgetnumqconstrs(env, lp) + slack = _safeDoubleArray(numqcon) + status = CR.CPXXqconstrslackfromx(env, lp, + LAU.double_list_to_array(x), slack) + check_status(env, status) + return LAU.array_to_list(slack, numqcon)
+ + + +
+[docs] +def djfrompi(env, lp, pi): + numcols = CR.CPXXgetnumcols(env, lp) + dj = _safeDoubleArray(numcols) + status = CR.CPXXdjfrompi(env, lp, LAU.double_list_to_array(pi), dj) + check_status(env, status) + return LAU.array_to_list(dj, numcols)
+ + + +
+[docs] +def qpdjfrompi(env, lp, pi, x): + numcols = CR.CPXXgetnumcols(env, lp) + dj = _safeDoubleArray(numcols) + status = CR.CPXXqpdjfrompi(env, lp, LAU.double_list_to_array(pi), + LAU.double_list_to_array(x), dj) + check_status(env, status) + return LAU.array_to_list(dj, numcols)
+ + + +
+[docs] +def mdleave(env, lp, goodlist): + goodlen = len(goodlist) + downratio = _safeDoubleArray(goodlen) + upratio = _safeDoubleArray(goodlen) + status = CR.CPXXmdleave(env, lp, LAU.int_list_to_array(goodlist), + goodlen, downratio, upratio) + check_status(env, status) + return (LAU.array_to_list(downratio, goodlen), + LAU.array_to_list(upratio, goodlen))
+ + + +
+[docs] +def qpindefcertificate(env, lp): + certlen = CR.CPXXgetnumquad(env, lp) + cert = _safeDoubleArray(certlen) + status = CR.CPXXqpindefcertificate(env, lp, cert) + check_status(env, status) + return LAU.array_to_list(cert, certlen)
+ + + +
+[docs] +def dualfarkas(env, lp): + ylen = CR.CPXXgetnumrows(env, lp) + y = _safeDoubleArray(ylen) + proof = CR.doublePtr() + status = CR.CPXXdualfarkas(env, lp, y, proof) + check_status(env, status) + return (LAU.array_to_list(y, ylen), proof.value())
+ + + +
+[docs] +def getijdiv(env, lp): + idiv = CR.intPtr() + jdiv = CR.intPtr() + status = CR.CPXXgetijdiv(env, lp, idiv, jdiv) + check_status(env, status) + if idiv.value() != -1: + return idiv.value() + getnumcols(env, lp) + if jdiv.value() != -1: + return jdiv.value() + # problem is not diverging + return -1
+ + + +
+[docs] +def getray(env, lp): + zlen = CR.CPXXgetnumcols(env, lp) + z = _safeDoubleArray(zlen) + status = CR.CPXXgetray(env, lp, z) + check_status(env, status) + return LAU.array_to_list(z, zlen)
+ + + +# Advanced Presolve Routines + +
+[docs] +def presolve(env, lp, method): + status = CR.CPXXpresolve(env, lp, method) + check_status(env, status)
+ + + +
+[docs] +def freepresolve(env, lp): + status = CR.CPXXfreepresolve(env, lp) + check_status(env, status)
+ + + +
+[docs] +def crushx(env, lp, x): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numcols = CR.CPXXgetnumcols(env, redlp.value()) + prex = _safeDoubleArray(numcols) + status = CR.CPXXcrushx(env, lp, LAU.double_list_to_array(x), prex) + check_status(env, status) + return LAU.array_to_list(prex, numcols)
+ + + +
+[docs] +def uncrushx(env, lp, prex): + numcols = CR.CPXXgetnumcols(env, lp) + x = _safeDoubleArray(numcols) + status = CR.CPXXuncrushx(env, lp, x, LAU.double_list_to_array(prex)) + check_status(env, status) + return LAU.array_to_list(x, numcols)
+ + + +
+[docs] +def crushpi(env, lp, pi): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numrows = CR.CPXXgetnumrows(env, redlp.value()) + prepi = _safeDoubleArray(numrows) + status = CR.CPXXcrushpi(env, lp, LAU.double_list_to_array(pi), prepi) + check_status(env, status) + return LAU.array_to_list(prepi, numrows)
+ + + +
+[docs] +def uncrushpi(env, lp, prepi): + numrows = CR.CPXXgetnumrows(env, lp) + pi = _safeDoubleArray(numrows) + status = CR.CPXXuncrushpi(env, lp, pi, LAU.double_list_to_array(prepi)) + check_status(env, status) + return LAU.array_to_list(pi, numrows)
+ + + +
+[docs] +def crushform(env, lp, ind, val): + plen = CR.intPtr() + poffset = CR.doublePtr() + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + numcols = CR.CPXXgetnumcols(env, redlp.value()) + pind = _safeIntArray(numcols) + pval = _safeDoubleArray(numcols) + status = CR.CPXXcrushform(env, lp, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + plen, poffset, pind, pval) + check_status(env, status) + return (poffset.value(), LAU.array_to_list(pind, plen.value()), + LAU.array_to_list(pval, plen.value()))
+ + + +
+[docs] +def uncrushform(env, lp, pind, pval): + length = CR.intPtr() + offset = CR.doublePtr() + maxlen = CR.CPXXgetnumcols(env, lp) + CR.CPXXgetnumrows(env, lp) + ind = _safeIntArray(maxlen) + val = _safeDoubleArray(maxlen) + status = CR.CPXXuncrushform(env, lp, len(pind), + LAU.int_list_to_array(pind), + LAU.double_list_to_array(pval), + length, offset, ind, val) + check_status(env, status) + return (offset.value(), LAU.array_to_list(ind, length.value()), + LAU.array_to_list(val, length.value()))
+ + + +
+[docs] +def getprestat_status(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return prestat.value()
+ + + +
+[docs] +def getprestat_r(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + nrows = CR.CPXXgetnumrows(env, lp) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = _safeIntArray(nrows) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(prstat, nrows)
+ + + +
+[docs] +def getprestat_c(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + ncols = CR.CPXXgetnumcols(env, lp) + prestat = CR.intPtr() + pcstat = _safeIntArray(ncols) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(pcstat, ncols)
+ + + +
+[docs] +def getprestat_or(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + nprows = CR.CPXXgetnumrows(env, redlp.value()) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = LAU.int_list_to_array([]) + orstat = _safeIntArray(nprows) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(orstat, nprows)
+ + + +
+[docs] +def getprestat_oc(env, lp): + redlp = CR.CPXLPptrPtr() + status = CR.CPXXgetredlp(env, lp, redlp) + check_status(env, status) + if redlp.value() is None: + raise CplexError("No presolved problem found") + npcols = CR.CPXXgetnumcols(env, redlp.value()) + prestat = CR.intPtr() + pcstat = LAU.int_list_to_array([]) + prstat = LAU.int_list_to_array([]) + ocstat = _safeIntArray(npcols) + orstat = LAU.int_list_to_array([]) + status = CR.CPXXgetprestat(env, lp, prestat, pcstat, prstat, + ocstat, orstat) + check_status(env, status) + return LAU.array_to_list(ocstat, npcols)
+ + + +
+[docs] +def prechgobj(env, lp, ind, val): + status = CR.CPXXprechgobj(env, lp, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(env, status)
+ + + +
+[docs] +def preaddrows(env, lp, rhs, sense, rmatbeg, rmatind, rmatval, names): + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.long_c_array(rmatbeg) as c_rmatbeg, \ + LAU.int_c_array(rmatind) as c_rmatind, \ + LAU.double_c_array(rmatval) as c_rmatval: # noqa: E126 + status = CR.CPXXpreaddrows(env, lp, len(rmatbeg), len(rmatind), + c_rhs, + sense, + c_rmatbeg, + c_rmatind, + c_rmatval, + names) + check_status(env, status)
+ + +######################################################################## +# MIP Starts API +######################################################################## + + +
+[docs] +def getnummipstarts(env, lp): + return CR.CPXXgetnummipstarts(env, lp)
+ + + +
+[docs] +def chgmipstarts(env, lp, mipstartindices, beg, varindices, values, + effortlevel): + with LAU.int_c_array(mipstartindices) as c_mipstartindices, \ + LAU.long_c_array(beg) as c_beg, \ + LAU.int_c_array(varindices) as c_varindices, \ + LAU.double_c_array(values) as c_values, \ + LAU.int_c_array(effortlevel) as c_effortlevel: + status = CR.CPXXchgmipstarts(env, lp, + len(mipstartindices), + c_mipstartindices, + len(varindices), + c_beg, + c_varindices, + c_values, + c_effortlevel) + check_status(env, status)
+ + + +
+[docs] +def addmipstarts(env, lp, beg, varindices, values, effortlevel, + mipstartname): + with LAU.long_c_array(beg) as c_beg, \ + LAU.int_c_array(varindices) as c_varindices, \ + LAU.double_c_array(values) as c_values, \ + LAU.int_c_array(effortlevel) as c_effortlevel: + status = CR.CPXXaddmipstarts( + env, lp, len(beg), len(varindices), + c_beg, c_varindices, c_values, c_effortlevel, + mipstartname) + check_status(env, status)
+ + + +
+[docs] +def delmipstarts(env, lp, begin, end): + delfn = CR.CPXXdelmipstarts + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getmipstarts_size(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return -surplus.value()
+ + + +
+[docs] +def getmipstarts_effort(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([0] * _rangelen(begin, end), [], [], + [0] * _rangelen(begin, end)) + startspace = -surplus.value() + beg = _safeLongArray(beglen) + varindices = _safeIntArray(startspace) + values = _safeDoubleArray(startspace) + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + check_status(env, status) + return LAU.array_to_list(effortlevel, beglen)
+ + + +
+[docs] +def getmipstarts(env, lp, begin, end): + beglen = _rangelen(begin, end) + beg = LAU.long_list_to_array([]) + effortlevel = _safeIntArray(beglen) + nzcnt = CR.cpxlongPtr() + surplus = CR.cpxlongPtr() + varindices = LAU.int_list_to_array([]) + values = LAU.double_list_to_array([]) + startspace = 0 + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + if surplus.value() == 0: + return ([0] * _rangelen(begin, end), [], [], + [0] * _rangelen(begin, end)) + beg = _safeLongArray(beglen) + startspace = -surplus.value() + varindices = _safeIntArray(startspace) + values = _safeDoubleArray(startspace) + status = CR.CPXXgetmipstarts(env, lp, nzcnt, beg, varindices, values, + effortlevel, startspace, surplus, begin, + end) + check_status(env, status) + return (LAU.array_to_list(beg, beglen), + LAU.array_to_list(varindices, startspace), + LAU.array_to_list(values, startspace), + LAU.array_to_list(effortlevel, beglen))
+ + + +
+[docs] +def getmipstartname(env, lp, begin, end): + namefn = CR.CPXXgetmipstartname + return _getnamebyrange(env, lp, begin, end, namefn)
+ + + +
+[docs] +def getmipstartindex(env, lp, mipstartname): + index = CR.intPtr() + status = CR.CPXXgetmipstartindex(env, lp, mipstartname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def readcopymipstarts(env, lp, filename): + status = CR.CPXXreadcopymipstarts(env, lp, + filename) + check_status(env, status)
+ + + +
+[docs] +def writemipstarts(env, lp, filename, begin, end): + status = CR.CPXXwritemipstarts(env, lp, filename, begin, end) + check_status(env, status)
+ + +# Optimizing Problems + +# Progress + + +
+[docs] +def getitcnt(env, lp): + return CR.CPXXgetitcnt(env, lp)
+ + + +
+[docs] +def getphase1cnt(env, lp): + return CR.CPXXgetphase1cnt(env, lp)
+ + + +
+[docs] +def getsiftitcnt(env, lp): + return CR.CPXXgetsiftitcnt(env, lp)
+ + + +
+[docs] +def getsiftphase1cnt(env, lp): + return CR.CPXXgetsiftphase1cnt(env, lp)
+ + + +
+[docs] +def getbaritcnt(env, lp): + return CR.CPXXgetbaritcnt(env, lp)
+ + + +
+[docs] +def getcrossppushcnt(env, lp): + return CR.CPXXgetcrossppushcnt(env, lp)
+ + + +
+[docs] +def getcrosspexchcnt(env, lp): + return CR.CPXXgetcrosspexchcnt(env, lp)
+ + + +
+[docs] +def getcrossdpushcnt(env, lp): + return CR.CPXXgetcrossdpushcnt(env, lp)
+ + + +
+[docs] +def getcrossdexchcnt(env, lp): + return CR.CPXXgetcrossdexchcnt(env, lp)
+ + + +
+[docs] +def getmipitcnt(env, lp): + return CR.CPXXgetmipitcnt(env, lp)
+ + + +
+[docs] +def getnodecnt(env, lp): + return CR.CPXXgetnodecnt(env, lp)
+ + + +
+[docs] +def getnodeleftcnt(env, lp): + return CR.CPXXgetnodeleftcnt(env, lp)
+ + + +# MIP Only solution interface + +
+[docs] +def getbestobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetbestobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getcutoff(env, lp): + cutoff = CR.doublePtr() + status = CR.CPXXgetcutoff(env, lp, cutoff) + check_status(env, status) + return cutoff.value()
+ + + +
+[docs] +def getmiprelgap(env, lp): + relgap = CR.doublePtr() + status = CR.CPXXgetmiprelgap(env, lp, relgap) + check_status(env, status) + return relgap.value()
+ + + +
+[docs] +def getnumcuts(env, lp, cuttype): + num = CR.intPtr() + status = CR.CPXXgetnumcuts(env, lp, cuttype, num) + check_status(env, status) + return num.value()
+ + + +
+[docs] +def getnodeint(env, lp): + return CR.CPXXgetnodeint(env, lp)
+ + + +
+[docs] +def getsubstat(env, lp): + return CR.CPXXgetsubstat(env, lp)
+ + +# for callback query methods + + +
+[docs] +def get_wherefrom(cbstruct): + return CR.get_wherefrom(cbstruct)
+ + + +cpxlong_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, + _const.CPX_CALLBACK_INFO_NODE_NODENUM_LONG, + _const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG, +] + +int_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_NIINF, + _const.CPX_CALLBACK_INFO_NODE_VAR, + _const.CPX_CALLBACK_INFO_NODE_SOS, + _const.CPX_CALLBACK_INFO_LAZY_SOURCE, +] + +double_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_SIINF, + _const.CPX_CALLBACK_INFO_NODE_ESTIMATE, + _const.CPX_CALLBACK_INFO_NODE_OBJVAL, +] + +# NB: CPX_CALLBACK_INFO_NODE_TYPE not used in the Python API. + +user_handle_callback_node_info = [ + _const.CPX_CALLBACK_INFO_NODE_USERHANDLE +] + + +
+[docs] +def gettime(env): + time = CR.doublePtr() + status = CR.CPXXgettime(env, time) + check_status(env, status) + return time.value()
+ + + +
+[docs] +def getdettime(env): + time = CR.doublePtr() + status = CR.CPXXgetdettime(env, time) + check_status(env, status) + return time.value()
+ + + +
+[docs] +def getcallbackincumbent(cbstruct, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetcallbackincumbent(cbstruct, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getcallbackpseudocosts(cbstruct, begin, end): + pclen = _rangelen(begin, end) + uppc = _safeDoubleArray(pclen) + dnpc = _safeDoubleArray(pclen) + status = CR.CPXXgetcallbackpseudocosts(cbstruct, uppc, dnpc, begin, end) + check_status(None, status) + return (LAU.array_to_list(uppc, pclen), + LAU.array_to_list(dnpc, pclen))
+ + + +
+[docs] +def getcallbacknodeintfeas(cbstruct, begin, end): + feaslen = _rangelen(begin, end) + feas = _safeIntArray(feaslen) + status = CR.CPXXgetcallbacknodeintfeas(cbstruct, feas, begin, end) + check_status(None, status) + return LAU.array_to_list(feas, feaslen)
+ + + +
+[docs] +def getcallbacknodelb(cbstruct, begin, end): + lblen = _rangelen(begin, end) + lb = _safeDoubleArray(lblen) + status = CR.CPXXgetcallbacknodelb(cbstruct, lb, begin, end) + check_status(None, status) + return LAU.array_to_list(lb, lblen)
+ + + +
+[docs] +def getcallbacknodeub(cbstruct, begin, end): + ublen = _rangelen(begin, end) + ub = _safeDoubleArray(ublen) + status = CR.CPXXgetcallbacknodeub(cbstruct, ub, begin, end) + check_status(None, status) + return LAU.array_to_list(ub, ublen)
+ + + +
+[docs] +def getcallbacknodeobjval(cbstruct): + x = CR.doublePtr() + status = CR.CPXXgetcallbacknodeobjval(cbstruct, x) + check_status(None, status) + return x.value()
+ + + +
+[docs] +def getcallbacknodex(cbstruct, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetcallbacknodex(cbstruct, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getcallbacknodeinfo(cbstruct, node, which): + if which in int_callback_node_info: + data = CR.intPtr() + elif which in cpxlong_callback_node_info: + data = CR.cpxlongPtr() + elif which in double_callback_node_info: + data = CR.doublePtr() + elif which in user_handle_callback_node_info: + data = [] + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbacknodeinfo") + status = CR.CPXXgetcallbacknodeinfo(cbstruct, [node, which, data]) + check_status(None, status) + if (which in int_callback_node_info or + which in double_callback_node_info or + which in cpxlong_callback_node_info): + return data.value() + assert which in user_handle_callback_node_info + return data[0]
+ + + +
+[docs] +def callbacksetuserhandle(cbstruct, userhandle): + data = [] + status = CR.CPXXcallbacksetuserhandle(cbstruct, [userhandle, data]) + check_status(None, status) + return data[0]
+ + + +
+[docs] +def callbacksetnodeuserhandle(cbstruct, nodeindex, userhandle): + data = [] + status = CR.CPXXcallbacksetnodeuserhandle( + cbstruct, [nodeindex, userhandle, data]) + check_status(None, status) + return data[0]
+ + + +
+[docs] +def getcallbackseqinfo(cbstruct, node, which): + if which in int_callback_node_info: + data = CR.intPtr() + elif which in cpxlong_callback_node_info: + data = CR.cpxlongPtr() + elif which in double_callback_node_info: + data = CR.doublePtr() + elif which in user_handle_callback_node_info: + data = [] + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbackseqinfo") + status = CR.CPXXgetcallbackseqinfo(cbstruct, [node, which, data]) + check_status(None, status) + if (which in int_callback_node_info or + which in double_callback_node_info or + which in cpxlong_callback_node_info): + return data.value() + assert which in user_handle_callback_node_info + return data[0]
+ + + +int_sos_info = [ + _const.CPX_CALLBACK_INFO_SOS_NUM, + _const.CPX_CALLBACK_INFO_SOS_SIZE, + _const.CPX_CALLBACK_INFO_SOS_IS_FEASIBLE, + _const.CPX_CALLBACK_INFO_SOS_MEMBER_INDEX, +] + +double_sos_info = [ + _const.CPX_CALLBACK_INFO_SOS_MEMBER_REFVAL, +] + +# NB: CPX_CALLBACK_INFO_SOS_TYPE not used in the Python API. + + +
+[docs] +def getcallbacksosinfo(cbstruct, sosindex, member, which): + if which in int_sos_info: + data = CR.intPtr() + elif which in double_sos_info: + data = CR.doublePtr() + else: + raise CplexError( + "invalid value for which in _internal._procedural.getcallbacksosinfo") + status = CR.CPXXgetcallbacksosinfo(cbstruct, sosindex, member, which, data) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def cutcallbackadd(cbstruct, rhs, sense, ind, val, purgeable): + status = CR.CPXXcutcallbackadd(cbstruct, len(ind), rhs, + sense, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + purgeable) + check_status(None, status)
+ + + +
+[docs] +def cutcallbackaddlocal(cbstruct, rhs, sense, ind, val): + status = CR.CPXXcutcallbackaddlocal(cbstruct, len(ind), rhs, + sense, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val)) + check_status(None, status)
+ + + +
+[docs] +def branchcallbackbranchgeneral(cbstruct, ind, lu, bd, rhs, sense, matbeg, + matind, matval, nodeest, userhandle): + seqnum = CR.cpxlongPtr() + status = CR.CPXXbranchcallbackbranchgeneral( + cbstruct, len(ind), + LAU.int_list_to_array(ind), + lu, + LAU.double_list_to_array(bd), + len(matbeg), len(matind), + LAU.double_list_to_array(rhs), + sense, + LAU.long_list_to_array(matbeg), + LAU.int_list_to_array(matind), + LAU.double_list_to_array(matval), + nodeest, userhandle, seqnum) + check_status(None, status) + return seqnum.value()
+ + + +
+[docs] +def branchcallbackbranchasCPLEX(cbstruct, n, userhandle): + seqnum = CR.cpxlongPtr() + status = CR.CPXXbranchcallbackbranchasCPLEX( + cbstruct, n, userhandle, seqnum) + check_status(None, status) + return seqnum.value()
+ + + +
+[docs] +def setpydel(env): + status = CR.setpydel(env) + check_status(env, status)
+ + + +
+[docs] +def delpydel(env): + status = CR.delpydel(env) + check_status(env, status)
+ + +# Solution pool + + +
+[docs] +def addsolnpooldivfilter(env, lp, lb, ub, ind, wts, ref, name): + status = CR.CPXXaddsolnpooldivfilter(env, lp, lb, ub, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(wts), + LAU.double_list_to_array(ref), + name) + check_status(env, status)
+ + + +
+[docs] +def addsolnpoolrngfilter(env, lp, lb, ub, ind, val, name): + status = CR.CPXXaddsolnpoolrngfilter(env, lp, lb, ub, len(ind), + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + name) + check_status(env, status)
+ + + +
+[docs] +def getsolnpooldivfilter_constant(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + wts = LAU.double_list_to_array([]) + ref = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return (lb.value(), ub.value(), -surplus.value())
+ + + +
+[docs] +def getsolnpooldivfilter(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + wts = LAU.double_list_to_array([]) + ref = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + wts = _safeDoubleArray(space) + ref = _safeDoubleArray(space) + status = CR.CPXXgetsolnpooldivfilter(env, lp, lb, ub, nzcnt, ind, + wts, ref, space, surplus, which) + check_status(env, status) + return (lb.value(), + ub.value(), + LAU.array_to_list(ind, space), + LAU.array_to_list(wts, space), + LAU.array_to_list(ref, space))
+ + + +
+[docs] +def getsolnpoolrngfilter_constant(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + val = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + return (lb.value(), ub.value(), -surplus.value())
+ + + +
+[docs] +def getsolnpoolrngfilter(env, lp, which): + lb = CR.doublePtr() + ub = CR.doublePtr() + nzcnt = CR.intPtr() + space = 0 + surplus = CR.intPtr() + ind = LAU.int_list_to_array([]) + val = LAU.double_list_to_array([]) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + val = _safeDoubleArray(space) + status = CR.CPXXgetsolnpoolrngfilter(env, lp, lb, ub, nzcnt, ind, val, + space, surplus, which) + check_status(env, status) + return (lb.value(), ub.value(), LAU.array_to_list(ind, space), + LAU.array_to_list(val, space))
+ + + +
+[docs] +def delsolnpoolfilters(env, lp, begin, end): + delfn = CR.CPXXdelsolnpoolfilters + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsolnpoolfiltername(env, lp, which): + namefn = CR.CPXXgetsolnpoolfiltername + return _getname(env, lp, which, namefn, index_first=False)
+ + + +
+[docs] +def getsolnpoolnumfilters(env, lp): + return CR.CPXXgetsolnpoolnumfilters(env, lp)
+ + + +
+[docs] +def fltwrite(env, lp, filename): + status = CR.CPXXfltwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def readcopysolnpoolfilters(env, lp, filename): + status = CR.CPXXreadcopysolnpoolfilters(env, lp, + filename) + check_status(env, status)
+ + + +
+[docs] +def getsolnpoolfilterindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetsolnpoolfilterindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getsolnpoolfiltertype(env, lp, index): + type_ = CR.intPtr() + status = CR.CPXXgetsolnpoolfiltertype(env, lp, type_, index) + check_status(env, status) + return type_.value()
+ + + +
+[docs] +def delsolnpoolsolns(env, lp, begin, end): + delfn = CR.CPXXdelsolnpoolsolns + _delbyrange(delfn, env, lp, begin, end)
+ + + +
+[docs] +def getsolnpoolnumsolns(env, lp): + return CR.CPXXgetsolnpoolnumsolns(env, lp)
+ + + +
+[docs] +def getsolnpoolnumreplaced(env, lp): + return CR.CPXXgetsolnpoolnumreplaced(env, lp)
+ + + +
+[docs] +def getsolnpoolsolnindex(env, lp, colname): + index = CR.intPtr() + status = CR.CPXXgetsolnpoolsolnindex(env, lp, colname, index) + check_status(env, status) + return index.value()
+ + + +
+[docs] +def getsolnpoolmeanobjval(env, lp): + objval = CR.doublePtr() + status = CR.CPXXgetsolnpoolmeanobjval(env, lp, objval) + check_status(env, status) + return objval.value()
+ + + +
+[docs] +def getsolnpoolsolnname(env, lp, which): + namefn = CR.CPXXgetsolnpoolsolnname + return _getname(env, lp, which, namefn, index_first=False)
+ + + +
+[docs] +def solwritesolnpool(env, lp, soln, filename): + status = CR.CPXXsolwritesolnpool(env, lp, soln, filename) + check_status(env, status)
+ + + +
+[docs] +def solwritesolnpoolall(env, lp, filename): + status = CR.CPXXsolwritesolnpoolall(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getsolnpoolobjval(env, lp, soln): + obj = CR.doublePtr() + status = CR.CPXXgetsolnpoolobjval(env, lp, soln, obj) + check_status(env, status) + return obj.value()
+ + + +
+[docs] +def getsolnpoolx(env, lp, soln, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXgetsolnpoolx(env, lp, soln, x, begin, end) + check_status(env, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def getsolnpoolslack(env, lp, soln, begin, end): + slacklen = _rangelen(begin, end) + slack = _safeDoubleArray(slacklen) + status = CR.CPXXgetsolnpoolslack(env, lp, soln, slack, begin, end) + check_status(env, status) + return LAU.array_to_list(slack, slacklen)
+ + + +
+[docs] +def getsolnpoolqconstrslack(env, lp, soln, begin, end): + qlen = _rangelen(begin, end) + q = _safeDoubleArray(qlen) + status = CR.CPXXgetsolnpoolqconstrslack(env, lp, soln, q, begin, end) + check_status(env, status) + return LAU.array_to_list(q, qlen)
+ + + +
+[docs] +def getsolnpoolintquality(env, lp, soln, what): + quality = CR.intPtr() + status = CR.CPXXgetsolnpoolintquality(env, lp, soln, quality, what) + check_status(env, status) + return quality.value()
+ + + +
+[docs] +def getsolnpooldblquality(env, lp, soln, what): + quality = CR.doublePtr() + status = CR.CPXXgetsolnpooldblquality(env, lp, soln, quality, what) + check_status(env, status) + return quality.value()
+ + + +# Initial data + + +
+[docs] +def copystart(env, lp, cstat, rstat, cprim, rprim, cdual, rdual): + status = CR.CPXXcopystart(env, lp, + LAU.int_list_to_array(cstat), + LAU.int_list_to_array(rstat), + LAU.double_list_to_array(cprim), + LAU.double_list_to_array(rprim), + LAU.double_list_to_array(cdual), + LAU.double_list_to_array(rdual)) + check_status(env, status)
+ + + +
+[docs] +def readcopybase(env, lp, filename): + status = CR.CPXXreadcopybase(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def getorder(env, lp): + count = CR.intPtr() + surplus = CR.intPtr() + space = 0 + ind = LAU.int_list_to_array([]) + pri = LAU.int_list_to_array([]) + dir_ = LAU.int_list_to_array([]) + status = CR.CPXXgetorder(env, lp, count, ind, pri, dir_, space, surplus) + if status != CR.CPXERR_NEGATIVE_SURPLUS: + check_status(env, status) + space = -surplus.value() + ind = _safeIntArray(space) + pri = _safeIntArray(space) + dir_ = _safeIntArray(space) + status = CR.CPXXgetorder(env, lp, count, ind, pri, dir_, space, surplus) + check_status(env, status) + return (LAU.array_to_list(ind, space), LAU.array_to_list(pri, space), + LAU.array_to_list(dir_, space))
+ + + +
+[docs] +def copyorder(env, lp, indices, priority, direction): + status = CR.CPXXcopyorder(env, lp, len(indices), + LAU.int_list_to_array(indices), + LAU.int_list_to_array(priority), + LAU.int_list_to_array(direction)) + check_status(env, status)
+ + + +
+[docs] +def readcopyorder(env, lp, filename): + status = CR.CPXXreadcopyorder(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def ordwrite(env, lp, filename): + status = CR.CPXXordwrite(env, lp, filename) + check_status(env, status)
+ + + +
+[docs] +def readcopystartinfo(env, lp, filename): + status = CR.CPXXreadcopystartinfo(env, lp, filename) + check_status(env, status)
+ + +# handle the lock for parallel callbacks + + +
+[docs] +def initlock(): + return CR.init_callback_lock()
+ + + +
+[docs] +def finitlock(lock): + CR.finit_callback_lock(lock)
+ + + +# get problem statistics + +
+[docs] +def getprobstats(env, lp): + ProbStats = namedtuple( + 'ProbStats', + ['objs', # 0 + 'rows', # 1 + 'cols', # 2 + 'objcnt', # 3 + 'rhscnt', # 4 + 'nzcnt', # 5 + 'ecnt', # 6 + 'gcnt', # 7 + 'lcnt', # 8 + 'rngcnt', # 9 + 'ncnt', # 10 + 'fcnt', # 11 + 'xcnt', # 12 + 'bcnt', # 13 + 'ocnt', # 14 + 'bicnt', # 15 + 'icnt', # 16 + 'scnt', # 17 + 'sicnt', # 18 + 'qpcnt', # 19 + 'qpnzcnt', # 20 + 'nqconstr', # 21 + 'qrhscnt', # 22 + 'qlcnt', # 23 + 'qgcnt', # 24 + 'quadnzcnt', # 25 + 'linnzcnt', # 26 + 'nindconstr', # 27 + 'indrhscnt', # 28 + 'indnzcnt', # 29 + 'indcompcnt', # 30 + 'indlcnt', # 31 + 'indecnt', # 32 + 'indgcnt', # 33 + 'maxcoef', # 34 + 'mincoef', # 35 + 'minrhs', # 36 + 'maxrhs', # 37 + 'minrng', # 38 + 'maxrng', # 39 + 'minobj', # 40 + 'maxobj', # 41 + 'minlb', # 42 + 'maxub', # 43 + 'minqcoef', # 44 + 'maxqcoef', # 45 + 'minqcq', # 46 + 'maxqcq', # 47 + 'minqcl', # 48 + 'maxqcl', # 49 + 'minqcr', # 50 + 'maxqcr', # 51 + 'minind', # 52 + 'maxind', # 53 + 'minindrhs', # 54 + 'maxindrhs', # 55 + 'minlazy', # 56 + 'maxlazy', # 57 + 'minlazyrhs', # 58 + 'maxlazyrhs', # 59 + 'minucut', # 60 + 'maxucut', # 61 + 'minucutrhs', # 62 + 'maxucutrhs', # 63 + 'nsos', # 64 + 'nsos1', # 65 + 'sos1nmem', # 66 + 'sos1type', # 67 + 'nsos2', # 68 + 'sos2nmem', # 69 + 'sos2type', # 70 + 'lazyrhscnt', # 71 + 'lazygcnt', # 72 + 'lazylcnt', # 73 + 'lazyecnt', # 74 + 'lazycnt', # 75 + 'lazynzcnt', # 76 + 'ucutrhscnt', # 77 + 'ucutgcnt', # 78 + 'ucutlcnt', # 79 + 'ucutecnt', # 80 + 'ucutcnt', # 81 + 'ucutnzcnt', # 82 + 'npwl', # 83 + 'npwlbreaks']) # 84 + + objs_p = CR.intPtr() + rows_p = CR.intPtr() + cols_p = CR.intPtr() + objcnt_p = CR.intPtr() + rhscnt_p = CR.intPtr() + nzcnt_p = CR.intPtr() + ecnt_p = CR.intPtr() + gcnt_p = CR.intPtr() + lcnt_p = CR.intPtr() + rngcnt_p = CR.intPtr() + ncnt_p = CR.intPtr() + fcnt_p = CR.intPtr() + xcnt_p = CR.intPtr() + bcnt_p = CR.intPtr() + ocnt_p = CR.intPtr() + bicnt_p = CR.intPtr() + icnt_p = CR.intPtr() + scnt_p = CR.intPtr() + sicnt_p = CR.intPtr() + qpcnt_p = CR.intPtr() + qpnzcnt_p = CR.intPtr() + nqconstr_p = CR.intPtr() + qrhscnt_p = CR.intPtr() + qlcnt_p = CR.intPtr() + qgcnt_p = CR.intPtr() + quadnzcnt_p = CR.intPtr() + linnzcnt_p = CR.intPtr() + nindconstr_p = CR.intPtr() + indrhscnt_p = CR.intPtr() + indnzcnt_p = CR.intPtr() + indcompcnt_p = CR.intPtr() + indlcnt_p = CR.intPtr() + indecnt_p = CR.intPtr() + indgcnt_p = CR.intPtr() + maxcoef_p = CR.doublePtr() + mincoef_p = CR.doublePtr() + minrhs_p = CR.doublePtr() + maxrhs_p = CR.doublePtr() + minrng_p = CR.doublePtr() + maxrng_p = CR.doublePtr() + minobj_p = CR.doublePtr() + maxobj_p = CR.doublePtr() + minlb_p = CR.doublePtr() + maxub_p = CR.doublePtr() + minqcoef_p = CR.doublePtr() + maxqcoef_p = CR.doublePtr() + minqcq_p = CR.doublePtr() + maxqcq_p = CR.doublePtr() + minqcl_p = CR.doublePtr() + maxqcl_p = CR.doublePtr() + minqcr_p = CR.doublePtr() + maxqcr_p = CR.doublePtr() + minind_p = CR.doublePtr() + maxind_p = CR.doublePtr() + minindrhs_p = CR.doublePtr() + maxindrhs_p = CR.doublePtr() + minlazy_p = CR.doublePtr() + maxlazy_p = CR.doublePtr() + minlazyrhs_p = CR.doublePtr() + maxlazyrhs_p = CR.doublePtr() + minucut_p = CR.doublePtr() + maxucut_p = CR.doublePtr() + minucutrhs_p = CR.doublePtr() + maxucutrhs_p = CR.doublePtr() + nsos_p = CR.intPtr() + nsos1_p = CR.intPtr() + sos1nmem_p = CR.intPtr() + sos1type_p = CR.intPtr() + nsos2_p = CR.intPtr() + sos2nmem_p = CR.intPtr() + sos2type_p = CR.intPtr() + lazyrhscnt_p = CR.intPtr() + lazygcnt_p = CR.intPtr() + lazylcnt_p = CR.intPtr() + lazyecnt_p = CR.intPtr() + lazycnt_p = CR.intPtr() + lazynzcnt_p = CR.intPtr() + ucutrhscnt_p = CR.intPtr() + ucutgcnt_p = CR.intPtr() + ucutlcnt_p = CR.intPtr() + ucutecnt_p = CR.intPtr() + ucutcnt_p = CR.intPtr() + ucutnzcnt_p = CR.intPtr() + npwl_p = CR.intPtr() + npwlbreaks_p = CR.intPtr() + status = CR.CPXEgetprobstats(env, lp, + objs_p, + rows_p, + cols_p, + objcnt_p, + rhscnt_p, + nzcnt_p, + ecnt_p, + gcnt_p, + lcnt_p, + rngcnt_p, + ncnt_p, + fcnt_p, + xcnt_p, + bcnt_p, + ocnt_p, + bicnt_p, + icnt_p, + scnt_p, + sicnt_p, + qpcnt_p, + qpnzcnt_p, + nqconstr_p, + qrhscnt_p, + qlcnt_p, + qgcnt_p, + quadnzcnt_p, + linnzcnt_p, + nindconstr_p, + indrhscnt_p, + indnzcnt_p, + indcompcnt_p, + indlcnt_p, + indecnt_p, + indgcnt_p, + maxcoef_p, + mincoef_p, + minrhs_p, + maxrhs_p, + minrng_p, + maxrng_p, + minobj_p, + maxobj_p, + minlb_p, + maxub_p, + minqcoef_p, + maxqcoef_p, + minqcq_p, + maxqcq_p, + minqcl_p, + maxqcl_p, + minqcr_p, + maxqcr_p, + minind_p, + maxind_p, + minindrhs_p, + maxindrhs_p, + minlazy_p, + maxlazy_p, + minlazyrhs_p, + maxlazyrhs_p, + minucut_p, + maxucut_p, + minucutrhs_p, + maxucutrhs_p, + nsos_p, + nsos1_p, + sos1nmem_p, + sos1type_p, + nsos2_p, + sos2nmem_p, + sos2type_p, + lazyrhscnt_p, + lazygcnt_p, + lazylcnt_p, + lazyecnt_p, + lazycnt_p, + lazynzcnt_p, + ucutrhscnt_p, + ucutgcnt_p, + ucutlcnt_p, + ucutecnt_p, + ucutcnt_p, + ucutnzcnt_p, + npwl_p, + npwlbreaks_p) + check_status(env, status) + return ProbStats( + objs_p.value(), + rows_p.value(), + cols_p.value(), + objcnt_p.value(), + rhscnt_p.value(), + nzcnt_p.value(), + ecnt_p.value(), + gcnt_p.value(), + lcnt_p.value(), + rngcnt_p.value(), + ncnt_p.value(), + fcnt_p.value(), + xcnt_p.value(), + bcnt_p.value(), + ocnt_p.value(), + bicnt_p.value(), + icnt_p.value(), + scnt_p.value(), + sicnt_p.value(), + qpcnt_p.value(), + qpnzcnt_p.value(), + nqconstr_p.value(), + qrhscnt_p.value(), + qlcnt_p.value(), + qgcnt_p.value(), + quadnzcnt_p.value(), + linnzcnt_p.value(), + nindconstr_p.value(), + indrhscnt_p.value(), + indnzcnt_p.value(), + indcompcnt_p.value(), + indlcnt_p.value(), + indecnt_p.value(), + indgcnt_p.value(), + maxcoef_p.value(), + mincoef_p.value(), + minrhs_p.value(), + maxrhs_p.value(), + minrng_p.value(), + maxrng_p.value(), + minobj_p.value(), + maxobj_p.value(), + minlb_p.value(), + maxub_p.value(), + minqcoef_p.value(), + maxqcoef_p.value(), + minqcq_p.value(), + maxqcq_p.value(), + minqcl_p.value(), + maxqcl_p.value(), + minqcr_p.value(), + maxqcr_p.value(), + minind_p.value(), + maxind_p.value(), + minindrhs_p.value(), + maxindrhs_p.value(), + minlazy_p.value(), + maxlazy_p.value(), + minlazyrhs_p.value(), + maxlazyrhs_p.value(), + minucut_p.value(), + maxucut_p.value(), + minucutrhs_p.value(), + maxucutrhs_p.value(), + nsos_p.value(), + nsos1_p.value(), + sos1nmem_p.value(), + sos1type_p.value(), + nsos2_p.value(), + sos2nmem_p.value(), + sos2type_p.value(), + lazyrhscnt_p.value(), + lazygcnt_p.value(), + lazylcnt_p.value(), + lazyecnt_p.value(), + lazycnt_p.value(), + lazynzcnt_p.value(), + ucutrhscnt_p.value(), + ucutgcnt_p.value(), + ucutlcnt_p.value(), + ucutecnt_p.value(), + ucutcnt_p.value(), + ucutnzcnt_p.value(), + npwl_p.value(), + npwlbreaks_p.value())
+ + +# get histogram of non-zero row/column counts + + +
+[docs] +def gethist(env, lp, key): + if key == 'r': + space = CR.CPXXgetnumcols(env, lp) + 1 + else: + key = 'c' + space = CR.CPXXgetnumrows(env, lp) + 1 + hist = _safeIntArray(space) + status = CR.CPXEgethist(env, lp, key, hist) + check_status(env, status) + return LAU.array_to_list(hist, space)
+ + +# get solution quality metrics + + +
+[docs] +def getqualitymetrics(env, lp, soln): + space = 26 + data = _safeDoubleArray(space) + ispace = 10 + idata = _safeIntArray(ispace) + status = CR.CPXEgetqualitymetrics(env, lp, soln, data, idata) + check_status(env, status) + return [LAU.array_to_list(idata, ispace), + LAU.array_to_list(data, space)]
+ + +
+[docs] +def showquality(env, lp, soln): + status = CR.CPXEshowquality(env, lp, soln) + check_status(env, status)
+ + +# ########## Expert Callback BEGIN ######################################## + + +
+[docs] +def setgenericcallbackfunc(env, lp, contextmask, cbhandle): + # NOTE: The cbhandle that is passed in here, is the Cplex instance that + # installs the callback. We do not increment the reference count + # for this on purpose: First of all, it is not necessary since the + # lifetime of env/lp is controled by the lifetime of this instance. + # Hence any reference the callable library stores is valid as long + # as it may be used. + # Second, in the destructor of the Cplex class we attempt to set + # the callback to (0, None). This may fail with + # CPXERR_NOT_ONE_PROBLEM. If we had incremented the reference count + # we would have to figure out whether the attempt to unset got as + # far as decrementing the reference count or failed earlier. + status = CR.CPXXcallbacksetfunc(env, lp, contextmask, cbhandle) + check_status(env, status)
+ + + +
+[docs] +def callbackgetinfoint(contextptr, which): + data = CR.intPtr() + status = CR.CPXXcallbackgetinfoint(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackgetinfolong(contextptr, which): + data = CR.cpxlongPtr() + status = CR.CPXXcallbackgetinfolong(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackgetinfodbl(contextptr, which): + data = CR.doublePtr() + status = CR.CPXXcallbackgetinfodbl(contextptr, [which, data]) + check_status(None, status) + return data.value()
+ + + +
+[docs] +def callbackabort(contextptr): + CR.CPXXcallbackabort(contextptr)
+ + +
+[docs] +def callbackcandidateispoint(contextptr): + bounded = CR.intPtr() + status = CR.CPXXcallbackcandidateispoint(contextptr, bounded) + check_status(None, status) + return bounded.value() != 0
+ + +
+[docs] +def callbackgetcandidatepoint(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetcandidatepoint(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackcandidateisray(contextptr): + ray = CR.intPtr() + status = CR.CPXXcallbackcandidateisray(contextptr, ray) + check_status(None, status) + return ray.value() != 0
+ + +
+[docs] +def callbackgetcandidateray(contextptr, begin, end): + raylen = _rangelen(begin, end) + ray = _safeDoubleArray(raylen) + status = CR.CPXXcallbackgetcandidateray(contextptr, ray, begin, end) + check_status(None, status) + return LAU.array_to_list(ray, raylen)
+ + +
+[docs] +def callbackgetcandidateobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetcandidatepoint(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + + +
+[docs] +def callbackgetrelaxationpoint(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetrelaxationpoint(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackgetrelaxationpointobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetrelaxationpoint(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + +
+[docs] +def callbackgetrelaxationstatus(contextptr, flags): + nodelpstat = CR.intPtr() + status = CR.CPXXcallbackgetrelaxationstatus(contextptr, nodelpstat, flags) + check_status(None, status) + return nodelpstat.value()
+ + +
+[docs] +def callbackmakebranch(contextptr, ind, lu, bd, rhs, sense, matbeg, + matind, matval, nodeest): + seqnum = CR.cpxlongPtr() + with LAU.int_c_array(ind) as c_ind,\ + LAU.double_c_array(bd) as c_bd, \ + LAU.double_c_array(rhs) as c_rhs, \ + LAU.long_c_array(matbeg) as c_matbeg, \ + LAU.int_c_array(matind) as c_matind, \ + LAU.double_c_array(matval) as c_matval: + status = CR.CPXXcallbackmakebranch(contextptr, len(ind), + c_ind, lu, c_bd, + len(matbeg), len(matind), + c_rhs, sense, + c_matbeg, c_matind, c_matval, + nodeest, seqnum) + check_status(None, status) + return seqnum.value()
+ + +
+[docs] +def callbackprunenode(contextptr): + status = CR.CPXXcallbackprunenode(contextptr) + check_status(None, status)
+ + +
+[docs] +def callbackexitcutloop(contextptr): + status = CR.CPXXcallbackexitcutloop(contextptr) + check_status(None, status)
+ + +
+[docs] +def callbackgetincumbent(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetincumbent(contextptr, x, begin, end, None) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetincumbentobj(contextptr): + obj_p = CR.doublePtr() + status = CR.CPXXcallbackgetincumbent(contextptr, None, 0, -1, obj_p) + check_status(None, status) + return obj_p.value()
+ + + +
+[docs] +def callbackgetlocallb(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetlocallb(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetlocalub(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetlocalub(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackgetgloballb(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetgloballb(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + + +
+[docs] +def callbackgetglobalub(contextptr, begin, end): + xlen = _rangelen(begin, end) + x = _safeDoubleArray(xlen) + status = CR.CPXXcallbackgetglobalub(contextptr, x, begin, end) + check_status(None, status) + return LAU.array_to_list(x, xlen)
+ + +
+[docs] +def callbackpostheursoln(contextptr, cnt, ind, val, obj, strategy): + status = CR.CPXXcallbackpostheursoln(contextptr, cnt, + LAU.int_list_to_array(ind), + LAU.double_list_to_array(val), + obj, strategy) + check_status(None, status)
+ + + +
+[docs] +def callbackaddusercuts(contextptr, rcnt, nzcnt, rhs, sense, rmat, + cutmanagement, local): + with LAU.double_c_array(rhs) as c_rhs, \ + LAU.int_c_array(cutmanagement) as c_cutmanagement, \ + LAU.int_c_array(local) as c_local: + status = CR.CPXXcallbackaddusercuts(contextptr, rcnt, nzcnt, c_rhs, + sense, rmat, + c_cutmanagement, c_local) + check_status(None, status)
+ + + +
+[docs] +def callbackrejectcandidate(contextptr, rcnt, nzcnt, rhs, sense, rmat): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXcallbackrejectcandidate(contextptr, rcnt, nzcnt, c_rhs, + sense, rmat) + check_status(None, status)
+ + +
+[docs] +def callbackrejectcandidatelocal(contextptr, rcnt, nzcnt, rhs, sense, rmat): + with LAU.double_c_array(rhs) as c_rhs: + status = CR.CPXXcallbackrejectcandidatelocal(contextptr, rcnt, nzcnt, + c_rhs, sense, rmat) + check_status(None, status)
+ + +# ########## Expert Callback END ########################################## + +# ########## Modeling Assistance Callback BEGIN ########################### + +
+[docs] +def modelasstcallbacksetfunc(env, lp, cbhandle): + # See note in setgenericcallbackfunc (the same applies here). + status = CR.CPXXmodelasstcallbacksetfunc(env, lp, cbhandle) + check_status(env, status)
+ + +# ########## Modeling Assistance Callback END ############################# +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_pwl.html b/docs/_modules/cplex/_internal/_pwl.html new file mode 100644 index 0000000..cad08fb --- /dev/null +++ b/docs/_modules/cplex/_internal/_pwl.html @@ -0,0 +1,378 @@ + + + + + + + cplex._internal._pwl — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._pwl

+# --------------------------------------------------------------------------
+# File: _pwl.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Piecewise Linear API"""
+from ._baseinterface import BaseInterface
+from . import _procedural as _proc
+from . import _aux_functions as _aux
+
+
+
+[docs] +class PWLConstraintInterface(BaseInterface): + """Methods for adding, querying, and modifying PWL constraints. + + A PWL constraint describes a piecewise linear relationship between + two variables: vary=pwl(varx). The PWL constraint is described by + specifying the index of the vary and varx variables involved and by + providing the breakpoints of the PWL function (specified by the + (breakx[i],breaky[i]) coordinate pairs). Before the first segment of + the PWL function there may be a half-line; its slope is specified by + preslope. After the last segment of the the PWL function there may + be a half-line; its slope is specified by postslope. Two consecutive + breakpoints may have the same x coordinate, in such cases there is a + discontinuity in the PWL function. Three consecutive breakpoints + may not have the same x coordinate. + """ + +
+[docs] + def __init__(self, cpx): + """Creates a new PWLConstraintInterface. + + The PWL constraint interface is exposed by the top-level `Cplex` + class as `Cplex.pwl_constraints`. This constructor is not meant + to be used externally. + """ + super().__init__(cplex=cpx, getindexfunc=_proc.getpwlindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of PWL constraints in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.pwl_constraints.get_num() + 0 + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + """ + return _proc.getnumpwl(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add(self, vary, varx, preslope, postslope, breakx, breaky, name=""): + """Adds a PWL constraint to the problem. + + vary: the index of the 'y' variable in the vary=pwl(varx) + function. + + varx: the index of the 'x' variable in the vary=pwl(varx) + function. + + preslope: before the first segment of the PWL function there is + a half-line; its slope is specified by preslope. + + postslope: after the last segment of the the PWL function there + is a half-line; its slope is specified by postslope. + + breakx: A list containing the indices of the 'x' variables + involved. + + breaky: A list containing the indices of the 'y' variables + involved. + + name: the name of the PWL constraint; defaults to the empty + string. + + Returns the index of the PWL constraint. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + """ + # FIXME: Should we provide defaults for any of the other arguments? + yidx = self._cplex.variables._conv(vary) + xidx = self._cplex.variables._conv(varx) + arg_list = [breakx, breaky] + nbreaks = _aux.max_arg_length(arg_list) + _aux.validate_arg_lengths( + arg_list, + allow_empty=False, + extra_msg=": breakx, breaky" + ) + + def _add(vary, varx, preslope, postslope, breakx, breaky, name): + _proc.addpwl(self._env._e, self._cplex._lp, + vary, varx, + preslope, postslope, + nbreaks, breakx, breaky, + name) + return self._add_single(self.get_num, _add, yidx, xidx, + preslope, postslope, breakx, breaky, + name)
+ + +
+[docs] + def delete(self, *args): + """Deletes PWL constraints from the problem. + + There are four forms by which pwl_constraints.delete may be + called. + + pwl_constraints.delete() + deletes all PWL constraints from the problem. + + pwl_constraints.delete(i) + i must be a PWL constraint name or index. Deletes the PWL + constraint whose index or name is i. + + pwl_constraints.delete(seq) + seq must be a sequence of PWL constraint names or indices. + Deletes the PWL constraints with names or indices contained + within s. Equivalent to [pwl_constraints.delete(i) for i in s]. + + pwl_constraints.delete(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Deletes the PWL constraints with indices between begin + and end, inclusive of end. Equivalent to + pwl_constraints.delete(range(begin, end + 1)). This will give + the best performance when deleting batches of PWL constraints. + + See CPXdelpwl in the Callable Library Reference Manual for more + detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_num() + 1 + >>> c.pwl_constraints.delete(idx) + >>> c.pwl_constraints.get_num() + 0 + """ + def _delete(begin, end=None): + _proc.delpwl(self._env._e, self._cplex._lp, begin, end) + _aux.delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of PWL constraints. + + May be called by four forms. + + pwl_constraints.get_names() + return the names of all PWL constraints in the problem. + + pwl_constraints.get_names(i) + i must be a PWL constraint name or index. Returns the name of + PWL constraint i. + + pwl_constraints.get_names(seq) + seq must be a sequence of PWL constraint names or indices. + Returns the names of PWL constraints with names or indices in + s. Equivalent to + [pwl_constraints.get_names(i) for i in s] + + pwl_constraints.get_names(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Returns the names of PWL constraints with indices + between begin and end, inclusive of end. Equivalent to + pwl_constraints.get_names(range(begin, end + 1)) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_names(idx) + 'pwl1' + """ + def _get_names(idx): + return _proc.getpwlname( + self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg( + _get_names, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_definitions(self, *args): + """Returns the definitions of a set of PWL constraints. + + Returns a list of PWL definitions, where each definition is a + list containing the following components: vary, varx, preslope, + postslope, breakx, breaky (see `add`). + + May be called by four forms. + + pwl_constraints.get_definitions() + return the definitions of all PWL constraints in the + problem. + + pwl_constraints.get_definitions(i) + i must be a PWL constraint name or index. Returns the + definition of PWL constraint i. + + pwl_constraints.get_definitions(seq) + seq must be a sequence of PWL constraint names or indices. + Returns the definitions of PWL constraints with names or + indices in s. Equivalent to + [pwl_constraints.get_definitions(i) for i in s] + + pwl_constraints.get_definitions(begin, end) + begin and end must be PWL constraint indices or PWL constraint + names. Returns the definitions of PWL constraints with indices + between begin and end, inclusive of end. Equivalent to + pwl_constraints.get_definitions(list(range(begin, end + 1))) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['y', 'x']) + >>> idx = c.pwl_constraints.add(vary='y', varx='x', + ... preslope=0.5, postslope=2.0, + ... breakx=[0.0, 1.0, 2.0], + ... breaky=[0.0, 1.0, 4.0], + ... name='pwl1') + >>> c.pwl_constraints.get_definitions(idx) + [0, 1, 0.5, 2.0, [0.0, 1.0, 2.0], [0.0, 1.0, 4.0]] + """ + def _getpwl(idx): + return _proc.getpwl(self._env._e, self._cplex._lp, idx) + return _aux.apply_freeform_one_arg(_getpwl, self._conv, + self.get_num(), args)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_solutionstrategyenum.html b/docs/_modules/cplex/_internal/_solutionstrategyenum.html new file mode 100644 index 0000000..ec09fec --- /dev/null +++ b/docs/_modules/cplex/_internal/_solutionstrategyenum.html @@ -0,0 +1,137 @@ + + + + + + + cplex._internal._solutionstrategyenum — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._solutionstrategyenum

+# --------------------------------------------------------------------------
+# Version 22.1.2
+# --------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2000, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""A module for the SolutionStrategy class."""
+from . import _constantsenum
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class SolutionStrategy(ConstantClass): + """The different types of solutions that can submitted to + `cplex.callbacks.Context.post_heuristic_solution()`. + + For further details about these values, see the reference manual of + the CPLEX Callable Library (C API) particularly, the enumeration + `CPXCALLBACKSOLUTIONSTRATEGY <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/enum/CPXCALLBACKSOLUTIONSTRATEGY.html>`_. + """ + + no_check = _constantsenum.CPXCALLBACKSOLUTION_NOCHECK + """See CPXCALLBACKSOLUTION_NOCHECK in the C API.""" + + check_feasible = _constantsenum.CPXCALLBACKSOLUTION_CHECKFEAS + """See CPXCALLBACKSOLUTION_CHECKFEAS in the C API.""" + + propagate = _constantsenum.CPXCALLBACKSOLUTION_PROPAGATE + """See CPXCALLBACKSOLUTION_PROPAGATE in the C API.""" + + solve = _constantsenum.CPXCALLBACKSOLUTION_SOLVE + """See CPXCALLBACKSOLUTION_SOLVE in the C API."""
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/_internal/_subinterfaces.html b/docs/_modules/cplex/_internal/_subinterfaces.html new file mode 100644 index 0000000..c66d6b1 --- /dev/null +++ b/docs/_modules/cplex/_internal/_subinterfaces.html @@ -0,0 +1,10242 @@ + + + + + + + cplex._internal._subinterfaces — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex._internal._subinterfaces

+# --------------------------------------------------------------------------
+# File: _subinterfaces.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Sub-interfaces of the CPLEX API."""
+from contextlib import closing, contextmanager
+from io import StringIO
+import numbers
+
+from . import _constants
+from . import _procedural as CPX_PROC
+from ._baseinterface import BaseInterface
+from ._multiobjsoln import MultiObjSolnInterface
+from ._matrices import (SparsePair, SparseTriple, _HBMatrix,
+                        unpack_pair, unpack_triple)
+from ._aux_functions import (apply_freeform_one_arg,
+                             apply_freeform_two_args,
+                             max_arg_length,
+                             validate_arg_lengths, apply_pairs,
+                             delete_set_by_range,
+                             make_group, _group,
+                             init_list_args, listify,
+                             unzip, convert_sequence)
+from ..exceptions import CplexSolverError, WrongNumberOfArgumentsError
+from ..constant_class import ConstantClass
+
+
+
+[docs] +class Histogram(): + """A class to retrieve histogram data of the columns or rows of the + linear constraint matrix. + + See `VariablesInterface.get_histogram()` and + `LinearConstraintInterface.get_histogram()`. + """ + +
+[docs] + def __init__(self, c, key): + self.__hist = CPX_PROC.gethist(c._env._e, c._lp, key[0]) + self.orientation = key
+ + +
+[docs] + def __getitem__(self, key): + """Returns the number of columns/rows with a given nonzero count.""" + if isinstance(key, int): + if key < 0: + raise IndexError("histogram keys must be non-negative") + return self.__hist[key] + if isinstance(key, slice): + start, stop, step = key.start, key.stop, key.step + if start is None: + start = 0 + if stop is None or stop > len(self.__hist): + stop = len(self.__hist) + if step is None: + step = 1 + if start < 0: + raise IndexError("histogram keys must be non-negative") + if stop < 0: + raise IndexError("histogram keys must be non-negative") + return [self.__hist[i] for i in range(start, stop, step)] + raise TypeError("key must be an integer or a slice")
+ + +
+[docs] + def __str__(self): + """Returns a string containing a histogram in human readable form.""" + if self.orientation[0] == "c": + hdr0 = "Column counts (excluding fixed variables):" + hdr1 = " Nonzero Count:" + hdr2 = "Number of Columns:" + else: + hdr0 = "Row counts (excluding fixed variables):" + hdr1 = " Nonzero Count:" + hdr2 = "Number of Rows:" + rng = len(self.__hist) + maxhist = max(self.__hist) + length = max(2, + len(str(rng)), + len(str(maxhist))) + 2 + perline = max((75 - len(hdr1)) / length, 1) + ret = "" + i = 0 + needs_hdr0 = True + while True: + if i >= rng: + break + for j in range(i, rng): + if self.__hist[j] != 0: + break + else: + break + if needs_hdr0: + ret = ret + hdr0 + "\n\n" + needs_hdr0 = False + ret = ret + hdr1 + k = 0 + for j in range(i, rng): + if k >= perline: + break + if self.__hist[j] == 0: + continue + ret = ret + str("%*d" % (length, j)) + k += 1 + + ret = ret + "\n" + ret = ret + hdr2 + k = 0 + jj = i + for j in range(i, rng): + if k >= perline: + break + jj += 1 + if self.__hist[j] == 0: + continue + ret = ret + str("%*d" % (length, self.__hist[j])) + k += 1 + ret = ret + "\n\n" + i = jj + return ret
+
+ + + +
+[docs] +class AdvancedVariablesInterface(BaseInterface): + """Methods for advanced operations on variables.""" + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedVariablesInterface. + + The advanced variables interface is exposed by the top-level + `Cplex` class as Cplex.variables.advanced. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def protect(self, *args): + """Prevents variables from being aggregated during presolve. + + protect may be called with either a single variable identifier + or a sequence of variable identifiers. A variable identifier + is either an index or a name of a variable. + + Note + Subsequent calls to protect will replace previously protected + variables with the new set of protected variables. + + Note + If presolve can fix a variable to a value, it will be removed + from the problem even if it has been protected. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["a", "b", "c", "d"]) + >>> c.variables.advanced.protect("a") + >>> c.variables.advanced.protect(["b", "d"]) + """ + a = listify(self._cplex.variables._conv(args[0])) + CPX_PROC.copyprotected(self._env._e, self._cplex._lp, a)
+ + +
+[docs] + def get_protected(self): + """Returns the currently protected variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["a", "b", "c", "d"]) + >>> c.variables.advanced.protect("a") + >>> c.variables.advanced.get_protected() + [0] + >>> c.variables.advanced.protect(["b", "d"]) + >>> c.variables.advanced.get_protected() + [1, 3] + """ + return CPX_PROC.getprotected(self._env._e, self._cplex._lp)
+ + +
+[docs] + def tighten_lower_bounds(self, *args): + """Tightens the lower bounds on the specified variables. + + There are two forms by which + variables.advanced.tighten_lower_bounds may be called. + + variables.advanced.tighten_lower_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the lower bound of the variable whose index + or name is i to lb. + + variables.advanced.tighten_lower_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the lower bound of the specified variables to + the corresponding values. Equivalent to + [variables.advanced.tighten_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.advanced.tighten_lower_bounds(0, 1.0) + >>> c.variables.get_lower_bounds() + [1.0, 0.0, 0.0] + >>> c.variables.advanced.tighten_lower_bounds([(2, 3.0), ("x1", -1.0)]) + >>> c.variables.get_lower_bounds() + [1.0, -1.0, 3.0] + """ + def tlb(a, b): + CPX_PROC.tightenbds(self._env._e, self._cplex._lp, a, + 'L' * len(a), b) + apply_pairs(tlb, self._cplex.variables._conv, *args)
+ + +
+[docs] + def tighten_upper_bounds(self, *args): + """Tightens the upper bounds on the specified variables. + + There are two forms by which + variables.advanced.tighten_upper_bounds may be called. + + variables.advanced.tighten_upper_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the upper bound of the variable whose index + or name is i to lb. + + variables.advanced.tighten_upper_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the upper bound of the specified variables to + the corresponding values. Equivalent to + [variables.advanced.tighten_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.advanced.tighten_upper_bounds(0, 1.0) + >>> c.variables.advanced.tighten_upper_bounds([(2, 3.0), ("x1", 10.0)]) + >>> c.variables.get_upper_bounds() + [1.0, 10.0, 3.0] + """ + def tub(a, b): + CPX_PROC.tightenbds(self._env._e, self._cplex._lp, a, + 'U' * len(a), b) + apply_pairs(tub, self._cplex.variables._conv, *args)
+
+ + + +
+[docs] +class VarTypes(ConstantClass): + """Constants defining variable types + + For a definition of each type, see those topics in the CPLEX User's + Manual. + """ + continuous = _constants.CPX_CONTINUOUS + binary = _constants.CPX_BINARY + integer = _constants.CPX_INTEGER + semi_integer = _constants.CPX_SEMIINT + semi_continuous = _constants.CPX_SEMICONT
+ + + +
+[docs] +class VariablesInterface(BaseInterface): + """Methods for adding, querying, and modifying variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> # default values for lower_bounds are 0.0 + >>> c.variables.get_lower_bounds() + [0.0, 0.0, 0.0] + >>> # values can be set either one at a time or many at a time + >>> c.variables.set_lower_bounds(0, 1.0) + >>> c.variables.set_lower_bounds([("x1", -1.0), (2, 3.0)]) + >>> # values can be queried as a range + >>> c.variables.get_lower_bounds(0, "x1") + [1.0, -1.0] + >>> # values can be queried as a sequence in arbitrary order + >>> c.variables.get_lower_bounds(["x1", "x2", 0]) + [-1.0, 3.0, 1.0] + >>> # can query the number of variables + >>> c.variables.get_num() + 3 + >>> c.variables.set_types(0, c.variables.type.binary) + >>> c.variables.get_num_binary() + 1 + """ + + type = VarTypes() + """See `VarTypes()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new VariablesInterface. + + The variables interface is exposed by the top-level `Cplex` class + as `Cplex.variables`. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getcolindex) + self.advanced = AdvancedVariablesInterface(self) + """See `AdvancedVariablesInterface()` """
+ + +
+[docs] + def get_num(self): + """Returns the number of variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.get_num() + 3 + """ + return CPX_PROC.getnumcols(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_integer(self): + """Returns the number of integer variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.get_num_integer() + 1 + """ + return CPX_PROC.getnumint(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_binary(self): + """Returns the number of binary variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.binary, t.integer]) + >>> c.variables.get_num_binary() + 1 + """ + return CPX_PROC.getnumbin(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_semicontinuous(self): + """Returns the number of semi-continuous variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer]) + >>> c.variables.get_num_semicontinuous() + 1 + """ + return CPX_PROC.getnumsemicont(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_semiinteger(self): + """Returns the number of semi-integer variables in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer]) + >>> c.variables.get_num_semiinteger() + 2 + """ + return CPX_PROC.getnumsemiint(self._env._e, self._cplex._lp)
+ + + def _add(self, obj, lb, ub, types, names, columns): + """non-public""" + if not isinstance(types, str): + types = "".join(types) + arg_list = [obj, lb, ub, types, names, columns] + num_new_cols = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": obj, lb, ub, types, names, columns" + ) + num_old_cols = self.get_num() + if columns == []: + CPX_PROC.newcols(self._env._e, self._cplex._lp, obj, lb, ub, + types, names) + else: + with CPX_PROC.chbmatrix(columns, self._cplex._env_lp_ptr, + 1) as (cmat, nnz): + CPX_PROC.addcols(self._env._e, self._cplex._lp, + num_new_cols, nnz, obj, + cmat, lb, ub, names) + if types != "": + CPX_PROC.chgctype( + self._env._e, self._cplex._lp, + list(range(num_old_cols, num_old_cols + num_new_cols)), + types) + +
+[docs] + def add(self, obj=None, lb=None, ub=None, types="", names=None, + columns=None): + """Adds variables and related data to the problem. + + variables.add accepts the keyword arguments obj, lb, ub, + types, names, and columns. + + If more than one argument is specified, all arguments must + have the same length. + + obj is a list of floats specifying the linear objective + coefficients of the variables. + + lb is a list of floats specifying the lower bounds on the + variables. + + ub is a list of floats specifying the upper bounds on the + variables. + + types must be either a list of single-character strings or a + string containing the types of the variables. + + Note + If types is specified, the problem type will be a MIP, even if + all variables are specified to be continuous. + + names is a list of strings. + + columns may be either a list of sparse vectors or a matrix in + list-of-lists format. + + Note + The entries of columns must not contain duplicate indices. + If an entry of columns references a row more than once, + either by index, name, or a combination of index and name, + an exception will be raised. + + Returns an iterator containing the indices of the added + variables. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=["c0", "c1", "c2"]) + >>> indices = c.variables.add( + ... obj=[1.0, 2.0, 3.0], + ... types=[c.variables.type.integer] * 3) + >>> indices = c.variables.add( + ... obj=[1.0, 2.0, 3.0], + ... lb=[-1.0, 1.0, 0.0], + ... ub=[100.0, cplex.infinity, cplex.infinity], + ... types=[c.variables.type.integer] * 3, + ... names=["0", "1", "2"], + ... columns=[cplex.SparsePair(ind=['c0', 2], + ... val=[1.0, -1.0]), + ... [['c2'],[2.0]], + ... cplex.SparsePair(ind=[0, 1], + ... val=[3.0, 4.0])]) + >>> c.variables.get_lower_bounds() + [0.0, 0.0, 0.0, -1.0, 1.0, 0.0] + >>> c.variables.get_cols("1") + SparsePair(ind = [2], val = [2.0]) + """ + obj, lb, ub, names, columns = init_list_args(obj, lb, ub, names, + columns) + return self._add_iter(self.get_num, self._add, + obj, lb, ub, types, names, columns)
+ + +
+[docs] + def delete(self, *args): + """Deletes variables from the problem. + + There are four forms by which variables.delete may be called. + + variables.delete() + deletes all variables from the problem. + + variables.delete(i) + i must be a variable name or index. Deletes the variable + whose index or name is i. + + variables.delete(s) + s must be a sequence of variable names or indices. Deletes + the variables with names or indices contained within s. + Equivalent to [variables.delete(i) for i in s]. + + variables.delete(begin, end) + begin and end must be variable indices or variable names. + Deletes the variables with indices between begin and end, + inclusive of end. Equivalent to + variables.delete(range(begin, end + 1)). This will give the + best performance when deleting batches of variables. + + See `CPXdelcols <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/delcols.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.delete(8) + >>> c.variables.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.variables.delete("1", 3) + >>> c.variables.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.variables.delete([2, "0", 5]) + >>> c.variables.get_names() + ['4', '6', '7'] + >>> c.variables.delete() + >>> c.variables.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delcols(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def set_lower_bounds(self, *args): + """Sets the lower bound for a variable or set of variables. + + There are two forms by which variables.set_lower_bounds may be + called. + + variables.set_lower_bounds(i, lb) + i must be a variable name or index and lb must be a real + number. Sets the lower bound of the variable whose index + or name is i to lb. + + variables.set_lower_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lb) pairs, each + of which consists of a variable name or index and a real + number. Sets the lower bound of the specified variables to + the corresponding values. Equivalent to + [variables.set_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.set_lower_bounds(0, 1.0) + >>> c.variables.get_lower_bounds() + [1.0, 0.0, 0.0] + >>> c.variables.set_lower_bounds([(2, 3.0), ("x1", -1.0)]) + >>> c.variables.get_lower_bounds() + [1.0, -1.0, 3.0] + """ + def setlb(a, b): + CPX_PROC.chgbds(self._env._e, self._cplex._lp, a, "L" * len(a), b) + apply_pairs(setlb, self._conv, *args)
+ + +
+[docs] + def set_upper_bounds(self, *args): + """Sets the upper bound for a variable or set of variables. + + There are two forms by which variables.set_upper_bounds may be + called. + + variables.set_upper_bounds(i, ub) + i must be a variable name or index and ub must be a real + number. Sets the upper bound of the variable whose index + or name is i to ub. + + variables.set_upper_bounds(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, ub) pairs, each + of which consists of a variable name or index and a real + number. Sets the upper bound of the specified variables to + the corresponding values. Equivalent to + [variables.set_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1", "x2"]) + >>> c.variables.set_upper_bounds(0, 1.0) + >>> c.variables.set_upper_bounds([("x1", 10.0), (2, 3.0)]) + >>> c.variables.get_upper_bounds() + [1.0, 10.0, 3.0] + """ + def setub(a, b): + CPX_PROC.chgbds(self._env._e, self._cplex._lp, a, "U" * len(a), b) + apply_pairs(setub, self._conv, *args)
+ + +
+[docs] + def set_names(self, *args): + """Sets the name of a variable or set of variables. + + There are two forms by which variables.set_names may be + called. + + variables.set_names(i, name) + i must be a variable name or index and name must be a + string. + + variables.set_names(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, name) pairs, + each of which consists of a variable name or index and a + string. Sets the name of the specified variables to the + corresponding strings. Equivalent to + [variables.set_names(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer]) + >>> c.variables.set_names(0, "first") + >>> c.variables.set_names([(2, "third"), (1, "second")]) + >>> c.variables.get_names() + ['first', 'second', 'third'] + """ + def setnames(a, b): + CPX_PROC.chgcolname(self._env._e, self._cplex._lp, a, b) + apply_pairs(setnames, self._conv, *args)
+ + +
+[docs] + def set_types(self, *args): + """Sets the type of a variable or set of variables. + + There are two forms by which variables.set_types may be + called. + + variables.set_types(i, type) + i must be a variable name or index and name must be a + single-character string. + + variables.set_types(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, type) pairs, + each of which consists of a variable name or index and a + single-character string. Sets the type of the specified + variables to the corresponding strings. Equivalent to + [variables.set_types(pair[0], pair[1]) for pair in seq_of_pairs]. + + Note + If the types are set, the problem will be treated as a MIP, + even if all variable types are continuous. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(5)]) + >>> c.variables.set_types(0, c.variables.type.continuous) + >>> c.variables.set_types([("1", c.variables.type.integer), + ("2", c.variables.type.binary), + ("3", c.variables.type.semi_continuous), + ("4", c.variables.type.semi_integer)]) + >>> c.variables.get_types() + ['C', 'I', 'B', 'S', 'N'] + >>> c.variables.type[c.variables.get_types(0)] + 'continuous' + """ + if len(args) == 2: + indices = [self._conv(args[0])] + xctypes = args[1] + elif len(args) == 1: + indices, xctypes = unzip(args[0]) + indices = self._conv(indices) + xctypes = "".join(xctypes) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgctype(self._env._e, self._cplex._lp, indices, xctypes)
+ + +
+[docs] + def get_lower_bounds(self, *args): + """Returns the lower bounds on variables from the problem. + + There are four forms by which variables.get_lower_bounds may be called. + + variables.get_lower_bounds() + return the lower bounds on all variables from the problem. + + variables.get_lower_bounds(i) + i must be a variable name or index. Returns the lower + bound on the variable whose index or name is i. + + variables.get_lower_bounds(s) + s must be a sequence of variable names or indices. Returns + the lower bounds on the variables with indices the members + of s. Equivalent to + [variables.get_lower_bounds(i) for i in s] + + variables.get_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns the lower bounds on the variables with indices between + begin and end, inclusive of end. Equivalent to + variables.get_lower_bounds(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(lb = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_lower_bounds(8) + 12.0 + >>> c.variables.get_lower_bounds("1",3) + [1.5, 3.0, 4.5] + >>> c.variables.get_lower_bounds([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.variables.get_lower_bounds() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getlb(a, b=self.get_num() - 1): + return CPX_PROC.getlb(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getlb, self._conv, args)
+ + +
+[docs] + def get_upper_bounds(self, *args): + """Returns the upper bounds on variables from the problem. + + There are four forms by which variables.get_upper_bounds may be called. + + variables.get_upper_bounds() + return the upper bounds on all variables from the problem. + + variables.get_upper_bounds(i) + i must be a variable name or index. Returns the upper + bound on the variable whose index or name is i. + + variables.get_upper_bounds(s) + s must be a sequence of variable names or indices. Returns + the upper bounds on the variables with indices the members + of s. Equivalent to + [variables.get_upper_bounds(i) for i in s] + + variables.get_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns the upper bounds on the variables with indices between + begin and end, inclusive of end. Equivalent to + variables.get_upper_bounds(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(ub = [(1.5 * i) + 1.0 for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_upper_bounds(8) + 13.0 + >>> c.variables.get_upper_bounds("1",3) + [2.5, 4.0, 5.5] + >>> c.variables.get_upper_bounds([2,"0",5]) + [4.0, 1.0, 8.5] + >>> c.variables.get_upper_bounds() + [1.0, 2.5, 4.0, 5.5, 7.0, 8.5, 10.0, 11.5, 13.0, 14.5] + """ + def getub(a, b=self.get_num() - 1): + return CPX_PROC.getub(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getub, self._conv, args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of variables from the problem. + + There are four forms by which variables.get_names may be called. + + variables.get_names() + return the names of all variables from the problem. + + variables.get_names(i) + i must be a variable index. Returns the name of variable i. + + variables.get_names(s) + s must be a sequence of variable indices. Returns the + names of the variables with indices the members of s. + Equivalent to [variables.get_names(i) for i in s] + + variables.get_names(begin, end) + begin and end must be variable indices. Returns the names of + the variables with indices between begin and end, inclusive of + end. Equivalent to variables.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x' + str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.variables.get_names(8) + 'x8' + >>> c.variables.get_names(1,3) + ['x1', 'x2', 'x3'] + >>> c.variables.get_names([2,0,5]) + ['x2', 'x0', 'x5'] + >>> c.variables.get_names() + ['x0', 'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getcolname( + self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getname, self._conv, args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the types of variables from the problem. + + There are four forms by which variables.types may be called. + + variables.types() + return the types of all variables from the problem. + + variables.types(i) + i must be a variable name or index. Returns the type of + the variable whose index or name is i. + + variables.types(s) + s must be a sequence of variable names or indices. Returns + the types of the variables with indices the members of s. + Equivalent to [variables.get_types(i) for i in s] + + variables.types(begin, end) + begin and end must be variable indices or variable names. + Returns the types of the variables with indices between begin + and end, inclusive of end. Equivalent to + variables.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> t = c.variables.type + >>> indices = c.variables.add(names = [str(i) for i in range(5)], + types = [t.continuous, t.integer, + t.binary, t.semi_continuous, t.semi_integer]) + >>> c.variables.get_num() + 5 + >>> c.variables.get_types(3) + 'S' + >>> c.variables.get_types(1,3) + ['I', 'B', 'S'] + >>> c.variables.get_types([2,0,4]) + ['B', 'C', 'N'] + >>> c.variables.get_types() + ['C', 'I', 'B', 'S', 'N'] + """ + def gettype(a, b=self.get_num() - 1): + return CPX_PROC.getctype(self._env._e, self._cplex._lp, a, b) + t = [i for i in "".join(apply_freeform_two_args( + gettype, self._conv, args))] + return t[0] if len(t) == 1 else t
+ + +
+[docs] + def get_cols(self, *args): + """Returns a set of columns of the linear constraint matrix. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + There are four forms by which variables.get_cols may be called. + + variables.get_cols() + return the entire linear constraint matrix. + + variables.get_cols(i) + i must be a variable name or index. Returns the column of + the linear constraint matrix associated with variable i. + + variables.get_cols(s) + s must be a sequence of variable names or indices. Returns + the columns of the linear constraint matrix associated with + the variables with indices the members of s. Equivalent to + [variables.get_cols(i) for i in s] + + variables.get_cols(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the linear constraint matrix associated + with the variables with indices between begin and end, + inclusive of end. Equivalent to + variables.get_cols(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=['c1', 'c2']) + >>> indices = c.variables.add( + ... names=[str(i) for i in range(3)], + ... columns=[cplex.SparsePair(ind=['c1'], val=[1.0]), + ... cplex.SparsePair(ind=['c2'], val=[2.0]), + ... cplex.SparsePair(ind=['c1','c2'], val=[3.0, 4.0])]) + >>> c.variables.get_num() + 3 + >>> c.variables.get_cols(2) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + >>> for col in c.variables.get_cols(1, 2): + ... print(col) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + >>> for col in c.variables.get_cols([2, 0, 1]): + ... print(col) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + >>> for col in c.variables.get_cols(): + ... print(col) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [0, 1], val = [3.0, 4.0]) + """ + def getcols(a, b=self.get_num() - 1): + mat = _HBMatrix() + t = CPX_PROC.getcols(self._env._e, self._cplex._lp, a, b) + mat.matbeg = t[0] + mat.matind = t[1] + mat.matval = t[2] + return [m for m in mat] + return apply_freeform_two_args(getcols, self._conv, args)
+ + +
+[docs] + def get_histogram(self): + """Returns a histogram of the columns of the linear constraint matrix. + + To access the number of columns with given nonzero counts, use + slice notation. If a negative nonzero count is queried in + this manner an IndexError will be raised. + + The __str__ method of the `Histogram` object returns a string + displaying the number of columns with given nonzeros counts in + human readable form. + + The data member "orientation" of the histogram object is + "column", indicating that the histogram shows the nonzero + counts for the columns of the linear constraint matrix. + + >>> import cplex + >>> c = cplex.Cplex("ind.lp") + >>> histogram = c.variables.get_histogram() + >>> print(histogram) + Column counts (excluding fixed variables): + <BLANKLINE> + Nonzero Count: 1 2 3 + Number of Columns: 1 6 36 + <BLANKLINE> + <BLANKLINE> + >>> histogram[2] + 6 + >>> histogram[0:4] + [0, 1, 6, 36] + """ + return Histogram(self._cplex, "column")
+
+ + + +
+[docs] +class AdvancedLinearConstraintInterface(BaseInterface): + """Methods for handling lazy cuts and user cuts. + + Lazy cuts are constraints not specified in the constraint + matrix of the MIP problem, but that must be not be violated + in a solution. Using lazy cuts makes sense when there are a + large number of constraints that must be satisfied at a solution, + but are unlikely to be violated if they are left out. When + you add lazy cuts to your model, set the CPLEX parameter + c.parameters.preprocessing.reduce to 0 (zero) or 1 (one) + in order to turn off dual reductions. + + User cuts are constraints that are implied by the constraint + matrix and integrality requirements. Adding user cuts is helpful + to tighten the MIP formulation. When you add user cuts, set + the CPLEX parameter cplex.parameters.preprocessing.reformulations to + cplex.parameters.preprocessing.reformulations.values.interfere_uncrush or + cplex.parameters.preprocessing.reformulations.values.none to make sure + that CPLEX makes only reductions that do not interfere with crushing + linear forms (cuts in this case). + """ + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedLinearConstraintInterface. + + The advanced linear constraints interface is exposed by the + top-level `Cplex` class as Cplex.linear_constraints.advanced. + This constructor is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_num_lazy_constraints(self): + """Returns the number of lazy cuts in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["lz1"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 1 + """ + return CPX_PROC._getnumlazyconstraints(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_user_cuts(self): + """Returns the number of user cuts in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["usr1"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 1 + """ + return CPX_PROC._getnumusercuts(self._env._e, self._cplex._lp)
+ + + def _add_lazy_constraints(self, lin_expr, senses, rhs, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + CPX_PROC.addlazyconstraints( + self._env._e, self._cplex._lp, rhs, senses, + lin_expr, names) + +
+[docs] + def add_lazy_constraints(self, lin_expr=None, senses="", rhs=None, + names=None): + """Adds lazy constraints to the problem. + + linear_constraints.advanced.add_lazy_constraints accepts the + keyword arguments lin_expr, senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + Returns an iterator containing the indices of the added lazy + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["lz1"]) + >>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0]) + >>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr=[cut2, cut3], + ... senses="EE", + ... rhs=[0.0, 0.0], + ... names=["lz2", "lz3"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 3 + """ + lin_expr, rhs, names = init_list_args(lin_expr, rhs, names) + return self._add_iter(self.get_num_lazy_constraints, + self._add_lazy_constraints, + lin_expr, senses, rhs, names)
+ + + def _add_user_cuts(self, lin_expr, senses, rhs, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + CPX_PROC.addusercuts( + self._env._e, self._cplex._lp, rhs, senses, + lin_expr, names) + +
+[docs] + def add_user_cuts(self, lin_expr=None, senses="", rhs=None, names=None): + """Adds user cuts to the problem. + + linear_constraints.advanced.add_user_cuts accepts the keyword + arguments lin_expr, senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... names=["usr1"], + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0]) + >>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0]) + >>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut2, cut3], + ... senses = "EE", + ... rhs=[0.0, 0.0], + ... names=["usr2", "usr3"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 3 + """ + lin_expr, senses, rhs, names = init_list_args( + lin_expr, senses, rhs, names) + return self._add_iter(self.get_num_user_cuts, self._add_user_cuts, + lin_expr, senses, rhs, names)
+ + +
+[docs] + def free_lazy_constraints(self): + """Removes all lazy constraints from the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_lazy_constraints( + ... lin_expr = [cut], + ... senses = "E", + ... rhs = [0.0], + ... names = ["lz1"]) + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 1 + >>> c.linear_constraints.advanced.free_lazy_constraints() + >>> c.linear_constraints.advanced.get_num_lazy_constraints() + 0 + """ + CPX_PROC.freelazyconstraints(self._env._e, self._cplex._lp)
+ + +
+[docs] + def free_user_cuts(self): + """Removes all user cuts from the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0]) + >>> indices = c.linear_constraints.advanced.add_user_cuts( + ... lin_expr=[cut], + ... senses="E", + ... rhs=[0.0], + ... names=["usr1"]) + >>> c.linear_constraints.advanced.get_num_user_cuts() + 1 + >>> c.linear_constraints.advanced.free_user_cuts() + >>> c.linear_constraints.advanced.get_num_user_cuts() + 0 + """ + CPX_PROC.freeusercuts(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class LinearConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying linear constraints.""" + +
+[docs] + def __init__(self, cplex): + """Creates a new LinearConstraintInterface. + + The linear constraints interface is exposed by the top-level + `Cplex` class as `Cplex.linear_constraints`. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getrowindex) + self.advanced = AdvancedLinearConstraintInterface(self) + """See `AdvancedLinearConstraintInterface()` """
+ + +
+[docs] + def get_num(self): + """Returns the number of linear constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c1", "c2", "c3"]) + >>> c.linear_constraints.get_num() + 3 + """ + return CPX_PROC.getnumrows(self._env._e, self._cplex._lp)
+ + + def _add(self, lin_expr, senses, rhs, range_values, names): + """non-public""" + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, range_values, names, lin_expr] + num_new_rows = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": lin_expr, senses, rhs, range_values, names" + ) + num_old_rows = self.get_num() + if lin_expr: + with CPX_PROC.chbmatrix(lin_expr, self._cplex._env_lp_ptr, + 0) as (rmat, nnz): + CPX_PROC.addrows(self._env._e, self._cplex._lp, 0, + num_new_rows, nnz, rhs, senses, + rmat, [], names) + if range_values != []: + CPX_PROC.chgrngval( + self._env._e, self._cplex._lp, + list(range(num_old_rows, num_old_rows + num_new_rows)), + range_values) + else: + if senses.find('R') != -1 and not range_values: + range_values = [0.0] * len(senses) + CPX_PROC.newrows(self._env._e, self._cplex._lp, rhs, senses, + range_values, names) + +
+[docs] + def add(self, lin_expr=None, senses="", rhs=None, range_values=None, + names=None): + """Adds linear constraints to the problem. + + linear_constraints.add accepts the keyword arguments lin_expr, + senses, rhs, range_values, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the senses of the linear constraints. + Each entry must + be one of 'G', 'L', 'E', and 'R', indicating + greater-than-or-equal-to (>=), less-than-or-equal-to (<=), + equality (=), and ranged constraints, respectively. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + range_values is a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + names is a list of strings. + + Returns an iterator containing the indices of the added linear + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + lin_expr = [cplex.SparsePair(ind = ["x1", "x3"], val = [1.0, -1.0]), + cplex.SparsePair(ind = ["x1", "x2"], val = [1.0, 1.0]), + cplex.SparsePair(ind = ["x1", "x2", "x3"], val = [-1.0] * 3), + cplex.SparsePair(ind = ["x2", "x3"], val = [10.0, -2.0])], + senses = ["E", "L", "G", "R"], + rhs = [0.0, 1.0, -1.0, 2.0], + range_values = [0.0, 0.0, 0.0, -10.0], + names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, -1.0, 2.0] + """ + lin_expr, senses, rhs, range_values, names = init_list_args( + lin_expr, senses, rhs, range_values, names) + return self._add_iter(self.get_num, self._add, + lin_expr, senses, rhs, range_values, names)
+ + +
+[docs] + def delete(self, *args): + """Removes linear constraints from the problem. + + There are four forms by which linear_constraints.delete may be + called. + + linear_constraints.delete() + deletes all linear constraints from the problem. + + linear_constraints.delete(i) + i must be a linear constraint name or index. Deletes the + linear constraint whose index or name is i. + + linear_constraints.delete(s) + s must be a sequence of linear constraint names or indices. + Deletes the linear constraints with names or indices contained + within s. Equivalent to [linear_constraints.delete(i) for i in s]. + + linear_constraints.delete(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Deletes the linear constraints with indices + between begin and end, inclusive of end. Equivalent to + linear_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of linear + constraints. + + See `CPXdelrows <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/delrows.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=[str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.delete(8) + >>> c.linear_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.linear_constraints.delete("1", 3) + >>> c.linear_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.linear_constraints.delete([2, "0", 5]) + >>> c.linear_constraints.get_names() + ['4', '6', '7'] + >>> c.linear_constraints.delete() + >>> c.linear_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delrows(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def set_rhs(self, *args): + """Sets the righthand side of a set of linear constraints. + + There are two forms by which linear_constraints.set_rhs may be + called. + + linear_constraints.set_rhs(i, rhs) + i must be a row name or index and rhs must be a real number. + Sets the righthand side of the row whose index or name is + i to rhs. + + linear_constraints.set_rhs(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, rhs) pairs, each + of which consists of a row name or index and a real + number. Sets the righthand side of the specified rows to + the corresponding values. Equivalent to + [linear_constraints.set_rhs(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_rhs() + [0.0, 0.0, 0.0, 0.0] + >>> c.linear_constraints.set_rhs("c1", 1.0) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, 0.0, 0.0] + >>> c.linear_constraints.set_rhs([("c3", 2.0), (2, -1.0)]) + >>> c.linear_constraints.get_rhs() + [0.0, 1.0, -1.0, 2.0] + """ + def chgrhs(a, b): + CPX_PROC.chgrhs(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgrhs, self._conv, *args)
+ + +
+[docs] + def set_names(self, *args): + """Sets the name of a linear constraint or set of linear constraints. + + There are two forms by which linear_constraints.set_names may be + called. + + linear_constraints.set_names(i, name) + i must be a linear constraint name or index and name must be a + string. + + linear_constraints.set_names(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, name) pairs, + each of which consists of a linear constraint name or index and a + string. Sets the name of the specified linear constraints to the + corresponding strings. Equivalent to + [linear_constraints.set_names(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.set_names("c1", "second") + >>> c.linear_constraints.get_names(1) + 'second' + >>> c.linear_constraints.set_names([("c3", "last"), (2, "middle")]) + >>> c.linear_constraints.get_names() + ['c0', 'second', 'middle', 'last'] + """ + def setnames(a, b): + CPX_PROC.chgrowname(self._env._e, self._cplex._lp, a, b) + apply_pairs(setnames, self._conv, *args)
+ + +
+[docs] + def set_senses(self, *args): + """Sets the sense of a linear constraint or set of linear constraints. + + There are two forms by which linear_constraints.set_senses may be + called. + + linear_constraints.set_senses(i, type) + i must be a row name or index and name must be a + single-character string. + + linear_constraints.set_senses(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, sense) pairs, + each of which consists of a row name or index and a + single-character string. Sets the sense of the specified + rows to the corresponding strings. Equivalent to + [linear_constraints.set_senses(pair[0], pair[1]) for pair in seq_of_pairs]. + + The senses of the constraints must be one of 'G', 'L', 'E', + and 'R', indicating greater-than-or-equal-to (>=), + less-than-or-equal-to (<=), equality (=), and ranged constraints, + respectively. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.get_senses() + ['E', 'E', 'E', 'E'] + >>> c.linear_constraints.set_senses("c1", "G") + >>> c.linear_constraints.get_senses(1) + 'G' + >>> c.linear_constraints.set_senses([("c3", "L"), (2, "R")]) + >>> c.linear_constraints.get_senses() + ['E', 'G', 'R', 'L'] + """ + if len(args) == 2: + indices = [self._conv(args[0])] + senses = args[1] + elif len(args) == 1: + indices, senses = unzip(args[0]) + indices = self._conv(indices) + senses = "".join(senses) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgsense(self._env._e, self._cplex._lp, + indices, senses)
+ + +
+[docs] + def set_linear_components(self, *args): + """Sets a linear constraint or set of linear constraints. + + There are two forms by which this method may be called: + + linear_constraints.set_linear_components(i, lin) + i must be a row name or index and lin must be either a + SparsePair or a pair of sequences, the first of which + consists of variable names or indices, the second of which + consists of floats. + + linear_constraints.set_linear_components(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, lin) pairs, + each of which consists of a row name or index and a vector + as described above. Sets the specified rows + to the corresponding vector. Equivalent to + [linear_constraints.set_linear_components(pair[0], pair[1]) + for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names=["c0", "c1", "c2", "c3"]) + >>> indices = c.variables.add(names=["x0", "x1"]) + >>> c.linear_constraints.set_linear_components("c0", [["x0"], [1.0]]) + >>> c.linear_constraints.get_rows("c0") + SparsePair(ind = [0], val = [1.0]) + >>> c.linear_constraints.set_linear_components([ + ... ("c3", cplex.SparsePair(ind=["x1"], val=[-1.0])), + ... (2, [[0, 1], [-2.0, 3.0]])]) + >>> c.linear_constraints.get_rows("c3") + SparsePair(ind = [1], val = [-1.0]) + >>> c.linear_constraints.get_rows(2) + SparsePair(ind = [0, 1], val = [-2.0, 3.0]) + """ + def setlin(cons, vars_): + validate_arg_lengths([cons, vars_]) + cons = convert_sequence(cons, self._get_index) + varcache = {} + for c, v in zip(cons, vars_): + ind, val = unpack_pair(v) + CPX_PROC.chgcoeflist( + self._env._e, + self._cplex._lp, + [c] * len(ind), + convert_sequence( + ind, + self._cplex.variables._get_index, + varcache + ), + val + ) + apply_pairs(setlin, self._conv, *args)
+ + +
+[docs] + def set_range_values(self, *args): + """Sets the range values for a set of linear constraints. + + That is, this method sets the lefthand side (lhs) for each ranged + constraint of the form lhs <= lin_expr <= rhs. + + The range values are a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + Note that changing the range values will not change the sense of a + constraint; you must call the method set_senses() of the class + LinearConstraintInterface to change the sense of a ranged row if + the previous range value was 0 (zero) and the constraint sense was not + 'R'. Similarly, changing the range coefficient from a nonzero value to + 0 (zero) will not change the constraint sense from 'R" to "E"; an + additional call of setsenses() is required to accomplish that. + + There are two forms by which linear_constraints.set_range_values may be + called. + + linear_constraints.set_range_values(i, range) + i must be a row name or index and range must be a real + number. Sets the range value of the row whose index or + name is i to range. + + linear_constraints.set_range_values(seq_of_pairs) + seq_of_pairs must be a list or tuple of (i, range) pairs, each + of which consists of a row name or index and a real + number. Sets the range values for the specified rows to + the corresponding values. Equivalent to + [linear_constraints.set_range_values(pair[0], pair[1]) for pair in seq_of_pairs]. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> c.linear_constraints.set_range_values("c1", 1.0) + >>> c.linear_constraints.get_range_values() + [0.0, 1.0, 0.0, 0.0] + >>> c.linear_constraints.set_range_values([("c3", 2.0), (2, -1.0)]) + >>> c.linear_constraints.get_range_values() + [0.0, 1.0, -1.0, 2.0] + """ + def chgrngval(a, b): + CPX_PROC.chgrngval(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgrngval, self._conv, *args)
+ + +
+[docs] + def set_coefficients(self, *args): + """Sets individual coefficients of the linear constraint matrix. + + There are two forms by which + linear_constraints.set_coefficients may be called. + + linear_constraints.set_coefficients(row, col, val) + row and col must be indices or names of a linear constraint + and variable, respectively. The corresponding coefficient + is set to val. + + linear_constraints.set_coefficients(coefficients) + coefficients must be a list of (row, col, val) triples as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"]) + >>> indices = c.variables.add(names = ["x0", "x1"]) + >>> c.linear_constraints.set_coefficients("c0", "x1", 1.0) + >>> c.linear_constraints.get_rows(0) + SparsePair(ind = [1], val = [1.0]) + >>> c.linear_constraints.set_coefficients([("c2", "x0", 2.0), + ("c2", "x1", -1.0)]) + >>> c.linear_constraints.get_rows("c2") + SparsePair(ind = [0, 1], val = [2.0, -1.0]) + """ + if len(args) == 3: + arg_list = [[arg] for arg in args] + elif len(args) == 1: + arg_list = unzip(args[0]) + else: + raise WrongNumberOfArgumentsError() + CPX_PROC.chgcoeflist( + self._env._e, self._cplex._lp, + self._conv(arg_list[0]), + self._cplex.variables._conv(arg_list[1]), + arg_list[2])
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of constraints from the problem. + + Can be called by four forms. + + linear_constraints.get_rhs() + return the righthand side of all linear constraints from + the problem. + + linear_constraints.get_rhs(i) + i must be a linear constraint name or index. Returns the + righthand side of the linear constraint whose index or + name is i. + + linear_constraints.get_rhs(s) + s must be a sequence of linear constraint names or indices. + Returns the righthand side of the linear constraints with + indices the members of s. Equivalent to + [linear_constraints.get_rhs(i) for i in s] + + linear_constraints.get_rhs(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the righthand side of the linear + constraints with indices between begin and end, inclusive + of end. Equivalent to + linear_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(rhs = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_rhs(8) + 12.0 + >>> c.linear_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.linear_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.linear_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(a, b=self.get_num() - 1): + return CPX_PROC.getrhs(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getrhs, self._conv, args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the senses of constraints from the problem. + + Can be called by four forms. + + linear_constraints.get_senses() + return the senses of all linear constraints from the + problem. + + linear_constraints.get_senses(i) + i must be a linear constraint name or index. Returns the + sense of the linear constraint whose index or name is i. + + linear_constraints.get_senses(s) + s must be a sequence of linear constraint names or indices. + Returns the senses of the linear constraints with indices + the members of s. Equivalent to + [linear_constraints.get_senses(i) for i in s] + + linear_constraints.get_senses(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the senses of the linear constraints + with indices between begin and end, inclusive of end. + Equivalent to + linear_constraints.get_senses(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add( + ... senses=["E", "G", "L", "R"], + ... names=[str(i) for i in range(4)]) + >>> c.linear_constraints.get_num() + 4 + >>> c.linear_constraints.get_senses(1) + 'G' + >>> c.linear_constraints.get_senses("1",3) + ['G', 'L', 'R'] + >>> c.linear_constraints.get_senses([2,"0",1]) + ['L', 'E', 'G'] + >>> c.linear_constraints.get_senses() + ['E', 'G', 'L', 'R'] + """ + def getsense(a, b=self.get_num() - 1): + return CPX_PROC.getsense(self._env._e, self._cplex._lp, a, b) + s = [i for i in "".join(apply_freeform_two_args( + getsense, self._conv, args))] + return s[0] if len(s) == 1 else s
+ + +
+[docs] + def get_range_values(self, *args): + """Returns the range values of linear constraints from the problem. + + That is, this method returns the lefthand side (lhs) for each + ranged constraint of the form lhs <= lin_expr <= rhs. This method + makes sense only for ranged constraints, that is, linear constraints + of sense 'R'. + + The range values are a list of floats, specifying the difference + between lefthand side and righthand side of each linear constraint. + If range_values[i] > 0 (zero) then the constraint i is defined as + rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) + then constraint i is defined as + rhs[i] + range_value[i] <= a*x <= rhs[i]. + + Can be called by four forms. + + linear_constraints.get_range_values() + return the range values of all linear constraints from the + problem. + + linear_constraints.get_range_values(i) + i must be a linear constraint name or index. Returns the + range value of the linear constraint whose index or name is i. + + linear_constraints.get_range_values(s) + s must be a sequence of linear constraint names or indices. + Returns the range values of the linear constraints with + indices the members of s. Equivalent to + [linear_constraints.get_range_values(i) for i in s] + + linear_constraints.get_range_values(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the range values of the linear + constraints with indices between begin and end, inclusive + of end. Equivalent to + linear_constraints.get_range_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add( + range_values = [1.5 * i for i in range(10)], + senses = ["R"] * 10, + names = [str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_range_values(8) + 12.0 + >>> c.linear_constraints.get_range_values("1",3) + [1.5, 3.0, 4.5] + >>> c.linear_constraints.get_range_values([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.linear_constraints.get_range_values() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrngval(a, b=self.get_num() - 1): + return CPX_PROC.getrngval(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getrngval, self._conv, args)
+ + +
+[docs] + def get_coefficients(self, *args): + """Returns coefficients by row, column coordinates. + + There are two forms by which + linear_constraints.get_coefficients may be called. + + linear_constraints.get_coefficients(row, col) + returns the coefficient. + + linear_constraints.get_coefficients(sequence_of_pairs) + returns a list of coefficients. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0", "x1"]) + >>> indices = c.linear_constraints.add( + names = ["c0", "c1"], + lin_expr = [[[1], [1.0]], [[0, 1], [2.0, -1.0]]]) + >>> c.linear_constraints.get_coefficients("c0", "x1") + 1.0 + >>> c.linear_constraints.get_coefficients([("c1", "x0"), ("c1", "x1")]) + [2.0, -1.0] + """ + def getcoef(row, col): + return CPX_PROC.getcoef(self._env._e, self._cplex._lp, row, col) + if len(args) == 2: + return getcoef(self._conv(args[0]), + self._cplex.variables._conv(args[1])) + if len(args) == 1: + return [self.get_coefficients(*arg) for arg in args[0]] + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def get_rows(self, *args): + """Returns a set of rows of the linear constraint matrix. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + There are four forms by which linear_constraints.get_rows may be + called. + + linear_constraints.get_rows() + return the entire linear constraint matrix. + + linear_constraints.get_rows(i) + i must be a row name or index. Returns the ith row of + the linear constraint matrix. + + linear_constraints.get_rows(s) + s must be a sequence of row names or indices. Returns the + rows of the linear constraint matrix indexed by the members + of s. Equivalent to + [linear_constraints.get_rows(i) for i in s] + + linear_constraints.get_rows(begin, end) + begin and end must be row indices or row names. Returns the + rows of the linear constraint matrix with indices between begin + and end, inclusive of end. Equivalent to + linear_constraints.get_rows(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + ... names=["c0", "c1", "c2", "c3"], + ... lin_expr=[ + ... cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]), + ... cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]), + ... cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3), + ... cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0]) + ... ] + ... ) + >>> c.linear_constraints.get_rows(0) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + >>> for row in c.linear_constraints.get_rows(1,3): + ... print(row) + SparsePair(ind = [0, 1], val = [1.0, 1.0]) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [1, 2], val = [10.0, -2.0]) + >>> for row in c.linear_constraints.get_rows(["c2", 0]): + ... print(row) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + >>> for row in c.linear_constraints.get_rows(): + ... print(row) + SparsePair(ind = [0, 2], val = [1.0, -1.0]) + SparsePair(ind = [0, 1], val = [1.0, 1.0]) + SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0]) + SparsePair(ind = [1, 2], val = [10.0, -2.0]) + """ + def getrows(begin, end=self.get_num() - 1): + mat = _HBMatrix() + t = CPX_PROC.getrows(self._env._e, self._cplex._lp, begin, end) + mat.matbeg = t[0] + mat.matind = t[1] + mat.matval = t[2] + return [m for m in mat] + return apply_freeform_two_args(getrows, self._conv, args)
+ + +
+[docs] + def get_num_nonzeros(self): + """Returns the number of nonzeros in the linear constraint + matrix. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.linear_constraints.add( + ... names=["c0", "c1", "c2", "c3"], + ... lin_expr=[ + ... cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]), + ... cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]), + ... cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3), + ... cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0]) + ... ] + ... ) + >>> c.linear_constraints.get_num_nonzeros() + 9 + """ + return CPX_PROC.getnumnz(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of linear constraints from the problem. + + There are four forms by which linear_constraints.get_names may be called. + + linear_constraints.get_names() + return the names of all linear constraints from the problem. + + linear_constraints.get_names(i) + i must be a linear constraint index. Returns the name of row i. + + linear_constraints.get_names(s) + s must be a sequence of row indices. Returns the names of + the linear constraints with indices the members of s. + Equivalent to [linear_constraints.get_names(i) for i in s] + + linear_constraints.get_names(begin, end) + begin and end must be linear constraint indices. Returns the + names of the linear constraints with indices between begin and + end, inclusive of end. Equivalent to + linear_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.linear_constraints.add(names = ["c" + str(i) for i in range(10)]) + >>> c.linear_constraints.get_num() + 10 + >>> c.linear_constraints.get_names(8) + 'c8' + >>> c.linear_constraints.get_names(1, 3) + ['c1', 'c2', 'c3'] + >>> c.linear_constraints.get_names([2, 0, 5]) + ['c2', 'c0', 'c5'] + >>> c.linear_constraints.get_names() + ['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getrowname(self._env._e, self._cplex._lp, + a, b) + return apply_freeform_two_args(getname, self._conv, args)
+ + +
+[docs] + def get_histogram(self): + """Returns a histogram of the rows of the linear constraint matrix. + + To access the number of rows with given nonzero counts, use + slice notation. If a negative nonzero count is queried in + this manner an IndexError will be raised. + + The __str__ method of the `Histogram` object returns a string + displaying the number of rows with given nonzeros counts in + human readable form. + + The data member "orientation" of the histogram object is + "row", indicating that the histogram shows the nonzero + counts for the rows of the linear constraint matrix. + + >>> import cplex + >>> c = cplex.Cplex("ind.lp") + >>> histogram = c.linear_constraints.get_histogram() + >>> print(histogram) + Row counts (excluding fixed variables): + <BLANKLINE> + Nonzero Count: 3 4 5 10 37 + Number of Rows: 1 9 1 4 1 + <BLANKLINE> + <BLANKLINE> + >>> histogram[4] + 9 + >>> histogram[2:7] + [0, 1, 9, 1, 0] + """ + return Histogram(self._cplex, "row")
+
+ + + +
+[docs] +class IndicatorType(ConstantClass): + """Identifiers for types of indicator constraints.""" + if_ = _constants.CPX_INDICATOR_IF + """CPX_INDICATOR_IF ('->').""" + onlyif = _constants.CPX_INDICATOR_ONLYIF + """CPX_INDICATOR_ONLYIF ('<-')""" + iff = _constants.CPX_INDICATOR_IFANDONLYIF + """CPX_INDICATOR_IFANDONLYIF ('<->')"""
+ + + +
+[docs] +class IndicatorConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying indicator constraints.""" + + type_ = IndicatorType() + """See `IndicatorType()`""" + +
+[docs] + def __init__(self, cplex): + """Creates a new IndicatorConstraintInterface. + + The indicator constraints interface is exposed by the top-level + `Cplex` class as `Cplex.indicator_constraints`. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=cplex, + getindexfunc=CPX_PROC.getindconstrindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of indicator constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.indicator_constraints.add(name="ind1") + 0 + >>> c.indicator_constraints.get_num() + 1 + """ + return CPX_PROC.getnumindconstrs(self._env._e, self._cplex._lp)
+ + + def _add_batch(self, lin_expr, sense, rhs, indvar, complemented, name, + indtype): + if not isinstance(sense, str): + sense = "".join(sense) + arg_list = [lin_expr, sense, rhs, indvar, complemented, name, + indtype] + num_new_rows = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + ": lin_expr, sense, rhs, indvar, complemented, name, indtype" + ) + with CPX_PROC.chbmatrix(lin_expr, self._cplex._env_lp_ptr, + 0) as (linmat, nnz): + CPX_PROC.addindconstr(self._env._e, self._cplex._lp, + num_new_rows, + self._cplex.variables._conv(indvar), + complemented, rhs, sense, + linmat, indtype, name, nnz) + +
+[docs] + def add_batch(self, lin_expr=None, sense=None, rhs=None, indvar=None, + complemented=None, name=None, indtype=None): + """Adds indicator constraints to the problem. + + Takes up to eight keyword arguments. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr : either a list of SparsePair instances or a matrix in + list-of-lists format. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + sense : must be either a list of single-character strings or a + string containing the senses of the indicator constraints. + Each entry must be one of 'G', 'L', 'E', indicating + greater-than-or-equal-to (>=), less-than-or-equal-to (<=), and + equality (=), respectively. Left unspecified, the default is 'E'. + + rhs : a list of floats, specifying the righthand side of each + indicator constraint. + + indvar : a list of names or indices (or a mixture of the two), of + the variables that control whether the constraint is active or + not. + + complemented : a list of values (0 or 1). Default value of 0 + instructs CPLEX to interpret indicator constraint as active when + the indicator variable is 1. Set complemented to 1 to instruct + CPLEX that the indicator constraint is active when indvar = 0. + + name : a list of strings that determine the names of the + individual constraints. + + indtype : a list of the types of indicator constraints. Defaults + to CPX_INDICATOR_IF ('->'). See `IndicatorType()`. + + Returns an iterator containing the indices of the added indicator + constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=["x1", "x2", "x3"]) + >>> indices = c.indicator_constraints.add_batch( + ... lin_expr=[cplex.SparsePair(ind=["x2"], val=[2.0]), + ... cplex.SparsePair(ind=["x3"], val=[2.0])], + ... sense="LL", + ... rhs=[1.0, 1.0], + ... indvar=["x1", "x2"], + ... complemented=[0, 0], + ... name=["ind1", "ind2"], + ... indtype=[c.indicator_constraints.type_.if_, + ... c.indicator_constraints.type_.if_]) + >>> len(list(indices)) + 2 + """ + (lin_expr, sense, rhs, indvar, + complemented, name, indtype) = init_list_args( + lin_expr, sense, rhs, indvar, complemented, name, indtype) + return self._add_iter(self.get_num, self._add_batch, + lin_expr, sense, rhs, indvar, complemented, + name, indtype)
+ + + def _add(self, lin_expr, sense, rhs, indvar, complemented, name, + indtype): + """non-public""" + self._add_batch([lin_expr], sense, [rhs], [indvar], [complemented], + [name], [indtype]) + +
+[docs] + def add(self, lin_expr=None, sense="E", rhs=0.0, indvar=0, + complemented=0, name="", indtype=IndicatorType.if_): + """Adds an indicator constraint to the problem. + + Takes up to eight keyword arguments. + + lin_expr : either a SparsePair or a list of two lists, the first of + which contains variable indices or names, the second of which + contains values. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + sense : the sense of the constraint, may be "L", "G", or "E": + default is "E" + + rhs : a float defining the righthand side of the constraint + + indvar : the name or index of the variable that controls if + the constraint is active + + complemented : default value of 0 instructs CPLEX to interpret + indicator constraint as active when the indicator variable is 1. + Set complemented to 1 to instruct CPLEX that the indicator + constraint is active when indvar = 0. + + name : the name of the constraint. + + indtype : the type of indicator constraint. Defaults to + CPX_INDICATOR_IF ('->'). See `IndicatorType()`. + + Returns the index of the added indicator constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x1", "x2"]) + >>> c.indicator_constraints.add( + ... indvar="x1", + ... complemented=0, + ... rhs=1.0, + ... sense="G", + ... lin_expr=cplex.SparsePair(ind=["x2"], val=[2.0]), + ... name="ind1", + ... indtype=c.indicator_constraints.type_.if_) + 0 + """ + if lin_expr is None: + lin_expr = SparsePair() + # We only ever create one indicator constraint at a time. + return self._add_single(self.get_num, self._add, lin_expr, + sense, rhs, indvar, complemented, + name, indtype)
+ + +
+[docs] + def delete(self, *args): + """Deletes indicator constraints from the problem. + + There are four forms by which indicator_constraints.delete may be + called. + + indicator_constraints.delete() + deletes all indicator constraints from the problem. + + indicator_constraints.delete(i) + i must be an indicator constraint name or index. Deletes + the indicator constraint whose index or name is i. + + indicator_constraints.delete(s) + s must be a sequence of indicator constraint names or + indices. Deletes the indicator constraints with names or + indices contained within s. Equivalent to + [indicator_constraints.delete(i) for i in s]. + + indicator_constraints.delete(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Deletes the indicator constraints with + indices between begin and end, inclusive of end. Equivalent to + indicator_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of indicator + constraints. + + See `CPXdelindconstrs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delindconstrs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name=str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.delete(8) + >>> c.indicator_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.indicator_constraints.delete("1", 3) + >>> c.indicator_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.indicator_constraints.delete([2, "0", 5]) + >>> c.indicator_constraints.get_names() + ['4', '6', '7'] + >>> c.indicator_constraints.delete() + >>> c.indicator_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delindconstrs(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_indicator_variables(self, *args): + """Returns the indicator variables of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_indicator_variables() + return the indicator variables of all indicator constraints + from the problem. + + indicator_constraints.get_indicator_variables(i) + i must be an indicator constraint name or index. Returns the + indicator variables of the indicator constraint whose index + or name is i. + + indicator_constraints.get_indicator_variables(s) + s must be a sequence of indicator constraint names or + indices. Returns the indicator variables of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_indicator_variables(i) for i in s] + + indicator_constraints.get_indicator_variables(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the indicator variables of the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_indicator_variables(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=i, + ... lin_expr=cplex.SparsePair(ind=[i+1], val=[1.0])) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_indicator_variables(8) + 8 + >>> c.indicator_constraints.get_indicator_variables("1",3) + [1, 2, 3] + >>> c.indicator_constraints.get_indicator_variables([2,"0",5]) + [2, 0, 5] + >>> c.indicator_constraints.get_indicator_variables() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getindvar(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[1] + return apply_freeform_two_args(getindvar, self._conv, args)
+ + +
+[docs] + def get_complemented(self, *args): + """Returns whether a set of indicator constraints is complemented. + + May be called by four forms. + + indicator_constraints.get_complemented() + return whether or not all indicator constraints from the + problem are complemented. + + indicator_constraints.get_complemented(i) + i must be an indicator constraint name or index. Returns + whether or not the indicator constraint whose index or name + is i is complemented. + + indicator_constraints.get_complemented(s) + s must be a sequence of indicator constraint names or + indices. Returns whether or not the indicator constraints + with indices the members of s are complemented. Equivalent + to [indicator_constraints.get_complemented(i) for i in s] + + indicator_constraints.get_complemented(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns whether or not the indicator + constraints with indices between begin and end, inclusive of + end, are complemented. Equivalent to + indicator_constraints.get_complemented(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=10, + ... complemented=i % 2) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_complemented(8) + 0 + >>> c.indicator_constraints.get_complemented("1",3) + [1, 0, 1] + >>> c.indicator_constraints.get_complemented([2,"0",5]) + [0, 0, 1] + >>> c.indicator_constraints.get_complemented() + [0, 1, 0, 1, 0, 1, 0, 1, 0, 1] + """ + def getcomp(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[2] + return apply_freeform_two_args(getcomp, self._conv, args)
+ + +
+[docs] + def get_num_nonzeros(self, *args): + """Returns the number of nonzeros in a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_num_nonzeros() + return the number of nonzeros in all indicator constraints + from the problem. + + indicator_constraints.get_num_nonzeros(i) + i must be an indicator constraint name or index. Returns the + number of nonzeros in the indicator constraint whose index + or name is i. + + indicator_constraints.get_num_nonzeros(s) + s must be a sequence of indicator constraint names or + indices. Returns the number of nonzeros in the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_num_nonzeros(i) for i in s] + + indicator_constraints.get_num_nonzeros(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the number of nonzeros in the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=10, + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_num_nonzeros(8) + 8 + >>> c.indicator_constraints.get_num_nonzeros("1",3) + [1, 2, 3] + >>> c.indicator_constraints.get_num_nonzeros([2,"0",5]) + [2, 0, 5] + >>> c.indicator_constraints.get_num_nonzeros() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getnnz(a): + # NB: We return surplus here for nzcnt (this is on purpose). + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, a, a)[5] + return apply_freeform_one_arg( + getnnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_rhs() + return the righthand side of all indicator constraints + from the problem. + + indicator_constraints.get_rhs(i) + i must be an indicator constraint name or index. Returns the + righthand side of the indicator constraint whose index or + name is i. + + indicator_constraints.get_rhs(s) + s must be a sequence of indicator constraint names or + indices. Returns the righthand side of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_rhs(i) for i in s] + + indicator_constraints.get_rhs(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the righthand side of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(rhs=1.5 * i, name=str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_rhs(8) + 12.0 + >>> c.indicator_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.indicator_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.indicator_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[3] + return apply_freeform_two_args(getrhs, self._conv, args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the sense of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_senses() + return the senses of all indicator constraints from the + problem. + + indicator_constraints.get_senses(i) + i must be an indicator constraint name or index. Returns the + sense of the indicator constraint whose index or name is i. + + indicator_constraints.get_senses(s) + s must be a sequence of indicator constraint names or + indices. Returns the senses of the indicator constraints + with indices the members of s. Equivalent to + [indicator_constraints.get_senses(i) for i in s] + + indicator_constraints.get_senses(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the senses of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_senses(range(begin, end + 1)). + + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name=str(i), sense=j) + ... for i, j in enumerate("EGLE")] + [0, 1, 2, 3] + >>> c.indicator_constraints.get_num() + 4 + >>> c.indicator_constraints.get_senses(1) + 'G' + >>> c.indicator_constraints.get_senses("1",3) + ['G', 'L', 'E'] + >>> c.indicator_constraints.get_senses([2,"0",1]) + ['L', 'E', 'G'] + >>> c.indicator_constraints.get_senses() + ['E', 'G', 'L', 'E'] + """ + def getsense(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[4] + result = apply_freeform_two_args(getsense, self._conv, args) + s = [i for i in "".join(result)] + return s[0] if len(s) == 1 else s
+ + +
+[docs] + def get_types(self, *args): + """Returns the type of a set of indicator constraints. + + See `IndicatorType()`. + + May be called by four forms. + + indicator_constraints.get_types() + return the types of all indicator constraints from the + problem. + + indicator_constraints.get_types(i) + i must be an indicator constraint name or index. Returns the + type of the indicator constraint whose index or name is i. + + indicator_constraints.get_types(s) + s must be a sequence of indicator constraint names or + indices. Returns the types of the indicator constraints + with indices the members of s. Equivalent to + [indicator_constraints.get_types(i) for i in s] + + indicator_constraints.get_types(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the types of the indicator + constraints with indices between begin and end, inclusive of + end. Equivalent to + indicator_constraints.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> idx = c.indicator_constraints.add(name='i1') + >>> c.indicator_constraints.get_types(idx) + 1 + >>> c.indicator_constraints.type_[1] + 'if_' + """ + def gettype(begin, end=self.get_num() - 1): + return CPX_PROC.getindconstr_constant( + self._env._e, self._cplex._lp, begin, end)[0] + return apply_freeform_two_args(gettype, self._conv, args)
+ + +
+[docs] + def get_linear_components(self, *args): + """Returns the linear constraint of a set of indicator + constraints. + + Returns a list of SparsePair instances or a single SparsePair + instance, depending on the form by which it was called. + + May be called by four forms. + + indicator_constraints.get_linear_components() + return the linear components of all indicator constraints + from the problem. + + indicator_constraints.get_linear_components(i) + i must be an indicator constraint name or index. Returns the + linear component of the indicator constraint whose index or + name is i. + + indicator_constraints.get_linear_components(s) + s must be a sequence of indicator constraint names or + indices. Returns the linear components of the indicator + constraints with indices the members of s. Equivalent to + [indicator_constraints.get_linear_components(i) for i in s] + + indicator_constraints.get_linear_components(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the linear components of the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + indicator_constraints.get_linear_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.indicator_constraints.add( + ... name=str(i), indvar=3, + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(3)] + [0, 1, 2] + >>> c.indicator_constraints.get_num() + 3 + >>> c.indicator_constraints.get_linear_components(2) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for row in c.indicator_constraints.get_linear_components("0", 1): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + >>> for row in c.indicator_constraints.get_linear_components([1, "0"]): + ... print(row) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> for row in c.indicator_constraints.get_linear_components(): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getlin(begin, end=self.get_num() - 1): + mat = _HBMatrix() + mat.matbeg, mat.matind, mat.matval = CPX_PROC.getindconstr( + self._env._e, self._cplex._lp, begin, end) + return [m for m in mat] + return apply_freeform_two_args(getlin, self._conv, args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of indicator constraints. + + May be called by four forms. + + indicator_constraints.get_names() + return the names of all indicator constraints from the + problem. + + indicator_constraints.get_names(i) + i must be an indicator constraint index. Returns the name + of constraint i. + + indicator_constraints.get_names(s) + s must be a sequence of indicator constraint indices. + Returns the names of the indicator constraints with indices + the members of s. Equivalent to + [indicator_constraints.get_names(i) for i in s] + + indicator_constraints.get_names(begin, end) + begin and end must be indicator constraint indices. Returns the + names of the indicator constraints with indices between begin + and end, inclusive of end. Equivalent to + indicator_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> [c.indicator_constraints.add(name="i" + str(i)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.indicator_constraints.get_num() + 10 + >>> c.indicator_constraints.get_names(8) + 'i8' + >>> c.indicator_constraints.get_names(1, 3) + ['i1', 'i2', 'i3'] + >>> c.indicator_constraints.get_names([2, 0, 5]) + ['i2', 'i0', 'i5'] + >>> c.indicator_constraints.get_names() + ['i0', 'i1', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9'] + """ + def getname(a): + return CPX_PROC.getindconstrname( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+
+ + + +
+[docs] +class QuadraticConstraintInterface(BaseInterface): + """Methods for adding, modifying, and querying quadratic constraints.""" + +
+[docs] + def __init__(self, cplex): + """Creates a new QuadraticConstraintInterface. + + The quadratic constraints interface is exposed by the top-level + `Cplex` class as `Cplex.quadratic_constraints`. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getqconstrindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of quadratic constraints. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y']) + >>> l = cplex.SparsePair(ind = ['x'], val = [1.0]) + >>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0]) + >>> [c.quadratic_constraints.add(name=str(i), lin_expr=l, quad_expr=q) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + """ + return CPX_PROC.getnumqconstrs(self._env._e, self._cplex._lp)
+ + + def _add(self, lin_expr, quad_expr, sense, rhs, name): + """non-public""" + ind, val = unpack_pair(lin_expr) + if len(val) == 1 and val[0] == 0.0: + ind = [] + val = [] + ind1, ind2, qval = unpack_triple(quad_expr) + varcache = {} + CPX_PROC.addqconstr(self._env._e, self._cplex._lp, rhs, sense, + self._cplex.variables._conv(ind, varcache), + val, + self._cplex.variables._conv(ind1, varcache), + self._cplex.variables._conv(ind2, varcache), + qval, name) + +
+[docs] + def add(self, lin_expr=None, quad_expr=None, sense="L", rhs=0.0, name=""): + """Adds a quadratic constraint to the problem. + + Takes up to five keyword arguments: + + lin_expr : either a SparsePair or a list of two lists specifying + the linear component of the constraint. + + Note + lin_expr must not contain duplicate indices. If lin_expr + references a variable more than once, either by index, name, + or a combination of index and name, an exception will be + raised. + + quad_expr : either a SparseTriple or a list of three lists + specifying the quadratic component of the constraint. + + Note + quad_expr must not contain duplicate indices. If quad_expr + references a matrix entry more than once, either by indices, + names, or a combination of indices and names, an exception + will be raised. + + sense : either "L", "G", or "E" + + rhs : a float specifying the righthand side of the constraint. + + name : the name of the constraint. + + Returns the index of the added quadratic constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y']) + >>> l = cplex.SparsePair(ind = ['x'], val = [1.0]) + >>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0]) + >>> c.quadratic_constraints.add(name = "my_quad", + ... lin_expr = l, + ... quad_expr = q, + ... rhs = 1.0, + ... sense = "G") + 0 + """ + if lin_expr is None: + lin_expr = SparsePair([0], [0.0]) + if quad_expr is None: + quad_expr = SparseTriple([0], [0], [0.0]) + # We only ever create one quadratic constraint at a time. + return self._add_single(self.get_num, self._add, + lin_expr, quad_expr, sense, rhs, name)
+ + +
+[docs] + def delete(self, *args): + """Deletes quadratic constraints from the problem. + + There are four forms by which quadratic_constraints.delete may be + called. + + quadratic_constraints.delete() + deletes all quadratic constraints from the problem. + + quadratic_constraints.delete(i) + i must be a quadratic constraint name or index. Deletes + the quadratic constraint whose index or name is i. + + quadratic_constraints.delete(s) + s must be a sequence of quadratic constraint names or + indices. Deletes the quadratic constraints with names or + indices contained within s. Equivalent to + [quadratic_constraints.delete(i) for i in s]. + + quadratic_constraints.delete(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Deletes the quadratic constraints with + indices between begin and end, inclusive of end. Equivalent to + quadratic_constraints.delete(range(begin, end + 1)). This will + give the best performance when deleting batches of quadratic + constraints. + + See `CPXdelqconstrs <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/socpapi/delqconstrs.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y']) + >>> l = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> q = cplex.SparseTriple(ind1=['x'], ind2=['y'], val=[1.0]) + >>> [c.quadratic_constraints.add( + ... name=str(i), lin_expr=l, quad_expr=q) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.delete(8) + >>> c.quadratic_constraints.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.quadratic_constraints.delete("1", 3) + >>> c.quadratic_constraints.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.quadratic_constraints.delete([2, "0", 5]) + >>> c.quadratic_constraints.get_names() + ['4', '6', '7'] + >>> c.quadratic_constraints.delete() + >>> c.quadratic_constraints.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delqconstrs(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_rhs(self, *args): + """Returns the righthand side of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_rhs() + return the righthand side of all quadratic constraints + from the problem. + + quadratic_constraints.get_rhs(i) + i must be a quadratic constraint name or index. Returns the + righthand side of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_rhs(s) + s must be a sequence of quadratic constraint names or + indices. Returns the righthand side of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_rhs(i) for i in s] + + quadratic_constraints.get_rhs(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the righthand side of the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + quadratic_constraints.get_rhs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(10)]) + >>> [c.quadratic_constraints.add(rhs=1.5 * i, name=str(i)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_rhs(8) + 12.0 + >>> c.quadratic_constraints.get_rhs("1",3) + [1.5, 3.0, 4.5] + >>> c.quadratic_constraints.get_rhs([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.quadratic_constraints.get_rhs() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getrhs(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[0] + return apply_freeform_one_arg( + getrhs, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_senses(self, *args): + """Returns the senses of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_senses() + return the senses of all quadratic constraints from the + problem. + + quadratic_constraints.get_senses(i) + i must be a quadratic constraint name or index. Returns the + sense of the quadratic constraint whose index or name is i. + + quadratic_constraints.get_senses(s) + s must be a sequence of quadratic constraint names or + indices. Returns the senses of the quadratic constraints + with indices the members of s. Equivalent to + [quadratic_constraints.get_senses(i) for i in s] + + quadratic_constraints.get_senses(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the senses of the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + quadratic_constraints.get_senses(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0"]) + >>> [c.quadratic_constraints.add(name=str(i), sense=j) + ... for i, j in enumerate("GGLL")] + [0, 1, 2, 3] + >>> c.quadratic_constraints.get_num() + 4 + >>> c.quadratic_constraints.get_senses(1) + 'G' + >>> c.quadratic_constraints.get_senses("1",3) + ['G', 'L', 'L'] + >>> c.quadratic_constraints.get_senses([2,"0",1]) + ['L', 'G', 'G'] + >>> c.quadratic_constraints.get_senses() + ['G', 'G', 'L', 'L'] + """ + def getsense(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[1] + return apply_freeform_one_arg( + getsense, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_linear_num_nonzeros(self, *args): + """Returns the number of nonzeros in the linear part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_linear_num_nonzeros() + return the number of nonzeros in all quadratic constraints + from the problem. + + quadratic_constraints.get_linear_num_nonzeros(i) + i must be a quadratic constraint name or index. Returns the + number of nonzeros in the quadratic constraint whose index + or name is i. + + quadratic_constraints.get_linear_num_nonzeros(s) + s must be a sequence of quadratic constraint names or + indices. Returns the number of nonzeros in the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_linear_num_nonzeros(i) for i in s] + + quadratic_constraints.get_linear_num_nonzeros(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the number of nonzeros in the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_linear_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.quadratic_constraints.add( + ... name = str(i), + ... lin_expr = [range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_linear_num_nonzeros(8) + 8 + >>> c.quadratic_constraints.get_linear_num_nonzeros("1",3) + [1, 2, 3] + >>> c.quadratic_constraints.get_linear_num_nonzeros([2,"0",5]) + [2, 0, 5] + >>> c.quadratic_constraints.get_linear_num_nonzeros() + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + """ + def getlinnz(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[2] + return apply_freeform_one_arg( + getlinnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_linear_components(self, *args): + """Returns the linear part of a set of quadratic constraints. + + Returns a list of SparsePair instances or one SparsePair + instance. + + Can be called by four forms. + + quadratic_constraints.get_linear_components() + return the linear components of all quadratic constraints + from the problem. + + quadratic_constraints.get_linear_components(i) + i must be a quadratic constraint name or index. Returns the + linear component of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_linear_components(s) + s must be a sequence of quadratic constraint names or + indices. Returns the linear components of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_linear_components(i) for i in s] + + quadratic_constraints.get_linear_components(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the linear components of the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_linear_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.quadratic_constraints.add( + ... name=str(i), + ... lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(3)] + [0, 1, 2] + >>> c.quadratic_constraints.get_num() + 3 + >>> c.quadratic_constraints.get_linear_components(2) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for row in c.quadratic_constraints.get_linear_components("0", 1): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + >>> for row in c.quadratic_constraints.get_linear_components([1, "0"]): + ... print(row) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> for row in c.quadratic_constraints.get_linear_components(): + ... print(row) + SparsePair(ind = [], val = []) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getlin(a): + return SparsePair(*CPX_PROC.getqconstr_lin( + self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getlin, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_quad_num_nonzeros(self, *args): + """Returns the number of nonzeros in the quadratic part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_quad_num_nonzeros() + Returns the number of nonzeros in all quadratic constraints + from the problem. + + quadratic_constraints.get_quad_num_nonzeros(i) + i must be a quadratic constraint name or index. Returns the + number of nonzeros in the quadratic constraint whose index + or name is i. + + quadratic_constraints.get_quad_num_nonzeros(s) + s must be a sequence of quadratic constraint names or + indices. Returns the number of nonzeros in the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_quad_num_nonzeros(i) for i in s] + + quadratic_constraints.get_quad_num_nonzeros(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the number of nonzeros in the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_quad_num_nonzeros(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)]) + >>> [c.quadratic_constraints.add( + ... name = str(i), + ... quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_quad_num_nonzeros(8) + 9 + >>> c.quadratic_constraints.get_quad_num_nonzeros("1",2) + [1, 2, 3] + >>> c.quadratic_constraints.get_quad_num_nonzeros([2,"1",5]) + [3, 1, 6] + >>> c.quadratic_constraints.get_quad_num_nonzeros() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getquadnz(a): + return CPX_PROC.getqconstr_info( + self._env._e, self._cplex._lp, a)[3] + return apply_freeform_one_arg( + getquadnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_quadratic_components(self, *args): + """Returns the quadratic part of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_quadratic_components() + return the quadratic components of all quadratic constraints + from the problem. + + quadratic_constraints.get_quadratic_components(i) + i must be a quadratic constraint name or index. Returns the + quadratic component of the quadratic constraint whose index or + name is i. + + quadratic_constraints.get_quadratic_components(s) + s must be a sequence of quadratic constraint names or + indices. Returns the quadratic components of the quadratic + constraints with indices the members of s. Equivalent to + [quadratic_constraints.get_quadratic_components(i) for i in s] + + quadratic_constraints.get_quadratic_components(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the quadratic components of the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + quadratic_constraints.get_quadratic_components(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)] + ... ) + >>> [c.quadratic_constraints.add( + ... name="q{0}".format(i), + ... quad_expr=[range(i), range(i), + ... [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 3)] + [0, 1] + >>> c.quadratic_constraints.get_num() + 2 + >>> c.quadratic_constraints.get_quadratic_components(1) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components("q1", 1): + ... print(quad) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components(["q2", 0]): + ... print(quad) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + >>> for quad in c.quadratic_constraints.get_quadratic_components(): + ... print(quad) + SparseTriple(ind1 = [0], ind2 = [0], val = [1.0]) + SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0]) + """ + def getquad(a): + return SparseTriple(*CPX_PROC.getqconstr_quad( + self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getquad, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of quadratic constraints. + + Can be called by four forms. + + quadratic_constraints.get_names() + return the names of all quadratic constraints from the + problem. + + quadratic_constraints.get_names(i) + i must be a quadratic constraint index. Returns the name + of constraint i. + + quadratic_constraints.get_names(s) + s must be a sequence of quadratic constraint indices. + Returns the names of the quadratic constraints with indices + the members of s. Equivalent to + [quadratic_constraints.get_names(i) for i in s] + + quadratic_constraints.get_names(begin, end) + begin and end must be quadratic constraint indices. Returns + the names of the quadratic constraints with indices between + begin and end, inclusive of end. Equivalent to + quadratic_constraints.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)]) + >>> [c.quadratic_constraints.add( + ... name = "q" + str(i), + ... quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.quadratic_constraints.get_num() + 10 + >>> c.quadratic_constraints.get_names(8) + 'q9' + >>> c.quadratic_constraints.get_names(1, 3) + ['q2', 'q3', 'q4'] + >>> c.quadratic_constraints.get_names([2, 0, 5]) + ['q3', 'q1', 'q6'] + >>> c.quadratic_constraints.get_names() + ['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9', 'q10'] + """ + def getname(a): + return CPX_PROC.getqconstrname( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+
+ + + +
+[docs] +class SOSType(ConstantClass): + """Constants defining the type of special ordered sets. + + For a definition of SOS type 1 and 2, see those topics in the CPLEX + User's Manual. + """ + SOS1 = _constants.CPX_TYPE_SOS1 + SOS2 = _constants.CPX_TYPE_SOS2
+ + + +
+[docs] +class SOSInterface(BaseInterface): + """Class containing methods for Special Ordered Sets (SOS).""" + + type = SOSType() + """See `SOSType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new SOSInterface. + + The SOS interface is exposed by the top-level `Cplex` class as + `Cplex.SOS`. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=cplex, getindexfunc=CPX_PROC.getsosindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of special ordered sets.""" + return CPX_PROC.getnumsos(self._env._e, self._cplex._lp)
+ + + # FIXME: 'type' and 'SOS' are bad variable names. type is a "reserved" + # word and SOS should be lowercased. + def _add(self, type, SOS, name): + """non-public""" + indices, weights = unpack_pair(SOS) + CPX_PROC.addsos(self._env._e, self._cplex._lp, type, [0], + self._cplex.variables._conv(indices), + weights, [name]) + +
+[docs] + def add(self, type="1", SOS=None, name=""): + """Adds a special ordered set constraint to the problem. + + Takes three keyword arguments. + + type : can be either SOS.type.SOS1 or SOS.type.SOS2 + + SOS : either a SparsePair or a list of two lists, the first of + which contains variable indices or names, the second of which + contains the weights to assign to those variables. + + name: the name of the SOS + + Returns the index of the added SOS constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(10)]) + >>> c.SOS.add(type = "1", name = "type_one", + ... SOS = cplex.SparsePair(ind = ["2", "3"], + ... val = [25.0, 18.0])) + 0 + >>> c.SOS.add(type = "2", name = "type_two", + ... SOS = cplex.SparsePair(ind = ["2", "4", "7", "3"], + ... val = [1.0, 3.0, 25.0, 18.0])) + 1 + """ + if SOS is None: + SOS = SparsePair([0], [0.0]) + # We only ever create one sos constraint at a time. + return self._add_single(self.get_num, self._add, + type, SOS, name)
+ + +
+[docs] + def delete(self, *args): + """Deletes special ordered sets from the problem. + + There are four forms by which SOS.delete may be called. + + SOS.delete() + deletes all SOS constraints from the problem. + + SOS.delete(i) + i must be a SOS constraint name or index. Deletes the SOS + constraint indexed as i or named i. + + SOS.delete(s) + s must be a sequence of SOS constraint names or indices. + Deletes the SOS constraints with names or indices contained + within s. Equivalent to [SOS.delete(i) for i in s]. + + SOS.delete(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Deletes the SOS constraints with indices between begin + and end, inclusive of end. Equivalent to + SOS.delete(range(begin, end + 1)). This will give the best + performance when deleting batches of SOS constraints. + + See `CPXdelsos <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsos.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y']) + >>> l = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.SOS.add(name=str(i), SOS=l) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.delete(8) + >>> c.SOS.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.SOS.delete("1", 3) + >>> c.SOS.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.SOS.delete([2, "0", 5]) + >>> c.SOS.get_names() + ['4', '6', '7'] + >>> c.SOS.delete() + >>> c.SOS.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsos(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_sets(self, *args): + """Returns the sets of variables and their corresponding weights. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + SOS.get_sets() + return the set of variables and weights of all SOS + constraints from the problem. + + SOS.get_sets(i) + i must be a SOS constraint name or index. Returns the set + of variables and weights of the SOS constraint whose index + or name is i. + + SOS.get_sets(s) + s must be a sequence of SOS constraint names or indices. + Returns the variables and weights of the SOS constraints + with indices the members of s. Equivalent to + [SOS.get_sets(i) for i in s] + + SOS.get_sets(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the variables and weights of the SOS constraints + with indices between begin and end, inclusive of end. + Equivalent to SOS.get_sets(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(4)], + ... types="B" * 4 + ... ) + >>> [c.SOS.add( + ... name="s{0}".format(i), + ... SOS=[range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1, 3)] + [0, 1] + >>> c.SOS.get_num() + 2 + >>> c.SOS.get_sets(1) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for s in c.SOS.get_sets("s1", 1): + ... print(s) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + >>> for s in c.SOS.get_sets(["s2", 0]): + ... print(s) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + SparsePair(ind = [0], val = [1.0]) + >>> for s in c.SOS.get_sets(): + ... print(s) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + """ + def getsos(a, b=self.get_num() - 1): + ret = CPX_PROC.getsos(self._env._e, self._cplex._lp, a, b) + mat = _HBMatrix() + mat.matbeg = ret[0] + mat.matind = ret[1] + mat.matval = ret[2] + return [m for m in mat] + return apply_freeform_two_args(getsos, self._conv, args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the type of a set of special ordered sets. + + Return values are attributes of Cplex.SOS.type. + + Can be called by four forms. + + SOS.get_types() + return the type of all SOS constraints. + + SOS.get_types(i) + i must be a SOS constraint name or index. Returns the type + of the SOS constraint whose index or name is i. + + SOS.get_types(s) + s must be a sequence of SOS constraint names or indices. + Returns the type of the SOS constraints with indices the + members of s. Equivalent to [SOS.get_types(i) for i in s] + + SOS.get_types(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the type of the SOS constraints with indices + between begin and end, inclusive of end. Equivalent to + SOS.get_types(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.SOS.add(name = str(i), type = str(i % 2 + 1)) + ... for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_types(8) + '1' + >>> c.SOS.get_types("1",3) + ['2', '1', '2'] + >>> c.SOS.get_types([2,"0",5]) + ['1', '1', '2'] + >>> c.SOS.get_types() + ['1', '2', '1', '2', '1', '2', '1', '2', '1', '2'] + """ + def gettype(a, b=self.get_num() - 1): + return CPX_PROC.getsos_info(self._env._e, self._cplex._lp, a, b)[0] + t = [i for i in "".join(apply_freeform_two_args( + gettype, self._conv, args))] + return t[0] if len(t) == 1 else t
+ + +
+[docs] + def get_num_members(self, *args): + """Returns the size of a set of special ordered sets. + + Can be called by four forms. + + SOS.get_num_members() + return the number of variables in all SOS constraints from + the problem. + + SOS.get_num_members(i) + i must be a SOS constraint name or index. Returns the + number of variables in the SOS constraint whose index or + name is i. + + SOS.get_num_members(s) + s must be a sequence of SOS constraint names or indices. + Returns the number of variables in the SOS constraints with + indices the members of s. Equivalent to + [SOS.get_num_members(i) for i in s] + + SOS.get_num_members(begin, end) + begin and end must be SOS constraint indices or SOS constraint + names. Returns the number of variables in the SOS constraints + with indices between begin and end, inclusive of end. + Equivalent to SOS.get_num_members(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11) + >>> [c.SOS.add(name = str(i), + ... SOS = [range(i), [1.0 * (j+1.0) for j in range(i)]]) + ... for i in range(1,11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_num_members(7) + 8 + >>> c.SOS.get_num_members("1",2) + [1, 2, 3] + >>> c.SOS.get_num_members([3,"1",4]) + [4, 1, 5] + >>> c.SOS.get_num_members() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getsize(a): + return CPX_PROC.getsos_info(self._env._e, self._cplex._lp, a, a)[1] + return apply_freeform_one_arg( + getsize, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of special ordered sets. + + Can be called by four forms. + + SOS.get_names() + return the names of all SOS constraints from the problem. + + SOS.get_names(i) + i must be an SOS constraint index. Returns the name of + SOS constraint i. + + SOS.get_names(s) + s must be a sequence of SOS constraint indices. Returns + the names of the SOS constraints with indices the members + of s. Equivalent to [SOS.get_names(i) for i in s] + + SOS.get_names(begin, end) + begin and end must be SOS constraint indices. Returns the names + of the SOS constraints with indices between begin and end, + inclusive of end. Equivalent to + SOS.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ["x0"]) + >>> [c.SOS.add(name = "sos" + str(i)) for i in range(1, 11)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.SOS.get_num() + 10 + >>> c.SOS.get_names(8) + 'sos9' + >>> c.SOS.get_names(1, 3) + ['sos2', 'sos3', 'sos4'] + >>> c.SOS.get_names([2, 0, 5]) + ['sos3', 'sos1', 'sos6'] + >>> c.SOS.get_names() + ['sos1', 'sos2', 'sos3', 'sos4', 'sos5', 'sos6', 'sos7', 'sos8', 'sos9', 'sos10'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getsosname(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getname, self._conv, args)
+
+ + + +
+[docs] +class EffortLevel(ConstantClass): + """Effort levels associated with a MIP start""" + auto = _constants.CPX_MIPSTART_AUTO + check_feasibility = _constants.CPX_MIPSTART_CHECKFEAS + solve_fixed = _constants.CPX_MIPSTART_SOLVEFIXED + solve_MIP = _constants.CPX_MIPSTART_SOLVEMIP + repair = _constants.CPX_MIPSTART_REPAIR + no_check = _constants.CPX_MIPSTART_NOCHECK
+ + + +
+[docs] +class MIPStartsInterface(BaseInterface): + """Contains methods pertaining to MIP starts.""" + + effort_level = EffortLevel() + """See `EffortLevel()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new MIPStartsInterface. + + The MIP starts interface is exposed by the top-level `Cplex` + class as `Cplex.MIP_starts`. This constructor is not meant to be + used externally. + """ + super().__init__(cplex=cplex, + getindexfunc=CPX_PROC.getmipstartindex)
+ + +
+[docs] + def get_num(self): + """Returns the number of MIP starts currently stored. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(5)]) + >>> c.MIP_starts.get_num() + 5 + """ + return CPX_PROC.getnummipstarts(self._env._e, self._cplex._lp)
+ + +
+[docs] + def read(self, filename): + """Reads MIP starts from a file. + + This method reads a file in the format MST and copies the + information of all the MIP starts contained in that file into a + CPLEX problem object. The parameter cplex.parameters.advance + must be set to cplex.parameters.advance.values.standard, its + default value, or cplex.parameters.advance.values.alternate + in order for the MIP starts to be used. + + Note + If the MIP start file is successfully read, then any + previously existing MIP starts will be deleted. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.MIP_starts.write("test_all.mst") + >>> c.MIP_starts.read("test_all.mst") + """ + CPX_PROC.readcopymipstarts(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def write(self, filename, begin=-1, end=-1): + """Writes a set of MIP starts to a file. + + If called with only a filename, writes all MIP starts to that + file. + + If called with a filename and one index or name of a MIP + start, writes only that MIP start to the file. + + If called with a filename and two indices or names of MIP + starts, writes all MIP starts between the first and second + index or name, inclusive of begin and end, to the file. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(5)]) + >>> c.MIP_starts.write("test_all.mst") + >>> c.MIP_starts.write("test_one.mst", 1) + >>> c.MIP_starts.write("test_four.mst", 1, 4) + """ + if begin == -1 and end == -1: + begin = 0 + end = self.get_num() - 1 + if end == -1: + end = begin + CPX_PROC.writemipstarts(self._env._e, self._cplex._lp, filename, + begin, end)
+ + + def _add(self, *args): + """non-public""" + if len(args) == 1: + for arg in args[0]: + self._add(*arg) + else: + if len(args) == 2: + name = "" + elif len(args) == 3: + name = args[2] + else: + raise WrongNumberOfArgumentsError() + ind, val = unpack_pair(args[0]) + CPX_PROC.addmipstarts( + self._env._e, self._cplex._lp, [0], + self._cplex.variables._conv(ind), + val, [args[1]], [name]) + +
+[docs] + def add(self, *args): + """Adds MIP starts to the problem. + + To add a single MIP start, call this method as + + cpx.MIP_starts.add(start, effort_level, name) + + The first argument, start, must be either a SparsePair + instance or a list of two lists, the first of which contains + variable indices or names, the second of which contains the + values that those variables take. + + The second argument, effort_level, must be an attribute of + MIP_starts.effort_level. + + The third optional argument is the name of the MIP start. + + To add a set of MIP starts, call this method as + + cpx.MIP_starts.add(sequence) + + where sequence is a list or tuple of pairs (start, + effort_level) or triples (start, effort_level, name) as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(11)], + ... types = "I" * 11) + >>> indices = c.MIP_starts.add( + ... cplex.SparsePair(ind = [0], val = [0.0]), + ... c.MIP_starts.effort_level.repair, "first") + >>> indices = c.MIP_starts.add( + ... cplex.SparsePair(ind = [1], val = [0.0]), + ... c.MIP_starts.effort_level.solve_MIP) + >>> indices = c.MIP_starts.add( + ... [([[2, 4], [0.0, 1.0]], + ... c.MIP_starts.effort_level.auto, "third"), + ... ([[3, 4], [1.0, 3.0]], + ... c.MIP_starts.effort_level.check_feasibility)]) + >>> c.MIP_starts.get_num() + 4 + >>> c.MIP_starts.get_names() + ['first', 'm2', 'third', 'm4'] + """ + return self._add_iter(self.get_num, self._add, *args)
+ + +
+[docs] + def change(self, *args): + """Changes a MIP start or set of MIP starts. + + To change a single MIP start, call this method as + + cpx.MIP_starts.change(ID, start, effort_level) + + The first argument, ID, must be an index or name of an + existing MIP start. + + The second argument, start, must be either a SparsePair + instance or a list of two lists, the first of which contains + variable indices or names, the second of which contains the + values that those variables take. If the MIP start identified + by ID already has a value for a variable specified by start, + that value is replaced. + + The third argument, effort_level, must be an attribute of + MIP_starts.effort_level. + + To change multiple MIP starts, call this method as + + cpx.MIP_starts.change(sequence) + + where sequence is a list of tuple of triples (ID, start, + effort_level) as described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = ["x{0}".format(i) for i in range(4)], + ... types = "I" * 4 + ... ) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [0.0]), + ... c.MIP_starts.effort_level.auto) for i in range(3)]) + >>> for s in c.MIP_starts.get_starts(): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [0.0]), 0) + (SparsePair(ind = [2], val = [0.0]), 0) + >>> c.MIP_starts.get_names() + ['m1', 'm2', 'm3'] + >>> check = c.MIP_starts.effort_level.check_feasibility + >>> repair = c.MIP_starts.effort_level.repair + >>> c.MIP_starts.change("m1", [["x0", "x1"], [1.0, 2.0]], check) + >>> c.MIP_starts.get_starts("m1") + (SparsePair(ind = [0, 1], val = [1.0, 2.0]), 1) + >>> c.MIP_starts.change(1, [[1, 2], [-1.0, -2.0]], repair) + >>> c.MIP_starts.get_starts("m2") + (SparsePair(ind = [1, 2], val = [-1.0, -2.0]), 4) + >>> c.MIP_starts.change([(1, [[0, 2], [-1.0, 2.0]], check), + ... ("m3", [["x0", 2], [3.0, 2.0]], repair)]) + >>> for s in c.MIP_starts.get_starts(["m2", "m3"]): + ... print(s) + (SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, 2.0]), 1) + (SparsePair(ind = [0, 2], val = [3.0, 2.0]), 4) + """ + if len(args) == 3: + ind, val = unpack_pair(args[1]) + CPX_PROC.chgmipstarts( + self._env._e, self._cplex._lp, [self._conv(args[0])], [0], + self._cplex.variables._conv(ind), + val, [args[2]]) + elif len(args) == 1: + for arg in args[0]: + self.change(arg[0], arg[1], arg[2]) + else: + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def delete(self, *args): + """Deletes MIP starts from the problem. + + There are four forms by which MIP_starts.delete may be called. + + MIP_starts.delete() + deletes all MIP starts from the problem. + + MIP_starts.delete(i) + i must be a MIP start name or index. Deletes the MIP start + whose index or name is i. + + MIP_starts.delete(s) + s must be a sequence of MIP start names or indices. + Deletes the MIP starts with names or indices contained within + s. Equivalent to [MIP_starts.delete(i) for i in s]. + + MIP_starts.delete(begin, end) + begin and end must be MIP start indices or MIP start names. + Deletes the MIP starts with indices between begin and end, + inclusive of end. Equivalent to + MIP_starts.delete(range(begin, end + 1)). This will give the + best performance when deleting batches of MIP starts. + + See `CPXdelmipstarts <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delmipstarts.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["II"]) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind=['x'], val=[1.0]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.delete(8) + >>> c.MIP_starts.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.MIP_starts.delete("1", 3) + >>> c.MIP_starts.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.MIP_starts.delete([2, "0", 5]) + >>> c.MIP_starts.get_names() + ['4', '6', '7'] + >>> c.MIP_starts.delete() + >>> c.MIP_starts.get_names() + [] + """ + + def _delete(begin, end=None): + CPX_PROC.delmipstarts(self._env._e, self._cplex._lp, begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_starts(self, *args): + """Returns a set of MIP starts. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + MIP_starts.get_starts() + return the starting vector for all MIP starts from the + problem. + + MIP_starts.get_starts(i) + i must be a MIP start name or index. Returns the starting + vector for the MIP start whose index or name is i. + + MIP_starts.get_starts(s) + s must be a sequence of MIP start names or indices. + Returns the starting vector for the MIP starts with indices + the members of s. Equivalent to [MIP_starts.get_starts(i) + for i in s] + + MIP_starts.get_starts(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the starting vector for the MIP starts with indices + between begin and end, inclusive of end. Equivalent to + MIP_starts.get_starts(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=[str(i) for i in range(11)], + ... types="B" * 11) + >>> indices =c.MIP_starts.add( + ... [(cplex.SparsePair(ind=[i], val=[1.0 * i]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_starts(7) + (SparsePair(ind = [7], val = [7.0]), 0) + >>> for s in c.MIP_starts.get_starts("0", 2): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [1.0]), 0) + (SparsePair(ind = [2], val = [2.0]), 0) + >>> for s in c.MIP_starts.get_starts([2, "0", 5]): + ... print(s) + (SparsePair(ind = [2], val = [2.0]), 0) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [5], val = [5.0]), 0) + >>> c.MIP_starts.delete(3,9) + >>> for s in c.MIP_starts.get_starts(): + ... print(s) + (SparsePair(ind = [0], val = [0.0]), 0) + (SparsePair(ind = [1], val = [1.0]), 0) + (SparsePair(ind = [2], val = [2.0]), 0) + >>> c.MIP_starts.effort_level[0] + 'auto' + """ + def getmst(a, b=self.get_num() - 1): + ret = CPX_PROC.getmipstarts(self._env._e, self._cplex._lp, a, b) + mat = _HBMatrix() + mat.matbeg = ret[0] + mat.matind = ret[1] + mat.matval = ret[2] + return [(m, ret[3][i]) for (i, m) in enumerate(mat)] + return apply_freeform_two_args(getmst, self._conv, args)
+ + +
+[docs] + def get_effort_levels(self, *args): + """Returns the effort levels for a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_effort_levels() + return the effort level for all MIP starts from the + problem. + + MIP_starts.get_effort_levels(i) + i must be a MIP start name or index. Returns the effort + level for the MIP start whose index or name is i. + + MIP_starts.get_effort_levels(s) + s must be a sequence of MIP start names or indices. + Returns the effort level for the MIP starts with indices + the members of s. Equivalent to + [MIP_starts.get_effort_levels(i) for i in s] + + MIP_starts.get_effort_levels(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the effort level for the MIP starts with indices + between begin and end, inclusive of end. Equivalent to + MIP_starts.get_effort_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(10)], + ... types = "B" * 10) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = [i], val = [1.0 * i]), + ... c.MIP_starts.effort_level.auto, str(i)) + ... for i in range(10)]) + >>> c.MIP_starts.change([(1, [[0], [0.0]], c.MIP_starts.effort_level.check_feasibility), + (2, [[0], [0.0]], c.MIP_starts.effort_level.solve_fixed), + (3, [[0], [0.0]], c.MIP_starts.effort_level.solve_MIP), + (4, [[0], [0.0]], c.MIP_starts.effort_level.repair), + (5, [[0], [0.0]], c.MIP_starts.effort_level.no_check)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.effort_level[c.MIP_starts.get_effort_levels(3)] + 'solve_MIP' + >>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels("0",2)] + ['auto', 'check_feasibility', 'solve_fixed'] + >>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels([2,"0",5])] + ['solve_fixed', 'auto', 'no_check'] + >>> c.MIP_starts.get_effort_levels() + [0, 1, 2, 3, 4, 5, 0, 0, 0, 0] + """ + def geteffort(a, b=self.get_num() - 1): + return CPX_PROC.getmipstarts_effort(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(geteffort, self._conv, args)
+ + +
+[docs] + def get_num_entries(self, *args): + """Returns the number of variables specified by a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_num_entries() + return the length of the starting vector for all MIP starts + from the problem. + + MIP_starts.get_num_entries(i) + i must be a MIP start name or index. Returns the length of + the starting vector for the MIP start whose index or name + is i. + + MIP_starts.get_num_entries(s) + s must be a sequence of MIP start names or indices. + Returns the length of the starting vector for the MIP + starts with indices the members of s. Equivalent to + [MIP_starts.get_num_entries(i) for i in s] + + MIP_starts.get_num_entries(begin, end) + begin and end must be MIP start indices or MIP start names. + Returns the length of the starting vector for the MIP starts + with indices between begin and end, inclusive of end. + Equivalent to + MIP_starts.get_num_entries(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "B" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = range(i), val = [0.0] * i), + ... c.MIP_starts.effort_level.auto, str(i - 1)) + ... for i in range(1, 11)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_num_entries(3) + 4 + >>> c.MIP_starts.get_num_entries("0",2) + [1, 2, 3] + >>> c.MIP_starts.get_num_entries([2,"0",5]) + [3, 1, 6] + >>> c.MIP_starts.get_num_entries() + [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] + """ + def getmstsize(a): + return CPX_PROC.getmipstarts_size(self._env._e, self._cplex._lp, a, a) + return apply_freeform_one_arg( + getmstsize, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of MIP starts. + + Can be called by four forms. + + MIP_starts.get_names() + return the names of all MIP starts from the problem. + + MIP_starts.get_names(i) + i must be a MIP start index. Returns the name of MIP start i. + + MIP_starts.get_names(s) + s must be a sequence of MIP start indices. Returns the + names of the MIP starts with indices the members of s. + Equivalent to [MIP_starts.get_names(i) for i in s] + + MIP_starts.get_names(begin, end) + begin and end must be MIP start indices. Returns the names of + the MIP starts with indices between begin and end, inclusive of + end. Equivalent to MIP_starts.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names = [str(i) for i in range(11)], + ... types = "B" * 11) + >>> indices = c.MIP_starts.add( + ... [(cplex.SparsePair(ind = range(i), val = [0.0] * i), + ... c.MIP_starts.effort_level.auto, "mst" + str(i - 1)) + ... for i in range(1, 11)]) + >>> c.MIP_starts.get_num() + 10 + >>> c.MIP_starts.get_names(8) + 'mst8' + >>> c.MIP_starts.get_names(1, 3) + ['mst1', 'mst2', 'mst3'] + >>> c.MIP_starts.get_names([2, 0, 5]) + ['mst2', 'mst0', 'mst5'] + >>> c.MIP_starts.get_names() + ['mst0', 'mst1', 'mst2', 'mst3', 'mst4', 'mst5', 'mst6', 'mst7', 'mst8', 'mst9'] + """ + def getname(a, b=self.get_num() - 1): + return CPX_PROC.getmipstartname(self._env._e, self._cplex._lp, + a, b) + return apply_freeform_two_args(getname, self._conv, args)
+
+ + + +
+[docs] +class ObjSense(ConstantClass): + """Constants defining the sense of the objective function. + + See `CPXgetobjsen <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getobjsen.html>`_ in the Callable Library Reference + Manual for more detail. + """ + maximize = _constants.CPX_MAX + """See CPX_MAX in the C API.""" + + minimize = _constants.CPX_MIN + """See CPX_MIN in the C API."""
+ + + +
+[docs] +class ObjectiveInterface(BaseInterface): + """Contains methods for querying and modifying the objective function.""" + + sense = ObjSense() + """See `ObjSense()` """ + +
+[docs] + def set_linear(self, *args): + """Changes the linear part of the objective function. + + Can be called by two forms: + + objective.set_linear(var, value) + var must be a variable index or name and value must be a + float. Changes the coefficient of the variable identified + by var to value. + + objective.set_linear(sequence) + sequence is a sequence of pairs (var, value) as described + above. Changes the coefficients for the specified + variables to the given values. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(4)]) + >>> c.objective.get_linear() + [0.0, 0.0, 0.0, 0.0] + >>> c.objective.set_linear(0, 1.0) + >>> c.objective.get_linear() + [1.0, 0.0, 0.0, 0.0] + >>> c.objective.set_linear("3", -1.0) + >>> c.objective.get_linear() + [1.0, 0.0, 0.0, -1.0] + >>> c.objective.set_linear([("2", 2.0), (1, 0.5)]) + >>> c.objective.get_linear() + [1.0, 0.5, 2.0, -1.0] + """ + + def chgobj(a, b): + CPX_PROC.chgobj(self._env._e, self._cplex._lp, a, b) + apply_pairs(chgobj, self._cplex.variables._conv, *args)
+ + +
+[docs] + def set_quadratic(self, *args): + """Sets the quadratic part of the objective function. + + Call this method with a list with length equal to the number + of variables in the problem. + + If the quadratic objective function is separable, the entries + of the list must all be of type float or int. + + If the quadratic objective function is not separable, the + entries of the list must be either SparsePair instances or + lists of two lists, the first of which contains variable + indices or names, the second of which contains the values that + those variables take. + + Note + Successive calls to set_quadratic will overwrite any previous + quadratic objective function. To modify only part of the + quadratic objective function, use the method + set_quadratic_coefficients. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(3)]) + >>> c.objective.set_quadratic( + ... [cplex.SparsePair(ind=[0, 1, 2], val=[1.0, -2.0, 0.5]), + ... cplex.SparsePair(ind=[0, 1], val=[-2.0, -1.0]), + ... cplex.SparsePair(ind=[0, 2], val=[0.5, -3.0])] + ... ) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [0, 1, 2], val = [1.0, -2.0, 0.5]) + SparsePair(ind = [0, 1], val = [-2.0, -1.0]) + SparsePair(ind = [0, 2], val = [0.5, -3.0]) + >>> c.objective.set_quadratic([1.0, 2.0, 3.0]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [1], val = [2.0]) + SparsePair(ind = [2], val = [3.0]) + """ + if len(args) != 1: + raise WrongNumberOfArgumentsError() + if isinstance(args[0], _HBMatrix): + CPX_PROC.copyquad( + self._env._e, self._cplex._lp, args[0].matbeg, + self._cplex.variables._conv(args[0].matind), + args[0].matval) + elif isinstance(args[0][0], numbers.Number): + CPX_PROC.copyqpsep(self._env._e, self._cplex._lp, args[0]) + else: + self.set_quadratic(_HBMatrix(args[0]))
+ + +
+[docs] + def set_quadratic_coefficients(self, *args): + """Sets coefficients of the quadratic component of the objective + function. + + To set a single coefficient, call this method as + + objective.set_quadratic_coefficients(v1, v2, val) + + where v1 and v2 are names or indices of variables and val is + the value for the coefficient. + + To set multiple coefficients, call this method as + + objective.set_quadratic_coefficients(sequence) + + where sequence is a list or tuple of triples (v1, v2, val) as + described above. + + Note + Since the quadratic objective function must be symmetric, each + triple in which v1 is different from v2 is used to set both + the (v1, v2) coefficient and the (v2, v1) coefficient. If + (v1, v2) and (v2, v1) are set with a single call, the second + value is stored. + + Note + Attempting to set many coefficients with set_quadratic_coefficients + can be time consuming. Instead, use the method set_quadratic to set + the quadratic part of the objective efficiently. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1], val = [1.0]) + SparsePair(ind = [0], val = [1.0]) + SparsePair(ind = [], val = []) + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), + ... (0, 2, 3.0)]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1, 2], val = [1.0, 3.0]) + SparsePair(ind = [0, 1], val = [1.0, 2.0]) + SparsePair(ind = [0], val = [3.0]) + >>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), + ... (1, 0, 5.0)]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [1, 2], val = [5.0, 3.0]) + SparsePair(ind = [0, 1], val = [5.0, 2.0]) + SparsePair(ind = [0], val = [3.0]) + """ + if len(args) not in (3, 1): + raise WrongNumberOfArgumentsError() + if isinstance(args[0], (str, int)): + arg_list = [args] + else: + arg_list = args[0] + varcache = {} + for i, j, val in arg_list: + CPX_PROC.chgqpcoef(self._env._e, self._cplex._lp, + self._cplex.variables._conv(i, varcache), + self._cplex.variables._conv(j, varcache), + val)
+ + +
+[docs] + def set_sense(self, sense): + """Sets the sense of the objective function. + + The argument to this method must be either + objective.sense.minimize or objective.sense.maximize. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + >>> c.objective.set_sense(c.objective.sense.maximize) + >>> c.objective.sense[c.objective.get_sense()] + 'maximize' + >>> c.objective.set_sense(c.objective.sense.minimize) + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + """ + CPX_PROC.chgobjsen(self._env._e, self._cplex._lp, sense)
+ + +
+[docs] + def set_name(self, name): + """Sets the name of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_name("cost") + >>> c.objective.get_name() + 'cost' + """ + CPX_PROC.copyobjname(self._env._e, self._cplex._lp, name)
+ + +
+[docs] + def get_linear(self, *args): + """Returns the linear coefficients of a set of variables. + + Can be called by four forms. + + objective.get_linear() + return the linear objective coefficients of all variables + from the problem. + + objective.get_linear(i) + i must be a variable name or index. Returns the linear + objective coefficient of the variable whose index or name + is i. + + objective.get_linear(s) + s must be a sequence of variable names or indices. Returns + the linear objective coefficient of the variables with + indices the members of s. Equivalent to + [objective.get_linear(i) for i in s] + + objective.get_linear(begin, end) + begin and end must be variable indices or variable names. + Returns the linear objective coefficient of the variables with + indices between begin and end, inclusive of end. Equivalent to + objective.get_linear(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(obj = [1.5 * i for i in range(10)], + names = [str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.objective.get_linear(8) + 12.0 + >>> c.objective.get_linear("1",3) + [1.5, 3.0, 4.5] + >>> c.objective.get_linear([2,"0",5]) + [3.0, 0.0, 7.5] + >>> c.objective.get_linear() + [0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5] + """ + def getobj(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getobj(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getobj, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_quadratic(self, *args): + """Returns a set of columns of the quadratic component of the + objective function. + + Returns a SparsePair instance or a list of SparsePair instances. + + Can be called by four forms. + + objective.get_quadratic() + return the entire quadratic objective function. + + objective.get_quadratic(i) + i must be a variable name or index. Returns the column of + the quadratic objective function associated with the + variable whose index or name is i. + + objective.get_quadratic(s) + s must be a sequence of variable names or indices. Returns + the columns of the quadratic objective function associated + with the variables with indices the members of s. + Equivalent to [objective.get_quadratic(i) for i in s] + + objective.get_quadratic(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the quadratic objective function + associated with the variables with indices between begin and + end, inclusive of end. Equivalent to + objective.get_quadratic(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=[str(i) for i in range(10)]) + >>> c.variables.get_num() + 10 + >>> c.objective.set_quadratic([1.5 * i for i in range(10)]) + >>> c.objective.get_quadratic(8) + SparsePair(ind = [8], val = [12.0]) + >>> for q in c.objective.get_quadratic("1", 3): + ... print(q) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [2], val = [3.0]) + SparsePair(ind = [3], val = [4.5]) + >>> for q in c.objective.get_quadratic([3, "1", 5]): + ... print(q) + SparsePair(ind = [3], val = [4.5]) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [5], val = [7.5]) + >>> for q in c.objective.get_quadratic(): + ... print(q) + SparsePair(ind = [], val = []) + SparsePair(ind = [1], val = [1.5]) + SparsePair(ind = [2], val = [3.0]) + SparsePair(ind = [3], val = [4.5]) + SparsePair(ind = [4], val = [6.0]) + SparsePair(ind = [5], val = [7.5]) + SparsePair(ind = [6], val = [9.0]) + SparsePair(ind = [7], val = [10.5]) + SparsePair(ind = [8], val = [12.0]) + SparsePair(ind = [9], val = [13.5]) + """ + num = self._cplex.variables.get_num() + + def getquad(begin, end=num - 1): + mat = _HBMatrix() + t = CPX_PROC.getquad(self._env._e, self._cplex._lp, begin, end) + mat.matbeg, mat.matind, mat.matval = t + return [m for m in mat] + return apply_freeform_two_args( + getquad, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_quadratic_coefficients(self, *args): + """Returns individual coefficients from the quadratic objective function. + + To query a single coefficient, call this as + + objective.get_quadratic_coefficients(v1, v2) + + where v1 and v2 are indices or names of variables. + + To query multiple coefficients, call this method as + + objective.get_quadratic_coefficients(sequence) + + where sequence is a list or tuple of pairs (v1, v2) as + described above. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_quadratic_coefficients("1", 0) + 1.0 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0), (1, 0, 5.0)]) + >>> c.objective.get_quadratic_coefficients([(1, 0), (1, "1"), (2, "0")]) + [5.0, 2.0, 3.0] + """ + def getqpcoef(v1, v2): + return CPX_PROC.getqpcoef(self._env._e, self._cplex._lp, v1, v2) + if len(args) == 2: + indices = self._cplex.variables._conv(args) + return getqpcoef(indices[0], indices[1]) + if len(args) == 1: + return [self.get_quadratic_coefficients(*arg) for arg in args[0]] + raise WrongNumberOfArgumentsError()
+ + +
+[docs] + def get_sense(self): + """Returns the sense of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + >>> c.objective.set_sense(c.objective.sense.maximize) + >>> c.objective.sense[c.objective.get_sense()] + 'maximize' + >>> c.objective.set_sense(c.objective.sense.minimize) + >>> c.objective.sense[c.objective.get_sense()] + 'minimize' + """ + return CPX_PROC.getobjsen(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_name(self): + """Returns the name of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_name("cost") + >>> c.objective.get_name() + 'cost' + """ + return CPX_PROC.getobjname(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_quadratic_variables(self): + """Returns the number of variables with quadratic coefficients. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_num_quadratic_variables() + 2 + >>> c.objective.set_quadratic([1.0, 0.0, 0.0]) + >>> c.objective.get_num_quadratic_variables() + 1 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)]) + >>> c.objective.get_num_quadratic_variables() + 3 + """ + return CPX_PROC.getnumquad(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_quadratic_nonzeros(self): + """Returns the number of nonzeros in the quadratic objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(3)]) + >>> c.objective.set_quadratic_coefficients(0, 1, 1.0) + >>> c.objective.get_num_quadratic_nonzeros() + 2 + >>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)]) + >>> c.objective.get_num_quadratic_nonzeros() + 5 + >>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), (1, 0, 0.0)]) + >>> c.objective.get_num_quadratic_nonzeros() + 3 + """ + return CPX_PROC.getnumqpnz(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_offset(self): + """Returns the constant offset of the objective function for a problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> offset = c.objective.get_offset() + >>> abs(offset - 0.0) < 1e-6 + True + """ + return CPX_PROC.getobjoffset(self._env._e, self._cplex._lp)
+ + +
+[docs] + def set_offset(self, offset): + """Sets the constant offset of the objective function for a problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.objective.set_offset(3.14) + >>> offset = c.objective.get_offset() + >>> abs(offset - 3.14) < 1e-6 + True + """ + return CPX_PROC.chgobjoffset(self._env._e, self._cplex._lp, offset)
+
+ + + +
+[docs] +class ProgressInterface(BaseInterface): + """Methods to query the progress of optimization.""" + +
+[docs] + def __init__(self, parent): + """Creates a new ProgressInterface. + + The progress interface is exposed by the top-level `Cplex` + class as Cplex.solution.progress. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations executed so far. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_iterations() + """ + if self._cplex._is_MIP(): + return CPX_PROC.getmipitcnt(self._env._e, self._cplex._lp) + siftcnt = CPX_PROC.getsiftitcnt(self._env._e, self._cplex._lp) + if siftcnt > 0: + return siftcnt + baritcnt = CPX_PROC.getbaritcnt(self._env._e, self._cplex._lp) + if baritcnt > 0: + return baritcnt + return CPX_PROC.getitcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_barrier_iterations(self): + """Returns the number of barrier iterations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_barrier_iterations() + """ + return CPX_PROC.getbaritcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_sifting_iterations(self): + """Returns the number of sifting iterations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting) + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_sifting_iterations() + """ + return CPX_PROC.getsiftitcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_phase_one_iterations(self): + """Returns the number of iterations to find a feasible solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_phase_one_iterations() + """ + return CPX_PROC.getphase1cnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_sifting_phase_one_iterations(self): + """Returns the number of sifting iterations to find a feasible solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting) + >>> c.solve() + >>> num_iter = c.solution.progress.get_num_sifting_phase_one_iterations() + """ + return CPX_PROC.getsiftphase1cnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_nodes_processed(self): + """Returns the number of nodes processed. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num_nodes = c.solution.progress.get_num_nodes_processed() + """ + return CPX_PROC.getnodecnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_nodes_remaining(self): + """Returns the number of nodes left to process. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num_nodes = c.solution.progress.get_num_nodes_remaining() + """ + return CPX_PROC.getnodeleftcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_push(self): + """Returns the number of primal push operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_push = c.solution.progress.get_num_primal_push() + """ + return CPX_PROC.getcrossppushcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_exchange(self): + """Returns the number of primal exchange operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_exch = c.solution.progress.get_num_primal_exchange() + """ + return CPX_PROC.getcrosspexchcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_push(self): + """Returns the number of dual push operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_push = c.solution.progress.get_num_dual_push() + """ + return CPX_PROC.getcrossdpushcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_exchange(self): + """Returns the number of dual exchange operations. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier) + >>> c.solve() + >>> num_exch = c.solution.progress.get_num_dual_exchange() + """ + return CPX_PROC.getcrossdexchcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_conflict_passes(self): + """Returns the number of passes performed by the conflict + refiner. + + See `CPXgetconflictnumpasses <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictnumpasses.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine() + >>> c.solution.progress.get_num_conflict_passes() + 5 + """ + return CPX_PROC.getconflictnumpasses(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class InfeasibilityInterface(BaseInterface): + """Methods for computing degree of infeasibility in a solution vector. + + Each of these methods takes one required argument, x, which must + be a list of floats with length equal to the number of variables. + + If no other arguments are provided, the methods return the + violation for all constraints of the given type. + + If one string or integer is provided, it is taken to be the name + or index of a constraint of the given type. The methods return + the violation of that constraint. + + If two strings or integers are provided, they are taken to be the + names or indices of constraints of the given type. All violations + for constraints between the first and second, inclusive, are + returned in a list. + + If a sequence of strings or integers are provided, they are taken + to be the names or indices of constraints of the given type. All + violations for constraints identified in the sequence are returned + in a list. + """ + +
+[docs] + def __init__(self, parent): + """Creates a new InfeasibilityInterface. + + The infeasibility interface is exposed by the top-level `Cplex` + class as Cplex.solution.infeasibility. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def bound_constraints(self, x, *args): + """Returns the amount by which variable bounds are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), 2) + 0.0 + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), "x10") + 0.0 + >>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), ["x10", 8]) + [0.0, 0.0] + >>> bd = c.solution.infeasibility.bound_constraints(c.solution.get_values()) + >>> bd[15] + 0.0 + """ + def getinfeas(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getcolinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.variables._conv, args)
+ + +
+[docs] + def linear_constraints(self, x, *args): + """Returns the amount by which a set of linear constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> sol_vals = c.solution.get_values() + >>> getrowinfeas = c.solution.infeasibility.linear_constraints + >>> abs(getrowinfeas(sol_vals, "c10")) + 0.0 + >>> abs(getrowinfeas(sol_vals, 7)) + 0.0 + >>> [abs(x) for x in getrowinfeas(sol_vals, ["c13", 4])] + [0.0, 0.0] + >>> lconstraint = getrowinfeas(sol_vals) + >>> abs(lconstraint[5]) + 0.0 + + """ + def getinfeas(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getrowinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def quadratic_constraints(self, x, *args): + """Returns the amount by which a set of quadratic constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> getqconstrinfeas = c.solution.infeasibility.quadratic_constraints + >>> abs(getqconstrinfeas(c.solution.get_values(), 2)) < 1e-6 + True + >>> abs(getqconstrinfeas(c.solution.get_values(), "QC3")) < 1e-6 + True + >>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values(), [1, "QC1"])] + [True, True] + >>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values())] + [True, True, True, True] + + """ + def getinfeas(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getqconstrinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def indicator_constraints(self, x, *args): + """Returns the amount by which indicator constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), 3) + 0.0 + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), "c21") + 0.0 + >>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), ["c21", 10]) + [0.0, 0.0] + >>> iconstraint = c.solution.infeasibility.indicator_constraints(c.solution.get_values()) + >>> iconstraint[5] + 0.0 + """ + def getinfeas(a, b=self._cplex.indicator_constraints.get_num() - 1): + return CPX_PROC.getindconstrinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.indicator_constraints._conv, args)
+ + +
+[docs] + def SOS_constraints(self, x, *args): + """Returns the amount by which SOS constraints are violated by x. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), 0) + 0.0 + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), "set1") + 0.0 + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), ["set1", 0]) + [0.0, 0.0] + >>> c.solution.infeasibility.SOS_constraints(c.solution.get_values()) + [0.0] + """ + def getinfeas(a, b=self._cplex.SOS.get_num() - 1): + return CPX_PROC.getsosinfeas(self._env._e, self._cplex._lp, x, a, b) + return apply_freeform_two_args( + getinfeas, self._cplex.SOS._conv, args)
+
+ + + +
+[docs] +class CutType(ConstantClass): + """Identifiers for types of cuts.""" + # NB: If you edit these, look at MIPInfoCallback.cut_type too! + cover = _constants.CPX_CUT_COVER + GUB_cover = _constants.CPX_CUT_GUBCOVER + flow_cover = _constants.CPX_CUT_FLOWCOVER + clique = _constants.CPX_CUT_CLIQUE + fractional = _constants.CPX_CUT_FRAC + MIR = _constants.CPX_CUT_MIR + flow_path = _constants.CPX_CUT_FLOWPATH + disjunctive = _constants.CPX_CUT_DISJ + implied_bound = _constants.CPX_CUT_IMPLBD + zero_half = _constants.CPX_CUT_ZEROHALF + multi_commodity_flow = _constants.CPX_CUT_MCF + _local_cover = _constants.CPX_CUT_LOCALCOVER + _tighten = _constants.CPX_CUT_TIGHTEN + _objective_disjunctive = _constants.CPX_CUT_OBJDISJ + lift_and_project = _constants.CPX_CUT_LANDP + user = _constants.CPX_CUT_USER + table = _constants.CPX_CUT_TABLE + solution_pool = _constants.CPX_CUT_SOLNPOOL + local_implied_bound = _constants.CPX_CUT_LOCALIMPLBD + BQP = _constants.CPX_CUT_BQP + RLT = _constants.CPX_CUT_RLT + benders = _constants.CPX_CUT_BENDERS + __num_types = _constants.CPX_CUT_NUM_TYPES
+ + + +
+[docs] +class MIPSolutionInterface(BaseInterface): + """Methods for accessing solutions to a MIP.""" + + cut_type = CutType() + """See `CutType()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new MIPSolutionInterface. + + The MIP solution interface is exposed by the top-level `Cplex` + class as Cplex.solution.MIP. This constructor is not meant to + be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_best_objective(self): + """Returns the currently best known bound of all the remaining + open nodes in a branch-and-cut tree. + + It is computed for a minimization problem as the minimum + objective function value of all remaining unexplored nodes. + Similarly, it is computed for a maximization problem as the + maximum objective function value of all remaining unexplored + nodes. + + For a regular MIP optimization, this value is also the best known + bound on the optimal solution value of the MIP problem. In fact, + when a problem has been solved to optimality, this value matches + the optimal solution value. + + However, for the populate method, the value can also exceed the + optimal solution value if CPLEX has already solved the model to + optimality but continues to search for additional solutions. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> best_obj = c.solution.MIP.get_best_objective() + >>> abs(best_obj - 499.0) < 1e-6 + True + """ + return CPX_PROC.getbestobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_cutoff(self): + """Returns the MIP cutoff value. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> cutoff = c.solution.MIP.get_cutoff() + >>> abs(cutoff - 499.0) < 1e-6 + True + """ + return CPX_PROC.getcutoff(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_mip_relative_gap(self): + """Returns the MIP relative gap. + + See `CPXgetmiprelgap <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/getmiprelgap.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.MIP.get_mip_relative_gap() + 0.0 + """ + return CPX_PROC.getmiprelgap(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_incumbent_node(self): + """Returns the node number of the best solution found. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.threads.set(1) + >>> c.solve() + >>> c.solution.MIP.get_incumbent_node() >= 0 + True + + """ + return CPX_PROC.getnodeint(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_cuts(self, cut_type): + """Returns the number of cuts of the specified type. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> ncuts = c.solution.MIP.get_num_cuts( + ... c.solution.MIP.cut_type.zero_half) + + """ + return CPX_PROC.getnumcuts(self._env._e, self._cplex._lp, cut_type)
+ + +
+[docs] + def get_subproblem_status(self): + """Returns the solution status of the last subproblem optimization. + + Returns an attribute of Cplex.solution.status if there was an + error termination where a subproblem could not be solved to + completion during mixed integer optimization. Otherwise 0 + (zero) is returned if no error occurred. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.MIP.get_subproblem_status() + 0 + """ + return CPX_PROC.getsubstat(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class BasisVarStatus(ConstantClass): + """Status values returned by basis query methods.""" + at_lower_bound = _constants.CPX_AT_LOWER + basic = _constants.CPX_BASIC + at_upper_bound = _constants.CPX_AT_UPPER + free_nonbasic = _constants.CPX_FREE_SUPER
+ + + +
+[docs] +class BasisInterface(BaseInterface): + """Methods for accessing the basis of a solution.""" + + status = BasisVarStatus() + """See `BasisVarStatus()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new BasisInterface. + + The basis interface is exposed by the top-level `Cplex` class as + Cplex.solution.basis. This constructor is not meant to be used + externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def get_basis(self): + """Returns the status of structural and slack variables. + + Returns a pair of lists of attributes of solution.basis.status. + The first lists the status of the structural variables (of length + equal to the number of variables), the second lists the status of + the slack variables (of length equal to the number of linear + constraints). + + See `CPXgetbase <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getbase.html>`_ in the Callable Library Reference Manual + for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> pair_of_lists = c.solution.basis.get_basis() + """ + return CPX_PROC.getbase(self._env._e, self._cplex._lp)
+ + +
+[docs] + def write(self, filename): + """Writes the basis to a file. + + See `CPXmbasewrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/mbasewrite.html>`_ in the Callable Library Reference + Manual and also `InitialInterface.read_basis()`. + + Example: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.basis.write("lpex.bas") + """ + CPX_PROC.mbasewrite(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def get_header(self): + """Returns the basis header. + + Returns a pair (head, x), where head is a list of variable + indices and x is a list of floats indicating the values of + those variables. Indices of basic slacks are specified by + -rowindex - 1. + """ + return CPX_PROC.getbhead(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_basic_row_index(self, row): + """Returns the position of a basic slack variable in the basis header. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.basis.get_basic_row_index(2) + 3 + """ + return CPX_PROC.getijrow(self._env._e, self._cplex._lp, row, True)
+ + +
+[docs] + def get_basic_col_index(self, col): + """Returns the position of a basic structural variable in the basis header. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.basis.get_basic_col_index(2) + 1 + """ + return CPX_PROC.getijrow(self._env._e, self._cplex._lp, col, False)
+ + +
+[docs] + def get_primal_norms(self): + """Returns norms from the primal steepest edge. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.parameters.simplex.pgradient.set(c.parameters.simplex.pgradient.values.steep) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal) + >>> c.solve() + >>> pnorm = c.solution.basis.get_primal_norms() + >>> for i, j in zip(pnorm[1], [1.722656, 1.691406, 2.0, 1.062499]): + ... abs(i - j) < 1e-6 + ... + True + True + True + True + """ + return CPX_PROC.getpnorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_dual_norms(self): + """Returns norms from the dual steepest edge. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.solve() + >>> c.solution.basis.get_dual_norms() + ([1.0, 1.0, 1.0, 1.0], [1, 2, 3, -3]) + """ + return CPX_PROC.getdnorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_basis_dual_norms(self): + """Returns basis and dual norms. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.solve() + >>> c.solution.basis.get_basis_dual_norms() + ([2, 1, 1, 1], [0, 0, 1, 0], [1.0, 1.0, 1.0, 1.0]) + """ + return CPX_PROC.getbasednorms(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_primal_superbasic(self): + """Returns the number of primal superbasic variables. + + """ + return CPX_PROC.getpsbcnt(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num_dual_superbasic(self): + """Returns the number of primal superbasic variables. + + """ + return CPX_PROC.getdsbcnt(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class SensitivityInterface(BaseInterface): + """Methods for sensitivity analysis.""" + +
+[docs] + def __init__(self, parent): + """Creates a new SensitivityInterface. + + The sensitivity interface is exposed by the top-level `Cplex` + class as Cplex.solution.sensitivity. This constructor is not + meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def lower_bounds(self, *args): + """Returns the sensitivity of a set of lower bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.lower_bounds(1) + (-1e+20, 17.5) + >>> c.solution.sensitivity.lower_bounds('x3') + (-1e+20, 42.5) + >>> c.solution.sensitivity.lower_bounds(["x3", 0]) + [(-1e+20, 42.5), (-1e+20, 40.0)] + >>> c.solution.sensitivity.lower_bounds() + [(-1e+20, 40.0), (-1e+20, 17.5), (-1e+20, 42.5), (-1e+20, 0.625)] + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa_lower(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def upper_bounds(self, *args): + """Returns the sensitivity of a set of upper bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.upper_bounds(1) + (17.5, 1e+20) + >>> c.solution.sensitivity.upper_bounds("x3") + (42.5, 1e+20) + >>> bupper = c.solution.sensitivity.upper_bounds(["x3", 0]) + >>> for i, j in zip(bupper, [(42.5, 1e+20), (36.428571, 155.0)]): + ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 + ... + True + True + >>> bupper = c.solution.sensitivity.upper_bounds() + >>> for i, j in zip(bupper[3], (0.625, 1e+20)): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa_upper(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def bounds(self, *args): + """Returns the sensitivity of a set of both lower and upper bounds. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.bounds(1) + (-1e+20, 17.5, 17.5, 1e+20) + >>> c.solution.sensitivity.bounds("x3") + (-1e+20, 42.5, 42.5, 1e+20) + >>> c.solution.sensitivity.bounds(["x3", 1]) + [(-1e+20, 42.5, 42.5, 1e+20), (-1e+20, 17.5, 17.5, 1e+20)] + >>> bd = c.solution.sensitivity.bounds() + >>> bd[1] + (-1e+20, 17.5, 17.5, 1e+20) + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.boundsa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def objective(self, *args): + """Returns the sensitivity of part of the objective function. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.sensitivity.objective(1) + (-3.0, 5.0) + >>> c.solution.sensitivity.objective("x3") + (-1e+20, -2.0) + >>> c.solution.sensitivity.objective(["x3", 1]) + [(-1e+20, -2.0), (-3.0, 5.0)] + >>> c.solution.sensitivity.objective() + [(-1e+20, 2.5), (-3.0, 5.0), (-1e+20, -2.0), (0.0, 4.0)] + """ + def sa(a, b=self._cplex.variables.get_num() - 1): + return unzip(CPX_PROC.objsa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.variables._conv, args)
+ + +
+[docs] + def rhs(self, *args): + """Returns the sensitivity of the righthand side of a set of linear constraints. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> rhssa = c.solution.sensitivity.rhs(1) + >>> for i, j in zip(rhssa, (20.0, 46.666666)): + ... abs(i - j) < 1e-6 + ... + True + True + >>> c.solution.sensitivity.rhs("c3") + (-1e+20, 112.5) + >>> rhssa = c.solution.sensitivity.rhs(["c3", 1]) + >>> for i, j in zip(rhssa, [(-1e+20, 112.5), (20.0, 46.666666)]): + ... abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6 + ... + True + True + >>> rhssa = c.solution.sensitivity.rhs() + >>> for i, j in zip(rhssa[3], (-1e+20, 42.5)): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def sa(a, b=self._cplex.linear_constraints.get_num() - 1): + return unzip(CPX_PROC.rhssa(self._env._e, self._cplex._lp, a, b)) + return apply_freeform_two_args( + sa, self._cplex.linear_constraints._conv, args)
+
+ + + +
+[docs] +class FilterType(ConstantClass): + """Attributes define the filter types.""" + diversity = _constants.CPX_SOLNPOOL_FILTER_DIVERSITY + range = _constants.CPX_SOLNPOOL_FILTER_RANGE
+ + + +
+[docs] +class SolnPoolFilterInterface(BaseInterface): + """Methods for solution pool filters.""" + + type = FilterType() + """See `FilterType()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new SolnPoolFilterInterface. + + The solution pool filter interface is exposed by the top-level + `Cplex` class as Cplex.solution.pool.filter. This constructor + is not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True, + getindexfunc=CPX_PROC.getsolnpoolfilterindex)
+ + + def _add_diversity_filter(self, lb, ub, expression, weights, name): + """non-public""" + ind, val = unpack_pair(expression) + validate_arg_lengths( + [ind, val, weights], + extra_msg=": expression, weights" + ) + CPX_PROC.addsolnpooldivfilter( + self._env._e, self._cplex._lp, lb, ub, + self._cplex.variables._conv(ind), + weights, val, name) + +
+[docs] + def add_diversity_filter(self, lb, ub, expression, weights=None, + name=''): + """Adds a diversity filter to the solution pool. + + The arguments determine, in order, + + the lower bound (float) + + the upper bound (float) + + the variables and values it takes as either a SparsePair or a + list of two lists. + + a set of weights (a list of floats with the same length as + expression). If an empty list is given, then weights of 1.0 + (one) will be used. + + name (string) + + Returns the index of the added diversity filter. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_diversity_filter( + ... 300, 600, [['x1','x2'], [1,1]], [2,1], "") + 0 + """ + (weights,) = init_list_args(weights) + return self._add_single(self.get_num, self._add_diversity_filter, + lb, ub, expression, weights, name)
+ + + def _add_range_filter(self, lb, ub, expression, name): + """non-public""" + ind, val = unpack_pair(expression) + CPX_PROC.addsolnpoolrngfilter( + self._env._e, self._cplex._lp, lb, ub, + self._cplex.variables._conv(ind), + val, name) + +
+[docs] + def add_range_filter(self, lb, ub, expression, name=''): + """Adds a range filter to the solution pool. + + The arguments determine, in order, + + the lower bound (float) + + the upper bound (float) + + the variables and values it takes as either a SparsePair or a + list of two lists. + + name (string) + + Returns the index of the added range filter. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + """ + return self._add_single(self.get_num, self._add_range_filter, + lb, ub, expression, name)
+ + +
+[docs] + def get_diversity_filters(self, *args): + """Returns a set of diversity filters. + + Returns filters as pairs of (SparsePair, weights), where + weights is a list of floats. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["BB"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], str(i)) + ... for i in range(2)] + [0, 1] + >>> c.solution.pool.filter.get_diversity_filters(0) + (SparsePair(ind = [0], val = [1.0]), [1.0]) + >>> c.solution.pool.filter.get_diversity_filters("1") + (SparsePair(ind = [0], val = [1.0]), [1.0]) + >>> c.solution.pool.filter.get_diversity_filters([0, "1"]) + [(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])] + >>> c.solution.pool.filter.get_diversity_filters() + [(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])] + """ + def getflt(a): + ret = CPX_PROC.getsolnpooldivfilter( + self._env._e, self._cplex._lp, a) + return (SparsePair(ret[2], ret[4]), ret[3]) + return apply_freeform_one_arg( + getflt, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_range_filters(self, *args): + """Returns a set of range filters. + + Returns filters as SparsePair instances. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(2)] + [0, 1] + >>> c.solution.pool.filter.get_range_filters(0) + SparsePair(ind = [0], val = [1.0]) + >>> c.solution.pool.filter.get_range_filters("1") + SparsePair(ind = [0], val = [1.0]) + >>> c.solution.pool.filter.get_range_filters([0, "1"]) + [SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])] + >>> c.solution.pool.filter.get_range_filters() + [SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])] + """ + def getflt(a): + ret = CPX_PROC.getsolnpoolrngfilter( + self._env._e, self._cplex._lp, a) + return SparsePair(ret[2], ret[3]) + return apply_freeform_one_arg( + getflt, self._conv, self.get_num(), args)
+ + + def _getfilter_constant(self, which): + filter_type = self.get_types(which) + if filter_type == self.type.diversity: + func = CPX_PROC.getsolnpooldivfilter_constant + else: + assert filter_type == self.type.range + func = CPX_PROC.getsolnpoolrngfilter_constant + return func(self._env._e, self._cplex._lp, which) + +
+[docs] + def get_bounds(self, *args): + """Returns (lb, ub) pairs for a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["BB"]) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], "div{0}".format(i)) for i in range(2)] + [0, 1] + >>> [c.solution.pool.filter.add_range_filter( + ... 0, 1, f, "rng{0}".format(i)) for i in range(2)] + [2, 3] + >>> c.solution.pool.filter.get_bounds(0) + (0.0, 1.0) + >>> c.solution.pool.filter.get_bounds("rng0") + (0.0, 1.0) + >>> c.solution.pool.filter.get_bounds(["div0", 2]) + [(0.0, 1.0), (0.0, 1.0)] + >>> c.solution.pool.filter.get_bounds() + [(0.0, 1.0), (0.0, 1.0), (0.0, 1.0), (0.0, 1.0)] + """ + def getbds(which): + lb, ub, _ = self._getfilter_constant(which) + return (lb, ub) + return apply_freeform_one_arg( + getbds, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_num_nonzeros(self, *args): + """Returns the number of variables specified by a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=["BB"]) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_diversity_filter( + ... 0, 1, f, [1], "div{0}".format(i)) for i in range(2)] + [0, 1] + >>> [c.solution.pool.filter.add_range_filter( + ... 0, 1, f, "rng{0}".format(i)) for i in range(2)] + [2, 3] + >>> c.solution.pool.filter.get_num_nonzeros(0) + 1 + >>> c.solution.pool.filter.get_num_nonzeros("rng0") + 1 + >>> c.solution.pool.filter.get_num_nonzeros(["div0", 2]) + [1, 1] + >>> c.solution.pool.filter.get_num_nonzeros() + [1, 1, 1, 1] + """ + def getnnz(which): + _, _, nnz = self._getfilter_constant(which) + return nnz + return apply_freeform_one_arg( + getnnz, self._conv, self.get_num(), args)
+ + +
+[docs] + def delete(self, *args): + """Deletes filters from the problem. + + There are four forms by which filters.delete may be called. + + filters.delete() + deletes all filters from the problem. + + filters.delete(i) + i must be a filter name or index. Deletes the filter whose + index or name is i. + + filters.delete(s) + s must be a sequence of filter names or indices. Deletes + the filters with names or indices contained within s. + Equivalent to [filters.delete(i) for i in s]. + + filters.delete(begin, end) + begin and end must be filter indices or filter names. Deletes + the filters with indices between begin and end, inclusive of + end. Equivalent to filters.delete(range(begin, end + 1)). This + will give the best performance when deleting batches of + filters. + + See `CPXdelsolnpoolfilters <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsolnpoolfilters.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names=['x', 'y'], types=['II']) + >>> f = cplex.SparsePair(ind=['x'], val=[1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_num() + 10 + >>> c.solution.pool.filter.delete(8) + >>> c.solution.pool.filter.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '9'] + >>> c.solution.pool.filter.delete('1', 3) + >>> c.solution.pool.filter.get_names() + ['0', '4', '5', '6', '7', '9'] + >>> c.solution.pool.filter.delete([2, '0', 5]) + >>> c.solution.pool.filter.get_names() + ['4', '6', '7'] + >>> c.solution.pool.filter.delete() + >>> c.solution.pool.filter.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsolnpoolfilters(self._env._e, self._cplex._lp, + begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_types(self, *args): + """Returns the types of a set of filters. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_types(3) + 2 + >>> c.solution.pool.filter.get_types("5") + 2 + >>> c.solution.pool.filter.get_types([2, "8"]) + [2, 2] + >>> c.solution.pool.filter.get_types() + [2, 2, 2, 2, 2, 2, 2, 2, 2, 2] + """ + def gettype(a): + return CPX_PROC.getsolnpoolfiltertype(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + gettype, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of filters, given their indices. + + There are four forms by which solution.pool.filter.get_names may be called. + + solution.pool.filter.get_names() + return the names of all solution pool filters from the problem. + + solution.pool.filter.get_names(i) + i must be a solution filter index. Returns the name of row i. + + solution.pool.filter.get_names(s) + s must be a sequence of row indices. Returns the names of + the solution pool filters with indices the members of s. + Equivalent to [solution.pool.filter.get_names(i) for i in s] + + solution.pool.filter.get_names(begin, end) + begin and end must be solution filter indices. Returns the + names of the solution pool filter with indices between begin + and end, inclusive of end. Equivalent to + solution.pool.filter.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = ['x','y'], types = ["II"]) + >>> f = cplex.SparsePair(ind = ['x'],val = [1.0]) + >>> [c.solution.pool.filter.add_range_filter( + ... 0.0, 1.0, f, str(i)) for i in range(10)] + [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] + >>> c.solution.pool.filter.get_names() + ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] + >>> c.solution.pool.filter.get_names(6) + '6' + >>> c.solution.pool.filter.get_names([5, 3]) + ['5', '3'] + >>> c.solution.pool.filter.get_names(3, 5) + ['3', '4', '5'] + """ + def getname(a): + return CPX_PROC.getsolnpoolfiltername( + self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+ + +
+[docs] + def write(self, filename): + """Writes the filters to a file. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.write("ind.flt") + """ + CPX_PROC.fltwrite(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def read(self, filename): + """Reads filters from a file. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.write("ind.flt") + >>> c.solution.pool.filter.read("ind.flt") + """ + CPX_PROC.readcopysolnpoolfilters(self._env._e, self._cplex._lp, + filename)
+ + +
+[docs] + def get_num(self): + """Returns the number of filters in the problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.filter.add_range_filter( + ... 300, 600, [['x1','x2'], [1,1]], "") + 0 + >>> c.solution.pool.filter.get_num() + 1 + """ + return CPX_PROC.getsolnpoolnumfilters(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class QualityMetric(ConstantClass): + """Measures of solution quality.""" + max_primal_infeasibility = _constants.CPX_MAX_PRIMAL_INFEAS + max_scaled_primal_infeasibility = _constants.CPX_MAX_SCALED_PRIMAL_INFEAS + sum_primal_infeasibilities = _constants.CPX_SUM_PRIMAL_INFEAS + sum_scaled_primal_infeasibilities = _constants.CPX_SUM_SCALED_PRIMAL_INFEAS + max_dual_infeasibility = _constants.CPX_MAX_DUAL_INFEAS + max_scaled_dual_infeasibility = _constants.CPX_MAX_SCALED_DUAL_INFEAS + sum_dual_infeasibilities = _constants.CPX_SUM_DUAL_INFEAS + sum_scaled_dual_infeasibilities = _constants.CPX_SUM_SCALED_DUAL_INFEAS + max_int_infeasibility = _constants.CPX_MAX_INT_INFEAS + sum_integer_infeasibilities = _constants.CPX_SUM_INT_INFEAS + max_primal_residual = _constants.CPX_MAX_PRIMAL_RESIDUAL + max_scaled_primal_residual = _constants.CPX_MAX_SCALED_PRIMAL_RESIDUAL + sum_primal_residual = _constants.CPX_SUM_PRIMAL_RESIDUAL + sum_scaled_primal_residual = _constants.CPX_SUM_SCALED_PRIMAL_RESIDUAL + max_dual_residual = _constants.CPX_MAX_DUAL_RESIDUAL + max_scaled_dual_residual = _constants.CPX_MAX_SCALED_DUAL_RESIDUAL + sum_dual_residual = _constants.CPX_SUM_DUAL_RESIDUAL + sum_scaled_dual_residual = _constants.CPX_SUM_SCALED_DUAL_RESIDUAL + max_comp_slack = _constants.CPX_MAX_COMP_SLACK + sum_comp_slack = _constants.CPX_SUM_COMP_SLACK + max_x = _constants.CPX_MAX_X + max_scaled_x = _constants.CPX_MAX_SCALED_X + max_pi = _constants.CPX_MAX_PI + max_scaled_pi = _constants.CPX_MAX_SCALED_PI + max_slack = _constants.CPX_MAX_SLACK + max_scaled_slack = _constants.CPX_MAX_SCALED_SLACK + max_reduced_cost = _constants.CPX_MAX_RED_COST + max_scaled_reduced_cost = _constants.CPX_MAX_SCALED_RED_COST + sum_x = _constants.CPX_SUM_X + sum_scaled_x = _constants.CPX_SUM_SCALED_X + sum_pi = _constants.CPX_SUM_PI + sum_scaled_pi = _constants.CPX_SUM_SCALED_PI + sum_slack = _constants.CPX_SUM_SLACK + sum_scaled_slack = _constants.CPX_SUM_SCALED_SLACK + sum_reduced_cost = _constants.CPX_SUM_RED_COST + sum_scaled_reduced_cost = _constants.CPX_SUM_SCALED_RED_COST + kappa = _constants.CPX_KAPPA + objective_gap = _constants.CPX_OBJ_GAP + dual_objective = _constants.CPX_DUAL_OBJ + primal_objective = _constants.CPX_PRIMAL_OBJ + max_quadratic_primal_residual = _constants.CPX_MAX_QCPRIMAL_RESIDUAL + sum_quadratic_primal_residual = _constants.CPX_SUM_QCPRIMAL_RESIDUAL + max_quadratic_slack_infeasibility = _constants.CPX_MAX_QCSLACK_INFEAS + sum_quadratic_slack_infeasibility = _constants.CPX_SUM_QCSLACK_INFEAS + max_quadratic_slack = _constants.CPX_MAX_QCSLACK + sum_quadratic_slack = _constants.CPX_SUM_QCSLACK + max_indicator_slack_infeasibility = _constants.CPX_MAX_INDSLACK_INFEAS + sum_indicator_slack_infeasibility = _constants.CPX_SUM_INDSLACK_INFEAS + max_pwl_slack_infeasibility = _constants.CPX_MAX_PWLSLACK_INFEAS + sum_pwl_slack_infeasibility = _constants.CPX_SUM_PWLSLACK_INFEAS + exact_kappa = _constants.CPX_EXACT_KAPPA + kappa_stable = _constants.CPX_KAPPA_STABLE + kappa_suspicious = _constants.CPX_KAPPA_SUSPICIOUS + kappa_unstable = _constants.CPX_KAPPA_UNSTABLE + kappa_illposed = _constants.CPX_KAPPA_ILLPOSED + kappa_max = _constants.CPX_KAPPA_MAX + kappa_attention = _constants.CPX_KAPPA_ATTENTION
+ + + +@contextmanager +def _temp_results_stream(cpx, temp_stream): + old_results_stream = cpx._env._get_results_stream() + try: + yield cpx._env.set_results_stream(temp_stream) + finally: + cpx._env.set_results_stream(old_results_stream._file) + + +
+[docs] +class QualityMetrics(): + """A class containing measures of the quality of a solution. + + The __str__ method of this class prints all available measures of + the quality of the solution in human readable form. + + This class may have a different set of data members depending on + the optimization algorithm used and the quality metrics that are + available. + + An instance of this class always has the member quality_type, + which is one of the following strings: + + * "feasopt" + * "simplex" + * "quadratically_constrained" + * "barrier" + * "MIP" + + If self.quality_type is "feasopt" this instance has the following + members: + + * scaled + * max_x + * max_bound_infeas + * max_Ax_minus_b + * max_slack + + If self.scaled is 1, this instance also has the members: + + * max_scaled_x + * max_scaled_bound_infeas + * max_scaled_Ax_minus_b + * max_scaled_slack + + If self.quality_type is "simplex" this instance has the following + members: + + * scaled + * max_x + * max_pi + * max_reduced_cost + * max_bound_infeas + * max_reduced_cost_infeas + * max_Ax_minus_b + * max_c_minus_Bpi + * max_slack + + If self.scaled is 1, this instance also has the members: + + * max_scaled_x + * max_scaled_pi + * max_scaled_reduced_cost + * max_scaled_bound_infeas + * max_scaled_reduced_cost_infeas + * max_scaled_Ax_minus_b + * max_scaled_c_minus_Bpi + * max_scaled_slack + + If the condition number of the final basis is available, this + instance has the member: + + * kappa + + If self.quality_type is "quadratically_constrained" this instance + has the following members: + + * objective + * norm_total + * norm_max + * error_Ax_b_total + * error_Ax_b_max + * error_xQx_dx_f_total + * error_xQx_dx_f_max + * x_bound_error_total + * x_bound_error_max + * slack_bound_error_total + * slack_bound_error_max + * quadratic_slack_bound_error_total + * quadratic_slack_bound_error_max + * normalized_error_max + + If self.quality_type is "barrier" this instance has the following + members: + + * primal_objective + * dual_objective + * duality_gap + * complementarity_total + * column_complementarity_total + * column_complementarity_max + * row_complementarity_total + * row_complementarity_max + * primal_norm_total + * primal_norm_max + * dual_norm_total + * dual_norm_max + * primal_error_total + * primal_error_max + * dual_error_total + * dual_error_max + * primal_x_bound_error_total + * primal_x_bound_error_max + * primal_slack_bound_error_total + * primal_slack_bound_error_max + * dual_pi_bound_error_total + * dual_pi_bound_error_max + * dual_reduced_cost_bound_error_total + * dual_reduced_cost_bound_error_max + * primal_normalized_error + * dual_normalized_error + + If self.quality_type is "MIP" and this instance was generated for + a specific member of the solution pool, it has the members: + + * solution_name + * num_solutions + + If self.quality_type is "MIP", this instance was not generated for + a specific member of the solution pool, and kappa statistics are + available, it has the members: + + * max_kappa + * pct_kappa_stable + * pct_kappa_suspicious + * pct_kappa_unstable + * pct_kappa_illposed + * kappa_attention + + If self.quality_type is "MIP" and this instance was generated for + the incumbent solution, it has the members: + + * solver + * objective + * x_norm_total + * x_norm_max + * error_Ax_b_total + * error_Ax_b_max + * x_bound_error_total + * x_bound_error_max + * integrality_error_total + * integrality_error_max + * slack_bound_error_total + * slack_bound_error_max + + If in addition the problem this instance was generated for has + indicator constraints, it has the members: + + * indicator_slack_bound_error_total + * indicator_slack_bound_error_max + + if in addition the problem this instance was generated for has + piecewise linear constraints, it has the members: + + * piecewise_linear_error_total + * piecewise_linear_error_max + + If solver is "MIQCP" this instance also has the members: + + * error_xQx_dx_f_total + * error_xQx_dx_f_max + * quadratic_slack_bound_error_total + * quadratic_slack_bound_error_max + + See also `SolutionInterface.get_quality_metrics` and + `SolnPoolInterface.get_quality_metrics`. + """ + +
+[docs] + def __init__(self, c, soln=-1): + idata, data = CPX_PROC.getqualitymetrics(c._env._e, c._lp, soln) + # We get the "to string" from showquality by temporarily + # hijacking the results stream. + with closing(StringIO()) as output, \ + _temp_results_stream(c, output): # noqa: E127 + CPX_PROC.showquality(c._env._e, c._lp, soln) + self._tostring = output.getvalue() + if idata[0] == 0: + self.quality_type = "feasopt" + self.scaled = idata[1] == 1 + if idata[2] == 1: + self.max_bound_infeas = data[0] + if self.scaled: + self.max_scaled_bound_infeas = data[1] + else: + self.max_bound_infeas = 0.0 + if self.scaled: + self.max_scaled_bound_infeas = 0.0 + if idata[3] == 1: + self.max_Ax_minus_b = data[2] + if self.scaled: + self.max_scaled_Ax_minus_b = data[3] + else: + self.max_Ax_minus_b = 0.0 + if self.scaled: + self.max_scaled_Ax_minus_b = 0.0 + self.max_x = data[4] + if self.scaled: + self.max_scaled_x = data[5] + if idata[4] == 1: + self.max_slack = data[6] + if self.scaled: + self.max_scaled_slack = data[7] + else: + self.max_slack = 0.0 + if self.scaled: + self.max_scaled_slack = 0.0 + elif idata[0] == 1: + self.quality_type = "simplex" + self.scaled = idata[1] == 1 + if idata[2] == 1: + self.max_bound_infeas = data[0] + if self.scaled: + self.max_scaled_bound_infeas = data[1] + else: + self.max_bound_infeas = 0.0 + if self.scaled: + self.max_scaled_bound_infeas = 0.0 + if idata[3] == 1: + self.max_reduced_cost_infeas = data[2] + if self.scaled: + self.max_scaled_reduced_cost_infeas = data[3] + else: + self.max_reduced_cost_infeas = 0.0 + if self.scaled: + self.max_scaled_reduced_cost_infeas = 0.0 + if idata[6] == 1: + self.max_Ax_minus_b = data[4] + if self.scaled: + self.max_scaled_Ax_minus_b = data[5] + else: + self.max_Ax_minus_b = 0.0 + if self.scaled: + self.max_scaled_Ax_minus_b = 0.0 + if idata[7] == 1: + self.max_c_minus_Bpi = data[6] + if self.scaled: + self.max_scaled_c_minus_Bpi = data[7] + else: + self.max_c_minus_Bpi = 0.0 + if self.scaled: + self.max_scaled_c_minus_Bpi = 0.0 + self.max_x = data[8] + if self.scaled: + self.max_scaled_x = data[9] + if idata[8] == 1: + self.max_slack = data[10] + if self.scaled: + self.max_scaled_slack = data[11] + else: + self.max_slack = 0.0 + if self.scaled: + self.max_scaled_slack = 0.0 + self.max_pi = data[12] + if self.scaled: + self.max_scaled_pi = data[13] + self.max_reduced_cost = data[14] + if self.scaled: + self.max_scaled_reduced_cost = data[15] + if idata[9] == 1: + self.kappa = data[16] + elif idata[0] == 2: + self.quality_type = "quadratically_constrained" + self.objective = data[0] + self.norm_total = data[1] + self.norm_max = data[2] + self.error_Ax_b_total = data[3] + self.error_Ax_b_max = data[4] + self.error_xQx_dx_f_total = data[5] + self.error_xQx_dx_f_max = data[6] + self.x_bound_error_total = data[7] + self.x_bound_error_max = data[8] + self.slack_bound_error_total = data[9] + self.slack_bound_error_max = data[10] + self.quadratic_slack_bound_error_total = data[11] + self.quadratic_slack_bound_error_max = data[12] + self.normalized_error_max = data[13] + elif idata[0] == 3: + self.quality_type = "barrier" + self.primal_objective = data[0] + self.dual_objective = data[1] + self.duality_gap = data[2] + self.complementarity_total = data[3] + self.column_complementarity_total = data[4] + self.column_complementarity_max = data[5] + self.row_complementarity_total = data[6] + self.row_complementarity_max = data[7] + self.primal_norm_total = data[8] + self.primal_norm_max = data[9] + self.dual_norm_total = data[10] + self.dual_norm_max = data[11] + self.primal_error_total = data[12] + self.primal_error_max = data[13] + self.dual_error_total = data[14] + self.dual_error_max = data[15] + self.primal_x_bound_error_total = data[16] + self.primal_x_bound_error_max = data[17] + self.primal_slack_bound_error_total = data[18] + self.primal_slack_bound_error_max = data[19] + self.dual_pi_bound_error_total = data[20] + self.dual_pi_bound_error_max = data[21] + self.dual_reduced_cost_bound_error_total = data[22] + self.dual_reduced_cost_bound_error_max = data[23] + self.primal_normalized_error = data[24] + self.dual_normalized_error = data[25] + elif idata[0] == 4: + self.quality_type = "MIP" + if soln >= 0: + self.solution_name = c.solution.pool.get_names(soln) + self.num_solutions = c.solution.pool.get_num() + if idata[4] == 1: + if idata[2] == 0: + self.solver = "MILP" + elif idata[2] == 1: + self.solver = "MIQP" + elif idata[2] == 2: + self.solver = "MIQCP" + self.error_xQx_dx_f_total = data[6] + self.error_xQx_dx_f_max = data[7] + self.quadratic_slack_bound_error_total = data[14] + self.quadratic_slack_bound_error_max = data[15] + self.objective = data[1] + self.x_norm_total = data[2] + self.x_norm_max = data[3] + self.error_Ax_b_total = data[4] + self.error_Ax_b_max = data[5] + self.x_bound_error_total = data[8] + self.x_bound_error_max = data[9] + self.integrality_error_total = data[10] + self.integrality_error_max = data[11] + self.slack_bound_error_total = data[12] + self.slack_bound_error_max = data[13] + if idata[3] == 1: + self.indicator_slack_bound_error_total = data[16] + self.indicator_slack_bound_error_max = data[17] + if idata[5] == 1: + self.piecewise_linear_error_total = data[24] + self.piecewise_linear_error_max = data[25] + if idata[1] == 1: + self.max_kappa = data[18] + self.pct_kappa_stable = data[19] + self.pct_kappa_suspicious = data[20] + self.pct_kappa_unstable = data[21] + self.pct_kappa_illposed = data[22] + self.kappa_attention = data[23]
+ + +
+[docs] + def __str__(self): + """Returns a string containing quality metrics in human readable form.""" + # See __init__ (above) to see how this is constructed. + return self._tostring
+
+ + + +
+[docs] +class SolnPoolInterface(BaseInterface): + """Methods for accessing the solution pool.""" + + incumbent = _constants.CPX_INCUMBENT_ID + """See `_constants.CPX_INCUMBENT_ID` """ + + quality_metric = QualityMetric() + """See `QualityMetric()` """ + +
+[docs] + def __init__(self, parent): + """Creates a new SolnPoolInterface. + + The solution pool interface is exposed by the top-level `Cplex` + class as Cplex.solution.pool. This constructor is not meant to + be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True, + getindexfunc=CPX_PROC.getsolnpoolsolnindex) + self.filter = SolnPoolFilterInterface(self) + """See `SolnPoolFilterInterface()` """
+ + +
+[docs] + def get_objective_value(self, soln): + """Returns the objective value for a member of the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> obj_val = c.solution.pool.get_objective_value(0) + >>> abs(obj_val - 499.0) < 1e-6 + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + return CPX_PROC.getsolnpoolobjval(self._env._e, self._cplex._lp, soln)
+ + +
+[docs] + def get_values(self, soln, *args): + """Returns the values of a set of variables for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> v1 = c.solution.pool.get_values(1, 2) + >>> v2 = c.solution.pool.get_values(1, "x2") + >>> somevals = c.solution.pool.get_values(1, [2, "x2"]) + >>> v1 == somevals[0], v2 == somevals[1] + (True, True) + >>> allvals = c.solution.pool.get_values(1) + >>> v1 == allvals[2] + True + """ + + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getx(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getsolnpoolx(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getx, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_linear_slacks(self, soln, *args): + """Returns a set of linear slacks for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> s1 = c.solution.pool.get_linear_slacks(1, 1) + >>> s2 = c.solution.pool.get_linear_slacks(1, "c2") + >>> someslacks = c.solution.pool.get_linear_slacks(1, [1, "c2"]) + >>> s1 == someslacks[0], s2 == someslacks[1] + (True, True) + >>> allslacks = c.solution.pool.get_linear_slacks(1) + >>> s1 == allslacks[1] + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getslacks(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getsolnpoolslack(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getslacks, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_slacks(self, soln, *args): + """Returns a set of quadratic slacks for a given solution. + + Can be called by four forms. + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("miqcp.lp") + >>> c.solve() + >>> var = c.solution.pool.get_quadratic_slacks(1, 1) + >>> var = c.solution.pool.get_quadratic_slacks(1, "QC3") + >>> vars = c.solution.pool.get_quadratic_slacks(1, ["QC3", 1]) + >>> vars = c.solution.pool.get_quadratic_slacks(1) + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + + def getqslacks(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getsolnpoolqconstrslack(self._env._e, self._cplex._lp, soln, a, b) + return apply_freeform_two_args( + getqslacks, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_integer_quality(self, soln, which): + """Returns the integer quality of a given solution. + + The integer quality of a solution can either be a single attribute of + solution.pool.quality_metrics or a sequence of such + attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetsolnpoolintquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> quality_metric = c.solution.pool.quality_metric + >>> misi = quality_metric.max_indicator_slack_infeasibility + >>> c.solution.pool.get_integer_quality(1, misi) + 0 + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + if isinstance(which, int): + return CPX_PROC.getsolnpoolintquality( + self._env._e, self._cplex._lp, soln, which) + return [CPX_PROC.getsolnpoolintquality(self._env._e, + self._cplex._lp, soln, a) + for a in which]
+ + +
+[docs] + def get_float_quality(self, soln, which): + """Returns the float quality of a given solution. + + The float quality of a solution can either be a single attribute of + solution.pool.quality_metrics or a sequence of such + attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetsolnpooldblquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> qual = c.solution.pool.get_float_quality(1, + c.solution.pool.quality_metric.max_indicator_slack_infeasibility) + >>> abs(qual) < 1.e-6 + True + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + if isinstance(which, int): + return CPX_PROC.getsolnpooldblquality( + self._env._e, self._cplex._lp, soln, which) + return [CPX_PROC.getsolnpooldblquality(self._env._e, + self._cplex._lp, soln, a) + for a in which]
+ + +
+[docs] + def get_mean_objective_value(self): + """Returns the average among the objective values in the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> mov = c.solution.pool.get_mean_objective_value() + """ + return CPX_PROC.getsolnpoolmeanobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def delete(self, *args): + """Deletes solutions from the solution pool. + + There are four forms by which pool.delete may be called. + + pool.delete() + deletes all solutions from the problem. + + pool.delete(i) + i must be a solution name or index. Deletes the solution + whose index or name is i. + + pool.delete(s) + s must be a sequence of solution names or indices. Deletes + the solutions with names or indices contained within s. + Equivalent to [pool.delete(i) for i in s]. + + pool.delete(begin, end) + begin and end must be solution indices or solution names. + Deletes the solutions with indices between begin and end, + inclusive of end. Equivalent to + pool.delete(range(begin, end + 1)). This will give the best + performance when deleting batches of solutions from the + solution pool. + + See `CPXdelsolnpoolsolns <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/delsolnpoolsolns.html>`_ in the Callable Library + Reference Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(5) + >>> c.populate_solution_pool() + >>> names = c.solution.pool.get_names() + >>> c.solution.pool.delete(1) + >>> n = c.solution.pool.get_names() + >>> del names[1] + >>> n == names + True + >>> c.solution.pool.delete(names[1]) + >>> n = c.solution.pool.get_names() + >>> names.remove(names[1]) + >>> n == names + True + >>> c.solution.pool.delete([names[1], 0]) + >>> n = c.solution.pool.get_names() + >>> names.remove(names[1]) + >>> del names[0] + >>> n == names + True + >>> c.solution.pool.delete() + >>> c.solution.pool.get_names() + [] + """ + def _delete(begin, end=None): + CPX_PROC.delsolnpoolsolns(self._env._e, self._cplex._lp, + begin, end) + delete_set_by_range(_delete, self._conv, self.get_num(), *args)
+ + +
+[docs] + def get_names(self, *args): + """Returns the names of a set of solutions. + + There are four forms by which solution.pool.get_names may be called. + + solution.pool.get_names() + return the names of all solutions from the problem. + + solution.pool.get_names(i) + i must be a solution index. Returns the name of row i. + + solution.pool.get_names(s) + s must be a sequence of row indices. Returns the names of + the solutions with indices the members of s. + Equivalent to [solution.pool.get_names(i) for i in s] + + solution.pool.get_names(begin, end) + begin and end must be solution indices. Returns the names of + the solutions with indices between begin and end, inclusive of + end. Equivalent to + solution.pool.get_names(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(10) + >>> c.populate_solution_pool() + >>> names = c.solution.pool.get_names() + >>> names[1] == c.solution.pool.get_names(1) + True + >>> [names[i] for i in [1,2]] == c.solution.pool.get_names([1,2]) + True + >>> names[1:5] == c.solution.pool.get_names(1, 4) + True + """ + def getname(a): + return CPX_PROC.getsolnpoolsolnname(self._env._e, + self._cplex._lp, + a) + return apply_freeform_one_arg( + getname, self._conv, self.get_num(), args)
+ + +
+[docs] + def get_num_replaced(self): + """Returns the number of solution pool members that have been replaced. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.pool.get_num_replaced() + 0 + """ + return CPX_PROC.getsolnpoolnumreplaced(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_num(self): + """Returns the number of solutions in the solution pool. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> num = c.solution.pool.get_num() + """ + return CPX_PROC.getsolnpoolnumsolns(self._env._e, self._cplex._lp)
+ + +
+[docs] + def write(self, filename, which=None): + """Writes solutions to a file. + + If no second argument is provided, all solutions are written + to file. + + If a second argument is provided, it is the index of a + solution in the solution pool. Only that solution will be + written to file. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.parameters.randomseed.set(1) + >>> c.parameters.mip.limits.populate.set(10) + >>> c.populate_solution_pool() + >>> c.solution.pool.write("ind.sol",4) + """ + if which is None: + CPX_PROC.solwritesolnpoolall(self._env._e, self._cplex._lp, + filename) + else: + CPX_PROC.solwritesolnpool(self._env._e, self._cplex._lp, + which, filename)
+ + +
+[docs] + def get_quality_metrics(self, soln): + """Returns an object containing measures of the quality of the + specified solution. + + See `QualityMetrics`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.randomseed.set(1) + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> qm = c.solution.pool.get_quality_metrics(0) + """ + if not isinstance(soln, int): + soln = self.get_indices(soln) + return QualityMetrics(self._cplex, soln)
+
+ + + +
+[docs] +class AdvancedSolutionInterface(BaseInterface): + """Advanced methods for accessing solution information. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvcol = c.solution.advanced.binvcol() + >>> binvrow = c.solution.advanced.binvrow() + >>> binvacol = c.solution.advanced.binvacol() + >>> binvarow = c.solution.advanced.binvarow() + >>> binvcol[0][24], binvcol[1][6] + (-0.215, 1.0) + >>> binvrow[24][0], binvrow[6][1] + (-0.215, 1.0) + >>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)] + ([1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) + >>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)] + ([1.0, 0.0], [0.0, 1.0], [0.0, 0.0]) + >>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num()) + >>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)] + >>> [x if x else 0.0 for x in bbtran] + [0.0, 2.0, 1.0] + >>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num()) + >>> ftran[0] + 2.891 + """ + +
+[docs] + def __init__(self, parent): + """Creates a new AdvancedSolutionInterface. + + The advanced solution interface is exposed by the top-level + `Cplex` class as Cplex.solution.advanced. This constructor is + not meant to be used externally. + """ + super().__init__(cplex=parent._cplex, advanced=True)
+ + +
+[docs] + def binvcol(self, *args): + """Returns a set of columns of the inverted basis matrix. + + Can be called by four forms. + + solution.advanced.binvcol() + returns the inverted basis matrix as a list of columns. + + solution.advanced.binvcol(i) + i must be a linear constraint name or index. Returns the + column of the inverted basis matrix associated with i. + + solution.advanced.binvcol(s) + s must be a sequence of linear constraint names or indices. + Returns the columns of the inverted basis matrix associated + with the members of s. Equivalent to + [solution.advanced.binvcol(i) for i in s] + + solution.advanced.binvcol(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the columns of the inverted basis + matrix associated with the linear constraints between begin + and end, inclusive of end. Equivalent to + solution.advanced.binvcol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvcol = c.solution.advanced.binvcol() + >>> binvcol[0][24], binvcol[1][6] + (-0.215, 1.0) + """ + def inv(a): + return CPX_PROC.binvcol(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def binvrow(self, *args): + """Returns a set of rows of the inverted basis matrix. + + Can be called by four forms. + + solution.advanced.binvrow() + returns the inverted basis matrix as a list of rows. + + solution.advanced.binvrow(i) + i must be a linear constraint name or index. Returns the + row of the inverted basis matrix associated with i. + + solution.advanced.binvrow(s) + s must be a sequence of linear constraint names or indices. + Returns the rows of the inverted basis matrix associated + with the members of s. Equivalent to + [solution.advanced.binvrow(i) for i in s] + + solution.advanced.binvrow(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the rows of the inverted basis matrix + associated with the linear constraints between begin and end, + inclusive of end. Equivalent to + solution.advanced.binvrow(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvrow = c.solution.advanced.binvrow() + >>> binvrow[24][0], binvrow[6][1] + (-0.215, 1.0) + """ + def inv(a): + return CPX_PROC.binvrow(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def binvacol(self, *args): + """Returns a set of columns of the tableau. + + Can be called by four forms. + + solution.advanced.binvacol() + returns the tableau as a list of columns. + + solution.advanced.binvacol(i) + i must be a variable name or index. Returns the column of + the tableau associated with i. + + solution.advanced.binvacol(s) + s must be a sequence of variable names or indices. Returns + the columns of the tableau associated with the members of s. + Equivalent to [solution.advanced.binvacol(i) for i in s] + + solution.advanced.binvacol(begin, end) + begin and end must be variable indices or variable names. + Returns the columns of the tableau associated with the + variables between begin and end, inclusive of end. Equivalent + to solution.advanced.binvacol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvacol = c.solution.advanced.binvacol() + >>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)] + ([1.0, 0.0, 0.0], [0.0, 1.0, 0.0]) + """ + def inv(a): + return CPX_PROC.binvacol(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.variables._conv, + self._cplex.variables.get_num(), args)
+ + +
+[docs] + def binvarow(self, *args): + """Returns a set of rows of the tableau. + + Can be called by four forms. + + solution.advanced.binvacol() + returns the tableau as a list of rows. + + solution.advanced.binvacol(i) + i must be a linear constraint name or index. Returns the + row of the tableau associated with i. + + solution.advanced.binvacol(s) + s must be a sequence of linear constraint names or indices. + Returns the rows of the tableau associated with the members + of s. Equivalent to [solution.advanced.binvacol(i) + for i in s] + + solution.advanced.binvacol(begin, end) + begin and end must be linear constraint indices or variable + names. Returns the rows of the tableau associated with the + variables between begin and end, inclusive of end. Equivalent + to solution.advanced.binvacol(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> binvarow = c.solution.advanced.binvarow() + >>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)] + ([1.0, 0.0], [0.0, 1.0], [0.0, 0.0]) + """ + def inv(a): + return CPX_PROC.binvarow(self._env._e, self._cplex._lp, a) + return apply_freeform_one_arg( + inv, self._cplex.linear_constraints._conv, + self._cplex.linear_constraints.get_num(), args)
+ + +
+[docs] + def btran(self, y): + """Performs a backward linear solve using the basis matrix. + + Returns the solution to the linear system + + x^T B = y^T + + y must be a list of floats with length equal to the number of + linear constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num()) + >>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)] + >>> [x if x else 0.0 for x in bbtran] + [0.0, 2.0, 1.0] + """ + return CPX_PROC.btran(self._env._e, self._cplex._lp, y)
+ + +
+[docs] + def ftran(self, x): + """Performs a linear solve using the basis matrix. + + Returns the solution to the linear system + + B x = y + + y must be a list of floats with length equal to the number of + linear constraints. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num()) + >>> ftran[0] + 2.891 + """ + return CPX_PROC.ftran(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_gradients(self, *args): + """Returns information useful in post-solution analysis after an + LP has been solved and a basis is available. + + See `CPXgetgrad <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getgrad.html>`_ in the Callable Library Reference Manual + for more detail. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> grad = c.solution.advanced.get_gradients(1) + >>> grad.ind[1] + 1 + >>> grad.val[1] + 1.0 + """ + def getgrad(a): + return SparsePair(*CPX_PROC.getgrad(self._env._e, self._cplex._lp, a)) + return apply_freeform_one_arg( + getgrad, self._cplex.variables._conv, + self._cplex.variables.get_num(), args)
+ + +
+[docs] + def get_linear_slacks_from_x(self, x): + """Computes the slack values from the given solution x + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> slack = c.solution.advanced.get_linear_slacks_from_x(c.solution.get_values()) + >>> abs(slack[3]) < 1e-6 + True + """ + return CPX_PROC.slackfromx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_quadratic_slacks_from_x(self, x): + """Computes the slack values for quadratic constraints from the given solution x + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> qslack = c.solution.advanced.get_quadratic_slacks_from_x(c.solution.get_values()) + >>> abs(qslack[0]) < 1e-6 + True + """ + return CPX_PROC.qconstrslackfromx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def get_linear_reduced_costs_from_pi(self, pi): + """Computes the reduced costs from the given dual solution pi + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> reducedcost = c.solution.advanced.get_linear_reduced_costs_from_pi( + c.solution.get_dual_values()) + >>> abs(reducedcost[0]) < 1e-6 + True + """ + return CPX_PROC.djfrompi(self._env._e, self._cplex._lp, pi)
+ + +
+[docs] + def get_quadratic_reduced_costs_from_pi(self, pi, x): + """Computes the reduced costs for QP from the given solution (pi, x) + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qp.lp") + >>> c.solve() + >>> qreducedcost = c.solution.advanced.get_quadratic_reduced_costs_from_pi( + c.solution.get_dual_values(), + c.solution.get_values()) + >>> abs(qreducedcost[0]) < 1e-6 + True + """ + return CPX_PROC.qpdjfrompi(self._env._e, self._cplex._lp, pi, x)
+ + +
+[docs] + def get_Driebeek_penalties(self, basic_variables): + """Returns values known as Driebeek penalties for a sequence of basic variables. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c_stat, _ = c.solution.basis.get_basis() + >>> b = [i for i, v in enumerate(c_stat) if v == c.solution.basis.status.basic] + >>> penalties = c.solution.advanced.get_Driebeek_penalties(b) + >>> penalties[0] + (0.34477142857142856, 8.021494102228047) + """ + return unzip(CPX_PROC.mdleave( + self._env._e, self._cplex._lp, + self._cplex.variables._conv(basic_variables)))
+ + +
+[docs] + def get_quadratic_indefinite_certificate(self): + """Compute a vector x that satisfies x'Qx < 0 + + Such a vector demonstrates that the matrix Q violates the + assumption of positive semi-definiteness, and can be an aid in + debugging a user's program if indefiniteness is an unexpected + outcome. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("qpindef.lp") + >>> x = c.solution.advanced.get_quadratic_indefinite_certificate() + >>> abs(-0.5547001 - x[1]) < 1e-6 + True + """ + return CPX_PROC.qpindefcertificate(self._env._e, self._cplex._lp)
+ + +
+[docs] + def dual_farkas(self): + """Returns Farkas proof of infeasibility for the active LP model after proven infeasibility. + + See `CPXdualfarkas <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/dualfarkas.html>`_ in the Callable Library Reference + Manual for more detail. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.linear_constraints.add(senses="L", rhs=[-1]) + >>> indices = c.variables.add(lb=[1], ub=[2],columns=[[[0],[1]]]) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> y = c.solution.advanced.dual_farkas() + >>> y[1] + 2.0 + """ + return CPX_PROC.dualfarkas(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_diverging_index(self): + """Returns the index of the diverging row or column + + if the problem is not unbounded, get_diverging_index returns -1. + + If the problem is unbounded, get_diverging_index returns the + index of the diverging variable in the augmented form of the + constraint matrix. In other words, if the diverging variable + is a structural variable, get_diverging_index returns its + index; if the diverging variable is a slack or ranged + variable, get_diverging_index returns the sum of the number of + structural variables and the index of the corresponding + constraint. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.variables.add(obj=[1,1],lb=[1,-cplex.infinity],ub=[2,cplex.infinity]) + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> idx = c.solution.advanced.get_diverging_index() + >>> idx + 1 + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> indices = c.variables.add(obj=[-1,-1],lb=[1,1],ub=[2,2]) + >>> indices = c.linear_constraints.add(lin_expr = [[[0,1],[-1,-1]]], rhs=[-10], senses="L") + >>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual) + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> idx = c.solution.advanced.get_diverging_index() + >>> idx + 2 + """ + return CPX_PROC.getijdiv(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_ray(self): + """Returns an unbounded direction, i.e., ray, if a LP model is unbounded + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("unblp.lp") + >>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off) + >>> c.solve() + >>> ray = c.solution.advanced.get_ray() + >>> ray[0] + -1.0 + """ + return CPX_PROC.getray(self._env._e, self._cplex._lp)
+
+ + + +
+[docs] +class SolutionMethod(ConstantClass): + """Solution methods.""" + none = _constants.CPX_ALG_NONE + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER + feasopt = _constants.CPX_ALG_FEASOPT + MIP = _constants.CPX_ALG_MIP + pivot = _constants.CPX_ALG_PIVOT + pivot_in = _constants.CPX_ALG_PIVOTIN + pivot_out = _constants.CPX_ALG_PIVOTOUT
+ + + +
+[docs] +class SolutionStatus(ConstantClass): + """Solution status codes. + + For documentation of each status code, see the reference manual + of the CPLEX Callable Library, especially the group + optim.cplex.callable.solutionstatus. + """ + unknown = 0 # There is no constant for this. + optimal = _constants.CPX_STAT_OPTIMAL + unbounded = _constants.CPX_STAT_UNBOUNDED + infeasible = _constants.CPX_STAT_INFEASIBLE + feasible = _constants.CPX_STAT_FEASIBLE + infeasible_or_unbounded = _constants.CPX_STAT_INForUNBD + optimal_infeasible = _constants.CPX_STAT_OPTIMAL_INFEAS + num_best = _constants.CPX_STAT_NUM_BEST + feasible_relaxed_sum = _constants.CPX_STAT_FEASIBLE_RELAXED_SUM + optimal_relaxed_sum = _constants.CPX_STAT_OPTIMAL_RELAXED_SUM + feasible_relaxed_inf = _constants.CPX_STAT_FEASIBLE_RELAXED_INF + optimal_relaxed_inf = _constants.CPX_STAT_OPTIMAL_RELAXED_INF + feasible_relaxed_quad = _constants.CPX_STAT_FEASIBLE_RELAXED_QUAD + optimal_relaxed_quad = _constants.CPX_STAT_OPTIMAL_RELAXED_QUAD + abort_obj_limit = _constants.CPX_STAT_ABORT_OBJ_LIM + abort_primal_obj_limit = _constants.CPX_STAT_ABORT_PRIM_OBJ_LIM + abort_dual_obj_limit = _constants.CPX_STAT_ABORT_DUAL_OBJ_LIM + first_order = _constants.CPX_STAT_FIRSTORDER + abort_iteration_limit = _constants.CPX_STAT_ABORT_IT_LIM + abort_time_limit = _constants.CPX_STAT_ABORT_TIME_LIM + abort_dettime_limit = _constants.CPX_STAT_ABORT_DETTIME_LIM + abort_user = _constants.CPX_STAT_ABORT_USER + optimal_face_unbounded = _constants.CPX_STAT_OPTIMAL_FACE_UNBOUNDED + conflict_feasible = _constants.CPX_STAT_CONFLICT_FEASIBLE + conflict_minimal = _constants.CPX_STAT_CONFLICT_MINIMAL + conflict_abort_contradiction = _constants.CPX_STAT_CONFLICT_ABORT_CONTRADICTION + conflict_abort_time_limit = _constants.CPX_STAT_CONFLICT_ABORT_TIME_LIM + conflict_abort_dettime_limit = _constants.CPX_STAT_CONFLICT_ABORT_DETTIME_LIM + conflict_abort_iteration_limit = _constants.CPX_STAT_CONFLICT_ABORT_IT_LIM + conflict_abort_node_limit = _constants.CPX_STAT_CONFLICT_ABORT_NODE_LIM + conflict_abort_obj_limit = _constants.CPX_STAT_CONFLICT_ABORT_OBJ_LIM + conflict_abort_memory_limit = _constants.CPX_STAT_CONFLICT_ABORT_MEM_LIM + conflict_abort_user = _constants.CPX_STAT_CONFLICT_ABORT_USER + relaxation_unbounded = _constants.CPXMIP_ABORT_RELAXATION_UNBOUNDED + abort_relaxed = _constants.CPXMIP_ABORT_RELAXED + optimal_tolerance = _constants.CPXMIP_OPTIMAL_TOL + solution_limit = _constants.CPXMIP_SOL_LIM + populate_solution_limit = _constants.CPXMIP_POPULATESOL_LIM + node_limit_feasible = _constants.CPXMIP_NODE_LIM_FEAS + node_limit_infeasible = _constants.CPXMIP_NODE_LIM_INFEAS + fail_feasible = _constants.CPXMIP_FAIL_FEAS + fail_infeasible = _constants.CPXMIP_FAIL_INFEAS + mem_limit_feasible = _constants.CPXMIP_MEM_LIM_FEAS + mem_limit_infeasible = _constants.CPXMIP_MEM_LIM_INFEAS + fail_feasible_no_tree = _constants.CPXMIP_FAIL_FEAS_NO_TREE + fail_infeasible_no_tree = _constants.CPXMIP_FAIL_INFEAS_NO_TREE + optimal_populated = _constants.CPXMIP_OPTIMAL_POPULATED + optimal_populated_tolerance = _constants.CPXMIP_OPTIMAL_POPULATED_TOL + benders_num_best = _constants.CPX_STAT_BENDERS_NUM_BEST + + MIP_optimal = _constants.CPXMIP_OPTIMAL + MIP_infeasible = _constants.CPXMIP_INFEASIBLE + MIP_time_limit_feasible = _constants.CPXMIP_TIME_LIM_FEAS + MIP_time_limit_infeasible = _constants.CPXMIP_TIME_LIM_INFEAS + MIP_dettime_limit_feasible = _constants.CPXMIP_DETTIME_LIM_FEAS + MIP_dettime_limit_infeasible = _constants.CPXMIP_DETTIME_LIM_INFEAS + MIP_abort_feasible = _constants.CPXMIP_ABORT_FEAS + MIP_abort_infeasible = _constants.CPXMIP_ABORT_INFEAS + MIP_optimal_infeasible = _constants.CPXMIP_OPTIMAL_INFEAS + MIP_unbounded = _constants.CPXMIP_UNBOUNDED + MIP_infeasible_or_unbounded = _constants.CPXMIP_INForUNBD + MIP_feasible_relaxed_sum = _constants.CPXMIP_FEASIBLE_RELAXED_SUM + MIP_optimal_relaxed_sum = _constants.CPXMIP_OPTIMAL_RELAXED_SUM + MIP_feasible_relaxed_inf = _constants.CPXMIP_FEASIBLE_RELAXED_INF + MIP_optimal_relaxed_inf = _constants.CPXMIP_OPTIMAL_RELAXED_INF + MIP_feasible_relaxed_quad = _constants.CPXMIP_FEASIBLE_RELAXED_QUAD + MIP_optimal_relaxed_quad = _constants.CPXMIP_OPTIMAL_RELAXED_QUAD + MIP_feasible = _constants.CPXMIP_FEASIBLE + + multiobj_optimal = _constants.CPX_STAT_MULTIOBJ_OPTIMAL + multiobj_infeasible = _constants.CPX_STAT_MULTIOBJ_INFEASIBLE + multiobj_inforunbd = _constants.CPX_STAT_MULTIOBJ_INForUNBD + multiobj_non_optimal = _constants.CPX_STAT_MULTIOBJ_NON_OPTIMAL + multiobj_stopped = _constants.CPX_STAT_MULTIOBJ_STOPPED + multiobj_unbounded = _constants.CPX_STAT_MULTIOBJ_UNBOUNDED
+ + + +
+[docs] +class SolutionType(ConstantClass): + """Solution types""" + none = _constants.CPX_NO_SOLN + basic = _constants.CPX_BASIC_SOLN + nonbasic = _constants.CPX_NONBASIC_SOLN + primal = _constants.CPX_PRIMAL_SOLN
+ + + +
+[docs] +class SolutionInterface(BaseInterface): + """Methods for querying the solution to an optimization problem.""" + + method = SolutionMethod() + """See `SolutionMethod()` """ + quality_metric = QualityMetric() + """See `QualityMetric()` """ + status = SolutionStatus() + """See `SolutionStatus()` """ + type = SolutionType() + """See `SolutionType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new SolutionInterface. + + The solution interface is exposed by the top-level `Cplex` class + as Cplex.solution. This constructor is not meant to be used + externally. + """ + super().__init__(cplex) + self.progress = ProgressInterface(self) + """See `ProgressInterface()` """ + self.infeasibility = InfeasibilityInterface(self) + """See `InfeasibilityInterface()` """ + self.MIP = MIPSolutionInterface(self) + """See `MIPSolutionInterface()` """ + self.basis = BasisInterface(self) + """See `BasisInterface()` """ + self.sensitivity = SensitivityInterface(self) + """See `SensitivityInterface()` """ + self.pool = SolnPoolInterface(self) + """See `SolnPoolInterface()` """ + self.advanced = AdvancedSolutionInterface(self) + """See `AdvancedSolutionInterface()` """ + self.multiobj = MultiObjSolnInterface(self) + """See `MultiObjSolnInterface()` """
+ + +
+[docs] + def get_status(self): + """Returns the status of the solution. + + Returns an attribute of Cplex.solution.status. + For interpretations of the status codes, see the + reference manual of the CPLEX Callable Library, + especially the group optim.cplex.callable.solutionstatus + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_status() + 1 + """ + return CPX_PROC.getstat(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_method(self): + """Returns the method used to solve the problem. + + Returns an attribute of Cplex.solution.method. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_method() + 2 + """ + return CPX_PROC.getmethod(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_status_string(self, status_code=None): + """Returns a string describing the status of the solution. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_status_string() + 'optimal' + """ + if status_code is None: + status_code = self.get_status() + return CPX_PROC.getstatstring(self._env._e, status_code)
+ + +
+[docs] + def get_objective_value(self): + """Returns the value of the objective function. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.solve() + >>> c.solution.get_objective_value() + -202.5 + """ + return CPX_PROC.getobjval(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_values(self, *args): + """Returns the values of a set of variables at the solution. + + Can be called by four forms. + + solution.get_values() + return the values of all variables from the problem. + + solution.get_values(i) + i must be a variable name or index. Returns the value of + the variable whose index or name is i. + + solution.get_values(s) + s must be a sequence of variable names or indices. Returns + the values of the variables with indices the members of s. + Equivalent to [solution.get_values(i) for i in s] + + solution.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns the values of the variables with indices between begin + and end, inclusive of end. Equivalent to + solution.get_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_values([0, 4, 5]) + [25.5, 0.0, 80.0] + """ + def getx(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getx(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getx, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_reduced_costs(self, *args): + """Returns the reduced costs of a set of variables. + + The values returned by this method are defined to be the dual + multipliers for bound constraints on the specified variables. + + Can be called by four forms. + + solution.get_reduced_costs() + return the reduced costs of all variables from the problem. + + solution.get_reduced_costs(i) + i must be a variable name or index. Returns the reduced + cost of the variable whose index or name is i. + + solution.get_reduced_costs(s) + s must be a sequence of variable names or indices. Returns + the reduced costs of the variables with indices the members + of s. Equivalent to [solution.get_reduced_costs(i) for i + in s] + + solution.get_reduced_costs(begin, end) + begin and end must be variable indices or variable names. + Returns the reduced costs of the variables with indices between + begin and end, inclusive of end. Equivalent to + solution.get_reduced_costs(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_reduced_costs([0, 4, 5]) + [0.0, 10.0, 0.0] + """ + def getdj(a, b=self._cplex.variables.get_num() - 1): + return CPX_PROC.getdj(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getdj, self._cplex.variables._conv, args)
+ + +
+[docs] + def get_dual_values(self, *args): + """Returns a set of dual values. + + Note that the values returned by this function are not only + meaningful for linear programs. Also for second order cone + programs, they provide information about the dual solution. + Refer to the user manual to see how to use the values returned by + this function for second order cone programs. + + Can be called by four forms. + + solution.get_dual_values() + return all dual values from the problem. + + solution.get_dual_values(i) + i must be a linear constraint name or index. Returns the + dual value associated with the linear constraint whose + index or name is i. + + solution.get_dual_values(s) + s must be a sequence of linear constraint names or indices. + Returns the dual values associated with the linear + constraints with indices the members of s. Equivalent to + [solution.get_dual_values(i) for i in s] + + solution.get_dual_values(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the dual values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_dual_values(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> pi = c.solution.get_dual_values([0, 1]) + >>> for i, j in zip(pi, [-0.628571, 0.0]): + ... abs(i - j) < 1e-6 + ... + True + True + """ + def getpi(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getpi(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getpi, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_dualslack(self, *args): + """Returns the dual slack for a quadratic constraint. + + The function returns the dual slack vector of its arguments as a + SparsePair. + The function argument may be either the index or the name of a + quadratic constraint. + """ + def getqconstrdslack(q): + res = CPX_PROC.getqconstrdslack(self._env._e, self._cplex._lp, q) + if res: + return SparsePair(res[0], res[1]) + return SparsePair() + return apply_freeform_one_arg( + getqconstrdslack, + self._cplex.quadratic_constraints._conv, + CPX_PROC.getnumqconstrs(self._env._e, self._cplex._lp), + args)
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks. + + Can be called by four forms. + + solution.get_linear_slacks() + return all linear slack values from the problem. + + solution.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + solution.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [solution.get_linear_slacks(i) for i in s] + + solution.get_linear_slacks(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_linear_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> abs(c.solution.get_linear_slacks(5)) < 1e-6 + True + """ + def getslack(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getslack, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_indicator_slacks(self, *args): + """Returns a set of indicator slacks. + + Can be called by four forms. + + solution.get_indicator_slacks() + return all indicator slack values from the problem. + + solution.get_indicator_slacks(i) + i must be a indicator constraint name or index. Returns + the slack values associated with the indicator constraint + whose index or name is i. + + solution.get_indicator_slacks(s) + s must be a sequence of indicator constraint names or + indices. Returns the slack values associated with the + indicator constraints with indices the members of s. + Equivalent to [solution.get_indicator_slacks(i) for i in s] + + solution.get_indicator_slacks(begin, end) + begin and end must be indicator constraint indices or indicator + constraint names. Returns the slack values associated with the + indicator constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_indicator_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("ind.lp") + >>> c.solve() + >>> c.solution.get_indicator_slacks([0, 18]) + [1e+20, 0.0] + """ + def getindslack(a, b=self._cplex.indicator_constraints.get_num() - 1): + return CPX_PROC.getindconstrslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getindslack, self._cplex.indicator_constraints._conv, + args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks. + + Can be called by four forms. + + solution.get_quadratic_slacks() + return all quadratic slack values from the problem. + + solution.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + solution.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [solution.get_quadratic_slacks(i) for i in s] + + solution.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + solution.get_quadratic_slacks(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> slack = c.solution.get_quadratic_slacks(0) + >>> abs(slack) < 1e-6 + True + """ + def getqslack(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getqconstrslack(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getqslack, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_integer_quality(self, which): + """Returns a measure of the quality of the solution. + + The measure of the quality of a solution can be a single attribute of + solution.quality_metrics or a sequence of such + attributes. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> m = c.solution.quality_metric + >>> c.solution.get_integer_quality([m.max_x, m.max_dual_infeasibility]) + [18, -1] + """ + if isinstance(which, int): + return CPX_PROC.getintquality(self._env._e, self._cplex._lp, which) + return [CPX_PROC.getintquality(self._env._e, self._cplex._lp, a) + for a in which]
+ + +
+[docs] + def get_float_quality(self, which): + """Returns a measure of the quality of the solution. + + The measure of the quality of a solution can be a single attribute of + solution.quality_metrics or a sequence of such attributes. + + Note + This corresponds to the CPLEX callable library function + CPXgetdblquality. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> m = c.solution.quality_metric + >>> c.solution.get_float_quality([m.max_x, m.max_dual_infeasibility]) + [500.0, 0.0] + """ + if isinstance(which, int): + return CPX_PROC.getdblquality(self._env._e, self._cplex._lp, which) + return [CPX_PROC.getdblquality(self._env._e, self._cplex._lp, a) + for a in which]
+ + +
+[docs] + def get_solution_type(self): + """Returns the type of the solution. + + Returns an attribute of Cplex.solution.type. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_solution_type() + 1 + """ + return CPX_PROC.solninfo(self._env._e, self._cplex._lp)[1]
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether or not the solution is known to be primal feasible. + + Note + Returning False does not necessarily mean that the problem is + not primal feasible, only that it is not proved to be primal + feasible. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.is_primal_feasible() + True + """ + return bool(CPX_PROC.solninfo(self._env._e, self._cplex._lp)[2])
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether or not the solution is known to be dual feasible. + + Note + Returning False does not necessarily mean that the problem is + not dual feasible, only that it is not proved to be dual + feasible. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.is_dual_feasible() + True + """ + return bool(CPX_PROC.solninfo(self._env._e, self._cplex._lp)[3])
+ + +
+[docs] + def get_activity_levels(self, *args): + """Returns the activity levels for set of linear constraints. + + Can be called by four forms. + + solution.get_activity_levels() + return the activity levels for all linear constraints from + the problem. + + solution.get_activity_levels(i) + i must be a linear constraint name or index. Returns the + activity levels for the linear constraint whose index or + name is i. + + solution.get_activity_levels(s) + s must be a sequence of linear constraint names or indices. + Returns the activity levels for the linear constraints with + indices the members of s. Equivalent to + [solution.get_activity_levels(i) for i in s] + + solution.get_activity_levels(begin, end) + begin and end must be linear constraint indices or linear + constraint names. Returns the activity levels for the linear + constraints with indices between begin and end, inclusive of + end. Equivalent to + solution.get_activity_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.get_activity_levels([2, 3, 12]) + [80.0, 0.0, 500.0] + """ + def getax(a, b=self._cplex.linear_constraints.get_num() - 1): + return CPX_PROC.getax(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getax, self._cplex.linear_constraints._conv, args)
+ + +
+[docs] + def get_quadratic_activity_levels(self, *args): + """Returns the activity levels for set of quadratic constraints. + + Can be called by four forms. + + solution.get_quadratic_activity_levels() + return the activity levels for all quadratic constraints + from the problem. + + solution.get_quadratic_activity_levels(i) + i must be a quadratic constraint name or index. Returns + the activity levels for the quadratic constraint whose + index or name is i. + + solution.get_quadratic_activity_levels(s) + s must be a sequence of quadratic constraint names or + indices. Returns the activity levels for the quadratic + constraints with indices the members of s. Equivalent to + [solution.get_quadratic_activity_levels(i) for i in s] + + solution.get_quadratic_activity_levels(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the activity levels for the quadratic + constraints with indices between begin and end, inclusive of + end. Equivalent to + solution.get_quadratic_activity_levels(range(begin, end + 1)). + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("qcp.lp") + >>> c.solve() + >>> xqxax = c.solution.get_quadratic_activity_levels() + >>> abs(xqxax[0] - 2.015616) < 1e-6 + True + """ + def getxqxax(a, b=self._cplex.quadratic_constraints.get_num() - 1): + return CPX_PROC.getxqxax(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args( + getxqxax, self._cplex.quadratic_constraints._conv, args)
+ + +
+[docs] + def get_quality_metrics(self): + """Returns an object containing measures of the solution quality. + + See `QualityMetrics`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> qm = c.solution.get_quality_metrics() + """ + return QualityMetrics(self._cplex)
+ + +
+[docs] + def write(self, filename): + """Writes the incumbent solution to a file. + + See `CPXsolwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/solwrite.html>`_ in the Callable Library Reference + Manual and also `InitialInterface.read_start()`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> c.solve() + >>> c.solution.write("lpex.sol") + """ + CPX_PROC.solwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class PresolveStatus(ConstantClass): + """Presolve status codes""" + no_reductions = 0 + has_problem = 1 + empty_problem = 2
+ + + +
+[docs] +class PresolveMethod(ConstantClass): + """Presolve solution methods""" + none = _constants.CPX_ALG_NONE + primal = _constants.CPX_ALG_PRIMAL + dual = _constants.CPX_ALG_DUAL + barrier = _constants.CPX_ALG_BARRIER
+ + + +
+[docs] +class PresolveColStatus(ConstantClass): + """Presolve variable status codes""" + lower_bound = _constants.CPX_PRECOL_LOW + upper_bound = _constants.CPX_PRECOL_UP + fixed = _constants.CPX_PRECOL_FIX + aggregated = _constants.CPX_PRECOL_AGG + other = _constants.CPX_PRECOL_OTHER
+ + + +
+[docs] +class PresolveRowStatus(ConstantClass): + """Presolve linear constraint status codes""" + reduced = _constants.CPX_PREROW_RED + aggregated = _constants.CPX_PREROW_AGG + other = _constants.CPX_PREROW_OTHER
+ + + +
+[docs] +class PresolveInterface(BaseInterface): + """Methods for dealing with the presolved problem.""" + + status = PresolveStatus() + """See `PresolveStatus()` """ + method = PresolveMethod() + """See `PresolveMethod()` """ + col_status = PresolveColStatus() + """See `PresolveColStatus()` """ + row_status = PresolveRowStatus() + """See `PresolveRowStatus()` """ + +
+[docs] + def crush_formula(self, formula): + """Crushes a linear formula down into the presolved space. + + formula may either be an instance of the SparsePair class or a + sequence of length two, the first entry of which contains + variable names or indices, the second entry of which contains + the float values associated with those variables. + + Returns a (crushed_formula, offset) pair, where + crushed_formula is a SparsePair object containing the crushed + formula in terms of the presolved variables and offset is the + value of the linear formula corresponding to variables that + have been removed in the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2)) + (SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0) + """ + ind, val = unpack_pair(formula) + ret = CPX_PROC.crushform(self._env._e, self._cplex._lp, ind, val) + return (SparsePair(ret[1], ret[2]), ret[0])
+ + +
+[docs] + def crush_x(self, x): + """Projects a primal solution down to the presolved space. + + x must be a list of floats with length equal to the number of + variables in the original problem. Returns a list of floats + with length equal to the number of variables in the presolved + problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_x([1.0] * 4) + [1.0, 1.0, 1.0] + """ + return CPX_PROC.crushx(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def crush_pi(self, pi): + """Projects a dual solution down to the presolved space. + + pi must be a list of floats with length equal to the number of + linear constraints in the original problem. Returns a list of + floats with length equal to the number of linear constraints + in the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.crush_pi([1.0] * 4) + [1.0, 1.0, 1.0] + """ + return CPX_PROC.crushpi(self._env._e, self._cplex._lp, pi)
+ + +
+[docs] + def uncrush_formula(self, pre_formula): + """Uncrushes a linear formula up from the presolved space. + + formula may either be an instance of the SparsePair class or a + sequence of length two, the first entry of which contains + variable names or indices, the second entry of which contains + the float values associated with those variables. + + Returns a (formula, offset) pair, where formula is a + SparsePair object containing the formula in terms of variables + in the original problem and offset is the value of the linear + formula corresponding to variables that have been removed in + the presolved problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2)) + (SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0) + """ + ind, val = unpack_pair(pre_formula) + ret = CPX_PROC.uncrushform(self._env._e, self._cplex._lp, ind, val) + return (SparsePair(ret[1], ret[2]), ret[0])
+ + +
+[docs] + def uncrush_x(self, pre_x): + """Projects a primal presolved solution up to the original space. + + x must be a list of floats with length equal to the number of + variables in the presolved problem. Returns a list of floats + with length equal to the number of variables in the original + problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_x([1.0] * 3) + [1.0, 1.0, 1.0, 0.0] + """ + return CPX_PROC.uncrushx(self._env._e, self._cplex._lp, pre_x)
+ + +
+[docs] + def uncrush_pi(self, pre_pi): + """Projects a dual presolved solution up to the presolved space. + + pi must be a list of floats with length equal to the number of + linear constraints in the presolved problem. Returns a list + of floats with length equal to the number of linear + constraints in the original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.uncrush_pi([1.0] * 3) + [1.0, 1.0, 1.0, 0.0] + """ + return CPX_PROC.uncrushpi(self._env._e, self._cplex._lp, pre_pi)
+ + +
+[docs] + def free(self): + """Frees the presolved problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.free() + """ + CPX_PROC.freepresolve(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_status(self): + """Returns the status of presolve. + + Returns an attribute of Cplex.presolve.status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_status() + 1 + """ + return CPX_PROC.getprestat_status(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_row_status(self): + """Returns the status of the original linear constraints. + + Returns a list of integers with length equal to the number of + linear constraints in the original problem. Each entry of + this list is an attribute of Cplex.presolve.row_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_row_status() + [-3, 1, 2, -3] + """ + return CPX_PROC.getprestat_r(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_col_status(self): + """Returns the status of the original variables. + + Returns a list of integers with length equal to the number of + variables in the original problem. Each entry of this list + is an attribute of Cplex.presolve.col_status. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_col_status() + [0, 1, 2, -5] + """ + return CPX_PROC.getprestat_c(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_presolved_row_status(self): + """Returns the status of the presolved linear constraints. + + Returns a list of integers with length equal to the number of + linear constraints in the presolved problem. -1 indicates + that the presolved linear constraint corresponds to more than + one linear constraint in the original problem. Otherwise the + value is the index of the corresponding linear constraint in + the original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_presolved_row_status() + [-1, 1, 2] + """ + return CPX_PROC.getprestat_or(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_presolved_col_status(self): + """Returns the status of the presolved variables. + + Returns a list of integers with length equal to the number of + variables in the presolved problem. -1 indicates that the + presolved variable corresponds to a linear combination of more + than one variable in the original problem. Otherwise the + value is the index of the corresponding variable in the + original problem. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + >>> c.presolve.get_presolved_col_status() + [0, 1, 2] + """ + return CPX_PROC.getprestat_oc(self._env._e, self._cplex._lp)
+ + +
+[docs] + def add_rows(self, lin_expr=None, senses="", rhs=None, names=None): + """Adds linear constraints to the presolved problem. + + presolve.add_rows accepts the keyword arguments lin_expr, + senses, rhs, and names. + + If more than one argument is specified, all arguments must + have the same length. + + lin_expr may be either a list of SparsePair instances or a + matrix in list-of-lists format. + + Note + The entries of lin_expr must not contain duplicate indices. + If an entry of lin_expr references a variable more than + once, either by index, name, or a combination of index and + name, an exception will be raised. + + senses must be either a list of single-character strings or a + string containing the types of the variables. + + rhs is a list of floats, specifying the righthand side of + each linear constraint. + + names is a list of strings. + + The specified constraints are added to both the original + problem and the presolved problem. + """ + lin_expr, senses, rhs, names = init_list_args( + lin_expr, senses, rhs, names) + if not isinstance(senses, str): + senses = "".join(senses) + validate_arg_lengths( + [rhs, senses, names, lin_expr], + extra_msg=": lin_expr, senses, rhs, names" + ) + if isinstance(lin_expr, list): + rmat = _HBMatrix(lin_expr) + CPX_PROC.preaddrows(self._env._e, self._cplex._lp, rhs, senses, + rmat.matbeg, rmat.matind, rmat.matval, names)
+ + # TODO: We don't return an iterator here because there's no way to + # get indices of presolve rows from names. + +
+[docs] + def set_objective(self, objective): + """Sets the linear objective function of the presolved problem. + + objective must be either a SparsePair instance or a list of + two lists, the first of which contains variable indices or + names, the second of which contains floats. + + The objective function of both the original problem and the + presolved problem are changed. + + """ + ind, val = unpack_pair(objective) + CPX_PROC.prechgobj(self._env._e, self._cplex._lp, ind, val)
+ + +
+[docs] + def presolve(self, method): + """Solves the presolved problem. + + method must be an attribute of Cplex.presolve.method. + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("example.mps") + >>> c.presolve.presolve(c.presolve.method.dual) + """ + CPX_PROC.presolve(self._env._e, self._cplex._lp, method)
+ + +
+[docs] + def write(self, filename): + """Writes the presolved problem to a file.""" + return CPX_PROC.preslvwrite(self._env._e, self._cplex._lp, + filename)
+
+ + + +
+[docs] +class FeasoptConstraintType(ConstantClass): + """Types of constraints""" + lower_bound = _constants.CPX_CON_LOWER_BOUND + upper_bound = _constants.CPX_CON_UPPER_BOUND + linear = _constants.CPX_CON_LINEAR + quadratic = _constants.CPX_CON_QUADRATIC + indicator = _constants.CPX_CON_INDICATOR
+ + + +
+[docs] +class FeasoptInterface(BaseInterface): + """Finds a minimal relaxation of the problem that is feasible. + + This is a callable class. To find a feasible relaxation of a problem, + invoke the `__call__` method of this class. + """ + + constraint_type = FeasoptConstraintType() + """See `FeasoptConstraintType()` """ + +
+[docs] + def all_constraints(self): + """Returns an object instructing feasopt to relax all constraints. + + Calling Cplex.feasopt(Cplex.feasopt.all_constraints()) will + result in every constraint being relaxed independently with + equal weight. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.all_constraints() + """ + gp = self.upper_bound_constraints()._gp + gp += self.lower_bound_constraints()._gp + gp += self.linear_constraints()._gp + gp += self.quadratic_constraints()._gp + gp += self.indicator_constraints()._gp + return _group(gp)
+ + +
+[docs] + def upper_bound_constraints(self, *args): + """Returns an object instructing feasopt to relax all upper bounds. + + If called with no arguments, every upper bound is assigned + weight 1.0. + + If called with one or more arguments, every upper bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of upper bounds to be relaxed. If one variable index or name + is specified, it is the only upper bound that can be relaxed. + If two variable indices or names are specified, then upper + bounds of all variables between the first and the second, + inclusive, can be relaxed. If a sequence of variable names or + indices is passed in, all of their upper bounds can be + relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.upper_bound_constraints() + """ + return self._make_group(self.constraint_type.upper_bound, *args)
+ + +
+[docs] + def lower_bound_constraints(self, *args): + """Returns an object instructing feasopt to relax all lower bounds. + + If called with no arguments, every lower bound is assigned + weight 1.0. + + If called with one or more arguments, every lower bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of lower bounds to be relaxed. If one variable index or name + is specified, it is the only lower bound that can be relaxed. + If two variable indices or names are specified, then lower + bounds of all variables between the first and the second, + inclusive, can be relaxed. If a sequence of variable names or + indices is passed in, all of their lower bounds can be + relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.lower_bound_constraints() + """ + return self._make_group(self.constraint_type.lower_bound, *args)
+ + +
+[docs] + def linear_constraints(self, *args): + """Returns an object instructing feasopt to relax all linear constraints. + + If called with no arguments, every linear constraint is + assigned weight 1.0. + + If called with one or more arguments, every linear constraint + is assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of linear constraints to be relaxed. If one linear constraint + index or name is specified, it is the only linear constraint + that can be relaxed. If two linear constraint indices or + names are specified, then all linear constraints between the + first and the second, inclusive, can be relaxed. If a sequence + of linear constraint names or indices is passed in, all of their + linear constraints can be relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.linear_constraints() + """ + return self._make_group(self.constraint_type.linear, *args)
+ + +
+[docs] + def quadratic_constraints(self, *args): + """Returns an object instructing feasopt to relax all quadratic constraints. + + If called with no arguments, every quadratic constraint is + assigned weight 1.0. + + If called with one or more arguments, every quadratic + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of quadratic constraints to be relaxed. If one quadratic + constraint index or name is specified, it is the only + quadratic constraint that can be relaxed. If two quadratic + constraint indices or names are specified, then all quadratic + constraints between the first and the second, inclusive, can be + relaxed. If a sequence of quadratic constraint names or indices + is passed in, all of their quadratic constraints can be relaxed. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.quadratic_constraints() + """ + return self._make_group(self.constraint_type.quadratic, *args)
+ + +
+[docs] + def indicator_constraints(self, *args): + """Returns an object instructing feasopt to relax all indicator constraints. + + If called with no arguments, every indicator constraint is + assigned weight 1.0. + + If called with one or more arguments, every indicator + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of indicator constraints to be relaxed. If one indicator + constraint index or name is specified, it is the only + indicator constraint that can be relaxed. If two indicator + constraint indices or names are specified, then all indicator + constraints between the first and the second, inclusive, can be + relaxed. If a sequence of indicator constraint names or indices + is passed in, all of their indicator constraints can be relaxed. + + See also the `__call__` method of this class. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.feasopt.indicator_constraints() + """ + return self._make_group(self.constraint_type.indicator, *args)
+ + +
+[docs] + def __call__(self, *args): + """Finds a minimal relaxation of the problem that is feasible. + + This method can take arbitrarily many arguments. Either the + object returned by feasopt.all_constraints() or any combination + of constraint groups and objects returned by + `upper_bound_constraints()`, `lower_bound_constraints()`, + `linear_constraints()`, `quadratic_constraints()`, or + `indicator_constraints()` may be used to specify the constraints + to consider. + + Constraint groups are sequences of length two, the first entry of + which is the preference for the group (a float), the second of + which is a sequence of pairs (type, id), where type is an + attribute of self.constraint_type and id is either an index or a + valid name for the type. + + See `CPXfeasoptext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/feasoptext.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("infeasible.lp") + >>> c.feasopt(c.feasopt.all_constraints()) + >>> c.solution.get_objective_value() + 2.0 + >>> c.solution.get_values() + [3.0, 2.0, 3.0, 2.0] + """ + if not args: + raise WrongNumberOfArgumentsError( + "Requires at least one argument") + gpref, gbeg, ind, indt = [], [], [], [] + args = list(args) # so we can call extend() below + for group in args: + if isinstance(group, _group): + args.extend(group._gp) + continue + gpref.append(group[0]) + gbeg.append(len(ind)) + for con in group[1]: + tran = self._getconvfunc(con[0]) + indt.append(con[0]) + ind.append(tran(con[1])) + self._cplex._setup_callbacks() + CPX_PROC.feasoptext(self._env._e, self._cplex._lp, + gpref, gbeg, ind, indt)
+ + + def _make_group(self, which, *args): + conv = self._getconvfunc(which) + max_num = self._getnum(which) + return make_group(conv, max_num, which, *args) + + def _getinterface(self, which): + contype = self.constraint_type + switcher = { + contype.lower_bound: self._cplex.variables, + contype.upper_bound: self._cplex.variables, + contype.linear: self._cplex.linear_constraints, + contype.quadratic: self._cplex.quadratic_constraints, + contype.indicator: self._cplex.indicator_constraints + } + return switcher[which] + + def _getnum(self, which): + interface = self._getinterface(which) + return interface.get_num() + + def _getconvfunc(self, which): + interface = self._getinterface(which) + return interface._conv
+ + + +
+[docs] +class ConflictStatus(ConstantClass): + """Status codes returned by conflict.get""" + excluded = _constants.CPX_CONFLICT_EXCLUDED + possible_member = _constants.CPX_CONFLICT_POSSIBLE_MEMBER + member = _constants.CPX_CONFLICT_MEMBER
+ + + +
+[docs] +class ConflictConstraintType(ConstantClass): + """Types of constraints""" + lower_bound = _constants.CPX_CON_LOWER_BOUND + upper_bound = _constants.CPX_CON_UPPER_BOUND + linear = _constants.CPX_CON_LINEAR + quadratic = _constants.CPX_CON_QUADRATIC + indicator = _constants.CPX_CON_INDICATOR + SOS = _constants.CPX_CON_SOS + pwl = _constants.CPX_CON_PWL
+ + + +
+[docs] +class ConflictInterface(BaseInterface): + """Methods for identifying conflicts among constraints.""" + + group_status = ConflictStatus() + """See `ConflictStatus()` """ + constraint_type = ConflictConstraintType() + """See `ConflictConstraintType()` """ + +
+[docs] + def __init__(self, cplex): + """Creates a new ConflictInterface. + + The conflict interface is exposed by the top-level `Cplex` class + as Cplex.conflict. This constructor is not meant to be used + externally. + """ + super().__init__(cplex)
+ + +
+[docs] + def all_constraints(self): + """Returns an object instructing the conflict refiner to include + all constraints. + + Calling + Cplex.conflict.refine(Cplex.conflict.all_constraints()) or + Cplex.conflict.refine_MIP_start(Cplex.conflict.all_constraints()) + will result in every constraint being included in the search + for conflicts with equal preference. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.all_constraints() + """ + gp = self.upper_bound_constraints()._gp + gp += self.lower_bound_constraints()._gp + gp += self.linear_constraints()._gp + gp += self.quadratic_constraints()._gp + gp += self.SOS_constraints()._gp + gp += self.indicator_constraints()._gp + gp += self.pwl_constraints()._gp + return _group(gp)
+ + +
+[docs] + def upper_bound_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all upper bounds. + + If called with no arguments, every upper bound is assigned + weight 1.0. + + If called with one or more arguments, every upper bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of upper bounds to be included. If one variable index or name + is specified, it is the only upper bound that will be + included. If two variable indices or names are specified, then + upper bounds of all variables between the first and the + second, inclusive, will be included. If a sequence of + variable names or indices is passed in, all of their upper + bounds will be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.upper_bound_constraints() + """ + return self._make_group(self.constraint_type.upper_bound, *args)
+ + +
+[docs] + def lower_bound_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all lower bounds. + + If called with no arguments, every lower bound is assigned + weight 1.0. + + If called with one or more arguments, every lower bound is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of lower bounds to be included. If one variable index or name + is specified, it is the only lower bound that will be + included. If two variable indices or names are specified, then + lower bounds of all variables between the first and the + second, inclusive, will be included. If a sequence of + variable names or indices is passed in, all of their lower + bounds will be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.lower_bound_constraints() + """ + return self._make_group(self.constraint_type.lower_bound, *args)
+ + +
+[docs] + def linear_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all linear constraints. + + If called with no arguments, every linear constraint is + assigned weight 1.0. + + If called with one or more arguments, every linear constraint + is assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of linear constraints to be included. If one linear + constraint index or name is specified, it is the only linear + constraint that will be included. If two linear constraint + indices or names are specified, then all linear constraints + between the first and the second, inclusive, will be included. + If a sequence of linear constraint names or indices is passed + in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.linear_constraints() + """ + return self._make_group(self.constraint_type.linear, *args)
+ + +
+[docs] + def quadratic_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all quadratic constraints. + + If called with no arguments, every quadratic constraint is + assigned weight 1.0. + + If called with one or more arguments, every quadratic + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of quadratic constraints to be included. If one quadratic + constraint index or name is specified, it is the only + quadratic constraint that will be included. If two quadratic + constraint indices or names are specified, then all quadratic + constraints between the first and the second, inclusive, will + be included. If a sequence of quadratic constraint names or + indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.quadratic_constraints() + """ + return self._make_group(self.constraint_type.quadratic, *args)
+ + +
+[docs] + def indicator_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all indicator constraints. + + If called with no arguments, every indicator constraint is + assigned weight 1.0. + + If called with one or more arguments, every indicator + constraint is assigned a weight equal to the float passed in + as the first argument. + + If additional arguments are specified, they determine a subset + of indicator constraints to be included. If one indicator + constraint index or name is specified, it is the only + indicator constraint that will be included. If two indicator + constraint indices or names are specified, the all indicator + constraints between the first and the second, inclusive, will + be included. If a sequence of indicator constraint names or + indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.indicator_constraints() + """ + return self._make_group(self.constraint_type.indicator, *args)
+ + +
+[docs] + def pwl_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all PWL constraints. + + If called with no arguments, every PWL constraint is assigned + weight 1.0. + + If called with one or more arguments, every PWL constraint is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of PWL constraints to be included. If one PWL constraint index or + name is specified, it is the only PWL constraint that will be + included. If two PWL constraint indices or names are specified, + then all PWL constraints between the first and the second, + inclusive, will be included. If a sequence of PWL constraint + names or indices is passed in, they will all be included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.pwl_constraints() + """ + return self._make_group(self.constraint_type.pwl, *args)
+ + +
+[docs] + def SOS_constraints(self, *args): + """Returns an object instructing the conflict refiner to include + all SOS constraints. + + If called with no arguments, every SOS constraint is assigned + weight 1.0. + + If called with one or more arguments, every SOS constraint is + assigned a weight equal to the float passed in as the first + argument. + + If additional arguments are specified, they determine a subset + of SOS constraints to be included. If one SOS constraint + index or name is specified, it is the only SOS constraint that + will be included. If two SOS constraint indices or names are + specified, then all SOS constraints between the first and the + second, inclusive, will be included. If a sequence of SOS + constraint names or indices is passed in, they will all be + included. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> group = c.conflict.SOS_constraints() + """ + return self._make_group(self.constraint_type.SOS, *args)
+ + + @staticmethod + def _expand_groups(args): + """Expands group arguments passed to the refine methods + + These should be either _group objects or tuples of length two + (the first entry of which is the preference for the group (a + float), the second of which is a tuple of pairs (type, id), + where type is an attribute of conflict.constraint_type and id is + either an index or a valid name for the type). + + As _group objects can contain many tuples, this method makes + sure that the expanded order is maintained. + """ + groups = [] + for arg in args: + try: + # Grab the tuple list out of any _group objects we encounter. + groups.extend(arg._gp) + except AttributeError: + # Otherwise, we assume these are tuples. + groups.append(arg) + return groups + + def _separate_groups(self, args): + """Separates group information into individual lists. + + This, so they can be passed into the callable library in the + expected format. + """ + grppref, grpbeg, grpind, grptype = [], [], [], [] + groups = self._expand_groups(args) + for group in groups: + pref, contpl = group + grppref.append(pref) + grpbeg.append(len(grpind)) + for contype, conid in contpl: + tran = self._getconvfunc(contype) + grptype.append(contype) + grpind.append(tran(conid)) + return grppref, grpbeg, grpind, grptype + + def _compose_groups(self, grppref, grpbeg, grpind, grptype): + """Convert individual lists of group information into group + format. + + These are tuples of length two (the first entry of which is the + preference for the group (a float), the second of which is a + tuple of pairs (type, id), where type is an attribute of + conflict.constraint_type and id is either an index or a valid + name for the type). + """ + groups = [] + grpbeglen = len(grpbeg) + for i in range(grpbeglen): + begin = grpbeg[i] + if i == grpbeglen - 1: + end = len(grpind) + else: + end = grpbeg[i + 1] + groups.append((grppref[i], tuple(zip(grptype[begin:end], + grpind[begin:end])))) + return groups + + def _make_group(self, which, *args): + conv = self._getconvfunc(which) + max_num = self._getnum(which) + return make_group(conv, max_num, which, *args) + + def _getinterface(self, which): + contype = self.constraint_type + switcher = { + contype.lower_bound: self._cplex.variables, + contype.upper_bound: self._cplex.variables, + contype.linear: self._cplex.linear_constraints, + contype.quadratic: self._cplex.quadratic_constraints, + contype.SOS: self._cplex.SOS, + contype.indicator: self._cplex.indicator_constraints, + contype.pwl: self._cplex.pwl_constraints + } + return switcher[which] + + def _getnum(self, which): + interface = self._getinterface(which) + return interface.get_num() + + def _getconvfunc(self, which): + interface = self._getinterface(which) + return interface._conv + +
+[docs] + def refine_MIP_start(self, MIP_start, *args): + """Identifies a minimal conflict among a set of constraints for a + given MIP start. + + This method can take arbitrarily many arguments. The first + argument must be either a name or index of a MIP start. + Additional arguments are optional and can be the object returned + by `all_constraints()` or any combination of constraint groups + and objects returned by `upper_bound_constraints()`, + `lower_bound_constraints()`, `linear_constraints()`, + `quadratic_constraints()`, `indicator_constraints()`, + `pwl_constraints()`, or `SOS_constraints()` may be used to + specify the constraints to consider. If no additional arguments + are specified, then constraint groups are created automatically + as in the CPLEX interactive. + + Constraint groups are sequences of length two, the first entry + of which is the preference for the group (a float), the second + of which is a sequence of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index + or a valid name for the type. + + See `CPXrefinemipstartconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/refinemipstartconflictext.html>`_ and in the Callable + Library Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> indices = c.variables.add([1], [0], [0], c.variables.type.binary) + >>> indices = c.variables.add([2], [0], [0], c.variables.type.binary) + >>> c.solve() + >>> indices = c.linear_constraints.add( + ... lin_expr=[[[0, 1], [1.0, 1.0]]], senses="E", rhs=[2.0]) + >>> c.conflict.refine_MIP_start(0, c.conflict.all_constraints()) + >>> c.conflict.get() + [-1, -1, -1, -1, 3] + >>> c.conflict.group_status[3], c.conflict.group_status[-1] + ('member', 'excluded') + >>> c.conflict.get_groups(0, 3) + [(1.0, ((2, 0),)), (1.0, ((2, 1),)), (1.0, ((1, 0),)), (1.0, ((1, 1),))] + """ + self._cplex._setup_callbacks() + mipstartindex = self._cplex.MIP_starts._conv(MIP_start) + if args: + grppref, grpbeg, grpind, grptype = self._separate_groups(args) + else: + grppref, grpbeg, grpind, grptype = None, None, None, None + CPX_PROC.refinemipstartconflictext(self._env._e, self._cplex._lp, + mipstartindex, + grppref, grpbeg, grpind, grptype)
+ + +
+[docs] + def refine(self, *args): + """Identifies a minimal conflict among a set of constraints. + + This method can take arbitrarily many arguments. Either the + object returned by `all_constraints()` or any combination of + constraint groups and objects returned by + `upper_bound_constraints()`, `lower_bound_constraints()`, + `linear_constraints()`, `quadratic_constraints()`, + `indicator_constraints()`, `pwl_constraints()`, or + `SOS_constraints()` may be used to specify the constraints to + consider. Alternatively, if no arguments are specified, then + constraint groups are created automatically as in the CPLEX + interactive. + + Constraint groups are sequences of length two, the first entry + of which is the preference for the group (a float), the second + of which is a sequence of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index or + a valid name for the type. + + See `CPXrefineconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/refineconflictext.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.linear_constraints(), + ... c.conflict.lower_bound_constraints()) + >>> c.conflict.get() + [3, -1, 3, -1, -1, -1] + >>> c.conflict.group_status[3], c.conflict.group_status[-1] + ('member', 'excluded') + >>> c.conflict.get_groups([0, 2]) + [(1.0, ((3, 0),)), (1.0, ((1, 0),))] + """ + self._cplex._setup_callbacks() + if args: + grppref, grpbeg, grpind, grptype = self._separate_groups(args) + else: + grppref, grpbeg, grpind, grptype = None, None, None, None + CPX_PROC.refineconflictext(self._env._e, self._cplex._lp, + grppref, grpbeg, grpind, grptype)
+ + +
+[docs] + def get(self, *args): + """Returns the status of a set of groups of constraints. + + Can be called by four forms. + + If called with no arguments, returns a list containing the + status of all constraint groups. + + If called with one integer argument, returns the status of + that constraint group. + + If called with two integer arguments, returns the status of + all constraint groups between the first and second argument, + inclusive. + + If called with a sequence of integers as its argument, returns + the status of all constraint groups in the sequence. + + The status codes are attributes of + Cplex.conflict.group_status. + + See `CPXgetconflictext <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictext.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> confstatus = c.conflict.get() + """ + def getconflict(a, b=self.get_num_groups() - 1): + return CPX_PROC.getconflictext(self._env._e, self._cplex._lp, a, b) + return apply_freeform_two_args(getconflict, None, args)
+ + +
+[docs] + def get_num_groups(self): + """Returns the number of constraint groups used in the last call + to `refine()` or `refine_MIP_start()`. + + See `CPXgetconflictnumgroups <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictnumgroups.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> c.conflict.get_num_groups() + 10 + """ + return CPX_PROC.getconflictnumgroups(self._env._e, self._cplex._lp)
+ + +
+[docs] + def get_groups(self, *args): + """Returns the groups of constraints used in the last call to + `refine()` or `refine_MIP_start()`. + + Can be called by four forms. + + If called with no arguments, returns a list containing all + constraint groups. + + If called with one integer argument, returns that constraint + group. + + If called with two integer arguments, returns all constraint + groups between the first and second argument, inclusive. + + If called with a sequence of integers as its argument, returns + all constraint groups in the sequence. + + Constraint groups are tuples of length two, the first entry of + which is the preference for the group (a float), the second of + which is a tuple of pairs (type, id), where type is an + attribute of conflict.constraint_type and id is either an index + or a valid name for the type. + + See `CPXgetconflictgroups <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/getconflictgroups.html>`_ in the Callable Library + Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> groups = c.conflict.get_groups() + """ + def getgroups(begin, end=self.get_num_groups() - 1): + (grppref, grpbeg, grpind, + grptype) = CPX_PROC.getconflictgroups(self._env._e, + self._cplex._lp, + begin, end) + return self._compose_groups(grppref, grpbeg, grpind, grptype) + return apply_freeform_two_args(getgroups, None, args)
+ + +
+[docs] + def write(self, filename): + """Writes the conflict to a file. + + See `CPXclpwrite <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/clpwrite.html>`_ in the Callable Library Reference + Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> c.read("infeasible.lp") + >>> c.conflict.refine(c.conflict.all_constraints()) + >>> c.conflict.write("conflict.clp") + """ + CPX_PROC.clpwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class PivotVarStatus(ConstantClass): + """Use as input to pivoting methods.""" + at_lower_bound = _constants.CPX_AT_LOWER + at_upper_bound = _constants.CPX_AT_UPPER
+ + + +
+[docs] +class AdvancedCplexInterface(BaseInterface): + """Advanced control of a Cplex object.""" + + no_variable = _constants.CPX_NO_VARIABLE + """See `_constants.CPX_NO_VARIABLE` """ + variable_status = PivotVarStatus() + """See `PivotVarStatus()` """ + +
+[docs] + def delete_names(self): + """Deletes all names from the problem and its objects.""" + CPX_PROC.delnames(self._env._e, self._cplex._lp)
+ + +
+[docs] + def basic_presolve(self): + """Performs bound strengthening and detects redundant rows. + + Returns a tuple containing three lists: a list containing the + strengthened lower bounds, a list containing the strengthened + upper bounds, and a list containing the status of each row. + + See `CPXbasicpresolve <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/basicpresolve.html>`_ in the Callable Library Reference + Manual. + + Note + This method does not create a presolved problem. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> c.read("lpex.mps") + >>> redlb, redub, rstat = c.advanced.basic_presolve() + """ + return CPX_PROC.basicpresolve(self._env._e, self._cplex._lp)
+ + +
+[docs] + def pivot(self, enter, leave, status): + """Pivots a variable into the basis. + + enter is a name or index of a variable or linear constraint. + The index of a slack variable is specified by a negative + integer; -i - 1 refers to the slack associated with the ith + linear constraint. enter must not identify a basic variable. + + leave is a name or index of a variable or linear constraint. + The index of a slack variable is specified by a negative + integer; -i - 1 refers to the slack associated with the ith + linear constraint. leave must identify either a basic + variable or a non-basic variable with both a lower and upper + bound to indicate that it is to move to its opposite bound. + leave may also be set to Cplex.advanced.no_variable to + instruct CPLEX to use a ratio test to determine the entering + variable. + + Note + If a linear constraint has the same name as a column, it must + be specified by -index - 1, not by name. + + status must be an attribute of Cplex.advanced.variable_status + specifying the nonbasic status to be assigned to the leaving + variable after the basis change. + + """ + def conv(var): + try: + return self._cplex.variables._conv(var) + except CplexSolverError: + # Variable name not found, try linear constraints. + return -self._cplex.linear_constraints._conv(var) - 1 + CPX_PROC.pivot(self._env._e, self._cplex._lp, conv(enter), + conv(leave), status)
+ + +
+[docs] + def pivot_slacks_in(self, which): + """Forcibly pivots slack variables into the basis. + + which may be either a single linear constraint index or name + or a sequence of linear constraint indices or names. + + """ + x = listify(self._cplex.linear_constraints._conv(which)) + CPX_PROC.pivotin(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def pivot_fixed_variables_out(self, which): + """Forcibly pivots structural variables out of the basis. + + which may be either a single variable index or name or a + sequence of variable indices or names. + + """ + x = listify(self._cplex.variables._conv(which)) + CPX_PROC.pivotout(self._env._e, self._cplex._lp, x)
+ + +
+[docs] + def strong_branching(self, variables, it_limit): + """Performs strong branching. + + variables is a sequence of names or indices of variables. + + it_limit is an integer that specifies the number of iterations + allowed. + + Returns a list of pairs (down_penalty, up_penalty) with the + same length as variables containing the penalties for + branching down or up, respectively, on each variable. + + See `CPXstrongbranch <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/strongbranch.html>`_ in the Callable Library Reference + Manual for more detail. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> out = c.set_results_stream(None) + >>> out = c.set_log_stream(None) + >>> itlim = c.parameters.simplex.limits.iterations.get() + >>> c.read("example.mps") + >>> c.solve() + >>> vars = list(range(c.variables.get_num())) + >>> result = c.advanced.strong_branching(vars, itlim) + """ + def conv(var): + return self._cplex.variables._conv(var) + return unzip(CPX_PROC.strongbranch( + self._env._e, self._cplex._lp, + conv(variables), it_limit))
+ + +
+[docs] + def complete(self): + """See `CPXcompletelp <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/completelp.html>`_ in the Callable Library Reference + Manual.""" + CPX_PROC.completelp(self._env._e, self._cplex.lp)
+
+ + + +
+[docs] +class BranchDirection(ConstantClass): + """Constants defining branch directions""" + default = _constants.CPX_BRANCH_GLOBAL + down = _constants.CPX_BRANCH_DOWN + up = _constants.CPX_BRANCH_UP
+ + + +
+[docs] +class OrderInterface(BaseInterface): + """Methods for setting and querying a priority order for branching. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add(names = [str(i) for i in range(5)]) + >>> c.variables.set_types(zip(list(range(5)), ["C","I","I","I","I"])) + >>> c.order.set([(1, 10, c.order.branch_direction.up), ('3', 5, c.order.branch_direction.down)]) + >>> c.order.get() + [(1, 10, 1), (3, 5, -1)] + >>> c.order.get_variables() + [1, 3] + """ + + branch_direction = BranchDirection() + """See `BranchDirection()` """ + +
+[docs] + def get(self): + """Returns a list of triples (variable, priority, direction) + representing the priority order for branching. + """ + return unzip(CPX_PROC.getorder(self._env._e, self._cplex._lp))
+ + +
+[docs] + def get_variables(self): + """Returns the variables for which an order has been set.""" + return CPX_PROC.getorder(self._env._e, self._cplex._lp)[0]
+ + +
+[docs] + def set(self, order): + """Sets the priority order for branching. + + order must be a list of triples (variable, priority, direction). + + variable must be an index or name of a variable. + + priority must be a nonnegative integer. + + direction must be an attribute of order.branch_direction. + """ + ord = unzip(order) + ord[0] = self._cplex.variables._conv(ord[0]) + CPX_PROC.copyorder(self._env._e, self._cplex._lp, *ord)
+ + +
+[docs] + def read(self, filename): + """Reads a priority order from a file.""" + CPX_PROC.readcopyorder(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def write(self, filename): + """Writes the priority order to a file.""" + CPX_PROC.ordwrite(self._env._e, self._cplex._lp, filename)
+
+ + + +
+[docs] +class InitialInterface(BaseInterface): + """Methods to set starting information for an optimization algorithm + to solve continuous problems (LP, QP, QCP). + + Note + Data passed to these methods cannot be queried immediately from + the methods in Cplex.solution. Those methods will return + data only after Cplex.solve() or Cplex.feasopt() has been called. + """ + + status = BasisVarStatus() + """See `BasisVarStatus()` """ + +
+[docs] + def set_start(self, col_status, row_status, col_primal, row_primal, + col_dual, row_dual): + """Sets basis statuses, primal values, and dual values. + + The arguments col_status, col_primal, and col_dual are lists + that either have length equal to the number of variables or + are empty. If col_status is empty, then row_status must also + be empty. If col_primal is empty, then row_primal must also + be empty. + + The arguments row_status, row_primal, and row_dual are lists + that either have length equal to the number of linear + constraints or are empty. If row_status is empty, the + col_status must also be empty. If row_dual is empty, then + col_dual must also be empty. + + Each entry of col_status and row_status must be an attribute of + Cplex.start.status. + + Each entry of col_primal and row_primal must be a float + specifying the starting primal values for the columns and + rows, respectively. + + Each entry of col_dual and row_dual must be a float + specifying the starting dual values for the columns and rows, + respectively. + + Note + The starting information is ignored by the optimizers if the + parameter cplex.parameters.advance is set to + cplex.parameters.advance.values.none. + + >>> import cplex + >>> c = cplex.Cplex() + >>> indices = c.variables.add( + ... names=["v{0}".format(i) for i in range(5)] + ... ) + >>> indices = c.linear_constraints.add( + ... names=["r{0}".format(i) for i in range(3)] + ... ) + >>> s = c.start.status + >>> c.start.set_start( + ... [s.basic] * 3 + [s.at_lower_bound] * 2, + ... [s.basic] + [s.at_upper_bound] * 2, + ... [0.0] * 5, + ... [1.0] * 3, + ... [2.0] * 5, + ... [3.0] * 3 + ... ) + """ + CPX_PROC.copystart(self._env._e, self._cplex._lp, col_status, + row_status, col_primal, row_primal, col_dual, + row_dual)
+ + +
+[docs] + def read_start(self, filename): + """Reads the starting information from a file. + + See `CPXreadcopystartinfo <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopystartinfo.html>`_ in the Callable Library + Reference Manual and also `SolutionInterface.write()`. + + Example usage: + + >>> import cplex + >>> c1 = cplex.Cplex() + >>> out = c1.set_results_stream(None) + >>> out = c1.set_log_stream(None) + >>> c1.read("lpex.mps") + >>> c1.solve() + >>> c1.solution.write("lpex.sol") + >>> c2 = cplex.Cplex() + >>> out = c2.set_results_stream(None) + >>> out = c2.set_log_stream(None) + >>> c2.read("lpex.mps") + >>> c2.start.read_start("lpex.sol") + """ + CPX_PROC.readcopystartinfo(self._env._e, self._cplex._lp, filename)
+ + +
+[docs] + def read_basis(self, filename): + """Reads the starting basis from a file. + + See `CPXreadcopybase <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/readcopybase.html>`_ in the Callable Library Reference + Manual and also `BasisInterface.write()`. + + Example: + + >>> import cplex + >>> c1 = cplex.Cplex() + >>> out = c1.set_results_stream(None) + >>> out = c1.set_log_stream(None) + >>> c1.read("lpex.mps") + >>> c1.solve() + >>> c1.solution.basis.write("lpex.bas") + >>> c2 = cplex.Cplex() + >>> out = c2.set_results_stream(None) + >>> out = c2.set_log_stream(None) + >>> c2.read("lpex.mps") + >>> c2.start.read_basis("lpex.bas") + """ + CPX_PROC.readcopybase(self._env._e, self._cplex._lp, filename)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/aborter.html b/docs/_modules/cplex/aborter.html new file mode 100644 index 0000000..311d1b3 --- /dev/null +++ b/docs/_modules/cplex/aborter.html @@ -0,0 +1,240 @@ + + + + + + + cplex.aborter — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.aborter

+# --------------------------------------------------------------------------
+# File: aborter.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""Aborter API"""
+from ._internal import _procedural as _proc
+
+
+
+[docs] +class Aborter(): + """Gracefully terminates the solve and tuning methods of CPLEX. + + You can pass an instance of this class to one or more Cplex objects. + + Calling the method abort() will then terminate the solve or tuning + method of the Cplex object. + """ + +
+[docs] + def __init__(self): + """Constructor of the Aborter class. + + The Aborter object is a context manager and can be used, like so: + + with Aborter() as aborter: + # do stuff + + When the with block is finished, the end() method will be called + automatically. + """ + self._disposed = False + self._p = _proc.new_native_int() + self._cpxlst = set()
+ + + def _register(self, cpx): + self._cpxlst.add(cpx) + + def _unregister(self, cpx): + self._cpxlst.discard(cpx) + + def _throw_if_disposed(self): + if self._disposed: + raise ValueError( + 'illegal method invocation after Aborter.end()') + +
+[docs] + def abort(self): + """Aborts the solving and tuning methods. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.abort() + """ + self._throw_if_disposed() + _proc.set_native_int(self._p, 1)
+ + +
+[docs] + def clear(self): + """Clears the invoking aborter. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.clear() + """ + self._throw_if_disposed() + _proc.set_native_int(self._p, 0)
+ + +
+[docs] + def is_aborted(self): + """Returns True if the method to abort has been called. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.is_aborted() + False + """ + self._throw_if_disposed() + return _proc.get_native_int(self._p) != 0
+ + +
+[docs] + def end(self): + """Ends the invoking aborter. + + Example usage: + + >>> aborter = cplex.Aborter() + >>> aborter.end() + """ + if self._disposed: + return + self._disposed = True + while self._cpxlst: + cpx = self._cpxlst.pop() + cpx.remove_aborter() + _proc.delete_native_int(self._p) + self._p = None
+ + + def __del__(self): + self.end() + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The with statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + Aborter objects return themselves. + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with block, the end() method is called. + """ + self.end()
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/callbacks.html b/docs/_modules/cplex/callbacks.html new file mode 100644 index 0000000..aa7cd2f --- /dev/null +++ b/docs/_modules/cplex/callbacks.html @@ -0,0 +1,3685 @@ + + + + + + + cplex.callbacks — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.callbacks

+# --------------------------------------------------------------------------
+# File: callback.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""Callback classes for the CPLEX Python API.
+
+This module defines the `Context` class which provides methods to query
+information and perform all actions that can be performed from a generic
+callback. See `Cplex.set_callback()`.
+
+See the following examples for more information on generic callbacks:
+
+ * admipex8.py
+ * admipex9.py
+ * bendersatsp2.py
+
+This module also defines a hierarchy of classes for legacy callbacks,
+many of which can be subclassed to define alternative behavior for the
+algorithms in CPLEX. The methods provided by the classes allow you to
+query information about the optimization in progress and to control the
+optimization algorithm.
+
+To use a subclassable legacy callback class, define a subclass of it that
+defines a __call__ method. Then pass that class name to the
+`Cplex.register_callback` method. The `Cplex` class will instantiate the
+legacy callback class and return the instance of the class that was
+created. If you wish to associate additional data with your callback
+class, you may do so after it has been registered with the `Cplex` object.
+
+See the following examples for more information on legacy callbacks:
+
+ * admipex1.py
+ * admipex2.py
+ * admipex3.py
+ * admipex5.py
+ * admipex6.py
+ * bendersatsp.py
+ * lpex4.py
+ * mipex4.py
+
+Note
+  If you operate the CPLEX Python API in parallel mode with callbacks
+  registered, there will be a single instance of each of your callback
+  classes shared among all threads.
+"""
+import weakref
+
+from . import _internal
+from ._internal._callbackinfoenum import CallbackInfo
+from ._internal import _constants as _const
+from ._internal._solutionstrategyenum import SolutionStrategy
+from ._internal import _procedural as _proc
+from ._internal._aux_functions import (apply_freeform_two_args,
+                                       apply_freeform_one_arg,
+                                       init_list_args, convert, max_arg_length,
+                                       validate_arg_lengths, unzip)
+from ._internal._matrices import SparsePair, _HBMatrix, unpack_pair
+from ._internal._subinterfaces import SolutionStatus
+from ._internal import _pycplex
+from .exceptions import (CplexError, CplexSolverError,
+                         WrongNumberOfArgumentsError)
+from .constant_class import ConstantClass
+from .exceptions.error_codes import CPXERR_UNSUPPORTED_OPERATION
+
+
+[docs] +class Callback(): + """Base class for Cplex callback classes. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + self._env = weakref.proxy(env) + self._cb_type_string = None + self._cb_set_function = None + self._cbstruct = None + self._env_lp_ptr = None + self._status = 0
+ + +
+[docs] + def __call__(self): + """Method to be overridden by user-defined callback class. + + See the `Cplex.register_callback` method. + """ + raise CplexError("Callback.__call__ is a pure virtual method")
+ + + def _conv_col(self, name, cache=None): + return convert(name, self._get_col_index, cache) + + def _get_col_index(self, name): + """non-public""" + status = _pycplex.cb_getcolindex( + self._cbstruct, self._env_lp_ptr, name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_row(self, name, cache=None): + return convert(name, self._get_row_index, cache) + + def _get_row_index(self, name): + """non-public""" + status = _pycplex.cb_getrowindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_quad(self, name, cache=None): + return convert(name, self._get_quad_index, cache) + + def _get_quad_index(self, name): + """non-public""" + status = _pycplex.cb_getqconstrindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + + def _conv_sos(self, name, cache=None): + return convert(name, self._get_sos_index, cache) + + def _get_sos_index(self, name): + """non-public""" + status = _pycplex.cb_getsosindex( + self._cbstruct, self._env_lp_ptr, + name) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + +
+[docs] + def abort(self): + """Terminates optimization. + + Note + A call to abort should be followed immediately by a return + statement. Calling other callback methods may override the + effect of the abort statement. + """ + if hasattr(self, "_useraction"): + self._useraction = _const.CPX_CALLBACK_FAIL + self._status = 0 + else: + self._status = 1
+ + +
+[docs] + def get_end_time(self): + """Returns a time stamp for computing the time limit. + + Subtracting the return value of Callback.get_time() from the + return value of this method yields the time remaining in + seconds. + + The interpretation of this value as wall clock time or CPU + time is controlled by the parameter clocktype. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ENDTIME, + CplexSolverError)
+ + +
+[docs] + def get_end_dettime(self): + """Returns a deterministic time stamp in ticks. + + Subtracting the return value of Callback.get_dettime() from the + return value of this method yields the time remaining in + deterministic ticks. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ENDDETTIME, + CplexSolverError)
+ + +
+[docs] + def get_start_time(self): + """Returns a time stamp specifying when the solving process started. + + To compute elapsed time in seconds, subtract the result of + Callback.get_time() from the result of this method. This computation + yields either wallclock time (also known as real time) or CPU time, + depending on the clock set by the clocktype parameter. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_STARTTIME, + CplexSolverError)
+ + +
+[docs] + def get_start_dettime(self): + """Returns a deterministic time stamp specifying when the solving process started. + + To compute elapsed deterministic time in ticks, subtract the result of + Callback.get_dettime() from the result of this method. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_STARTDETTIME, + CplexSolverError)
+ + +
+[docs] + def get_time(self): + """Returns a time stamp for the current time. + + Subtracting the return value of this method from the return + value of Callback.get_end_time() yields the time remaining in + seconds. + + The interpretation of this value as wall clock time or CPU + time is controlled by the parameter clocktype. + """ + status = _pycplex.cb_gettime(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+ + +
+[docs] + def get_dettime(self): + """Returns a deterministic time stamp for the current time. + + Subtracting the return value of this method from the return + value of Callback.get_end_dettime() yields the time remaining in + deterministic ticks. + """ + status = _pycplex.cb_getdettime(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+
+ + + +
+[docs] +class OptimizationCallback(Callback): + """Base class for Cplex optimization callback classes.""" + + def _wherefrom(self): + """non-public""" + return _proc.get_wherefrom(self._cbstruct) + +
+[docs] + def get_num_quadratic_constraints(self): + """Returns the number of quadratic constraints in the problem.""" + return _pycplex.cb_getnumqconstrs(self._cbstruct, self._env_lp_ptr)
+ + +
+[docs] + def get_num_cols(self): + """Returns the number of variables in the problem.""" + return _pycplex.cb_getnumcols(self._cbstruct, self._env_lp_ptr)
+ + +
+[docs] + def get_num_rows(self): + """Returns the number of linear constraints in the problem.""" + return _pycplex.cb_getnumrows(self._cbstruct, self._env_lp_ptr)
+
+ + + +
+[docs] +class ContinuousCallback(OptimizationCallback): + """Subclassable class for Cplex continuous callbacks. + + When Cplex is solving a problem by a simplex or barrier method, + this callback will be called after the simplex or barrier + callback, if any such callbacks are registered. + + During concurrent optimization, CPLEX calls the user-written + callback only in the main thread, not in other concurrent threads. + + :undocumented: __init__, _wherefrom + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "continuous" + self._cb_set_function = _proc.setlpcallbackfunc
+ + +
+[docs] + def get_dual_infeasibility(self): + """Returns a measure of the dual infeasibility of the problem.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_INFMEAS, + CplexSolverError)
+ + +
+[docs] + def get_primal_infeasibility(self): + """Returns a measure of the primal infeasibility of the problem.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_INFMEAS, + CplexSolverError)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations completed.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_ITCOUNT_LONG, + CplexSolverError)
+ + +
+[docs] + def get_objective_value(self): + """Returns the current value of the objective function.""" + if self._wherefrom() == _const.CPX_CALLBACK_DUAL: + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_OBJ, + CplexSolverError) + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_OBJ, + CplexSolverError)
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether or not the current solution is dual feasible.""" + if self._wherefrom() == _const.CPX_CALLBACK_PRIMAL: + return self.get_dual_infeasibility() <= 0.0 + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_FEAS, + CplexSolverError)
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether or not the current solution is primal feasible.""" + if self._wherefrom() == _const.CPX_CALLBACK_DUAL: + return self.get_primal_infeasibility() <= 0.0 + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_PRIMAL_FEAS, + CplexSolverError)
+
+ + + +
+[docs] +class SimplexCallback(ContinuousCallback): + """Subclassable class for Cplex simplex callback classes. + + This callback will be used during execution of the primal simplex, + dual simplex, or quadratic simplex algorithms. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "simplex"
+
+ + + +
+[docs] +class BarrierCallback(ContinuousCallback): + """Subclassable class for Cplex barrier callback classes. + + This callback will be used during execution of the barrier or + quadratic barrier algorithms. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "barrier"
+ + +
+[docs] + def get_dual_objective_value(self): + """Returns the current dual value of the objective function.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_DUAL_OBJ, + CplexSolverError)
+
+ + + +
+[docs] +class CrossoverCallback(OptimizationCallback): + """Subclassable class for Cplex crossover callback classes. + + This callback will be used during execution of a crossover + algorithm. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "crossover" + self._cb_set_function = _proc.setlpcallbackfunc
+ + +
+[docs] + def get_num_dual_exchanges(self): + """Returns the number of dual exchanges performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_DEXCH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_dual_pushes(self): + """Returns the number of dual pushes performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_DPUSH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_primal_exchanges(self): + """Returns the number of primal exchanges performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_PEXCH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_primal_pushes(self): + """Returns the number of primal pushes performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_PPUSH_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_superbasics(self): + """Returns the number of superbasic variables in the basis.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CROSSOVER_SBCNT, + CplexSolverError)
+
+ + + +
+[docs] +class QualityMetric(ConstantClass): + """Constants defining metrics for the quality of the MIP solve.""" + kappa_stable = _const.CPX_CALLBACK_INFO_KAPPA_STABLE + kappa_suspicious = _const.CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS + kappa_unstable = _const.CPX_CALLBACK_INFO_KAPPA_UNSTABLE + kappa_illposed = _const.CPX_CALLBACK_INFO_KAPPA_ILLPOSED + kappa_max = _const.CPX_CALLBACK_INFO_KAPPA_MAX + kappa_attention = _const.CPX_CALLBACK_INFO_KAPPA_ATTENTION
+ + + +
+[docs] +class CutType(ConstantClass): + """Arguments to MIPInfoCallback.get_num_cuts().""" + # NB: If you edit these, look at _subinterfaces.py:CutType too! + # Also add the cut to the list of valid values get_num_cuts()! + cover = _const.CPX_CALLBACK_INFO_COVER_COUNT + GUB_cover = _const.CPX_CALLBACK_INFO_GUBCOVER_COUNT + flow_cover = _const.CPX_CALLBACK_INFO_FLOWCOVER_COUNT + clique = _const.CPX_CALLBACK_INFO_CLIQUE_COUNT + fractional = _const.CPX_CALLBACK_INFO_FRACCUT_COUNT + MIR = _const.CPX_CALLBACK_INFO_MIRCUT_COUNT + flow_path = _const.CPX_CALLBACK_INFO_FLOWPATH_COUNT + disjunctive = _const.CPX_CALLBACK_INFO_DISJCUT_COUNT + implied_bound = _const.CPX_CALLBACK_INFO_IMPLBD_COUNT + zero_half = _const.CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT + multi_commodity_flow = _const.CPX_CALLBACK_INFO_MCFCUT_COUNT + lift_and_project = _const.CPX_CALLBACK_INFO_LANDPCUT_COUNT + user = _const.CPX_CALLBACK_INFO_USERCUT_COUNT + table = _const.CPX_CALLBACK_INFO_TABLECUT_COUNT + solution_pool = _const.CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT + benders = _const.CPX_CALLBACK_INFO_BENDERS_COUNT
+ + # Not Implemented: + # local_implied_bound + # BQP + # RLT + + +
+[docs] +class MIPInfoCallback(OptimizationCallback): + """Subclassable class for MIP informational callback classes. + + This callback will be used when CPLEX is solving a MIP problem. + + :undocumented: __init__ + """ + + quality_metric = QualityMetric() + """See `QualityMetric()`""" + + cut_type = CutType() + """See `CutType()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "MIP_info" + self._cb_set_function = _proc.setinfocallbackfunc
+ + + def _setup(self, e, lp): + self.num_cols = _proc.getnumcols(e, lp) + self.num_rows = _proc.getnumrows(e, lp) + self.num_quad = _proc.getnumqconstrs(e, lp) + +
+[docs] + def get_num_cols(self): + return self.num_cols
+ + +
+[docs] + def get_num_rows(self): + return self.num_rows
+ + +
+[docs] + def get_num_quadratic_constraints(self): + return self.num_quad
+ + +
+[docs] + def get_num_cuts(self, cut_type): + """Returns the number of cuts of type cut_type added so far.""" + if cut_type not in (_const.CPX_CALLBACK_INFO_COVER_COUNT, + _const.CPX_CALLBACK_INFO_GUBCOVER_COUNT, + _const.CPX_CALLBACK_INFO_FLOWCOVER_COUNT, + _const.CPX_CALLBACK_INFO_CLIQUE_COUNT, + _const.CPX_CALLBACK_INFO_FRACCUT_COUNT, + _const.CPX_CALLBACK_INFO_MIRCUT_COUNT, + _const.CPX_CALLBACK_INFO_FLOWPATH_COUNT, + _const.CPX_CALLBACK_INFO_DISJCUT_COUNT, + _const.CPX_CALLBACK_INFO_IMPLBD_COUNT, + _const.CPX_CALLBACK_INFO_ZEROHALFCUT_COUNT, + _const.CPX_CALLBACK_INFO_MCFCUT_COUNT, + _const.CPX_CALLBACK_INFO_LANDPCUT_COUNT, + _const.CPX_CALLBACK_INFO_USERCUT_COUNT, + _const.CPX_CALLBACK_INFO_TABLECUT_COUNT, + _const.CPX_CALLBACK_INFO_SOLNPOOLCUT_COUNT, + _const.CPX_CALLBACK_INFO_BENDERS_COUNT): + raise ValueError("invalid value for cut_type ({0})".format(cut_type)) + return _pycplex.fast_getcallbackinfo(self._cbstruct, cut_type, + CplexSolverError)
+ + +
+[docs] + def get_best_objective_value(self): + """Returns the best objective value among unexplored nodes.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_BEST_REMAINING, + CplexSolverError)
+ + +
+[docs] + def get_cutoff(self): + """Returns the current cutoff value.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_CUTOFF, + CplexSolverError)
+ + +
+[docs] + def get_incumbent_objective_value(self): + """Returns the objective value of the incumbent solution.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_BEST_INTEGER, + CplexSolverError)
+ + +
+[docs] + def get_incumbent_linear_slacks(self, *args): + """Returns a set of linear slacks for the incumbent solution. + + Can be called by four forms. + + self.get_incumbent_linear_slacks() + return all linear slack values from the incumbent solution. + + self.get_incumbent_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_incumbent_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_incumbent_linear_slacks(i) for i in s] + + self.get_incumbent_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_incumbent_linear_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_incumbent_values())] + status = _pycplex.cb_slackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.num_rows - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_incumbent_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks for the incumbent solution. + + Can be called by four forms. + + self.get_incumbent_quadratic_slacks() + return all quadratic slack values from the incumbent + solution. + + self.get_incumbent_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_incumbent_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to + [self.get_incumbent_quadratic_slacks(i) for i in s] + + self.get_incumbent_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_incumbent_quadratic_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_incumbent_values())] + status = _pycplex.cb_qconstrslackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.num_quad - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_incumbent_values(self, *args): + """Returns the variable values of the incumbent solution. + + There are four forms by which get_incumbent_values may be + called. + + self.get_incumbent_values() + returns the entire incumbent solution + + self.get_incumbent_values(i) + i must be a variable index or name. Returns the value + of the variable with index i in the incumbent solution. + + self.get_incumbent_values(s) + s must be a sequence of variables indices or names. + Returns a list of the values of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_incumbent_values(i) for i in s] + + self.get_incumbent_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the values of the variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_incumbent_values(range(begin, end + 1)) + """ + def getcallbackincumbent(begin, end=self.num_cols - 1): + return _proc.getcallbackincumbent(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbackincumbent, self._conv_col, args)
+ + +
+[docs] + def get_MIP_relative_gap(self): + """Returns the current relative MIP gap. + + Accesses the current relative gap, like the routine + CPXgetmiprelgap in the Callable Library. See CPXgetcallbackinfo + and CPXgetmiprelgap in the Callable Library Reference Manual for + more detail. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_REL_GAP, + CplexSolverError)
+ + +
+[docs] + def get_num_iterations(self): + """Returns the number of iterations performed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_ITERATIONS_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_nodes(self): + """Returns the number of nodes processed so far.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_NODE_COUNT_LONG, + CplexSolverError)
+ + +
+[docs] + def get_num_remaining_nodes(self): + """Returns the number of unexplored nodes remaining.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_NODES_LEFT_LONG, + CplexSolverError)
+ + +
+[docs] + def has_incumbent(self): + """Returns whether or not an incumbent solution has been found.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MIP_FEAS, + CplexSolverError)
+ + +
+[docs] + def get_float_quality(self, which): + """Returns a measure of the quality of the MIP solution as a floating point value. + + The measure of the quality of a solution must be an attribute + of self.quality_metric corresponding to a floating point + quality metric. Such metrics include: + + self.quality_metric.kappa_stable + self.quality_metric.kappa_suspicious + self.quality_metric.kappa_unstable + self.quality_metric.kappa_illposed + self.quality_metric.kappa_max + self.quality_metric.kappa_attention + """ + if which not in (_const.CPX_CALLBACK_INFO_KAPPA_STABLE, + _const.CPX_CALLBACK_INFO_KAPPA_SUSPICIOUS, + _const.CPX_CALLBACK_INFO_KAPPA_UNSTABLE, + _const.CPX_CALLBACK_INFO_KAPPA_ILLPOSED, + _const.CPX_CALLBACK_INFO_KAPPA_MAX, + _const.CPX_CALLBACK_INFO_KAPPA_ATTENTION): + raise ValueError("invalid value for which ({0})".format(which)) + return _pycplex.fast_getcallbackinfo(self._cbstruct, which, + CplexSolverError)
+ + +
+[docs] + def get_thread_num(self): + """Returns the identifier for the thread from which the callback + was invoked. + + See CPX_CALLBACK_INFO_MY_THREAD_NUM in the Callable Library + Reference Manual for more detail. + """ + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_MY_THREAD_NUM, + CplexSolverError)
+
+ + + +
+[docs] +class MIPCallback(MIPInfoCallback): + """Subclassable class for MIP callback classes. + + This callback will be used when CPLEX is solving a MIP problem. + + :undocumented: __init__, _get_node_info, _get_seq_info + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "MIP" + self._cb_set_function = _proc.setmipcallbackfunc
+ + + def _get_node_info(self, which_info, which_node): + """non-public""" + return _proc.getcallbacknodeinfo(self._cbstruct, which_node, which_info) + + def _get_seq_info(self, which_info, which_node): + """non-public""" + return _proc.getcallbackseqinfo(self._cbstruct, which_node, which_info) + +
+[docs] + def get_objective_coefficients(self, *args): + """Returns the coefficients of the linear objective function. + + There are four forms by which get_objective_coefficients may + be called. + + self.get_objective_coefficients() + returns the entire objective function. + + self.get_objective_coefficients(i) + i must be a variable index or name. Returns the objective + coefficient of the variable with index i. + + self.get_objective_coefficients(s) + s must be a sequence of variable indices or names. Returns + a list of the objective coefficients of the variables with + indices the members of s, in the same order as they appear + in s. Equivalent to [self.get_objective_coefficients(i) + for i in s] + + self.get_objective_coefficients(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the objective coefficients of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_objective_coefficients(range(begin, end + 1)) + """ + def getobj(begin, end=self.get_num_cols() - 1): + status = _pycplex.cb_getobj(self._cbstruct, self._env_lp_ptr, + begin, end) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1] + return apply_freeform_two_args( + getobj, self._conv_col, args)
+ + +
+[docs] + def get_current_node_depth(self): + """Returns the depth of the current node in the search tree. + + The root node has depth 0 (zero). The depth of other nodes is defined + recursively as the depth of their parent node plus one. In other + words, the depth of a node is its distance in terms of the number of + branches from the root. + """ + # The function is called get_current_node_depth() rather than + # get_depth() (as in the other APIs) for historical reasons: + # when we introduced the function we already had a get_depth() + # function in the node callback which had a different signature and + # different semantics + return _proc.getcallbacknodeinfo( + self._cbstruct, 0, + _const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG)
+
+ + + +
+[docs] +class FeasibilityStatus(ConstantClass): + """Feasibility status codes.""" + feasible = _const.CPX_INTEGER_FEASIBLE + implied_feasible = _const.CPX_IMPLIED_INTEGER_FEASIBLE + infeasible = _const.CPX_INTEGER_INFEASIBLE
+ + + +
+[docs] +class ControlCallback(MIPCallback): + """Base class for Cplex MIP control callback classes. + + :undocumented: __init__ + """ + + feasibility_status = FeasibilityStatus() + """See `FeasibilityStatus()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._useraction = _const.CPX_CALLBACK_DEFAULT
+ + +
+[docs] + def get_pseudo_costs(self, *args): + """Returns the current pseudo costs. + + There are four forms by which get_pseudo_costs may be + called. + + self.get_pseudo_costs() + returns a list of pairs with the pseudo costs for all the + variables. + + self.get_pseudo_costs(i) + i must be a variable index or name. Returns a pair (up, + down), where up is the up pseudo cost and down is the down + pseudo cost of branching on the variable i. + + self.get_pseudo_costs(s) + s must be a sequence of variable indices or names. Returns + a list of pairs (up, down) of pseudo costs of branching on + the variables with indices the members of s, in the same + order as they appear in s. Equivalent to + [self.get_pseudo_costs(i) for i in s] + + self.get_pseudo_costs(begin, end) + begin and end must be variable indices or variable names. + Returns a list of pairs (up, down) of pseudo costs of branching + on the variables with indices between begin and end, inclusive + of end. Equivalent to + self.get_pseudo_costs(range(begin, end + 1)) + """ + def getcallbackpseudocosts(begin, end=self.get_num_cols() - 1): + return unzip(_proc.getcallbackpseudocosts(self._cbstruct, begin, end)) + return apply_freeform_two_args( + getcallbackpseudocosts, self._conv_col, args)
+ + +
+[docs] + def get_feasibilities(self, *args): + """Returns the current integer feasibility status. + + There are four forms by which get_feasibilities may be + called. + + The return values are attributes of self.feasibility_status. + + self.get_feasibilities() + returns a list with the feasibility status for all the + variables. + + self.get_feasibilities(i) + i must be a variable index or name. Returns the + feasibility status of the variable with index i. + + self.get_feasibilities(s) + s must be a sequence of variable indices or names. Returns + a list of the feasibility statuses of the variables with + indices the members of s, in the same order as they appear + in s. Equivalent to [self.get_feasibilities(i) for i in s] + + self.get_feasibilities(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the feasibility statuses of the variables + with indices between begin and end, inclusive of end. + Equivalent to self.get_feasibilities(range(begin, end + 1)) + + Note + Before you call this method from a solve callback, a + solution must exist. That is, you must first create the + solution by calling a CPLEX optimization method, and then + you must verify that this optimization method generated a + solution by checking its return value before you call the + method get_feasibilities. + """ + def getcallbacknodeintfeas(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodeintfeas(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodeintfeas, self._conv_col, args)
+ + +
+[docs] + def get_lower_bounds(self, *args): + """Returns the lower bounds at the current node. + + There are four forms by which get_lower_bounds may be + called. + + self.get_lower_bounds() + returns a list with the lower bounds for all the variables. + + self.get_lower_bounds(i) + i must be a variable index or name. Returns the lower + bound of the variable with index i. + + self.get_lower_bounds(s) + s must be a sequence of variable indices or names. Returns + a list of the lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_lower_bounds(i) for i in s] + + self.get_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the lower bounds of the variables with + indices between begin and end, inclusive of end. Equivalent + to self.get_lower_bounds(range(begin, end + 1)) + """ + def getcallbacknodelb(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodelb(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodelb, self._conv_col, args)
+ + +
+[docs] + def get_upper_bounds(self, *args): + """Returns the upper bounds at the current node. + + There are four forms by which get_upper_bounds may be + called. + + self.get_upper_bounds() + returns a list with the upper bounds for all the variables. + + self.get_upper_bounds(i) + i must be a variable index or name. Returns the upper + bound of the variable with index i. + + self.get_upper_bounds(s) + s must be a sequence of variable indices or names. Returns + a list of the upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_upper_bounds(i) for i in s] + + self.get_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the upper bounds of the variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_upper_bounds(range(begin, end + 1)) + """ + def getcallbacknodeub(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodeub(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodeub, self._conv_col, args)
+ + +
+[docs] + def get_node_data(self): + """Returns the user handle for the current node. + + Returns None if no handle is set for the node. + """ + return self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_USERHANDLE, 0)
+ + +
+[docs] + def set_node_data(self, data): + """Set the user handle for the current node. + + Returns the user handle previously set for this node (or None + if no handle was set). + """ + return _proc.callbacksetuserhandle(self._cbstruct, data)
+ + +
+[docs] + def get_node_ID(self): + """Return the sequence number of this node.""" + return self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, 0)
+ + +
+[docs] + def get_objective_value(self): + """Returns the value of the objective function at the current node.""" + return _proc.getcallbacknodeobjval(self._cbstruct)
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks for the solution at the current node. + + Can be called by four forms. + + self.get_linear_slacks() + return all linear slack values from the problem at the + current node. + + self.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_linear_slacks(i) for i in s] + + self.get_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_linear_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_values())] + status = _pycplex.cb_slackfromx( + self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_rows() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Returns a set of quadratic slacks for the solution at the current node. + + Can be called by four forms. + + self.get_quadratic_slacks() + return all quadratic slack values from the problem at the + current node. + + self.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [self.get_quadratic_slacks(i) for i in s] + + self.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or quadratic + constraint names. Returns the slack values associated with the + quadratic constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_quadratic_slacks(range(begin, end + 1)). + """ + values = [x for x in iter(self.get_values())] + status = _pycplex.cb_qconstrslackfromx(self._cbstruct, self._env_lp_ptr, values) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_quadratic_constraints() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_values(self, *args): + """Returns the solution values at the current node. + + In the case that the node LP is unbounded, this method returns + a vector that corresponds to an unbounded direction, scaled so + that at least one of its elements has magnitude + cplex.infinity. Thus, often the vector can be used directly, + for example to separate a lazy constraint. However, due to + the presence of large values in the vector care must be taken + to avoid potential numerical errors. If in doubt, + rescale the vector, and use it as an unbounded ray + rather than a primal vector. + + There are four forms by which get_values may be called. + + self.get_values() + returns the entire primal solution vector. + + self.get_values(i) + i must be a variable index or name. Returns the solution + value of the variable with index i. + + self.get_values(s) + s must be a sequence of variable indices or names. Returns + a list of the solution values of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_values(i) for i in s] + + self.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_values(range(begin, end + 1)) + """ + def getcallbacknodex(begin, end=self.get_num_cols() - 1): + return _proc.getcallbacknodex(self._cbstruct, begin, end) + return apply_freeform_two_args( + getcallbacknodex, self._conv_col, args)
+ + +
+[docs] + def get_SOS_feasibilities(self, *args): + """Returns the current special ordered set feasibility status. + + There are four forms by which get_SOS_feasibilities may be + called. + + Returns 1 if the SOS is feasible and 0 if it is not. + + self.get_SOS_feasibilties() + Returns the feasibility statuses of all the special ordered + sets. + + self.get_SOS_feasibilities(i) + i must be a SOS index or name. Returns the feasibility + status of the special ordered set with index i. + + self.get_SOS_feasibilities(s) + s must be a sequence of SOS indices or names. Returns a + list of the feasibility statuses of the special ordered + sets with indices the members of s, in the same order as + they appear in s. Equivalent to + [self.get_SOS_feasibilities(i) for i in s] + + self.get_SOS_feasibilities(begin, end) + begin and end must be SOS indices or SOS names. Returns a list + of the feasibility statuses of the special ordered sets with + indices between begin and end, inclusive of end. Equivalent to + self.get_SOS_feasibilities(range(begin, end + 1)) + + Note + Before you call this method from a solve callback, a + solution must exist. That is, you must first create the + solution by calling a CPLEX optimization method, and then + you must verify that this optimization method generated a + solution by checking its return value before you call the + method get_SOS_feasibilities. + """ + def is_sos_feasible(index): + return _proc.getcallbacksosinfo( + self._cbstruct, index, 0, + _const.CPX_CALLBACK_INFO_SOS_IS_FEASIBLE) + return apply_freeform_one_arg( + is_sos_feasible, self._conv_sos, + _pycplex.cb_getnumsos(self._cbstruct, self._env_lp_ptr), args)
+
+ + + +
+[docs] +class BranchType(ConstantClass): + """Constants defining types of branches.""" + any = _const.CPX_TYPE_ANY + SOS1 = _const.CPX_TYPE_SOS1 + SOS2 = _const.CPX_TYPE_SOS2 + variable = _const.CPX_TYPE_VAR
+ + + +
+[docs] +class BranchCallback(ControlCallback): + """Subclassable class for branch callback classes. + + The user must be careful when using this class. Pruning a valid node + can prune the optimal solution. Also, choosing a different branching + variable can result in placing an invalid bound on a variable, in case + the variable was already restricted to other bounds before. + + In particular, the user must not branch on variables that are implied + feasible. ImpliedFeasible specifies that the variable has been + presolved out. It will be feasible when all other integer variables + are integer feasible. Branching on such variables can cut off + feasible solutions. + + If the user intends to branch on continuous variables, the user must + disable dual presolve reductions. To disable dual presolve + reductions, set the parameter to control primal and dual reduction + type, parameters.preprocessing.reduce, either to the value 1 (one) + (that is, CPX_PREREDUCE_PRIMALONLY) or to the value 0 (zero) (that + is, CPX_PREREDUCE_NOPRIMALORDUAL). + + Also, if the user intends to branch on continuous variables, the user + must turn off reductions that may interfere with crushing or uncrushing. + This is parameters.preprocessing.reformulations. + + By design, the CPLEX branch callback calculates and provides the + branching decisions that CPLEX would make in case the user does not + create any branches in the callback. Depending on variable selection + and other features of your model, the computation of these candidate + branches can be time-consuming. Consequently, if you know that you + will never use the branching candidates suggested by CPLEX, then you + can save time by disabling such features as strong branching. This + callback will be used prior to branching at a node in the branch and + cut tree. + + :undocumented: __init__ + """ + + branch_type = BranchType() + """See `BranchType()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + def fn(a, b): + _proc.setbranchcallbackfunc(a, b) + _proc.setbranchnosolncallbackfunc(a, b) + super().__init__(env) + self._cb_type_string = "branch" + self._cb_set_function = fn + self._node_count = 0 + self._bound_count = 0 + self._node_begin = [] + self._index = [] + self._bounds = [] + self._lu = [] + self._node_estimate = [] + self._branch_type = None
+ + +
+[docs] + def get_branch(self, which_branch): + """Returns one of the candidate branches at the current node. + + which_branch must be an integer such that 0 <= which_branch < + self.get_num_branches(). + + The return value of get_branch is a tuple t with two entries. + The first entry is the node estimate for the specified branch. + The second entry is a list of (var, dir, bnd) triples, where + var is the index of a variable whose bound will change, bnd is + the new bound, and dir is one of "L", "U", and "B", indicating + that the branch will change the lower bound, the upper bound, + or both, respectively. + """ + if which_branch < 0 or which_branch >= self._node_count: + raise CplexError("BranchCallback.get_branch: Bad branch index") + if which_branch == self._node_count - 1: + end = self._bound_count + else: + end = self._node_begin[which_branch + 1] + vars = self._index[self._node_begin[which_branch]: end] + bnds = self._bounds[self._node_begin[which_branch]: end] + dirs = self._lu[self._node_begin[which_branch]: end] + return (self._node_estimate[which_branch], list(zip(vars, dirs, bnds)))
+ + +
+[docs] + def get_branch_type(self): + """Returns the type of the branch. + + One of the following: + self.branch_type.any + self.branch_type.SOS1 + self.branch_type.SOS2 + self.branch_type.variable + """ + return self._branch_type
+ + +
+[docs] + def get_num_branches(self): + """Return the number of nodes Cplex will create from this branch.""" + return self._node_count
+ + +
+[docs] + def is_integer_feasible(self): + """Return whether or not the current node is integer feasible.""" + return self.get_num_branches() == 0
+ + +
+[docs] + def make_branch(self, objective_estimate, variables=None, + constraints=None, node_data=None): + """Makes a new branch with the specified data. + + objective_estimate is a float representing the estimated + objective value resulting from the specified branch. + + variables is a sequence of (var, dir, bnd) triples specifying + the variables on which to branch. var must be an index of a + variable, dir must be one of "L" and "U", indicating that the + bound is a lower or upper bound, respectively, and bnd is an + integer specifying the new bound for the variable. + + constraints is a sequence of (vec, sense, rhs) triples + specifying the constraints with which to branch. vec must be + either an instance of SparsePair or a sequence with two + entries, the first of which specifies the indices and the + second of which specifies the values of the constraint. rhs + must be a float determining the righthand side of the + constraint. sense must be one of "L", "G", or "E", specifying + whether the constraint is a less-than-or-equal-to (<=), + greater-than-or-equal-to (>=), or equality constraint. + + node_data may be any object to be associated with the created + node. It can be queried by the get_node_data methods of the + IncumbentCallback class and the NodeCallback class. + """ + variables, constraints = init_list_args(variables, constraints) + obje = objective_estimate + if variables: + a = unzip(variables) + else: + a = [[], [], []] + vars = list(a[0]) + dirs = ''.join(list(a[1])) + bnds = list(a[2]) + if constraints: + a = unzip(constraints) + else: + a = [[], [], []] + rmat = _HBMatrix(a[0]) + sense = ''.join(list(a[1])) + rhs = list(a[2]) + seqnum = _proc.branchcallbackbranchgeneral( + self._cbstruct, vars, dirs, bnds, rhs, sense, rmat.matbeg, + rmat.matind, rmat.matval, obje, node_data) + self._useraction = _const.CPX_CALLBACK_SET + return (seqnum,)
+ + +
+[docs] + def make_cplex_branch(self, which_branch, node_data=None): + """Replicates a CPLEX branch. + + This method replicates the n-th branch that CPLEX would create + at the current node. The purpose of this method is to branch + exactly like CPLEX, but at the same time attach a user object to + the newly created node. + + which_branch must be an integer such that 0 <= which_branch < + self.get_num_branches(). + + node_data may be any object to be associated with the created + node. It can be queried by the get_node_data methods of various + callback classes. + + This method returns the sequence number of the newly created + node. + """ + seqnum = _proc.branchcallbackbranchasCPLEX(self._cbstruct, + which_branch, + node_data) + self._useraction = _const.CPX_CALLBACK_SET + return seqnum
+ + +
+[docs] + def prune(self): + """Removes the current node from the search tree. + + Note + Prune must not be called in combination with make_branch. + Prune is not compatible with the populate_solution_pool + method of the Cplex class because + that method retains fathomed nodes for subsequent use. + """ + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class CutCallback(ControlCallback): + """Base class for user cut and lazy constraint callback classes. + + :undocumented: add, add_local + """ + + def _add(self, cut, sense, rhs, use_cut): + """non-public""" + indices, values = unpack_pair(cut) + if use_cut is True: + use_cut = 1 + if use_cut is False: + use_cut = 0 + _proc.cutcallbackadd( + self._cbstruct, rhs, sense, + self._conv_col(indices), + values, use_cut) + + def _add_local(self, cut, sense, rhs): + """non-public""" + indices, values = unpack_pair(cut) + _proc.cutcallbackaddlocal( + self._cbstruct, rhs, sense, + self._conv_col(indices), values)
+ + + +
+[docs] +class UseConstraint(ConstantClass): + """Constants to specify when to use the added constraint""" + force = _const.CPX_USECUT_FORCE + purge = _const.CPX_USECUT_PURGE
+ + + +
+[docs] +class LazyConstraintCallback(CutCallback): + """Subclassable class for lazy constraint callback classes. + + This callback will be used when CPLEX finds a new integer + feasible solution and when CPLEX finds that the LP relaxation + at the current node is unbounded. + + Note: + The lazy constraint callback may be invoked during MIP start + processing. In that case get_solution_source returns + mip_start_solution. When this value is returned some special + considerations apply: + + - MIP start processing occurs very early in the solution process. + At this point no search tree is setup yet and there are no + search tree nodes yet. Consequently, a lot of the callback + methods that require a node context will fail in this + situation. + - Lazy constraints separated when processing a MIP start will be + discarded after that MIP start has been processed. This means + that the callback may have to separate the same constraint + again for the next MIP start or for a solution that is found + later in the solution process. + + :undocumented: __init__ + """ + + use_constraint = UseConstraint() + """See `UseConstraint()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "lazycon" + self._cb_set_function = _proc.setlazyconstraintcallbackfunc
+ + +
+[docs] + def add(self, constraint, sense, rhs, use=use_constraint.force): + """Adds a linear constraint to the current subproblem. + + constraint must be either a SparsePair instance or a list of + two lists, the first of which specifies variables, the second + of which specifies the values of the constraint. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the constraint. + + use indicates under what circumstances the constraint should + be used. It can take the following values: + + self.use_constraint.force (default) : force CPLEX to use the constraint + self.use_constraint.purge : allow CPLEX to purge the constraint + + When you add a lazy constraint with the nondefault value purge, + you authorize CPLEX to purge (that is, to eliminate) the lazy + constraint under certain circumstances, for example, if the + lazy constraint becomes slack. Consequently, in view of such + purging, you must not assume that any previously added constraints + are still in current relaxation. In other words, the purged + lazy constraint may be violated in subsequent relaxations. + """ + self._add(constraint, sense, rhs, use)
+ + +
+[docs] + def add_local(self, constraint, sense, rhs): + """Adds a linear local constraint to the current subproblem. + + A local constraint is a constraint that will only be added to + the problem at the current node and the subtree rooted by the + current node. It will not be added to the constraint matrix of + the original model. + + constraint must be either a SparsePair instance or a list of + two lists, the first of which specifies variables, the second + of which specifies the values of the constraint. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the constraint. + """ + self._add_local(constraint, sense, rhs)
+ + +
+[docs] + def is_unbounded_node(self): + """Returns True if the current LP relaxation is unbounded, False otherwise.""" + return self._wherefrom() == _const.CPX_CALLBACK_MIP_CUT_UNBD
+ + +
+[docs] + def get_solution_source(self): + """Returns the source of the solution for which the lazy constraint callback was invoked. + + The possible return values are: + + IncumbentCallback.solution_source.node_solution: The integral solution is + the solution to the LP relaxation of a node in the MIP search + tree. + + IncumbentCallback.solution_source.heuristic_solution: The integral solution + has been found by a CPLEX internal heuristic. + + IncumbentCallback.solution_source.mipstart_solution: The integral solution has been + found during MIP start processing. + """ + node_info = self._get_node_info(_const.CPX_CALLBACK_INFO_LAZY_SOURCE, 0) + source = IncumbentCallback.solution_source + switcher = { + _const.CPX_LAZYCONSTRAINTCALLBACK_NODE: source.node_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_HEUR: source.heuristic_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_MIPSTART: source.mipstart_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_USER: source.user_solution + } + return switcher[node_info]
+
+ + + +
+[docs] +class UseCut(ConstantClass): + """Constants to specify when to use the added cut.""" + force = _const.CPX_USECUT_FORCE + purge = _const.CPX_USECUT_PURGE + filter = _const.CPX_USECUT_FILTER
+ + + +
+[docs] +class UserCutCallback(CutCallback): + """Subclassable class for lazy constraint callback classes. + + This callback will be used within the cut loop that CPLEX calls at + each node of the branch and cut algorithm. It will be called once + after CPLEX has ended its own cut generation loop so that the user + can specify additional cuts to be added to the cut pool. + + :undocumented: __init__ + """ + + use_cut = UseCut() + """See `UseCut()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "usercut" + self._cb_set_function = _proc.setusercutcallbackfunc
+ + +
+[docs] + def add(self, cut, sense, rhs, use=use_cut.force): + """Adds a linear cut to to the current subproblem. + + cut must be either a SparsePair instance or a list of two + lists, the first of which specifies variables, the second of + which specifies the values of the cut. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the cut. + + use indicates under what circumstances the cut should be used. + It can take the following values + + self.use_cut.force (default) : force CPLEX to use the cut + self.use_cut.purge : allow CPLEX to purge the cut + self.use_cut.filter : treat as cuts CPLEX creates + """ + self._add(cut, sense, rhs, use)
+ + +
+[docs] + def add_local(self, cut, sense, rhs): + """Adds a linear local cut to the current subproblem. + + A local cut is a cut that is only valid at the current + node and the subtree rooted by the current node. It does + not need to be globally valid. + + cut must be either a SparsePair instance or a list of two + lists, the first of which specifies variables, the second of + which specifies the values of the cut. + + sense must be a single-character string; ("L", "G", "E") + + rhs is a float, specifying the righthand side of the cut. + """ + self._add_local(cut, sense, rhs)
+ + +
+[docs] + def is_after_cut_loop(self): + """Returns True if called after the cut loop, False otherwise.""" + return self._wherefrom() == _const.CPX_CALLBACK_MIP_CUT_LAST
+ + +
+[docs] + def abort_cut_loop(self): + """Terminate the cut loop and proceed with branching.""" + self._useraction = _const.CPX_CALLBACK_ABORT_CUT_LOOP
+
+ + + +
+[docs] +class MethodType(ConstantClass): + """Constants defining methods for solving the node LP.""" + primal = _const.CPX_ALG_PRIMAL + dual = _const.CPX_ALG_DUAL + barrier = _const.CPX_ALG_BARRIER + network = _const.CPX_ALG_NET
+ + + +
+[docs] +class HSCallback(ControlCallback): + """Base class for heuristic and solve callback classes.""" + + status = _internal._subinterfaces.SolutionStatus() + """See `_internal._subinterfaces.SolutionStatus()` """ + + method = MethodType() + """See `MethodType()`""" + +
+[docs] + def get_cplex_status(self): + """Returns the solution status of the current subproblem. + + Returns an attribute of self.status. + """ + status = _pycplex.cb_getstat(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return status[1]
+ + +
+[docs] + def is_dual_feasible(self): + """Returns whether the solution of the current subproblem is dual feasible.""" + status = _pycplex.cb_solninfo(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return bool(status[2])
+ + +
+[docs] + def is_primal_feasible(self): + """Returns whether the solution of the current subproblem is primal feasible.""" + status = _pycplex.cb_solninfo(self._cbstruct) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + return bool(status[1])
+ + +
+[docs] + def solve(self, alg=_const.CPX_ALG_DUAL): + """Solves the current subproblem. + + The value of alg, if specified, determines the algorithm to + use to solve the current subproblem. + + self.method.primal : primal simplex + + self.method.dual : dual simplex + + self.method.barrier : barrier + + self.method.network : network + + If this method generates a feasible solution it returns True, + otherwise it returns False. + """ + if alg == _const.CPX_ALG_PRIMAL: + status = _pycplex.cb_primopt(self._cbstruct) + elif alg in (_const.CPX_ALG_DUAL, _const.CPX_ALG_AUTOMATIC): + status = _pycplex.cb_dualopt(self._cbstruct) + elif alg == _const.CPX_ALG_BARRIER: + status = _pycplex.cb_hybbaropt(self._cbstruct) + elif alg == _const.CPX_ALG_NET: + status = _pycplex.cb_hybnetopt(self._cbstruct) + else: + raise CplexError("HSCallback.solve: bad algorithm identifier") + _proc.check_status(self._cbstruct, status, from_cb=True) + return self.get_cplex_status() in (self.status.optimal, + self.status.feasible, + self.status.MIP_optimal, + self.status.MIP_feasible)
+
+ + + +
+[docs] +class HeuristicCallback(HSCallback): + """Subclassable class for heuristic callback classes. + + This callback will be used after solving each subproblem and at + the root node before each round of cuts is added to the problem + and resolved. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "heuristic" + self._cb_set_function = _proc.setheuristiccallbackfunc + self._x = []
+ + +
+[docs] + def set_bounds(self, *args): + """Sets the bounds for a set of variables. + + Can be called by two forms. + + self.set_bounds(i, lb, ub) + i must be a variable name or index and lb and ub must be + real numbers. Sets the lower bound and upper bound of the + variable whose index or name is i to lb and ub, + respectively. + + self.set_lower_bounds(seq_of_triples) + seq_of_triples must be a list or tuple of tuples (i, lb, ub), + each of which consists of a variable name or index and + two real numbers. Sets the bounds of the specified + variables to the corresponding values. Equivalent to + [self.set_lower_bounds(triple[0], triple[1], triple[2]) for + triple in seq_of_triples]. + + Note + The variables specified must not have been removed by + presolve. + + Note + These bound changes affect only the problem at the current + node. + """ + if len(args) == 1: + vars, lb, ub = unzip(args) + elif len(args) == 3: + vars = [args[0]] + lb = [args[1]] + ub = [args[2]] + else: + raise WrongNumberOfArgumentsError() + vars = self._conv_col(vars) + status = _pycplex.cb_getprestat_c(self._cbstruct, self._env_lp_ptr) + if status is not None: + _proc.check_status(self._cbstruct, status[0], from_cb=True) + pstat = status[1] + for i in vars: + if pstat[i] == 0: + raise CplexError( + "Variable removed by presolve: cannot change bounds") + ind = [] + lu = "" + bd = [] + for i, v in enumerate(vars): + ind.append(v) + if lb[i] == ub[i]: + lu = ''.join([lu, "B"]) + bd.append(lb[i]) + else: + ind.append(v) + lu = ''.join([lu, "LU"]) + bd.extend([lb[i], ub[i]]) + status = _pycplex.cb_chgbds(self._cbstruct, ind, lu, bd) + _proc.check_status(self._cbstruct, status, from_cb=True)
+ + +
+[docs] + def set_solution(self, solution, objective_value=None): + """Sets a solution to be used as the incumbent. + + solution is either an instance of SparsePair or a sequence of + length two. If it is a sequence, the first entry is a + sequence of variable indices or names whose values are to be + changed and the second entry is a sequence of floats with the + corresponding new solution values. Variables whose indices + are not specified remain unchanged. + + If objective_value is specified, it is taken as the objective + value of the new solution. Otherwise, the objective value is + computed. + + Do not call this method multiple times. + Calling it again will overwrite any previously specified solution. + """ + vars, vals = unpack_pair(solution) + vars = self._conv_col(vars) + for i, v in enumerate(vars): + self._x[v] = vals[i] + if objective_value is None: + objective_value = 0.0 + obj_coef = self.get_objective_coefficients() + for i, v in enumerate(self._x): + objective_value += v * obj_coef[i] + self._objective_value = objective_value + self._useraction = _const.CPX_CALLBACK_SET + self._check_feasibility = 1 + self._status = 0
+
+ + + +
+[docs] +class SolveCallback(HSCallback): + """Subclassable class for solve callback classes. + + This callback can be used to solve node relaxations during branch + and cut search. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "solve" + self._cb_set_function = _proc.setsolvecallbackfunc
+ + +
+[docs] + def set_start(self, primal=None, dual=None): + """Sets the starting vectors for the next solve. + + The arguments primal and dual must either be instances of + SparsePair or sequences of length two. If they are sequences, + the first entry is a sequence of indices or names specifying + the columns or rows whose values are to be set, and the second + entry is a sequence of floats with the corresponding new + values. + + If primal is specified but dual is not, no dual values will be + stored. If dual is specified but primal is not, no primal + values will be stored. + + Variables whose indices are not specified will be set to 0.0. + + Note + If presolve is enabled, attempting to set dual values in + this method will raise an exception. + """ + if primal is None: + primal = SparsePair([], []) + if dual is None: + dual = SparsePair([], []) + var, x = unpack_pair(primal) + rng, pi = unpack_pair(dual) + prim = [0.0] * self.get_num_cols() + dual = [0.0] * self.get_num_rows() + var = self._conv_col(var) + rng = self._conv_row(rng) + for i, val in enumerate(x): + prim[var[i]] = val + for i, val in enumerate(pi): + dual[rng[i]] = val + if var: + status = _pycplex.cb_crushx(self._cbstruct, self._env_lp_ptr, prim) + if status is not None: + _proc.check_status(self._cbstruct, + status[0], from_cb=True) + prim = status[1] + if rng: + status = _pycplex.cb_crushpi(self._cbstruct, self._env_lp_ptr, dual) + if status is not None: + _proc.check_status(self._cbstruct, + status, from_cb=True) + raise CplexError( + "Presolve must be disabled to set dual vectors in SolveCallback.set_start") + status = _pycplex.cb_copystart(self._cbstruct, prim, dual) + _proc.check_status(self._cbstruct, status, from_cb=True)
+ + +
+[docs] + def use_solution(self): + """Tell CPLEX to use the resident solution after calling solve.""" + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class SolutionSource(ConstantClass): + """Attributes defining possible solution sources.""" + node_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_NODESOLN + heuristic_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN + user_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_USERSOLN + mipstart_solution = _const.CPX_CALLBACK_MIP_INCUMBENT_MIPSTART
+ + + +
+[docs] +class IncumbentCallback(MIPCallback): + """Subclassable class for incumbent callback classes. + + This callback will be used after each new potential incumbent is found. + If the callback is used to reject incumbents, the user must set + the parameter + c.parameters.preprocessing.reduce either to the value + 1 (one) to restrict presolve to primal reductions only or to 0 (zero) + to disable all presolve reductions. This setting of the parameter is + not necessary if the incumbent callback is used for other purposes. + + Note + The incumbent callback may be invoked during MIP start processing. + In that case get_solution_source will return mip_start_solution. + In this situation the following special consideration applies: + + - MIP start processing occurs very early in the solution process. + At this point no search tree is setup yet and there are no search + tree nodes yet. Consequently, a lot of the callback methods + that require a node context will fail in this situation. + + :undocumented: __init__ + """ + + solution_source = SolutionSource() + """See `SolutionSource()`""" + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "incumbent" + self._cb_set_function = _proc.setincumbentcallbackfunc + self._useraction = _const.CPX_CALLBACK_DEFAULT + self._objective_value = 0.0 + self._x = []
+ + +
+[docs] + def get_node_data(self): + """Returns the user handle for the current node. + + Returns None if no handle is set for the node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_USERHANDLE, 0)
+ + +
+[docs] + def set_node_data(self, data): + """Set the user handle for the current node. + + Returns the user handle previously set for this node (or None + if no handle was set). + """ + return _proc.callbacksetuserhandle(self._cbstruct, data)
+ + +
+[docs] + def get_node_ID(self): + """Returns the sequence number of the current node.""" + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, 0)
+ + +
+[docs] + def get_objective_value(self): + """Returns the objective value of the potential incumbent.""" + return self._objective_value
+ + +
+[docs] + def get_linear_slacks(self, *args): + """Returns a set of linear slacks for the solution at the current node. + + Can be called by four forms. + + self.get_linear_slacks() + return all linear slack values from the problem at the + current node. + + self.get_linear_slacks(i) + i must be a linear constraint name or index. Returns the + slack values associated with the linear constraint whose + index or name is i. + + self.get_linear_slacks(s) + s must be a sequence of linear constraint names or indices. + Returns the slack values associated with the linear + constraints with indices the members of s. Equivalent to + [self.get_linear_slacks(i) for i in s] + + self.get_linear_slacks(begin, end) + begin and end must be linear constraint indices with begin + <= end or linear constraint names whose indices respect + this order. Returns the slack values associated with the + linear constraints with indices between begin and end, + inclusive of end. Equivalent to + self.get_linear_slacks(range(begin, end + 1)). + """ + status = _pycplex.cb_slackfromx(self._cbstruct, self._env_lp_ptr, + self._x) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_rows() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_row, args)
+ + +
+[docs] + def get_quadratic_slacks(self, *args): + """Return a set of quadratic slacks for the solution at the current node. + + Can be called by four forms. + + self.get_quadratic_slacks() + return all quadratic slack values from the problem at the + current node. + + self.get_quadratic_slacks(i) + i must be a quadratic constraint name or index. Returns + the slack values associated with the quadratic constraint + whose index or name is i. + + self.get_quadratic_slacks(s) + s must be a sequence of quadratic constraint names or + indices. Returns the slack values associated with the + quadratic constraints with indices the members of s. + Equivalent to [self.get_quadratic_slacks(i) for i in s] + + self.get_quadratic_slacks(begin, end) + begin and end must be quadratic constraint indices or + quadratic constraint names. Returns the slack values associated + with the quadratic constraints with indices between begin and + end, inclusive of end. Equivalent to + self.get_quadratic_slacks(range(begin, end + 1)). + """ + status = _pycplex.cb_qconstrslackfromx( + self._cbstruct, self._env_lp_ptr, self._x) + _proc.check_status(self._cbstruct, status[0], from_cb=True) + slacks = status[1] + + def getslack(a, b=self.get_num_quadratic_constraints() - 1): + return slacks[a:b + 1] + return apply_freeform_two_args( + getslack, self._conv_quad, args)
+ + +
+[docs] + def get_values(self, *args): + """Return the potential incumbent solution values. + + There are four forms by which get_values may be called. + + self.get_values() + returns the entire potential incumbent. + + self.get_values(i) + i must be a variable index or name. Returns the potential + incumbent value of the variable with index i. + + self.get_values(s) + s must be a sequence of variable indices or names. Returns + a list of the potential incumbent values of the variables + with indices the members of s, in the same order as they + appear in s. Equivalent to [self.get_values(i) for i in s] + + self.get_values(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the potential incumbent values of variables + with indices between begin and end, inclusive of end. + Equivalent to self.get_values(range(begin, end + 1)) + """ + def getx(begin, end=self.get_num_cols() - 1): + return self._x[begin:end + 1] + return apply_freeform_two_args( + getx, self._conv_col, args)
+ + +
+[docs] + def get_solution_source(self): + """Returns the source of the solution for which the incumbent callback was invoked. + + The possible return values are: + + self.solution_source.node_solution: The integral solution is + the solution to the LP relaxation of a node in the MIP search + tree. + + self.solution_source.heuristic_solution: The integral solution + has been found by a CPLEX internal heuristic. + + self.solution_source.user_solution: The integral solution has been + found by the user in the heuristic callback. + + self.solution_source.mipstart_solution: The integral solution has been + found during MIP start processing. + """ + wherefrom = self._wherefrom() + source = self.solution_source + switcher = { + _const.CPX_CALLBACK_MIP_INCUMBENT_NODESOLN: source.node_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_HEURSOLN: source.heuristic_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_USERSOLN: source.user_solution, + _const.CPX_CALLBACK_MIP_INCUMBENT_MIPSTART: source.mipstart_solution + } + return switcher[wherefrom]
+ + +
+[docs] + def reject(self): + """Tells Cplex not to use the potential incumbent.""" + self._useraction = _const.CPX_CALLBACK_SET + self._is_feasible = False
+
+ + + +
+[docs] +class NodeCallback(MIPCallback): + """Subclassable class for node callback classes. + + This callback will be used before CPLEX enters a node, and can select + a different node to be entered instead. + + :undocumented: __init__, __conditionally_convert + """ + + def __conditionally_convert(self, which_node): + if isinstance(which_node, type(())): + return self.get_node_number(which_node) + return which_node + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "node" + self._cb_set_function = _proc.setnodecallbackfunc + self._useraction = _const.CPX_CALLBACK_DEFAULT
+ + +
+[docs] + def get_branch_variable(self, which_node): + """Returns the index of the variable used to branch at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_VAR, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_depth(self, which_node): + """Returns the depth in the search tree of node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_DEPTH_LONG, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_current_node_depth(self): + """Returns the depth of the current node in the search tree. + + This method always raises an exception since the node callback is not + invoked in the context of any node. + """ + # Overrides MIPCallback.get_current_node_depth + # Always throw an exception. + # The intention is this: The super class has a getCurrentNodeDepth() + # function as well. That would throw an exception because the callable + # library returns a non-zero status. + # However, by explicitly overriding this function, we can explicitly + # document that this will fail. + raise CplexSolverError('Not in a node context', None, + CPXERR_UNSUPPORTED_OPERATION)
+ + +
+[docs] + def get_estimated_objective_value(self, which_node): + """Returns the estimated objective function value at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_ESTIMATE, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_infeasibility_sum(self, which_node): + """Returns the sum of infeasibilities at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_SIINF, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_num_infeasibilities(self, which_node): + """Returns the number of infeasibilities at node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_NIINF, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def get_node_data(self, which_node): + """Returns the handle set by the user for node which_node. + + Returns None if no handle was set when the node was created. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_USERHANDLE, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def set_node_data(self, which_node, data): + """Set the user handle for the specified node. + + Returns the user handle previously set for that node (or None + if no handle was set). + """ + return _proc.callbacksetnodeuserhandle(self._cbstruct, + which_node, data)
+ + +
+[docs] + def get_node_ID(self, which_node): + """Returns a one-tuple containing the sequence number of node which_node. + + which_node must be an integer specifying the index + number of the desired node. + """ + return (self._get_node_info( + _const.CPX_CALLBACK_INFO_NODE_SEQNUM_LONG, which_node),)
+ + +
+[docs] + def get_node_number(self, which_node): + """Returns the index number of node which_node. + + which_node must be a 1-tuple whose entry is an integer + specifying the sequence number of the desired node. + """ + return self._get_seq_info( + _const.CPX_CALLBACK_INFO_NODE_NODENUM_LONG, which_node[0])
+ + +
+[docs] + def get_objective_value(self, which_node): + """Returns the objective function value for node which_node. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + return self._get_node_info(_const.CPX_CALLBACK_INFO_NODE_OBJVAL, + self.__conditionally_convert(which_node))
+ + +
+[docs] + def select_node(self, which_node): + """Tells Cplex to enter node which_node next. + + which_node may either be an integer specifying the index + number of the desired node, or a 1-tuple whose entry is an + integer specifying the sequence number of the desired node. + """ + self._node_number = self.__conditionally_convert(which_node) + self._useraction = _const.CPX_CALLBACK_SET + self._status = 0
+
+ + + +
+[docs] +class TuningCallback(Callback): + """Subclassable class for tuning callback classes. + + This callback will be used during tuning. + + For general information about tuning callbacks, see that topic + in the CPLEX User's Manual. + + :undocumented: __init__ + """ + +
+[docs] + def __init__(self, env): + """non-public""" + super().__init__(env) + self._cb_type_string = "tuning" + self._cb_set_function = _proc.settuningcallbackfunc
+ + +
+[docs] + def get_progress(self): + """Returns the fraction of the tuning process that is done.""" + return _pycplex.fast_getcallbackinfo( + self._cbstruct, + _const.CPX_CALLBACK_INFO_TUNING_PROGRESS, + CplexSolverError)
+
+ + + +
+[docs] +class ContextType(ConstantClass): + """The different contexts in which a generic callback can be invoked. + + The values defined here serve two purposes: + + They are returned from `Context.get_id()` to indicate in which + context a particular callback invocation happened. + + The bit-wise OR of these values specifies to + `Cplex.set_callback()` in which contexts CPLEX invokes the + callback. + + See the reference manual of the CPLEX Callable Library (C API) + for a more detailed description of the various contexts. + """ + + thread_up = _const.CPX_CALLBACKCONTEXT_THREAD_UP + """See `CPX_CALLBACKCONTEXT_THREAD_UP <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_THREAD_UP.html>`_ in the C API.""" + + thread_down = _const.CPX_CALLBACKCONTEXT_THREAD_DOWN + """See `CPX_CALLBACKCONTEXT_THREAD_DOWN <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_THREAD_DOWN.html>`_ in the C API.""" + + local_progress = _const.CPX_CALLBACKCONTEXT_LOCAL_PROGRESS + """See `CPX_CALLBACKCONTEXT_LOCAL_PROGRESS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_LOCAL_PROGRESS.html>`_ in the C API.""" + + global_progress = _const.CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS + """See `CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS.html>`_ in the C API.""" + + candidate = _const.CPX_CALLBACKCONTEXT_CANDIDATE + """See `CPX_CALLBACKCONTEXT_CANDIDATE <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_CANDIDATE.html>`_ in the C API.""" + + relaxation = _const.CPX_CALLBACKCONTEXT_RELAXATION + """See `CPX_CALLBACKCONTEXT_RELAXATION <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_RELAXATION.html>`_ in the C API.""" + + branching = _const.CPX_CALLBACKCONTEXT_BRANCHING + """See `CPX_CALLBACKCONTEXT_BRANCHING <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_CALLBACKCONTEXT_BRANCHING.html>`_ in the C API."""
+ + + +
+[docs] +class RelaxationFlags(ConstantClass): + """The flags that can be passed to `Context.get_relaxation_status()`. + + See the reference manual of the CPLEX Callable Library (C API) + for a more detailed description of the various contexts. + """ + + no_solve = _const.CPX_RELAXATION_FLAG_NOSOLVE + """See `CPX_RELAXATION_FLAG_NOSOLVE <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/macros/CPX_RELAXATION_FLAG_NOSOLVE.html>`_ in the C API."""
+ + + +
+[docs] +class Context(): + """Context for the generic callback. + + An instance of this class defines the context in which a generic + callback was invoked. It provides methods to query information and + perform all actions that can be performed from a generic callback. + + Note that an instance of this class is only valid during the + execution of the callback into which it was passed. Don't store a + reference to the context across callback invocations. + + See `Cplex.set_callback()`. + + :undocumented: __init__ + """ + + info = CallbackInfo() + """See `CallbackInfo`""" + + solution_strategy = SolutionStrategy() + """See `SolutionStrategy`""" + + id = ContextType() + """See `ContextType`""" + + relaxation_flags = RelaxationFlags() + """See `RelaxationFlags`""" + + solution_status = SolutionStatus() + """See `SolutionStatus`""" + +
+[docs] + def __init__(self, cpx, contextptr, contextid): + """non-public""" + self._cpx = cpx + self._contextptr = contextptr + self._contextid = contextid
+ + + def _get_column_index(self, name): + """non-public""" + # Adapted from Callback._get_col_index + return _proc.getcolindex(env=self._cpx._env._e, lp=self._cpx._lp, + colname=name) + + def _get_column_count(self): + """non-public""" + return _proc.getnumcols(self._cpx._env._e, self._cpx._lp) + + def _colname2idx(self, name, cache=None): + """non-public""" + # This is the same as Callback._conv_col! + return convert(name, self._get_column_index, cache) + +
+[docs] + def get_id(self): + """Returns the context in which the current callback was invoked. + + The return value will be one of the constants in `ContextType`. + """ + return self._contextid
+ + +
+[docs] + def in_thread_up(self): + """Returns True if the callback was invoked in context + `ContextType.thread_up`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.thread_up` or not. + """ + return self._contextid == self.id.thread_up
+ + +
+[docs] + def in_thread_down(self): + """Returns True if the callback was invoked in context + `ContextType.thread_down`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.thread_down` or not. + """ + return self._contextid == self.id.thread_down
+ + +
+[docs] + def in_local_progress(self): + """Returns True if the callback was invoked in context + `ContextType.local_progress`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.local_progress` or not. + """ + return self._contextid == self.id.local_progress
+ + +
+[docs] + def in_global_progress(self): + """Returns True if the callback was invoked in context + `ContextType.global_progress`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.global_progress` or not. + """ + return self._contextid == self.id.global_progress
+ + +
+[docs] + def in_candidate(self): + """Returns True if the callback was invoked in context + `ContextType.candidate`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.candidate` or not. + """ + return self._contextid == self.id.candidate
+ + +
+[docs] + def in_relaxation(self): + """Returns True if the callback was invoked in context + `ContextType.relaxation`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.relaxation` or not. + """ + return self._contextid == self.id.relaxation
+ + +
+[docs] + def in_branching(self): + """Returns True if the callback was invoked in context + `ContextType.branching`. + + It is a shortcut for checking whether `get_id()` returns + `ContextType.branching` or not. + """ + return self._contextid == self.id.branching
+ + +
+[docs] + def get_int_info(self, what): + """Returns a 32bit signed information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfoint(self._contextptr, what)
+ + +
+[docs] + def get_long_info(self, what): + """Returns a 64bit signed information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfolong <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfolong.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfolong(self._contextptr, what)
+ + +
+[docs] + def get_double_info(self, what): + """Returns a float information value. + + Potential values are listed in `Context.info`. Note that in all + contexts but `ContextType.global_progress` the information + returned by the method is thread-local. + + See `CPXcallbackgetinfodbl <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetinfodbl.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetinfodbl(self._contextptr, what)
+ + +
+[docs] + def abort(self): + """Aborts the optimization. + + If you call this method then CPLEX will abort optimization at + the next opportunity. + + See `CPXcallbackabort <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackabort.html>`_ in the Callable Library Reference + Manual for more detail. + """ + _proc.callbackabort(self._contextptr)
+ + +
+[docs] + def get_relaxation_point(self, *args): + """Returns the solution to the current relaxation. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + This method returns the values in the solution for the current + relaxation for the variables specified by the arguments. + + There are four forms by which get_relaxation_point may be called. + + self.get_relaxation_point() + returns the full solution vector. + + self.get_relaxation_point(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the solution to the current + relaxation. + + self.get_relaxation_point(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_relaxation_point(i) for i in s] + + self.get_relaxation_point(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_relaxation_point(range(begin, end + 1)). + + See `CPXcallbackgetrelaxationpoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationpoint.html>`_ in the Callable + Library Reference Manual for more detail. + """ + def callbackgetrelaxationpoint(begin, end=self._get_column_count() - 1): + return _proc.callbackgetrelaxationpoint(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetrelaxationpoint, self._colname2idx, args)
+ + +
+[docs] + def get_relaxation_objective(self): + """Returns the objective value of current relaxation. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + See `CPXcallbackgetrelaxationpoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationpoint.html>`_ in the Callable + Library Reference Manual for more detail. + """ + return _proc.callbackgetrelaxationpointobj(self._contextptr)
+ + +
+[docs] + def get_relaxation_status(self, flags=0): + """Returns the solution status of the relaxation LP. + + Returns the solution status of the LP relaxation at the current + node. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + See `CPXcallbackgetrelaxationstatus <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetrelaxationstatus.html>`_ in the Callable + Library Reference Manual for more detail. + """ + return _proc.callbackgetrelaxationstatus(self._contextptr, flags)
+ + +
+[docs] + def make_branch(self, objective_estimate, variables=None, + constraints=None): + """Makes a new branch with the specified data. + + This method can only be invoked if `get_id()` returns + `ContextType.branching`. If invoked in a different context it + will raise an exception. + + objective_estimate is a float representing the estimated + objective value resulting from the specified branch. + + variables is a sequence of (var, dir, bnd) tuples specifying + the variables on which to branch. var must be an index of a + variable, dir must be one of "L" and "U", indicating that the + bound is a lower or upper bound, respectively, and bnd is an + integer specifying the new bound for the variable. + + constraints is a sequence of (vec, sense, rhs) tuples specifying + the constraints with which to branch. vec must be either an + instance of `SparsePair` or a sequence with two entries, the + first of which specifies the indices and the second of which + specifies the values of the constraint. rhs must be a float + determining the righthand side of the constraint. sense must be + one of "L", "G", or "E", specifying whether the constraint is a + less-than-or-equal-to (<=), greater-than-or-equal-to (>=), or + equality constraint (=). + + The method returns an integer that uniquely identifies the newly + created child node in the search tree. + + Note that the children will be dropped if you call + `prune_current_node()` at the same node. + + See `CPXcallbackmakebranch <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackmakebranch.html>`_ in the Callable Library + Reference Manual for more detail. + """ + variables, constraints = init_list_args(variables, constraints) + if variables: + a = unzip(variables) + else: + a = [[], [], []] + vars = list(a[0]) + dirs = ''.join(list(a[1])) + bnds = list(a[2]) + if constraints: + a = unzip(constraints) + else: + a = [[], [], []] + rmat = _HBMatrix(a[0]) + sense = ''.join(list(a[1])) + rhs = list(a[2]) + return _proc.callbackmakebranch(self._contextptr, + vars, dirs, bnds, rhs, sense, + rmat.matbeg, rmat.matind, rmat.matval, + objective_estimate)
+ + +
+[docs] + def prune_current_node(self): + """Ask CPLEX to prune the current node from the search tree. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation` or `ContextType.branching`. If invoked + in a different context it will raise an exception. + + The node is marked for pruning. As soon as the callback returns, + CPLEX stops processing the node. In particular, no child nodes + will be created from that node, even if you called + `make_branch()` to explicitly create new nodes. + + See `CPXcallbackprunenode <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackprunenode.html>`_ in the Callable Library + Reference Manual for more detail. + """ + _proc.callbackprunenode(self._contextptr)
+ + +
+[docs] + def exit_cut_loop(self): + """Ask CPLEX to stop cutting plane separatation at the current + node. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + See `CPXcallbackexitcutloop <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackexitcutloop.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackexitcutloop(self._contextptr)
+ + +
+[docs] + def get_incumbent(self, *args): + """Returns the current incumbent solution. + + The method returns the values in the current incumbent solution + for the variables specified by the arguments. + + There are four forms by which get_incumbent may be called. + + self.get_incumbent() + returns the full incumbent vector. + + self.get_incumbent(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the current incumbent + solution. + + self.get_incumbent(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_incumbent(i) for i in s] + + self.get_incumbent(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_incumbent(range(begin, end + 1)). + + See `CPXcallbackgetincumbent <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetincumbent.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetincumbent(begin, end=self._get_column_count() - 1): + return _proc.callbackgetincumbent(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetincumbent, self._colname2idx, args)
+ + +
+[docs] + def get_incumbent_objective(self): + """Returns the objective value of the current incumbent. + + The returned value may be a huge value (such as 1e75) to indicate + that no incumbent was found yet. Consider using `get_int_info()` + with `CallbackInfo.feasible` first to check whether there is an + incumbent. + + See `CPXcallbackgetincumbent <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetincumbent.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetincumbentobj(self._contextptr)
+ + +
+[docs] + def is_candidate_point(self): + """Test if the callback was invoked for a candidate feasible + point. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method returns true if the callback was invoked for a + candidate feasible point. In that case the candidate feasible + point can be examined using `get_candidate_point()` and + `get_candidate_objective()`. + + See `CPXcallbackcandidateispoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackcandidateispoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackcandidateispoint(self._contextptr)
+ + +
+[docs] + def get_candidate_source(self): + """Get the source from which the current candidate solution originated. + + The value returned is from IncumbentCallback.solution_source. + """ + + # FIXME: Share this code with above + source = IncumbentCallback.solution_source + switcher = { + _const.CPX_LAZYCONSTRAINTCALLBACK_NODE: source.node_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_HEUR: source.heuristic_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_MIPSTART: source.mipstart_solution, + _const.CPX_LAZYCONSTRAINTCALLBACK_USER: source.user_solution + } + + return switcher[self.get_int_info(self.info.candidate_source)]
+ + +
+[docs] + def get_candidate_point(self, *args): + """Returns the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_point()` returns true. + If invoked in a different context it will raise an exception. + + This method returns the values in the current candidate solution + for the variables specified by the arguments. + + There are four forms by which get_candidate_point may be called. + + self.get_candidate_point() + returns the full solution vector. + + self.get_candidate_point(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the current candidate + solution. + + self.get_candidate_point(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_candidate_point(i) for i in s] + + self.get_candidate_point(begin, end) + begin and end must be variable indices or variable names. + Returns a list of solution values of variables with indices + between begin and end, inclusive of end. Equivalent to + self.get_candidate_point(range(begin, end + 1)) + + See `CPXcallbackgetcandidatepoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidatepoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetcandidatepoint(begin, end=self._get_column_count() - 1): + return _proc.callbackgetcandidatepoint(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetcandidatepoint, self._colname2idx, args)
+ + +
+[docs] + def get_candidate_objective(self): + """Returns the objective value of current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_point()` returns true. + It will raise an exception if invoked in a different context. + + See `CPXcallbackgetcandidatepoint <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidatepoint.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackgetcandidateobj(self._contextptr)
+ + +
+[docs] + def is_candidate_ray(self): + """Test if the callback was invoked for an unbounded ray. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method returns true if the callback was invoked for an + unbounded relaxation. In that case the unbounded ray can be + obtained using `get_candidate_ray()` and. + + See `CPXcallbackcandidateisray <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackcandidateisray.html>`_ in the Callable Library + Reference Manual for more detail. + """ + return _proc.callbackcandidateisray(self._contextptr)
+ + +
+[docs] + def get_candidate_ray(self, *args): + """Returns the current unbounded ray. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and `is_candidate_ray()` returns true. If + invoked in a different context it will raise an exception. + + The method returns the values for in the unbounded ray for the + variables specified by the arguments. + + There are four forms by which get_candidate_ray may be called. + + self.get_candidate_ray() + returns the full ray vector. + + self.get_candidate_ray(i) + i must be a variable index or name. Returns the value of the + variable with index or name i in the unbounded ray. + + self.get_candidate_ray(s) + s must be a sequence of variable indices or names. Returns a + list of the values of the variables with indices the members of + s, in the same order as they appear in s. Equivalent to + [self.get_candidate_ray(i) for i in s] + + self.get_candidate_ray(begin, end) + begin and end must be variable indices or variable names. + Returns a list of unbounded reay values of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_candidate_ray(range(begin, end + 1)). + + See `CPXcallbackgetcandidateray <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackgetcandidateray.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetcandidateray(begin, end=self._get_column_count() - 1): + return _proc.callbackgetcandidateray(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetcandidateray, self._colname2idx, args)
+ + +
+[docs] + def get_local_lower_bounds(self, *args): + """Returns the current local lower bounds. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + There are four forms by which get_local_lower_bounds may be + called. + + self.get_local_lower_bounds() + returns local lower bounds for all variables. + + self.get_local_lower_bounds(i) + i must be a variable index or name. Returns the local lower + bound of the variable with index or name i. + + self.get_local_lower_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the local lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_local_lower_bounds(i) for i in s] + + self.get_local_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the local lower bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_local_lower_bounds(range(begin, end + 1)). + + See `CPXcallbackgetlocallb <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetlocallb.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetlocallb(begin, end=self._get_column_count() - 1): + return _proc.callbackgetlocallb(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetlocallb, self._colname2idx, args)
+ + +
+[docs] + def get_local_upper_bounds(self, *args): + """Returns the current local upper bounds. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + There are four forms by which get_local_upper_bounds may be + called. + + self.get_local_upper_bounds() + returns local upper bounds for all variables. + + self.get_local_upper_bounds(i) + i must be a variable index or name. Returns the local upper + bound of the variable with index or name i. + + self.get_local_upper_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the local upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_local_upper_bounds(i) for i in s] + + self.get_local_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the local upper bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_local_upper_bounds(range(begin, end + 1)). + + See `CPXcallbackgetlocalub <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetlocalub.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetlocalub(begin, end=self._get_column_count() - 1): + return _proc.callbackgetlocalub(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetlocalub, self._colname2idx, args)
+ + +
+[docs] + def get_global_lower_bounds(self, *args): + """Returns the current globally valid lower bounds. + + This method cannot be invoked if `get_id()` returns + `ContextType.thread_up` or `ContextType.thread_down`. + + There are four forms by which get_global_lower_bounds may be + called. + + self.get_global_lower_bounds() + returns global lower bounds for all variables. + + self.get_global_lower_bounds(i) + i must be a variable index or name. Returns the global lower + bound of the variable with index or name i. + + self.get_global_lower_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the global lower bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_global_lower_bounds(i) for i in s] + + self.get_global_lower_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the global lower bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_global_lower_bounds(range(begin, end + 1)). + + See `CPXcallbackgetgloballb <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetgloballb.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetgloballb(begin, end=self._get_column_count() - 1): + return _proc.callbackgetgloballb(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetgloballb, self._colname2idx, args)
+ + +
+[docs] + def get_global_upper_bounds(self, *args): + """Returns the current globally valid upper bounds. + + This method cannot be invoked if `get_id()` returns + `ContextType.thread_up` or `ContextType.thread_down`. + + There are four forms by which get_global_upper_bounds may be + called. + + self.get_global_upper_bounds() + returns global upper bounds for all variables. + + self.get_global_upper_bounds(i) + i must be a variable index or name. Returns the global upper + bound of the variable with index or name i. + + self.get_global_upper_bounds(s) + s must be a sequence of variable indices or names. Returns a + list of the global upper bounds of the variables with indices + the members of s, in the same order as they appear in s. + Equivalent to [self.get_global_upper_bounds(i) for i in s] + + self.get_global_upper_bounds(begin, end) + begin and end must be variable indices or variable names. + Returns a list of the global upper bounds of variables with + indices between begin and end, inclusive of end. Equivalent to + self.get_global_upper_bounds(range(begin, end + 1)). + + See `CPXcallbackgetglobalub <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/mipapi/callbackgetglobalub.html>`_ in the Callable Library + Reference Manual for more detail. + """ + def callbackgetglobalub(begin, end=self._get_column_count() - 1): + return _proc.callbackgetglobalub(self._contextptr, begin, end) + return apply_freeform_two_args( + callbackgetglobalub, self._colname2idx, args)
+ + +
+[docs] + def post_heuristic_solution(self, x, obj, strategy): + """Posts a feasible solution vector to CPLEX. + + This method posts a (possibly partial) feasible solution to + CPLEX. CPLEX may use this vector to find a new incumbent + solution. + + x is either a `SparsePair` instance or a list of two lists, the + first of which specifies the variables (by index or name) and the + second of which specifies the values. + + obj is an estimate for the objective function value of the + solution provided by x. + + strategy specifies how CPLEX should complete partial solutions. + See `SolutionStrategy` for further details. + + See `CPXcallbackpostheursoln <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackpostheursoln.html>`_ in the Callable Library + Reference Manual for more detail. + """ + indices, values = unpack_pair(x) + _proc.callbackpostheursoln(self._contextptr, len(indices), + self._colname2idx(indices), values, + obj, strategy)
+ + +
+[docs] + def add_user_cuts(self, cuts, senses, rhs, cutmanagement, local): + """Adds user cuts. + + This method can only be invoked if `get_id()` returns + `ContextType.relaxation`. If invoked in a different context it + will raise an exception. + + This method submits the specified user cuts to CPLEX. + + cuts, senses, rhs, cutmanagement, local must all be lists of + compatible dimensions. The first three specify the cuts to be + added. + + cuts must be either a list of `SparsePair` instances or a list of + lists of two lists, the first of which specifies variables, the + second of which specifies the values of the constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + cutmanagement must be a list of integer values specifying how + CPLEX should treat each cut (see `UseCut` constants for further + details). + + local must be a list of boolean values and specifies for each cut + whether it is only locally valid (True) or globally valid + (False). + + See `CPXcallbackaddusercuts <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackaddusercuts.html>`_ in the Callable Library + Reference Manual for more detail. + """ + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, cuts, cutmanagement, local] + ncuts = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": cuts, senses, rhs, cutmanagement, local" + ) + if ncuts > 0: + with _proc.chbmatrix(cuts, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackaddusercuts(self._contextptr, ncuts, nnz, + rhs, senses, rmat, + cutmanagement, local)
+ + +
+[docs] + def add_user_cut(self, cut, sense, rhs, cutmanagement, local): + """Convenience wrapper for `add_user_cuts()` that only adds a + single cut. + """ + self.add_user_cuts([cut], [sense], [rhs], [cutmanagement], [local])
+ + +
+[docs] + def reject_candidate(self, constraints=None, senses=None, rhs=None): + """Rejects the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate`. If invoked in a different context it + will raise an exception. + + This method marks the current candidate solution as infeasible, + potentially specifying additional constraints that cut it off. + + If constraints, senses, and rhs are all None then the current + candidate solution is just rejected. If any of the three is not + None then all must be not None and all must have compatible + dimensions. In that case the three arguments specify a set of + constraints that cut off the current candidate solution. CPLEX + may use this information to tighten the problem formulation and + to avoid finding the same solution again. There is however no + guarantee that CPLEX will actually use those additional + constraints. + + constraints must be either a list of `SparsePair` instances or a + list of lists of two lists, the first of which specifies + variables, the second of which specifies the values of the + constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + See `CPXcallbackrejectcandidate <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackrejectcandidate.html>`_ in the Callable Library + Reference Manual for more detail. + """ + constraints, senses, rhs = init_list_args(constraints, senses, rhs) + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, constraints] + nconstraints = max_arg_length(arg_list) + validate_arg_lengths( + arg_list, + extra_msg=": constraints, senses, rhs" + ) + with _proc.chbmatrix(constraints, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackrejectcandidate(self._contextptr, nconstraints, nnz, + rhs, senses, rmat)
+ + +
+[docs] + def reject_candidate_local(self, constraints=None, senses=None, rhs=None): + """Rejects the current candidate solution. + + This method can only be invoked if `get_id()` returns + `ContextType.candidate` and if the candidate was invoked for an + integral node. If invoked in a different context it will raise an + exception. + + This method marks the current candidate solution as infeasible, + potentially specifying additional constraints that cut it off. + The specified constraints are not required to be globally valid. + They are only required to be valid in the subtree in which the + callback was invoked. + + If constraints, senses, and rhs are all None then the current + candidate solution is just rejected. If any of the three is not + None then all must be not None and all must have compatible + dimensions. In that case the three arguments specify a set of + constraints that cut off the current candidate solution. CPLEX + may use this information to tighten the problem formulation and + to avoid finding the same solution again. There is however no + guarantee that CPLEX will actually use those additional + constraints. + + constraints must be either a list of `SparsePair` instances or a + list of lists of two lists, the first of which specifies + variables, the second of which specifies the values of the + constraint. + + senses must be list of single-character strings; ("L", "G", "E") + It may also be one single string (the concatenation of the single + character strings). + + rhs is a list of floats, specifying the righthand side of the + constraints. + + See `CPXcallbackrejectcandidatelocal <https://www.ibm.com/docs/en/SSSA5P_22.1.2/ilog.odms.cplex.help/refcallablelibrary/cpxapi/callbackrejectcandidatelocal.html>`_ in the Callable Library + Reference Manual for more detail. + """ + constraints, senses, rhs = init_list_args(constraints, senses, rhs) + if not isinstance(senses, str): + senses = "".join(senses) + arg_list = [rhs, senses, constraints] + nconstraints = max_arg_length(arg_list) + validate_arg_lengths(arg_list) + with _proc.chbmatrix(constraints, self._cpx._env_lp_ptr, + 0) as (rmat, nnz): + _proc.callbackrejectcandidatelocal(self._contextptr, nconstraints, + nnz, rhs, senses, rmat)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/constant_class.html b/docs/_modules/cplex/constant_class.html new file mode 100644 index 0000000..a61f768 --- /dev/null +++ b/docs/_modules/cplex/constant_class.html @@ -0,0 +1,153 @@ + + + + + + + cplex.constant_class — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.constant_class

+# --------------------------------------------------------------------------
+# File: constant_class.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""A base class for classes that contain groups of constants."""
+
+
+
+[docs] +class ConstantClass(): + """A base class for classes that contain groups of constants.""" + +
+[docs] + def __init__(self): + """Creates a new ConstantClass. + + This constructor is not meant to be used externally. + """ + self.__constant_map = None
+ + + def _get_constant_map(self): + return {key: value + for key, value + in self.__class__.__dict__.items() + if not key.startswith("_")} + +
+[docs] + def __getitem__(self, item): + """Converts a constant to a string.""" + if self.__constant_map is None: + self.__constant_map = self._get_constant_map() + for name, value in self.__constant_map.items(): + if item == value: + return name + raise KeyError(item)
+ + +
+[docs] + def __iter__(self): + """Iterate over the constants in this class.""" + if self.__constant_map is None: + self.__constant_map = self._get_constant_map() + for value in self.__constant_map.values(): + yield value
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/exceptions/errors.html b/docs/_modules/cplex/exceptions/errors.html new file mode 100644 index 0000000..6bcdaf0 --- /dev/null +++ b/docs/_modules/cplex/exceptions/errors.html @@ -0,0 +1,154 @@ + + + + + + + cplex.exceptions.errors — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.exceptions.errors

+# ------------------------------------------------------------------------
+# File: errors.py
+# ------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# ------------------------------------------------------------------------
+"""Exceptions raised by the CPLEX Python API."""
+
+
+
+[docs] +class CplexError(Exception): + """Class for exceptions raised by the CPLEX Python API."""
+ + + +
+[docs] +class CplexSolverError(CplexError): + """Class for errors returned by the Callable Library functions. + + self.args[0] : A string describing the error. + + self.args[1] : The address of the environment that raised the error. + + self.args[2] : The integer status code of the error. + """ + + def __str__(self): + return self.args[0] # pylint: disable=unsubscriptable-object
+ + + +
+[docs] +class WrongNumberOfArgumentsError(CplexError, TypeError): + """Class for errors involving the wrong number of arguments. + + This exception is generally raised by methods that can accept a + dynamic number of arguments, but also enforce certain rules (e.g., to + be grouped in pairs, requires at least one argument, etc.). + """
+ + + +
+[docs] +class ErrorChannelMessage(CplexError): + """Class for storing the last message on the error channel. + + For internal use only. + """
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/cplex/paramset.html b/docs/_modules/cplex/paramset.html new file mode 100644 index 0000000..703fc36 --- /dev/null +++ b/docs/_modules/cplex/paramset.html @@ -0,0 +1,449 @@ + + + + + + + cplex.paramset — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ +

Source code for cplex.paramset

+# --------------------------------------------------------------------------
+# File: paramset.py
+# ---------------------------------------------------------------------------
+# Licensed Materials - Property of IBM
+# 5725-A06 5725-A29 5724-Y48 5724-Y49 5724-Y54 5724-Y55 5655-Y21
+# Copyright IBM Corporation 2008, 2024. All Rights Reserved.
+#
+# US Government Users Restricted Rights - Use, duplication or
+# disclosure restricted by GSA ADP Schedule Contract with
+# IBM Corp.
+# --------------------------------------------------------------------------
+"""ParameterSet API"""
+import weakref
+from ._internal import _procedural as _proc
+
+
+def _get_id(param):
+    """Returns a parameter ID.
+
+    If param is a Parameter object, then we get the ID from it.
+    Otherwise, we assume param is an integer.
+    """
+    try:
+        # If this is a Parameter object, then return its _id attr.
+        return param._id
+    except AttributeError:
+        # Otherwise, we assume it's an integer.
+        return param
+
+
+def _get_type(env, param):
+    """Returns a parameter type.
+
+    If param is a Parameter object, then we get the type from it.
+    Otherwise, we assume param is an integer and query the parameter
+    type.
+    """
+    try:
+        return param._type
+    except AttributeError:
+        return _proc.getparamtype(env, param)
+
+
+
+[docs] +class ParameterSet(): + """A parameter set object for use with multi-objective optimization. + + A parameter set consists of key-value pairs where the key is a CPLEX + parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated + parameter value. + + When adding, getting, or deleting items from a parameter set the + param argument can be either a Parameter object (e.g, + Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND + (1001)). + + For more details see the section on multi-objective optimization in + the CPLEX User's Manual. + + See `Cplex.create_parameter_set` and `Cplex.copy_parameter_set`. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, c.parameters.advance.values.none) + >>> len(ps) + 1 + """ + +
+[docs] + def __init__(self, env): + """Constructor of the ParameterSet class. + + This class is not meant to be instantiated directly nor used + externally. + """ + self._disposed = False + self._env = weakref.proxy(env) + self._ps = _proc.paramsetcreate(self._env._e)
+ + + def _throw_if_disposed(self): + if self._disposed: + raise ValueError( + 'illegal method invocation after ParameterSet.end()') + +
+[docs] + def end(self): + """Releases the ParameterSet object. + + Frees all data structures associated with a ParameterSet. After + a call of the method end(), the invoking object can no longer be + used. Attempts to use them subsequently raise a ValueError. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.end() + """ + if self._disposed: + return + self._disposed = True + try: + _proc.paramsetfree(self._env._e, self._ps) + except ReferenceError: + # Ignore error raised if the reference env of our weakref + # has been garbage collected. If the env has already been + # closed, then the paramset has already been freed. + pass + self._ps = None
+ + +
+[docs] + def __del__(self): + """Destructor of the ParameterSet class. + + When a ParameterSet object is destoyed, the end() method is + called. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> del ps + """ + self.end()
+ + +
+[docs] + def __enter__(self): + """Enter the runtime context related to this object. + + The with statement will bind this method's return value to the + target specified in the as clause of the statement, if any. + + ParameterSet objects return themselves. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> with c.create_parameter_set(): + ... pass # do something here + """ + return self
+ + +
+[docs] + def __exit__(self, exc_type, exc_value, traceback): + """Exit the runtime context. + + When we exit the with block, the end() method is called. + """ + self.end()
+ + +
+[docs] + def add(self, param, value): + """Add a parameter ID and value to a parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + """ + self._throw_if_disposed() + whichparam = _get_id(param) + paramtype = _get_type(self._env._e, param) + _proc.paramsetadd(self._env._e, self._ps, whichparam, value, + paramtype)
+ + +
+[docs] + def get(self, param): + """Gets a parameter value. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> val = ps.get(c.parameters.advance) + >>> val == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + whichparam = _get_id(param) + paramtype = _get_type(self._env._e, param) + return _proc.paramsetget(self._env._e, self._ps, whichparam, + paramtype)
+ + +
+[docs] + def get_ids(self): + """Gets the parameter IDs contained in a parameter set. + + Returns an iterator containing the parameter IDs in a parameter + set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> list(ps.get_ids()) + [1001] + """ + self._throw_if_disposed() + return _proc.paramsetgetids(self._env._e, self._ps)
+ + +
+[docs] + def delete(self, param): + """Deletes a parameter from a parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> len(ps) + 1 + >>> ps.delete(c.parameters.advance) + >>> len(ps) + 0 + """ + self._throw_if_disposed() + _proc.paramsetdel(self._env._e, self._ps, _get_id(param))
+ + +
+[docs] + def clear(self): + """Clears all items from the parameter set. + + Example Usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> ps.clear() + >>> len(ps) + 0 + """ + self._throw_if_disposed() + for item in self.get_ids(): + self.delete(item)
+ + +
+[docs] + def __len__(self): + """Return the number of items in the parameter set. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> len(ps) + 0 + """ + self._throw_if_disposed() + return _proc.paramsetgetnum(self._env._e, self._ps)
+ + +
+[docs] + def read(self, filename): + """Reads parameter names and settings from the file specified by + filename and copies them into the parameter set. + + Note that the content of the parameter set is not cleared out + before the parameters in the file are copied into the parameter + set. The parameters are read from the file one by one and are + added to the parameter set, or, if the parameter was already + present in the set, then its value is updated. + + This routine reads and copies files in the PRM format, as created + by Cplex.parameters.write. The PRM format is documented in the + CPLEX File Formats Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> c.parameters.advance.set(c.parameters.advance.values.none) + >>> c.parameters.write_file('example.prm') + >>> ps = c.create_parameter_set() + >>> ps.read('example.prm') + >>> value = ps.get(c.parameters.advance) + >>> value == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + _proc.paramsetreadcopy(self._env._e, self._ps, filename)
+ + +
+[docs] + def write(self, filename): + """Writes a parameter file that contains the parameters in the + parameter set. + + This routine writes a file in a format suitable for reading by + ParameterSet.read or by Cplex.parameters.read. + + The file is written in the PRM format which is documented in the + CPLEX File Formats Reference Manual. + + Example usage: + + >>> import cplex + >>> c = cplex.Cplex() + >>> ps = c.create_parameter_set() + >>> ps.add(c.parameters.advance, + ... c.parameters.advance.values.none) + >>> ps.write('example.prm') + >>> c.parameters.read_file('example.prm') + >>> value = c.parameters.advance.get() + >>> value == c.parameters.advance.values.none + True + """ + self._throw_if_disposed() + _proc.paramsetwrite(self._env._e, self._ps, filename)
+
+ +
+ +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/_modules/index.html b/docs/_modules/index.html new file mode 100644 index 0000000..daa49e9 --- /dev/null +++ b/docs/_modules/index.html @@ -0,0 +1,110 @@ + + + + + + + Overview: module code — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/_static/base-stemmer.js b/docs/_static/base-stemmer.js new file mode 100644 index 0000000..e6fa0c4 --- /dev/null +++ b/docs/_static/base-stemmer.js @@ -0,0 +1,476 @@ +// @ts-check + +/**@constructor*/ +BaseStemmer = function() { + /** @protected */ + this.current = ''; + this.cursor = 0; + this.limit = 0; + this.limit_backward = 0; + this.bra = 0; + this.ket = 0; + + /** + * @param {string} value + */ + this.setCurrent = function(value) { + this.current = value; + this.cursor = 0; + this.limit = this.current.length; + this.limit_backward = 0; + this.bra = this.cursor; + this.ket = this.limit; + }; + + /** + * @return {string} + */ + this.getCurrent = function() { + return this.current; + }; + + /** + * @param {BaseStemmer} other + */ + this.copy_from = function(other) { + /** @protected */ + this.current = other.current; + this.cursor = other.cursor; + this.limit = other.limit; + this.limit_backward = other.limit_backward; + this.bra = other.bra; + this.ket = other.ket; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor++; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) + return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) + return true; + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.in_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return false; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return false; + this.cursor--; + return true; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_in_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) return true; + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) return true; + this.cursor--; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping = function(s, min, max) { + /** @protected */ + if (this.cursor >= this.limit) return false; + var ch = this.current.charCodeAt(this.cursor); + if (ch > max || ch < min) { + this.cursor++; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) == 0) { + this.cursor++; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping = function(s, min, max) { + /** @protected */ + while (this.cursor < this.limit) { + var ch = this.current.charCodeAt(this.cursor); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0X1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor++; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.out_grouping_b = function(s, min, max) { + /** @protected */ + if (this.cursor <= this.limit_backward) return false; + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch > max || ch < min) { + this.cursor--; + return true; + } + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) == 0) { + this.cursor--; + return true; + } + return false; + }; + + /** + * @param {number[]} s + * @param {number} min + * @param {number} max + * @return {boolean} + */ + this.go_out_grouping_b = function(s, min, max) { + /** @protected */ + while (this.cursor > this.limit_backward) { + var ch = this.current.charCodeAt(this.cursor - 1); + if (ch <= max && ch >= min) { + ch -= min; + if ((s[ch >>> 3] & (0x1 << (ch & 0x7))) != 0) { + return true; + } + } + this.cursor--; + } + return false; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s = function(s) + { + /** @protected */ + if (this.limit - this.cursor < s.length) return false; + if (this.current.slice(this.cursor, this.cursor + s.length) != s) + { + return false; + } + this.cursor += s.length; + return true; + }; + + /** + * @param {string} s + * @return {boolean} + */ + this.eq_s_b = function(s) + { + /** @protected */ + if (this.cursor - this.limit_backward < s.length) return false; + if (this.current.slice(this.cursor - s.length, this.cursor) != s) + { + return false; + } + this.cursor -= s.length; + return true; + }; + + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among = function(v) + { + /** @protected */ + var i = 0; + var j = v.length; + + var c = this.cursor; + var l = this.limit; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >>> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; // smaller + // w[0]: string, w[1]: substring_i, w[2]: result, w[3]: function (optional) + var w = v[k]; + var i2; + for (i2 = common; i2 < w[0].length; i2++) + { + if (c + common == l) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c + common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; // v->s has been inspected + if (j == i) break; // only one item in v + + // - but now we need to go round once more to get + // v->s inspected. This looks messy, but is actually + // the optimal approach. + + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c + w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c + w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + // find_among_b is for backwards processing. Same comments apply + /** + * @param {Among[]} v + * @return {number} + */ + this.find_among_b = function(v) + { + /** @protected */ + var i = 0; + var j = v.length + + var c = this.cursor; + var lb = this.limit_backward; + + var common_i = 0; + var common_j = 0; + + var first_key_inspected = false; + + while (true) + { + var k = i + ((j - i) >> 1); + var diff = 0; + var common = common_i < common_j ? common_i : common_j; + var w = v[k]; + var i2; + for (i2 = w[0].length - 1 - common; i2 >= 0; i2--) + { + if (c - common == lb) + { + diff = -1; + break; + } + diff = this.current.charCodeAt(c - 1 - common) - w[0].charCodeAt(i2); + if (diff != 0) break; + common++; + } + if (diff < 0) + { + j = k; + common_j = common; + } + else + { + i = k; + common_i = common; + } + if (j - i <= 1) + { + if (i > 0) break; + if (j == i) break; + if (first_key_inspected) break; + first_key_inspected = true; + } + } + do { + var w = v[i]; + if (common_i >= w[0].length) + { + this.cursor = c - w[0].length; + if (w.length < 4) return w[2]; + var res = w[3](this); + this.cursor = c - w[0].length; + if (res) return w[2]; + } + i = w[1]; + } while (i >= 0); + return 0; + }; + + /* to replace chars between c_bra and c_ket in this.current by the + * chars in s. + */ + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + * @return {number} + */ + this.replace_s = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = s.length - (c_ket - c_bra); + this.current = this.current.slice(0, c_bra) + s + this.current.slice(c_ket); + this.limit += adjustment; + if (this.cursor >= c_ket) this.cursor += adjustment; + else if (this.cursor > c_bra) this.cursor = c_bra; + return adjustment; + }; + + /** + * @return {boolean} + */ + this.slice_check = function() + { + /** @protected */ + if (this.bra < 0 || + this.bra > this.ket || + this.ket > this.limit || + this.limit > this.current.length) + { + return false; + } + return true; + }; + + /** + * @param {number} c_bra + * @return {boolean} + */ + this.slice_from = function(s) + { + /** @protected */ + var result = false; + if (this.slice_check()) + { + this.replace_s(this.bra, this.ket, s); + result = true; + } + return result; + }; + + /** + * @return {boolean} + */ + this.slice_del = function() + { + /** @protected */ + return this.slice_from(""); + }; + + /** + * @param {number} c_bra + * @param {number} c_ket + * @param {string} s + */ + this.insert = function(c_bra, c_ket, s) + { + /** @protected */ + var adjustment = this.replace_s(c_bra, c_ket, s); + if (c_bra <= this.bra) this.bra += adjustment; + if (c_bra <= this.ket) this.ket += adjustment; + }; + + /** + * @return {string} + */ + this.slice_to = function() + { + /** @protected */ + var result = ''; + if (this.slice_check()) + { + result = this.current.slice(this.bra, this.ket); + } + return result; + }; + + /** + * @return {string} + */ + this.assign_to = function() + { + /** @protected */ + return this.current.slice(0, this.limit); + }; +}; diff --git a/docs/_static/basic.css b/docs/_static/basic.css new file mode 100644 index 0000000..4738b2e --- /dev/null +++ b/docs/_static/basic.css @@ -0,0 +1,906 @@ +/* + * Sphinx stylesheet -- basic theme. + */ + +/* -- main layout ----------------------------------------------------------- */ + +div.clearer { + clear: both; +} + +div.section::after { + display: block; + content: ''; + clear: left; +} + +/* -- relbar ---------------------------------------------------------------- */ + +div.related { + width: 100%; + font-size: 90%; +} + +div.related h3 { + display: none; +} + +div.related ul { + margin: 0; + padding: 0 0 0 10px; + list-style: none; +} + +div.related li { + display: inline; +} + +div.related li.right { + float: right; + margin-right: 5px; +} + +/* -- sidebar --------------------------------------------------------------- */ + +div.sphinxsidebarwrapper { + padding: 10px 5px 0 10px; +} + +div.sphinxsidebar { + float: left; + width: 230px; + margin-left: -100%; + font-size: 90%; + word-wrap: break-word; + overflow-wrap : break-word; +} + +div.sphinxsidebar ul { + list-style: none; +} + +div.sphinxsidebar ul ul, +div.sphinxsidebar ul.want-points { + margin-left: 20px; + list-style: square; +} + +div.sphinxsidebar ul ul { + margin-top: 0; + margin-bottom: 0; +} + +div.sphinxsidebar form { + margin-top: 10px; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar #searchbox form.search { + overflow: hidden; +} + +div.sphinxsidebar #searchbox input[type="text"] { + float: left; + width: 80%; + padding: 0.25em; + box-sizing: border-box; +} + +div.sphinxsidebar #searchbox input[type="submit"] { + float: left; + width: 20%; + border-left: none; + padding: 0.25em; + box-sizing: border-box; +} + + +img { + border: 0; + max-width: 100%; +} + +/* -- search page ----------------------------------------------------------- */ + +ul.search { + margin-top: 10px; +} + +ul.search li { + padding: 5px 0; +} + +ul.search li a { + font-weight: bold; +} + +ul.search li p.context { + color: #888; + margin: 2px 0 0 30px; + text-align: left; +} + +ul.keywordmatches li.goodmatch a { + font-weight: bold; +} + +/* -- index page ------------------------------------------------------------ */ + +table.contentstable { + width: 90%; + margin-left: auto; + margin-right: auto; +} + +table.contentstable p.biglink { + line-height: 150%; +} + +a.biglink { + font-size: 1.3em; +} + +span.linkdescr { + font-style: italic; + padding-top: 5px; + font-size: 90%; +} + +/* -- general index --------------------------------------------------------- */ + +table.indextable { + width: 100%; +} + +table.indextable td { + text-align: left; + vertical-align: top; +} + +table.indextable ul { + margin-top: 0; + margin-bottom: 0; + list-style-type: none; +} + +table.indextable > tbody > tr > td > ul { + padding-left: 0em; +} + +table.indextable tr.pcap { + height: 10px; +} + +table.indextable tr.cap { + margin-top: 10px; + background-color: #f2f2f2; +} + +img.toggler { + margin-right: 3px; + margin-top: 3px; + cursor: pointer; +} + +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +/* -- domain module index --------------------------------------------------- */ + +table.modindextable td { + padding: 2px; + border-collapse: collapse; +} + +/* -- general body styles --------------------------------------------------- */ + +div.body { + min-width: 360px; + max-width: 800px; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + -moz-hyphens: auto; + -ms-hyphens: auto; + -webkit-hyphens: auto; + hyphens: auto; +} + +a.headerlink { + visibility: hidden; +} + +a:visited { + color: #551A8B; +} + +h1:hover > a.headerlink, +h2:hover > a.headerlink, +h3:hover > a.headerlink, +h4:hover > a.headerlink, +h5:hover > a.headerlink, +h6:hover > a.headerlink, +dt:hover > a.headerlink, +caption:hover > a.headerlink, +p.caption:hover > a.headerlink, +div.code-block-caption:hover > a.headerlink { + visibility: visible; +} + +div.body p.caption { + text-align: inherit; +} + +div.body td { + text-align: left; +} + +.first { + margin-top: 0 !important; +} + +p.rubric { + margin-top: 30px; + font-weight: bold; +} + +img.align-left, figure.align-left, .figure.align-left, object.align-left { + clear: left; + float: left; + margin-right: 1em; +} + +img.align-right, figure.align-right, .figure.align-right, object.align-right { + clear: right; + float: right; + margin-left: 1em; +} + +img.align-center, figure.align-center, .figure.align-center, object.align-center { + display: block; + margin-left: auto; + margin-right: auto; +} + +img.align-default, figure.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + +.align-left { + text-align: left; +} + +.align-center { + text-align: center; +} + +.align-default { + text-align: center; +} + +.align-right { + text-align: right; +} + +/* -- sidebars -------------------------------------------------------------- */ + +div.sidebar, +aside.sidebar { + margin: 0 0 0.5em 1em; + border: 1px solid #ddb; + padding: 7px; + background-color: #ffe; + width: 40%; + float: right; + clear: right; + overflow-x: auto; +} + +p.sidebar-title { + font-weight: bold; +} + +nav.contents, +aside.topic, +div.admonition, div.topic, blockquote { + clear: left; +} + +/* -- topics ---------------------------------------------------------------- */ + +nav.contents, +aside.topic, +div.topic { + border: 1px solid #ccc; + padding: 7px; + margin: 10px 0 10px 0; +} + +p.topic-title { + font-size: 1.1em; + font-weight: bold; + margin-top: 10px; +} + +/* -- admonitions ----------------------------------------------------------- */ + +div.admonition { + margin-top: 10px; + margin-bottom: 10px; + padding: 7px; +} + +div.admonition dt { + font-weight: bold; +} + +p.admonition-title { + margin: 0px 10px 5px 0px; + font-weight: bold; +} + +div.body p.centered { + text-align: center; + margin-top: 25px; +} + +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +aside.sidebar > :last-child, +nav.contents > :last-child, +aside.topic > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +aside.sidebar::after, +nav.contents::after, +aside.topic::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + +/* -- tables ---------------------------------------------------------------- */ + +table.docutils { + margin-top: 10px; + margin-bottom: 10px; + border: 0; + border-collapse: collapse; +} + +table.align-center { + margin-left: auto; + margin-right: auto; +} + +table.align-default { + margin-left: auto; + margin-right: auto; +} + +table caption span.caption-number { + font-style: italic; +} + +table caption span.caption-text { +} + +table.docutils td, table.docutils th { + padding: 1px 8px 1px 5px; + border-top: 0; + border-left: 0; + border-right: 0; + border-bottom: 1px solid #aaa; +} + +th { + text-align: left; + padding-right: 5px; +} + +table.citation { + border-left: solid 1px gray; + margin-left: 1px; +} + +table.citation td { + border-bottom: none; +} + +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + +/* -- figures --------------------------------------------------------------- */ + +div.figure, figure { + margin: 0.5em; + padding: 0.5em; +} + +div.figure p.caption, figcaption { + padding: 0.3em; +} + +div.figure p.caption span.caption-number, +figcaption span.caption-number { + font-style: italic; +} + +div.figure p.caption span.caption-text, +figcaption span.caption-text { +} + +/* -- field list styles ----------------------------------------------------- */ + +table.field-list td, table.field-list th { + border: 0 !important; +} + +.field-list ul { + margin: 0; + padding-left: 1em; +} + +.field-list p { + margin: 0; +} + +.field-name { + -moz-hyphens: manual; + -ms-hyphens: manual; + -webkit-hyphens: manual; + hyphens: manual; +} + +/* -- hlist styles ---------------------------------------------------------- */ + +table.hlist { + margin: 1em 0; +} + +table.hlist td { + vertical-align: top; +} + +/* -- object description styles --------------------------------------------- */ + +.sig { + font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace; +} + +.sig-name, code.descname { + background-color: transparent; + font-weight: bold; +} + +.sig-name { + font-size: 1.1em; +} + +code.descname { + font-size: 1.2em; +} + +.sig-prename, code.descclassname { + background-color: transparent; +} + +.optional { + font-size: 1.3em; +} + +.sig-paren { + font-size: larger; +} + +.sig-param.n { + font-style: italic; +} + +/* C++ specific styling */ + +.sig-inline.c-texpr, +.sig-inline.cpp-texpr { + font-family: unset; +} + +.sig.c .k, .sig.c .kt, +.sig.cpp .k, .sig.cpp .kt { + color: #0033B3; +} + +.sig.c .m, +.sig.cpp .m { + color: #1750EB; +} + +.sig.c .s, .sig.c .sc, +.sig.cpp .s, .sig.cpp .sc { + color: #067D17; +} + + +/* -- other body styles ----------------------------------------------------- */ + +ol.arabic { + list-style: decimal; +} + +ol.loweralpha { + list-style: lower-alpha; +} + +ol.upperalpha { + list-style: upper-alpha; +} + +ol.lowerroman { + list-style: lower-roman; +} + +ol.upperroman { + list-style: upper-roman; +} + +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +aside.footnote > span, +div.citation > span { + float: left; +} +aside.footnote > span:last-of-type, +div.citation > span:last-of-type { + padding-right: 0.5em; +} +aside.footnote > p { + margin-left: 2em; +} +div.citation > p { + margin-left: 4em; +} +aside.footnote > p:last-of-type, +div.citation > p:last-of-type { + margin-bottom: 0em; +} +aside.footnote > p:last-of-type:after, +div.citation > p:last-of-type:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + +dl { + margin-bottom: 15px; +} + +dd > :first-child { + margin-top: 0px; +} + +dd ul, dd table { + margin-bottom: 10px; +} + +dd { + margin-top: 3px; + margin-bottom: 10px; + margin-left: 30px; +} + +.sig dd { + margin-top: 0px; + margin-bottom: 0px; +} + +.sig dl { + margin-top: 0px; + margin-bottom: 0px; +} + +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + +dt:target, span.highlighted { + background-color: #fbe54e; +} + +rect.highlighted { + fill: #fbe54e; +} + +dl.glossary dt { + font-weight: bold; + font-size: 1.1em; +} + +.versionmodified { + font-style: italic; +} + +.system-message { + background-color: #fda; + padding: 5px; + border: 3px solid red; +} + +.footnote:target { + background-color: #ffa; +} + +.line-block { + display: block; + margin-top: 1em; + margin-bottom: 1em; +} + +.line-block .line-block { + margin-top: 0; + margin-bottom: 0; + margin-left: 1.5em; +} + +.guilabel, .menuselection { + font-family: sans-serif; +} + +.accelerator { + text-decoration: underline; +} + +.classifier { + font-style: oblique; +} + +.classifier:before { + font-style: normal; + margin: 0 0.5em; + content: ":"; + display: inline-block; +} + +abbr, acronym { + border-bottom: dotted 1px; + cursor: help; +} + +/* -- code displays --------------------------------------------------------- */ + +pre { + overflow: auto; + overflow-y: hidden; /* fixes display issues on Chrome browsers */ +} + +pre, div[class*="highlight-"] { + clear: both; +} + +span.pre { + -moz-hyphens: none; + -ms-hyphens: none; + -webkit-hyphens: none; + hyphens: none; + white-space: nowrap; +} + +div[class*="highlight-"] { + margin: 1em 0; +} + +td.linenos pre { + border: 0; + background-color: transparent; + color: #aaa; +} + +table.highlighttable { + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; +} + +table.highlighttable td { + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; +} + +div.code-block-caption { + margin-top: 1em; + padding: 2px 5px; + font-size: small; +} + +div.code-block-caption code { + background-color: transparent; +} + +table.highlighttable td.linenos, +span.linenos, +div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; + -webkit-user-select: text; /* Safari fallback only */ + -webkit-user-select: none; /* Chrome/Safari */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* IE10+ */ +} + +div.code-block-caption span.caption-number { + padding: 0.1em 0.3em; + font-style: italic; +} + +div.code-block-caption span.caption-text { +} + +div.literal-block-wrapper { + margin: 1em 0; +} + +code.xref, a code { + background-color: transparent; + font-weight: bold; +} + +h1 code, h2 code, h3 code, h4 code, h5 code, h6 code { + background-color: transparent; +} + +.viewcode-link { + float: right; +} + +.viewcode-back { + float: right; + font-family: sans-serif; +} + +div.viewcode-block:target { + margin: -1px -10px; + padding: 0 10px; +} + +/* -- math display ---------------------------------------------------------- */ + +img.math { + vertical-align: middle; +} + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} + +span.eqno a.headerlink { + position: absolute; + z-index: 1; +} + +div.math:hover a.headerlink { + visibility: visible; +} + +/* -- printout stylesheet --------------------------------------------------- */ + +@media print { + div.document, + div.documentwrapper, + div.bodywrapper { + margin: 0 !important; + width: 100%; + } + + div.sphinxsidebar, + div.related, + div.footer, + #top-link { + display: none; + } +} \ No newline at end of file diff --git a/docs/_static/classic.css b/docs/_static/classic.css new file mode 100644 index 0000000..4c4bcc7 --- /dev/null +++ b/docs/_static/classic.css @@ -0,0 +1,311 @@ +/* + * Sphinx stylesheet -- classic theme. + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +html { + /* CSS hack for macOS's scrollbar (see #1125) */ + background-color: #FFFFFF; +} + +body { + font-family: sans-serif; + font-size: 100%; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + display: flex; + background-color: #1c4e63; +} + +div.documentwrapper { + float: left; + width: 100%; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { + top: 30px; + bottom: 0; + margin: 0; + position: fixed; + overflow: auto; + height: auto; +} +/* this is nice, but it it leads to hidden headings when jumping + to an anchor */ +/* +div.related { + position: fixed; +} + +div.documentwrapper { + margin-top: 30px; +} +*/ + +div.sphinxsidebar h3 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + font-family: 'Trebuchet MS', sans-serif; + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + + + + + + +/* for collapsible sidebar */ +#sidebarbutton { + height: 100%; + background-color: #3c6e83; + margin-left: 0; + color: #FFFFFF; + border-left: 1px solid #133f52; + font-size: 1.2em; + cursor: pointer; + padding-top: 1px; + float: right; + display: table; /* for vertically centering the */ +} + +#sidebarbutton:hover { + background-color: #133f52; +} + +#sidebarbutton span { + display: table-cell; + vertical-align: middle; +} + +div.sphinxsidebarwrapper { + float: left; + margin-right: 0; +} + + +/* -- hyperlink styles ------------------------------------------------------ */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:visited { + color: #551a8b; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + + + +/* -- body styles ----------------------------------------------------------- */ + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: 'Trebuchet MS', sans-serif; + background-color: #f2f2f2; + font-weight: normal; + color: #20435c; + border-bottom: 1px solid #ccc; + margin: 20px -20px 10px -20px; + padding: 3px 0 3px 10px; +} + +div.body h1 { margin-top: 0; font-size: 200%; } +div.body h2 { font-size: 160%; } +div.body h3 { font-size: 140%; } +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li, div.body blockquote { + text-align: justify; + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.admonition p { + margin-bottom: 5px; +} + +div.admonition pre { + margin-bottom: 5px; +} + +div.admonition ul, div.admonition ol { + margin-bottom: 5px; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +nav.contents, +aside.topic, +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: unset; + color: unset; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +code { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} + +th, dl.field-list > dt { + background-color: #ede; +} + +.warning code { + background: #efc2c2; +} + +.note code { + background: #d6d6d6; +} + +.viewcode-back { + font-family: sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} + +div.code-block-caption { + color: #efefef; + background-color: #1c4e63; +} \ No newline at end of file diff --git a/docs/_static/copyright.png b/docs/_static/copyright.png new file mode 100644 index 0000000..173b6e8 Binary files /dev/null and b/docs/_static/copyright.png differ diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js new file mode 100644 index 0000000..807cdb1 --- /dev/null +++ b/docs/_static/doctools.js @@ -0,0 +1,150 @@ +/* + * Base JavaScript utilities for all Sphinx HTML documentation. + */ +"use strict"; + +const BLACKLISTED_KEY_CONTROL_ELEMENTS = new Set([ + "TEXTAREA", + "INPUT", + "SELECT", + "BUTTON", +]); + +const _ready = (callback) => { + if (document.readyState !== "loading") { + callback(); + } else { + document.addEventListener("DOMContentLoaded", callback); + } +}; + +/** + * Small JavaScript module for the documentation. + */ +const Documentation = { + init: () => { + Documentation.initDomainIndexTable(); + Documentation.initOnKeyListeners(); + }, + + /** + * i18n support + */ + TRANSLATIONS: {}, + PLURAL_EXPR: (n) => (n === 1 ? 0 : 1), + LOCALE: "unknown", + + // gettext and ngettext don't access this so that the functions + // can safely bound to a different name (_ = Documentation.gettext) + gettext: (string) => { + const translated = Documentation.TRANSLATIONS[string]; + switch (typeof translated) { + case "undefined": + return string; // no translation + case "string": + return translated; // translation exists + default: + return translated[0]; // (singular, plural) translation tuple exists + } + }, + + ngettext: (singular, plural, n) => { + const translated = Documentation.TRANSLATIONS[singular]; + if (typeof translated !== "undefined") + return translated[Documentation.PLURAL_EXPR(n)]; + return n === 1 ? singular : plural; + }, + + addTranslations: (catalog) => { + Object.assign(Documentation.TRANSLATIONS, catalog.messages); + Documentation.PLURAL_EXPR = new Function( + "n", + `return (${catalog.plural_expr})`, + ); + Documentation.LOCALE = catalog.locale; + }, + + /** + * helper function to focus on search bar + */ + focusSearchBar: () => { + document.querySelectorAll("input[name=q]")[0]?.focus(); + }, + + /** + * Initialise the domain index toggle buttons + */ + initDomainIndexTable: () => { + const toggler = (el) => { + const idNumber = el.id.substr(7); + const toggledRows = document.querySelectorAll(`tr.cg-${idNumber}`); + if (el.src.substr(-9) === "minus.png") { + el.src = `${el.src.substr(0, el.src.length - 9)}plus.png`; + toggledRows.forEach((el) => (el.style.display = "none")); + } else { + el.src = `${el.src.substr(0, el.src.length - 8)}minus.png`; + toggledRows.forEach((el) => (el.style.display = "")); + } + }; + + const togglerElements = document.querySelectorAll("img.toggler"); + togglerElements.forEach((el) => + el.addEventListener("click", (event) => toggler(event.currentTarget)), + ); + togglerElements.forEach((el) => (el.style.display = "")); + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) togglerElements.forEach(toggler); + }, + + initOnKeyListeners: () => { + // only install a listener if it is really needed + if ( + !DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS + && !DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + ) + return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; + // bail with special keys + if (event.altKey || event.ctrlKey || event.metaKey) return; + + if (!event.shiftKey) { + switch (event.key) { + case "ArrowLeft": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const prevLink = document.querySelector('link[rel="prev"]'); + if (prevLink && prevLink.href) { + window.location.href = prevLink.href; + event.preventDefault(); + } + break; + case "ArrowRight": + if (!DOCUMENTATION_OPTIONS.NAVIGATION_WITH_KEYS) break; + + const nextLink = document.querySelector('link[rel="next"]'); + if (nextLink && nextLink.href) { + window.location.href = nextLink.href; + event.preventDefault(); + } + break; + } + } + + // some keyboard layouts may need Shift to get / + switch (event.key) { + case "/": + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) break; + Documentation.focusSearchBar(); + event.preventDefault(); + } + }); + }, +}; + +// quick alias for translations +const _ = Documentation.gettext; + +_ready(Documentation.init); diff --git a/docs/_static/documentation_options.js b/docs/_static/documentation_options.js new file mode 100644 index 0000000..829fd53 --- /dev/null +++ b/docs/_static/documentation_options.js @@ -0,0 +1,13 @@ +const DOCUMENTATION_OPTIONS = { + VERSION: '22.1.2', + LANGUAGE: 'en', + COLLAPSE_INDEX: false, + BUILDER: 'html', + FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', + HAS_SOURCE: true, + SOURCELINK_SUFFIX: '.txt', + NAVIGATION_WITH_KEYS: false, + SHOW_SEARCH_SUMMARY: true, + ENABLE_SEARCH_SHORTCUTS: true, +}; \ No newline at end of file diff --git a/docs/_static/english-stemmer.js b/docs/_static/english-stemmer.js new file mode 100644 index 0000000..056760e --- /dev/null +++ b/docs/_static/english-stemmer.js @@ -0,0 +1,1066 @@ +// Generated from english.sbl by Snowball 3.0.1 - https://snowballstem.org/ + +/**@constructor*/ +var EnglishStemmer = function() { + var base = new BaseStemmer(); + + /** @const */ var a_0 = [ + ["arsen", -1, -1], + ["commun", -1, -1], + ["emerg", -1, -1], + ["gener", -1, -1], + ["later", -1, -1], + ["organ", -1, -1], + ["past", -1, -1], + ["univers", -1, -1] + ]; + + /** @const */ var a_1 = [ + ["'", -1, 1], + ["'s'", 0, 1], + ["'s", -1, 1] + ]; + + /** @const */ var a_2 = [ + ["ied", -1, 2], + ["s", -1, 3], + ["ies", 1, 2], + ["sses", 1, 1], + ["ss", 1, -1], + ["us", 1, -1] + ]; + + /** @const */ var a_3 = [ + ["succ", -1, 1], + ["proc", -1, 1], + ["exc", -1, 1] + ]; + + /** @const */ var a_4 = [ + ["even", -1, 2], + ["cann", -1, 2], + ["inn", -1, 2], + ["earr", -1, 2], + ["herr", -1, 2], + ["out", -1, 2], + ["y", -1, 1] + ]; + + /** @const */ var a_5 = [ + ["", -1, -1], + ["ed", 0, 2], + ["eed", 1, 1], + ["ing", 0, 3], + ["edly", 0, 2], + ["eedly", 4, 1], + ["ingly", 0, 2] + ]; + + /** @const */ var a_6 = [ + ["", -1, 3], + ["bb", 0, 2], + ["dd", 0, 2], + ["ff", 0, 2], + ["gg", 0, 2], + ["bl", 0, 1], + ["mm", 0, 2], + ["nn", 0, 2], + ["pp", 0, 2], + ["rr", 0, 2], + ["at", 0, 1], + ["tt", 0, 2], + ["iz", 0, 1] + ]; + + /** @const */ var a_7 = [ + ["anci", -1, 3], + ["enci", -1, 2], + ["ogi", -1, 14], + ["li", -1, 16], + ["bli", 3, 12], + ["abli", 4, 4], + ["alli", 3, 8], + ["fulli", 3, 9], + ["lessli", 3, 15], + ["ousli", 3, 10], + ["entli", 3, 5], + ["aliti", -1, 8], + ["biliti", -1, 12], + ["iviti", -1, 11], + ["tional", -1, 1], + ["ational", 14, 7], + ["alism", -1, 8], + ["ation", -1, 7], + ["ization", 17, 6], + ["izer", -1, 6], + ["ator", -1, 7], + ["iveness", -1, 11], + ["fulness", -1, 9], + ["ousness", -1, 10], + ["ogist", -1, 13] + ]; + + /** @const */ var a_8 = [ + ["icate", -1, 4], + ["ative", -1, 6], + ["alize", -1, 3], + ["iciti", -1, 4], + ["ical", -1, 4], + ["tional", -1, 1], + ["ational", 5, 2], + ["ful", -1, 5], + ["ness", -1, 5] + ]; + + /** @const */ var a_9 = [ + ["ic", -1, 1], + ["ance", -1, 1], + ["ence", -1, 1], + ["able", -1, 1], + ["ible", -1, 1], + ["ate", -1, 1], + ["ive", -1, 1], + ["ize", -1, 1], + ["iti", -1, 1], + ["al", -1, 1], + ["ism", -1, 1], + ["ion", -1, 2], + ["er", -1, 1], + ["ous", -1, 1], + ["ant", -1, 1], + ["ent", -1, 1], + ["ment", 15, 1], + ["ement", 16, 1] + ]; + + /** @const */ var a_10 = [ + ["e", -1, 1], + ["l", -1, 2] + ]; + + /** @const */ var a_11 = [ + ["andes", -1, -1], + ["atlas", -1, -1], + ["bias", -1, -1], + ["cosmos", -1, -1], + ["early", -1, 5], + ["gently", -1, 3], + ["howe", -1, -1], + ["idly", -1, 2], + ["news", -1, -1], + ["only", -1, 6], + ["singly", -1, 7], + ["skies", -1, 1], + ["sky", -1, -1], + ["ugly", -1, 4] + ]; + + /** @const */ var /** Array */ g_aeo = [17, 64]; + + /** @const */ var /** Array */ g_v = [17, 65, 16, 1]; + + /** @const */ var /** Array */ g_v_WXY = [1, 17, 65, 208, 1]; + + /** @const */ var /** Array */ g_valid_LI = [55, 141, 2]; + + var /** boolean */ B_Y_found = false; + var /** number */ I_p2 = 0; + var /** number */ I_p1 = 0; + + + /** @return {boolean} */ + function r_prelude() { + B_Y_found = false; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + base.bra = base.cursor; + if (!(base.eq_s("'"))) + { + break lab0; + } + base.ket = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.cursor = v_1; + /** @const */ var /** number */ v_2 = base.cursor; + lab1: { + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab1; + } + base.ket = base.cursor; + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + } + base.cursor = v_2; + /** @const */ var /** number */ v_3 = base.cursor; + lab2: { + while(true) + { + /** @const */ var /** number */ v_4 = base.cursor; + lab3: { + golab4: while(true) + { + /** @const */ var /** number */ v_5 = base.cursor; + lab5: { + if (!(base.in_grouping(g_v, 97, 121))) + { + break lab5; + } + base.bra = base.cursor; + if (!(base.eq_s("y"))) + { + break lab5; + } + base.ket = base.cursor; + base.cursor = v_5; + break golab4; + } + base.cursor = v_5; + if (base.cursor >= base.limit) + { + break lab3; + } + base.cursor++; + } + if (!base.slice_from("Y")) + { + return false; + } + B_Y_found = true; + continue; + } + base.cursor = v_4; + break; + } + } + base.cursor = v_3; + return true; + }; + + /** @return {boolean} */ + function r_mark_regions() { + I_p1 = base.limit; + I_p2 = base.limit; + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + lab1: { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + if (base.find_among(a_0) == 0) + { + break lab2; + } + break lab1; + } + base.cursor = v_2; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + } + I_p1 = base.cursor; + if (!base.go_out_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + if (!base.go_in_grouping(g_v, 97, 121)) + { + break lab0; + } + base.cursor++; + I_p2 = base.cursor; + } + base.cursor = v_1; + return true; + }; + + /** @return {boolean} */ + function r_shortv() { + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.out_grouping_b(g_v_WXY, 89, 121))) + { + break lab1; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + lab2: { + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (!(base.in_grouping_b(g_v, 97, 121))) + { + break lab2; + } + if (base.cursor > base.limit_backward) + { + break lab2; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("past"))) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_R1() { + return I_p1 <= base.cursor; + }; + + /** @return {boolean} */ + function r_R2() { + return I_p2 <= base.cursor; + }; + + /** @return {boolean} */ + function r_Step_1a() { + var /** number */ among_var; + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab0: { + base.ket = base.cursor; + if (base.find_among_b(a_1) == 0) + { + base.cursor = base.limit - v_1; + break lab0; + } + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + base.ket = base.cursor; + among_var = base.find_among_b(a_2); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + if (!base.slice_from("ss")) + { + return false; + } + break; + case 2: + lab1: { + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + { + /** @const */ var /** number */ c1 = base.cursor - 2; + if (c1 < base.limit_backward) + { + break lab2; + } + base.cursor = c1; + } + if (!base.slice_from("i")) + { + return false; + } + break lab1; + } + base.cursor = base.limit - v_2; + if (!base.slice_from("ie")) + { + return false; + } + } + break; + case 3: + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1b() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_5); + base.bra = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + switch (among_var) { + case 1: + /** @const */ var /** number */ v_2 = base.limit - base.cursor; + lab2: { + lab3: { + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + lab4: { + if (base.find_among_b(a_3) == 0) + { + break lab4; + } + if (base.cursor > base.limit_backward) + { + break lab4; + } + break lab3; + } + base.cursor = base.limit - v_3; + if (!r_R1()) + { + break lab2; + } + if (!base.slice_from("ee")) + { + return false; + } + } + } + base.cursor = base.limit - v_2; + break; + case 2: + break lab1; + case 3: + among_var = base.find_among_b(a_4); + if (among_var == 0) + { + break lab1; + } + switch (among_var) { + case 1: + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + break lab1; + } + if (base.cursor > base.limit_backward) + { + break lab1; + } + base.cursor = base.limit - v_4; + base.bra = base.cursor; + if (!base.slice_from("ie")) + { + return false; + } + break; + case 2: + if (base.cursor > base.limit_backward) + { + break lab1; + } + break; + } + break; + } + break lab0; + } + base.cursor = base.limit - v_1; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + if (!base.go_out_grouping_b(g_v, 97, 121)) + { + return false; + } + base.cursor--; + base.cursor = base.limit - v_5; + if (!base.slice_del()) + { + return false; + } + base.ket = base.cursor; + base.bra = base.cursor; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + among_var = base.find_among_b(a_6); + switch (among_var) { + case 1: + if (!base.slice_from("e")) + { + return false; + } + return false; + case 2: + { + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + lab5: { + if (!(base.in_grouping_b(g_aeo, 97, 111))) + { + break lab5; + } + if (base.cursor > base.limit_backward) + { + break lab5; + } + return false; + } + base.cursor = base.limit - v_7; + } + break; + case 3: + if (base.cursor != I_p1) + { + return false; + } + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + if (!r_shortv()) + { + return false; + } + base.cursor = base.limit - v_8; + if (!base.slice_from("e")) + { + return false; + } + return false; + } + base.cursor = base.limit - v_6; + base.ket = base.cursor; + if (base.cursor <= base.limit_backward) + { + return false; + } + base.cursor--; + base.bra = base.cursor; + if (!base.slice_del()) + { + return false; + } + } + return true; + }; + + /** @return {boolean} */ + function r_Step_1c() { + base.ket = base.cursor; + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("y"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("Y"))) + { + return false; + } + } + base.bra = base.cursor; + if (!(base.out_grouping_b(g_v, 97, 121))) + { + return false; + } + lab2: { + if (base.cursor > base.limit_backward) + { + break lab2; + } + return false; + } + if (!base.slice_from("i")) + { + return false; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_2() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_7); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ence")) + { + return false; + } + break; + case 3: + if (!base.slice_from("ance")) + { + return false; + } + break; + case 4: + if (!base.slice_from("able")) + { + return false; + } + break; + case 5: + if (!base.slice_from("ent")) + { + return false; + } + break; + case 6: + if (!base.slice_from("ize")) + { + return false; + } + break; + case 7: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 8: + if (!base.slice_from("al")) + { + return false; + } + break; + case 9: + if (!base.slice_from("ful")) + { + return false; + } + break; + case 10: + if (!base.slice_from("ous")) + { + return false; + } + break; + case 11: + if (!base.slice_from("ive")) + { + return false; + } + break; + case 12: + if (!base.slice_from("ble")) + { + return false; + } + break; + case 13: + if (!base.slice_from("og")) + { + return false; + } + break; + case 14: + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_from("og")) + { + return false; + } + break; + case 15: + if (!base.slice_from("less")) + { + return false; + } + break; + case 16: + if (!(base.in_grouping_b(g_valid_LI, 99, 116))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_3() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_8); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R1()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("tion")) + { + return false; + } + break; + case 2: + if (!base.slice_from("ate")) + { + return false; + } + break; + case 3: + if (!base.slice_from("al")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ic")) + { + return false; + } + break; + case 5: + if (!base.slice_del()) + { + return false; + } + break; + case 6: + if (!r_R2()) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_4() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_9); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + if (!r_R2()) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_del()) + { + return false; + } + break; + case 2: + lab0: { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab1: { + if (!(base.eq_s_b("s"))) + { + break lab1; + } + break lab0; + } + base.cursor = base.limit - v_1; + if (!(base.eq_s_b("t"))) + { + return false; + } + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_Step_5() { + var /** number */ among_var; + base.ket = base.cursor; + among_var = base.find_among_b(a_10); + if (among_var == 0) + { + return false; + } + base.bra = base.cursor; + switch (among_var) { + case 1: + lab0: { + lab1: { + if (!r_R2()) + { + break lab1; + } + break lab0; + } + if (!r_R1()) + { + return false; + } + { + /** @const */ var /** number */ v_1 = base.limit - base.cursor; + lab2: { + if (!r_shortv()) + { + break lab2; + } + return false; + } + base.cursor = base.limit - v_1; + } + } + if (!base.slice_del()) + { + return false; + } + break; + case 2: + if (!r_R2()) + { + return false; + } + if (!(base.eq_s_b("l"))) + { + return false; + } + if (!base.slice_del()) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_exception1() { + var /** number */ among_var; + base.bra = base.cursor; + among_var = base.find_among(a_11); + if (among_var == 0) + { + return false; + } + base.ket = base.cursor; + if (base.cursor < base.limit) + { + return false; + } + switch (among_var) { + case 1: + if (!base.slice_from("sky")) + { + return false; + } + break; + case 2: + if (!base.slice_from("idl")) + { + return false; + } + break; + case 3: + if (!base.slice_from("gentl")) + { + return false; + } + break; + case 4: + if (!base.slice_from("ugli")) + { + return false; + } + break; + case 5: + if (!base.slice_from("earli")) + { + return false; + } + break; + case 6: + if (!base.slice_from("onli")) + { + return false; + } + break; + case 7: + if (!base.slice_from("singl")) + { + return false; + } + break; + } + return true; + }; + + /** @return {boolean} */ + function r_postlude() { + if (!B_Y_found) + { + return false; + } + while(true) + { + /** @const */ var /** number */ v_1 = base.cursor; + lab0: { + golab1: while(true) + { + /** @const */ var /** number */ v_2 = base.cursor; + lab2: { + base.bra = base.cursor; + if (!(base.eq_s("Y"))) + { + break lab2; + } + base.ket = base.cursor; + base.cursor = v_2; + break golab1; + } + base.cursor = v_2; + if (base.cursor >= base.limit) + { + break lab0; + } + base.cursor++; + } + if (!base.slice_from("y")) + { + return false; + } + continue; + } + base.cursor = v_1; + break; + } + return true; + }; + + this.stem = /** @return {boolean} */ function() { + lab0: { + /** @const */ var /** number */ v_1 = base.cursor; + lab1: { + if (!r_exception1()) + { + break lab1; + } + break lab0; + } + base.cursor = v_1; + lab2: { + { + /** @const */ var /** number */ v_2 = base.cursor; + lab3: { + { + /** @const */ var /** number */ c1 = base.cursor + 3; + if (c1 > base.limit) + { + break lab3; + } + base.cursor = c1; + } + break lab2; + } + base.cursor = v_2; + } + break lab0; + } + base.cursor = v_1; + r_prelude(); + r_mark_regions(); + base.limit_backward = base.cursor; base.cursor = base.limit; + /** @const */ var /** number */ v_3 = base.limit - base.cursor; + r_Step_1a(); + base.cursor = base.limit - v_3; + /** @const */ var /** number */ v_4 = base.limit - base.cursor; + r_Step_1b(); + base.cursor = base.limit - v_4; + /** @const */ var /** number */ v_5 = base.limit - base.cursor; + r_Step_1c(); + base.cursor = base.limit - v_5; + /** @const */ var /** number */ v_6 = base.limit - base.cursor; + r_Step_2(); + base.cursor = base.limit - v_6; + /** @const */ var /** number */ v_7 = base.limit - base.cursor; + r_Step_3(); + base.cursor = base.limit - v_7; + /** @const */ var /** number */ v_8 = base.limit - base.cursor; + r_Step_4(); + base.cursor = base.limit - v_8; + /** @const */ var /** number */ v_9 = base.limit - base.cursor; + r_Step_5(); + base.cursor = base.limit - v_9; + base.cursor = base.limit_backward; + /** @const */ var /** number */ v_10 = base.cursor; + r_postlude(); + base.cursor = v_10; + } + return true; + }; + + /**@return{string}*/ + this['stemWord'] = function(/**string*/word) { + base.setCurrent(word); + this.stem(); + return base.getCurrent(); + }; +}; diff --git a/docs/_static/file.png b/docs/_static/file.png new file mode 100644 index 0000000..a858a41 Binary files /dev/null and b/docs/_static/file.png differ diff --git a/docs/_static/graphviz.css b/docs/_static/graphviz.css new file mode 100644 index 0000000..30f3837 --- /dev/null +++ b/docs/_static/graphviz.css @@ -0,0 +1,12 @@ +/* + * Sphinx stylesheet -- graphviz extension. + */ + +img.graphviz { + border: 0; + max-width: 100%; +} + +object.graphviz { + max-width: 100%; +} diff --git a/docs/_static/ibm_python.css b/docs/_static/ibm_python.css new file mode 100644 index 0000000..84a51b7 --- /dev/null +++ b/docs/_static/ibm_python.css @@ -0,0 +1,403 @@ + + +/* Epydoc CSS Stylesheet + * + * This stylesheet can be used to customize the appearance of epydoc's + * HTML output. + * + */ + +/* Default Colors & Styles + * - Set the default foreground & background color with 'body'; and + * link colors with 'a:link' and 'a:visited'. + * - Use bold for decision list terms. + * - The heading styles defined here are used for headings *within* + * docstring descriptions. All headings used by epydoc itself use + * either class='epydoc' or class='toc' (CSS styles for both + * defined below). + */ +body { font-size: 13px; background: #ffffff; color: #000000; font-family: sans-serif } /*font-size nothing*/ +p { font-size: 13px; margin-top: 0.5em; margin-bottom: 0.5em; } +/*a:link { color: #0000ff; } +a:visited { color: #204080; }*/ + +a:active {color: #d7bb7a} /*From CPPREF config*/ +a:hover {color: #d7bb7a} +a:link {color: #005da0} +a:visited {color: #704d90} + +dt { font-weight: bold; } /*bold*/ +li dt { font-weight: normal; } /*bold*/ +h1 { font-size: 16px; font-style: normal; + font-weight: bold; } +h2 { font-size: 16px; font-style: normal; + font-weight: bold; } +h3 { font-size: 16px; font-style: normal; + font-weight: normal; } +code { font-size: 13px } /*100%*/ +/* N.B.: class, not pseudoclass */ +a.link { font-family: monospace; } + + +/* Page Header & Footer + * - The standard page header consists of a navigation bar (with + * pointers to standard pages such as 'home' and 'trees'); a + * breadcrumbs list, which can be used to navigate to containing + * classes or modules; options links, to show/hide private + * variables and to show/hide frames; and a page title (using + *

). The page title may be followed by a link to the + * corresponding source code (using 'span.codelink'). + * - The footer consists of a navigation bar, a timestamp, and a + * pointer to epydoc's homepage. + */ +h1.epydoc { margin: 0; font-size: 16px; font-weight: bold; margin-top: 5px;} +h2.epydoc { font-size: 16px; font-weight: bold; margin-top: 0; /* CC */} +h3.epydoc { font-size: 16px; font-weight: bold; /* +115%*/ + margin-top: 0.2em; } +td h3.epydoc { font-size: 13px; font-weight: bold; + margin-bottom: 0; } +table.navbar { background: #e8f0f8; color: #ffffff; /*background: #a0c0ff; color: #000000;*/ + border: 0px groove #c0d0d0; padding: 5px; margin-bottom: 10px} /*2px no cell padding*/ +table.navbar table { color: #000000} +th.navbar-select { font-size: 13px; + background: #e8f0f8; /*#70b0ff;*/ + color: #000000; } +table.navbar a { font-size: 13px; } +/*table.navbar a:link { color: #0000ff; } +table.navbar a:visited { color: #204080; }*/ +table.navbar a:active {color: #d7bb7a} /*From CPPREF config*/ +table.navbar a:hover {color: #d7bb7a} +table.navbar a:link {color: #005da0} +table.navbar a:visited {color: #704d90} + +span.breadcrumbs { font-size: 13px; font-weight: bold; } +span.options { font-size: 13px; } +span.codelink { font-size: 13px; } +span.pre { font-size: 13px } /*for Help page*/ +span.summary-sig { font-size: 13px;} + +/*Special CSS code to include an imahe for the copyright notice */ +td.footer { font-size: 13px; background-image:url(copyright.png); width: 251px; height: 22px; background-repeat:no-repeat;} + +/* Table Headers + * - Each summary table and details section begins with a 'header' + * row. This row contains a section title (marked by + * 'span.table-header') as well as a show/hide private link + * (marked by 'span.options', defined above). + * - Summary tables that contain user-defined groups mark those + * groups using 'group header' rows. + */ +td.table-header { background: #a9cbe7; color: #000000; /*background #70b0ff;*/ + border: 1px solid #608090; } +td.table-header table { color: #000000; } +/*td.table-header table a:link { color: #0000ff; } +td.table-header table a:visited { color: #204080; }*/ +td.table-header table a:active {color: #d7bb7a} /*From CPPREF config*/ +td.table-header table a:hover {color: #d7bb7a} +td.table-header table a:link {color: #005da0} +td.table-header table a:visited {color: #704d90} +span.table-header { font-size: 13px; font-weight: bold; } /*120%*/ +th.group-header { background: #c0e0f8; color: #000000; + text-align: left; font-style: italic; + font-size: 13px; + border: 1px solid #608090; } + +/* Summary Tables (functions, variables, etc) + * - Each object is described by a single row of the table with + * two cells. The left cell gives the object's type, and is + * marked with 'code.summary-type'. The right cell gives the + * object's name and a summary description. + * - CSS styles for the table's header and group headers are + * defined above, under 'Table Headers' + */ +table.summary { font-size: 13px; + border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin-bottom: 0.5em; } +td.summary { border: 1px solid #608090; font-size: 13px; } +td { font-size: 13px; } +code.summary-type { font-size: 13px; } +/*table.summary a:link { color: #0000ff; } +table.summary a:visited { color: #204080; }*/ +table.summary a:active {color: #d7bb7a} /*From CPPREF config*/ +table.summary a:hover {color: #d7bb7a} +table.summary a:link {color: #005da0} +table.summary a:visited {color: #704d90} + + +/* Details Tables (functions, variables, etc) + * - Each object is described in its own div. + * - A single-row summary table w/ table-header is used as + * a header for each details section (CSS style for table-header + * is defined above, under 'Table Headers'). + */ +table.details { font-size: 13px; + border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin: .2em 0 0 0; } +table.details table { color: #000000; } +/*table.details a:link { color: #0000ff; } +table.details a:visited { color: #204080; }*/ +table.details a:active {color: #d7bb7a} /*From CPPREF config*/ +table.details a:hover {color: #d7bb7a} +table.details a:link {color: #005da0} +table.details a:visited {color: #704d90} + +/* Fields */ +dl.fields { margin-left: 2em; margin-top: 1em; + margin-bottom: 1em; } +dl.fields dd ul { margin-left: 0em; padding-left: 0em; } +dl.fields dd ul li ul { margin-left: 2em; padding-left: 0em; } +div.fields { margin-left: 2em; } +div.fields p { margin-bottom: 0.5em; } + + +/* Index tables (identifier index, term index, etc) + * - link-index is used for indices containing lists of links + * (namely, the identifier index & term index). + * - index-where is used in link indices for the text indicating + * the container/source for each link. + * - metadata-index is used for indices containing metadata + * extracted from fields (namely, the bug index & todo index). + */ +table.link-index { border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + /* CC border: 1px solid #608090; */ + border: 0px solid #608090; + margin-top : 2em; } +td.link-index { border-width: 0px;} +/* CC */ +table.link-index tr { border: 0px } + +/*table.link-index a:link { color: #0000ff; } +table.link-index a:visited { color: #204080; }*/ +table.link-index a:active {color: #d7bb7a} /*From CPPREF config*/ +table.link-index a:hover {color: #d7bb7a} +table.link-index a:link {color: #005da0} +table.link-index a:visited {color: #704d90} + + +span.index-where { font-size: 13px; } +table.metadata-index { border-collapse: collapse; + background: #ffffff; color: #000000; /*background #e8f0f8*/ + border: 1px solid #608090; + margin: .2em 0 0 0; } +td.metadata-index { border-width: 1px; border-style: solid; } +/*table.metadata-index a:link { color: #0000ff; } +table.metadata-index a:visited { color: #204080; }*/ +table.metadata-index a:active {color: #d7bb7a} /*From CPPREF config*/ +table.metadata-index a:hover {color: #d7bb7a} +table.metadata-index a:link {color: #005da0} +table.metadata-index a:visited {color: #704d90} + + +/* Function signatures + * - sig* is used for the signature in the details section. + * - .summary-sig* is used for the signature in the summary + * table, and when listing property accessor functions. + * */ +.sig-name { color: #000000; font-size: 13px;} /*#006080;*/ +.sig-arg { color: #000000; font-size: 13px;} /*#008060;*/ +.sig-default { color: #000000; font-size: 13px;} /*#602000;*/ +.summary-sig { font-family: monospace; font-size: 13px;} /*no font-size*/ +.summary-sig-name { color: #000000; font-weight: bold; font-size: 13px; } /*#006080;*/ +/*table.summary a.summary-sig-name:link + { color: #006080; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #006080; font-weight: bold; }*/ + +table.summary a.summary-sig-name:active + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-sig-name:hover + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-sig-name:link + { color: #005da0; font-weight: bold; } +table.summary a.summary-sig-name:visited + { color: #704d90; font-weight: bold; } + +.summary-sig-arg { color: #006040; } +.summary-sig-default { color: #501800; } + +/* Subclass list + */ +ul.subclass-list { display: inline; } +ul.subclass-list li { display: inline; } + +/* To render variables, classes etc. like functions */ +table.summary .summary-name { font-size: 13px;color: #006080; font-weight: bold; /*not font-size*/ + font-family: monospace; } +/*table.summary + a.summary-name:link { color: #006080; font-weight: bold; + font-family: monospace; } +table.summary + a.summary-name:visited { color: #006080; font-weight: bold; + font-family: monospace; }*/ + +table.summary a.summary-name:active + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-name:hover + { color: #d7bb7a; font-weight: bold; } +table.summary a.summary-name:link + { color: #005da0; font-weight: bold; } +table.summary a.summary-name:visited + { color: #704d90; font-weight: bold; } + + +/* Variable values + * - In the 'variable details' sections, each varaible's value is + * listed in a 'pre.variable' box. The width of this box is + * restricted to 80 chars; if the value's repr is longer than + * this it will be wrapped, using a backslash marked with + * class 'variable-linewrap'. If the value's repr is longer + * than 3 lines, the rest will be ellided; and an ellipsis + * marker ('...' marked with 'variable-ellipsis') will be used. + * - If the value is a string, its quote marks will be marked + * with 'variable-quote'. + * - If the variable is a regexp, it is syntax-highlighted using + * the re* CSS classes. + */ +pre.variable { padding: .5em; margin: 0; + background: #dce4ec; color: #000000; + border: 1px solid #708890; font-size: 13px;} /*no font-size*/ +.variable-linewrap { color: #604000; font-weight: bold; } +.variable-ellipsis { color: #604000; font-weight: bold; } +.variable-quote { color: #604000; font-weight: bold; } +.variable-group { color: #008000; font-weight: bold; } +.variable-op { color: #604000; font-weight: bold; } +.variable-string { color: #006030; } +.variable-unknown { color: #a00000; font-weight: bold; } +.re { color: #000000; } +.re-char { color: #006030; } +.re-op { color: #600000; } +.re-group { color: #003060; } +.re-ref { color: #404040; } + +/* Base tree + * - Used by class pages to display the base class hierarchy. + */ +pre.base-tree { font-size: 13px; margin: 0; } + +/* Frames-based table of contents headers + * - Consists of two frames: one for selecting modules; and + * the other listing the contents of the selected module. + * - h1.toc is used for each frame's heading + * - h2.toc is used for subheadings within each frame. + */ +h1.toc { text-align: center; font-size: 16px; + margin: 0; font-weight: bold; + padding: 0; } +h2.toc { font-size: 16px; font-weight: bold; + margin: 0.5em 0 0 -0.3em; } + +/* Syntax Highlighting for Source Code + * - doctest examples are displayed in a 'pre.py-doctest' block. + * If the example is in a details table entry, then it will use + * the colors specified by the 'table pre.py-doctest' line. + * - Source code listings are displayed in a 'pre.py-src' block. + * Each line is marked with 'span.py-line' (used to draw a line + * down the left margin, separating the code from the line + * numbers). Line numbers are displayed with 'span.py-lineno'. + * The expand/collapse block toggle button is displayed with + * 'a.py-toggle' (Note: the CSS style for 'a.py-toggle' should not + * modify the font size of the text.) + * - If a source code page is opened with an anchor, then the + * corresponding code block will be highlighted. The code + * block's header is highlighted with 'py-highlight-hdr'; and + * the code block's body is highlighted with 'py-highlight'. + * - The remaining py-* classes are used to perform syntax + * highlighting (py-string for string literals, py-name for names, + * etc.) + */ +pre.py-doctest { padding: .5em; margin: 1em; + background: #e8f0f8; color: #000000; + border: 1px solid #708890; font-size: 13px;} /*no font size*/ +table pre.py-doctest { background: #dce4ec; + color: #000000; } +pre.py-src { border: 2px solid #000000; + background: #f0f0f0; color: #000000; } +.py-line { border-left: 2px solid #000000; + margin-left: .2em; padding-left: .4em; } +.py-lineno { font-style: italic; font-size: 13px; + padding-left: .5em; } +a.py-toggle { text-decoration: none; } +div.py-highlight-hdr { border-top: 2px solid #000000; + border-bottom: 2px solid #000000; + background: #d8e8e8; } +div.py-highlight { border-bottom: 2px solid #000000; + background: #d0e0e0; } +.py-prompt { color: #005050; font-weight: bold;} +.py-more { color: #005050; font-weight: bold;} +.py-string { color: #006030; } +.py-comment { color: #003060; } +.py-keyword { color: #600000; } +.py-output { color: #404040; } +.py-name { color: #000050; } +.py-name:link { color: #000050 !important; } +.py-name:visited { color: #000050 !important; } +.py-number { color: #005000; } +.py-defname { color: #000060; font-weight: bold; } +.py-def-name { color: #000060; font-weight: bold; } +.py-base-class { color: #000060; } +.py-param { color: #000060; } +.py-docstring { color: #006030; } +.py-decorator { color: #804020; } +/* Use this if you don't want links to names underlined: */ +/*a.py-name { text-decoration: none; }*/ + +/* Graphs & Diagrams + * - These CSS styles are used for graphs & diagrams generated using + * Graphviz dot. 'img.graph-without-title' is used for bare + * diagrams (to remove the border created by making the image + * clickable). + */ +img.graph-without-title { border: none; } +img.graph-with-title { border: 1px solid #000000; } +span.graph-title { font-weight: bold; } +span.graph-caption { } + +/* General-purpose classes + * - 'p.indent-wrapped-lines' defines a paragraph whose first line + * is not indented, but whose subsequent lines are. + * - The 'nomargin-top' class is used to remove the top margin (e.g. + * from lists). The 'nomargin' class is used to remove both the + * top and bottom margin (but not the left or right margin -- + * for lists, that would cause the bullets to disappear.) + */ +p.indent-wrapped-lines { font-size: 13px;padding: 0 0 0 7em; text-indent: -7em; /*Nothing for font size*/ + margin: 0; } +.nomargin-top { margin-top: 0; } +.nomargin { margin-top: 0; margin-bottom: 0; } + +/* HTML Log */ +div.log-block { padding: 0; margin: .5em 0 .5em 0; + background: #e8f0f8; color: #000000; + border: 1px solid #000000; } +div.log-error { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffb0b0; color: #000000; + border: 1px solid #000000; } +div.log-warning { padding: .1em .3em .1em .3em; margin: 4px; + background: #ffffb0; color: #000000; + border: 1px solid #000000; } +div.log-info { padding: .1em .3em .1em .3em; margin: 4px; + background: #b0ffb0; color: #000000; + border: 1px solid #000000; } +h2.log-hdr { background: #70b0ff; color: #000000; + margin: 0; padding: 0em 0.5em 0em 0.5em; + border-bottom: 1px solid #000000; font-size: 13px; } +p.log { font-weight: bold; margin: .5em 0 .5em 0; } +tr.opt-changed { color: #000000; font-weight: bold; } +tr.opt-default { color: #606060; } +pre.log { margin: 0; padding: 0; padding-left: 1em; } + +/* Accessibility for people with Physical disabilities */ +img.ibm-access { + border: 0px; +} + +div.ibm-access { + font-size:10px; + margin-top:-8px; + +} \ No newline at end of file diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js new file mode 100644 index 0000000..5776786 --- /dev/null +++ b/docs/_static/language_data.js @@ -0,0 +1,13 @@ +/* + * This script contains the language-specific data used by searchtools.js, + * namely the set of stopwords, stemmer, scorer and splitter. + */ + +const stopwords = new Set(["a", "about", "above", "after", "again", "against", "all", "am", "an", "and", "any", "are", "aren't", "as", "at", "be", "because", "been", "before", "being", "below", "between", "both", "but", "by", "can't", "cannot", "could", "couldn't", "did", "didn't", "do", "does", "doesn't", "doing", "don't", "down", "during", "each", "few", "for", "from", "further", "had", "hadn't", "has", "hasn't", "have", "haven't", "having", "he", "he'd", "he'll", "he's", "her", "here", "here's", "hers", "herself", "him", "himself", "his", "how", "how's", "i", "i'd", "i'll", "i'm", "i've", "if", "in", "into", "is", "isn't", "it", "it's", "its", "itself", "let's", "me", "more", "most", "mustn't", "my", "myself", "no", "nor", "not", "of", "off", "on", "once", "only", "or", "other", "ought", "our", "ours", "ourselves", "out", "over", "own", "same", "shan't", "she", "she'd", "she'll", "she's", "should", "shouldn't", "so", "some", "such", "than", "that", "that's", "the", "their", "theirs", "them", "themselves", "then", "there", "there's", "these", "they", "they'd", "they'll", "they're", "they've", "this", "those", "through", "to", "too", "under", "until", "up", "very", "was", "wasn't", "we", "we'd", "we'll", "we're", "we've", "were", "weren't", "what", "what's", "when", "when's", "where", "where's", "which", "while", "who", "who's", "whom", "why", "why's", "with", "won't", "would", "wouldn't", "you", "you'd", "you'll", "you're", "you've", "your", "yours", "yourself", "yourselves"]); +window.stopwords = stopwords; // Export to global scope + + +/* Non-minified versions are copied as separate JavaScript files, if available */ +BaseStemmer=function(){this.current="",this.cursor=0,this.limit=0,this.limit_backward=0,this.bra=0,this.ket=0,this.setCurrent=function(t){this.current=t,this.cursor=0,this.limit=this.current.length,this.limit_backward=0,this.bra=this.cursor,this.ket=this.limit},this.getCurrent=function(){return this.current},this.copy_from=function(t){this.current=t.current,this.cursor=t.cursor,this.limit=t.limit,this.limit_backward=t.limit_backward,this.bra=t.bra,this.ket=t.ket},this.in_grouping=function(t,r,i){return!(this.cursor>=this.limit||i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i))||(this.cursor++,0))},this.go_in_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.in_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward||i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i))||(this.cursor--,0))},this.go_in_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(i>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.out_grouping=function(t,r,i){return!(this.cursor>=this.limit)&&(i<(i=this.current.charCodeAt(this.cursor))||i>>3]&1<<(7&i)))&&(this.cursor++,!0)},this.go_out_grouping=function(t,r,i){for(;this.cursor>>3]&1<<(7&s)))return!0;this.cursor++}return!1},this.out_grouping_b=function(t,r,i){return!(this.cursor<=this.limit_backward)&&(i<(i=this.current.charCodeAt(this.cursor-1))||i>>3]&1<<(7&i)))&&(this.cursor--,!0)},this.go_out_grouping_b=function(t,r,i){for(;this.cursor>this.limit_backward;){var s=this.current.charCodeAt(this.cursor-1);if(s<=i&&r<=s&&0!=(t[(s-=r)>>>3]&1<<(7&s)))return!0;this.cursor--}return!1},this.eq_s=function(t){return!(this.limit-this.cursor>>1),o=0,a=e=(l=t[r])[0].length){if(this.cursor=s+l[0].length,l.length<4)return l[2];var g=l[3](this);if(this.cursor=s+l[0].length,g)return l[2]}}while(0<=(r=l[1]));return 0},this.find_among_b=function(t){for(var r=0,i=t.length,s=this.cursor,h=this.limit_backward,e=0,n=0,c=!1;;){for(var u,o=r+(i-r>>1),a=0,l=e=(u=t[r])[0].length){if(this.cursor=s-u[0].length,u.length<4)return u[2];var g=u[3](this);if(this.cursor=s-u[0].length,g)return u[2]}}while(0<=(r=u[1]));return 0},this.replace_s=function(t,r,i){var s=i.length-(r-t);return this.current=this.current.slice(0,t)+i+this.current.slice(r),this.limit+=s,this.cursor>=r?this.cursor+=s:this.cursor>t&&(this.cursor=t),s},this.slice_check=function(){return!(this.bra<0||this.bra>this.ket||this.ket>this.limit||this.limit>this.current.length)},this.slice_from=function(t){var r=!1;return this.slice_check()&&(this.replace_s(this.bra,this.ket,t),r=!0),r},this.slice_del=function(){return this.slice_from("")},this.insert=function(t,r,i){r=this.replace_s(t,r,i);t<=this.bra&&(this.bra+=r),t<=this.ket&&(this.ket+=r)},this.slice_to=function(){var t="";return t=this.slice_check()?this.current.slice(this.bra,this.ket):t},this.assign_to=function(){return this.current.slice(0,this.limit)}}; +var EnglishStemmer=function(){var a=new BaseStemmer,c=[["arsen",-1,-1],["commun",-1,-1],["emerg",-1,-1],["gener",-1,-1],["later",-1,-1],["organ",-1,-1],["past",-1,-1],["univers",-1,-1]],o=[["'",-1,1],["'s'",0,1],["'s",-1,1]],u=[["ied",-1,2],["s",-1,3],["ies",1,2],["sses",1,1],["ss",1,-1],["us",1,-1]],t=[["succ",-1,1],["proc",-1,1],["exc",-1,1]],l=[["even",-1,2],["cann",-1,2],["inn",-1,2],["earr",-1,2],["herr",-1,2],["out",-1,2],["y",-1,1]],n=[["",-1,-1],["ed",0,2],["eed",1,1],["ing",0,3],["edly",0,2],["eedly",4,1],["ingly",0,2]],f=[["",-1,3],["bb",0,2],["dd",0,2],["ff",0,2],["gg",0,2],["bl",0,1],["mm",0,2],["nn",0,2],["pp",0,2],["rr",0,2],["at",0,1],["tt",0,2],["iz",0,1]],_=[["anci",-1,3],["enci",-1,2],["ogi",-1,14],["li",-1,16],["bli",3,12],["abli",4,4],["alli",3,8],["fulli",3,9],["lessli",3,15],["ousli",3,10],["entli",3,5],["aliti",-1,8],["biliti",-1,12],["iviti",-1,11],["tional",-1,1],["ational",14,7],["alism",-1,8],["ation",-1,7],["ization",17,6],["izer",-1,6],["ator",-1,7],["iveness",-1,11],["fulness",-1,9],["ousness",-1,10],["ogist",-1,13]],m=[["icate",-1,4],["ative",-1,6],["alize",-1,3],["iciti",-1,4],["ical",-1,4],["tional",-1,1],["ational",5,2],["ful",-1,5],["ness",-1,5]],b=[["ic",-1,1],["ance",-1,1],["ence",-1,1],["able",-1,1],["ible",-1,1],["ate",-1,1],["ive",-1,1],["ize",-1,1],["iti",-1,1],["al",-1,1],["ism",-1,1],["ion",-1,2],["er",-1,1],["ous",-1,1],["ant",-1,1],["ent",-1,1],["ment",15,1],["ement",16,1]],k=[["e",-1,1],["l",-1,2]],g=[["andes",-1,-1],["atlas",-1,-1],["bias",-1,-1],["cosmos",-1,-1],["early",-1,5],["gently",-1,3],["howe",-1,-1],["idly",-1,2],["news",-1,-1],["only",-1,6],["singly",-1,7],["skies",-1,1],["sky",-1,-1],["ugly",-1,4]],d=[17,64],v=[17,65,16,1],i=[1,17,65,208,1],w=[55,141,2],p=!1,y=0,h=0;function q(){var r=a.limit-a.cursor;return!!(a.out_grouping_b(i,89,121)&&a.in_grouping_b(v,97,121)&&a.out_grouping_b(v,97,121)||(a.cursor=a.limit-r,a.out_grouping_b(v,97,121)&&a.in_grouping_b(v,97,121)&&!(a.cursor>a.limit_backward))||(a.cursor=a.limit-r,a.eq_s_b("past")))}function z(){return h<=a.cursor}function Y(){return y<=a.cursor}this.stem=function(){var r=a.cursor;if(!(()=>{var r;if(a.bra=a.cursor,0!=(r=a.find_among(g))&&(a.ket=a.cursor,!(a.cursora.limit)a.cursor=i;else{a.cursor=e,a.cursor=r,(()=>{p=!1;var r=a.cursor;if(a.bra=a.cursor,!a.eq_s("'")||(a.ket=a.cursor,a.slice_del())){a.cursor=r;r=a.cursor;if(a.bra=a.cursor,a.eq_s("y")){if(a.ket=a.cursor,!a.slice_from("Y"))return;p=!0}a.cursor=r;for(r=a.cursor;;){var i=a.cursor;r:{for(;;){var e=a.cursor;if(a.in_grouping(v,97,121)&&(a.bra=a.cursor,a.eq_s("y"))){a.ket=a.cursor,a.cursor=e;break}if(a.cursor=e,a.cursor>=a.limit)break r;a.cursor++}if(!a.slice_from("Y"))return;p=!0;continue}a.cursor=i;break}a.cursor=r}})(),h=a.limit,y=a.limit;i=a.cursor;r:{var s=a.cursor;if(0==a.find_among(c)){if(a.cursor=s,!a.go_out_grouping(v,97,121))break r;if(a.cursor++,!a.go_in_grouping(v,97,121))break r;a.cursor++}h=a.cursor,a.go_out_grouping(v,97,121)&&(a.cursor++,a.go_in_grouping(v,97,121))&&(a.cursor++,y=a.cursor)}a.cursor=i,a.limit_backward=a.cursor,a.cursor=a.limit;var e=a.limit-a.cursor,r=((()=>{var r=a.limit-a.cursor;if(a.ket=a.cursor,0==a.find_among_b(o))a.cursor=a.limit-r;else if(a.bra=a.cursor,!a.slice_del())return;if(a.ket=a.cursor,0!=(r=a.find_among_b(u)))switch(a.bra=a.cursor,r){case 1:if(a.slice_from("ss"))break;return;case 2:r:{var i=a.limit-a.cursor,e=a.cursor-2;if(!(e{a.ket=a.cursor,o=a.find_among_b(n),a.bra=a.cursor;r:{var r=a.limit-a.cursor;i:{switch(o){case 1:var i=a.limit-a.cursor;e:{var e=a.limit-a.cursor;if(0==a.find_among_b(t)||a.cursor>a.limit_backward){if(a.cursor=a.limit-e,!z())break e;if(!a.slice_from("ee"))return}}a.cursor=a.limit-i;break;case 2:break i;case 3:if(0==(o=a.find_among_b(l)))break i;switch(o){case 1:var s=a.limit-a.cursor;if(!a.out_grouping_b(v,97,121))break i;if(a.cursor>a.limit_backward)break i;if(a.cursor=a.limit-s,a.bra=a.cursor,a.slice_from("ie"))break;return;case 2:if(a.cursor>a.limit_backward)break i}}break r}a.cursor=a.limit-r;var c=a.limit-a.cursor;if(!a.go_out_grouping_b(v,97,121))return;if(a.cursor--,a.cursor=a.limit-c,!a.slice_del())return;a.ket=a.cursor,a.bra=a.cursor;var o,c=a.limit-a.cursor;switch(o=a.find_among_b(f)){case 1:return a.slice_from("e");case 2:var u=a.limit-a.cursor;if(a.in_grouping_b(d,97,111)&&!(a.cursor>a.limit_backward))return;a.cursor=a.limit-u;break;case 3:return a.cursor!=h||(u=a.limit-a.cursor,q()&&(a.cursor=a.limit-u,a.slice_from("e")))}if(a.cursor=a.limit-c,a.ket=a.cursor,a.cursor<=a.limit_backward)return;if(a.cursor--,a.bra=a.cursor,!a.slice_del())return}})(),a.cursor=a.limit-r,a.limit-a.cursor),r=(a.ket=a.cursor,e=a.limit-a.cursor,(a.eq_s_b("y")||(a.cursor=a.limit-e,a.eq_s_b("Y")))&&(a.bra=a.cursor,a.out_grouping_b(v,97,121))&&a.cursor>a.limit_backward&&a.slice_from("i"),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(_))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ence"))break;return;case 3:if(a.slice_from("ance"))break;return;case 4:if(a.slice_from("able"))break;return;case 5:if(a.slice_from("ent"))break;return;case 6:if(a.slice_from("ize"))break;return;case 7:if(a.slice_from("ate"))break;return;case 8:if(a.slice_from("al"))break;return;case 9:if(a.slice_from("ful"))break;return;case 10:if(a.slice_from("ous"))break;return;case 11:if(a.slice_from("ive"))break;return;case 12:if(a.slice_from("ble"))break;return;case 13:if(a.slice_from("og"))break;return;case 14:if(!a.eq_s_b("l"))return;if(a.slice_from("og"))break;return;case 15:if(a.slice_from("less"))break;return;case 16:if(!a.in_grouping_b(w,99,116))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.limit-a.cursor),i=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(m))&&(a.bra=a.cursor,z()))switch(r){case 1:if(a.slice_from("tion"))break;return;case 2:if(a.slice_from("ate"))break;return;case 3:if(a.slice_from("al"))break;return;case 4:if(a.slice_from("ic"))break;return;case 5:if(a.slice_del())break;return;case 6:if(!Y())return;if(a.slice_del())break}})(),a.cursor=a.limit-e,a.limit-a.cursor),r=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(b))&&(a.bra=a.cursor,Y()))switch(r){case 1:if(a.slice_del())break;return;case 2:var i=a.limit-a.cursor;if(!a.eq_s_b("s")&&(a.cursor=a.limit-i,!a.eq_s_b("t")))return;if(a.slice_del())break}})(),a.cursor=a.limit-i,a.limit-a.cursor),e=((()=>{var r;if(a.ket=a.cursor,0!=(r=a.find_among_b(k)))switch(a.bra=a.cursor,r){case 1:if(!Y()){if(!z())return;var i=a.limit-a.cursor;if(q())return;a.cursor=a.limit-i}if(a.slice_del())break;return;case 2:if(!Y())return;if(!a.eq_s_b("l"))return;if(a.slice_del())break}})(),a.cursor=a.limit-r,a.cursor=a.limit_backward,a.cursor);(()=>{if(p)for(;;){var r=a.cursor;r:{for(;;){var i=a.cursor;if(a.bra=a.cursor,a.eq_s("Y")){a.ket=a.cursor,a.cursor=i;break}if(a.cursor=i,a.cursor>=a.limit)break r;a.cursor++}if(a.slice_from("y"))continue;return}a.cursor=r;break}})(),a.cursor=e}}return!0},this.stemWord=function(r){return a.setCurrent(r),this.stem(),a.getCurrent()}}; +window.Stemmer = EnglishStemmer; diff --git a/docs/_static/minus.png b/docs/_static/minus.png new file mode 100644 index 0000000..d96755f Binary files /dev/null and b/docs/_static/minus.png differ diff --git a/docs/_static/plus.png b/docs/_static/plus.png new file mode 100644 index 0000000..7107cec Binary files /dev/null and b/docs/_static/plus.png differ diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css new file mode 100644 index 0000000..5f2b0a2 --- /dev/null +++ b/docs/_static/pygments.css @@ -0,0 +1,75 @@ +pre { line-height: 125%; } +td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } +td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } +.highlight .hll { background-color: #ffffcc } +.highlight { background: #eeffcc; } +.highlight .c { color: #408090; font-style: italic } /* Comment */ +.highlight .err { border: 1px solid #F00 } /* Error */ +.highlight .k { color: #007020; font-weight: bold } /* Keyword */ +.highlight .o { color: #666 } /* Operator */ +.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */ +.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */ +.highlight .cp { color: #007020 } /* Comment.Preproc */ +.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */ +.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */ +.highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */ +.highlight .gd { color: #A00000 } /* Generic.Deleted */ +.highlight .ge { font-style: italic } /* Generic.Emph */ +.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ +.highlight .gr { color: #F00 } /* Generic.Error */ +.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.highlight .gi { color: #00A000 } /* Generic.Inserted */ +.highlight .go { color: #333 } /* Generic.Output */ +.highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */ +.highlight .gs { font-weight: bold } /* Generic.Strong */ +.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.highlight .gt { color: #04D } /* Generic.Traceback */ +.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.highlight .kp { color: #007020 } /* Keyword.Pseudo */ +.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.highlight .kt { color: #902000 } /* Keyword.Type */ +.highlight .m { color: #208050 } /* Literal.Number */ +.highlight .s { color: #4070A0 } /* Literal.String */ +.highlight .na { color: #4070A0 } /* Name.Attribute */ +.highlight .nb { color: #007020 } /* Name.Builtin */ +.highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */ +.highlight .no { color: #60ADD5 } /* Name.Constant */ +.highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */ +.highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */ +.highlight .ne { color: #007020 } /* Name.Exception */ +.highlight .nf { color: #06287E } /* Name.Function */ +.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */ +.highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */ +.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */ +.highlight .nv { color: #BB60D5 } /* Name.Variable */ +.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */ +.highlight .w { color: #BBB } /* Text.Whitespace */ +.highlight .mb { color: #208050 } /* Literal.Number.Bin */ +.highlight .mf { color: #208050 } /* Literal.Number.Float */ +.highlight .mh { color: #208050 } /* Literal.Number.Hex */ +.highlight .mi { color: #208050 } /* Literal.Number.Integer */ +.highlight .mo { color: #208050 } /* Literal.Number.Oct */ +.highlight .sa { color: #4070A0 } /* Literal.String.Affix */ +.highlight .sb { color: #4070A0 } /* Literal.String.Backtick */ +.highlight .sc { color: #4070A0 } /* Literal.String.Char */ +.highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */ +.highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */ +.highlight .s2 { color: #4070A0 } /* Literal.String.Double */ +.highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */ +.highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */ +.highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */ +.highlight .sx { color: #C65D09 } /* Literal.String.Other */ +.highlight .sr { color: #235388 } /* Literal.String.Regex */ +.highlight .s1 { color: #4070A0 } /* Literal.String.Single */ +.highlight .ss { color: #517918 } /* Literal.String.Symbol */ +.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */ +.highlight .fm { color: #06287E } /* Name.Function.Magic */ +.highlight .vc { color: #BB60D5 } /* Name.Variable.Class */ +.highlight .vg { color: #BB60D5 } /* Name.Variable.Global */ +.highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */ +.highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */ +.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js new file mode 100644 index 0000000..e29b1c7 --- /dev/null +++ b/docs/_static/searchtools.js @@ -0,0 +1,693 @@ +/* + * Sphinx JavaScript utilities for the full-text search. + */ +"use strict"; + +/** + * Simple result scoring code. + */ +if (typeof Scorer === "undefined") { + var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [docname, title, anchor, descr, score, filename] + // and returns the new score. + /* + score: result => { + const [docname, title, anchor, descr, score, filename, kind] = result + return score + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: { + 0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5, // used to be unimportantResults + }, + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + partialTitle: 7, + // query found in terms + term: 5, + partialTerm: 2, + }; +} + +// Global search result kind enum, used by themes to style search results. +// prettier-ignore +class SearchResultKind { + static get index() { return "index"; } + static get object() { return "object"; } + static get text() { return "text"; } + static get title() { return "title"; } +} + +const _removeChildren = (element) => { + while (element && element.lastChild) element.removeChild(element.lastChild); +}; + +/** + * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping + */ +const _escapeRegExp = (string) => + string.replace(/[.*+\-?^${}()|[\]\\]/g, "\\$&"); // $& means the whole matched string + +const _escapeHTML = (text) => { + return text + .replaceAll("&", "&") + .replaceAll("<", "<") + .replaceAll(">", ">") + .replaceAll('"', """) + .replaceAll("'", "'"); +}; + +const _displayItem = (item, searchTerms, highlightTerms) => { + const docBuilder = DOCUMENTATION_OPTIONS.BUILDER; + const docFileSuffix = DOCUMENTATION_OPTIONS.FILE_SUFFIX; + const docLinkSuffix = DOCUMENTATION_OPTIONS.LINK_SUFFIX; + const showSearchSummary = DOCUMENTATION_OPTIONS.SHOW_SEARCH_SUMMARY; + const contentRoot = document.documentElement.dataset.content_root; + + const [docName, title, anchor, descr, score, _filename, kind] = item; + + let listItem = document.createElement("li"); + // Add a class representing the item's type: + // can be used by a theme's CSS selector for styling + // See SearchResultKind for the class names. + listItem.classList.add(`kind-${kind}`); + let requestUrl; + let linkUrl; + if (docBuilder === "dirhtml") { + // dirhtml builder + let dirname = docName + "/"; + if (dirname.match(/\/index\/$/)) + dirname = dirname.substring(0, dirname.length - 6); + else if (dirname === "index/") dirname = ""; + requestUrl = contentRoot + dirname; + linkUrl = requestUrl; + } else { + // normal html builders + requestUrl = contentRoot + docName + docFileSuffix; + linkUrl = docName + docLinkSuffix; + } + let linkEl = listItem.appendChild(document.createElement("a")); + linkEl.href = linkUrl + anchor; + linkEl.dataset.score = score; + linkEl.innerHTML = _escapeHTML(title); + if (descr) { + listItem.appendChild(document.createElement("span")).innerHTML = + ` (${_escapeHTML(descr)})`; + // highlight search terms in the description + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); + } else if (showSearchSummary) + fetch(requestUrl) + .then((responseData) => responseData.text()) + .then((data) => { + if (data) + listItem.appendChild( + Search.makeSearchSummary(data, searchTerms, anchor), + ); + // highlight search terms in the summary + if (SPHINX_HIGHLIGHT_ENABLED) + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + highlightTerms.forEach((term) => + _highlightText(listItem, term, "highlighted"), + ); + }); + Search.output.appendChild(listItem); +}; +const _finishSearch = (resultCount) => { + Search.stopPulse(); + Search.title.innerText = _("Search Results"); + if (!resultCount) + Search.status.innerText = Documentation.gettext( + "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.", + ); + else + Search.status.innerText = Documentation.ngettext( + "Search finished, found one page matching the search query.", + "Search finished, found ${resultCount} pages matching the search query.", + resultCount, + ).replace("${resultCount}", resultCount); +}; +const _displayNextItem = ( + results, + resultCount, + searchTerms, + highlightTerms, +) => { + // results left, load the summary and display it + // this is intended to be dynamic (don't sub resultsCount) + if (results.length) { + _displayItem(results.pop(), searchTerms, highlightTerms); + setTimeout( + () => _displayNextItem(results, resultCount, searchTerms, highlightTerms), + 5, + ); + } + // search finished, update title and status message + else _finishSearch(resultCount); +}; +// Helper function used by query() to order search results. +// Each input is an array of [docname, title, anchor, descr, score, filename, kind]. +// Order the results by score (in opposite order of appearance, since the +// `_displayNextItem` function uses pop() to retrieve items) and then alphabetically. +const _orderResultsByScoreThenName = (a, b) => { + const leftScore = a[4]; + const rightScore = b[4]; + if (leftScore === rightScore) { + // same score: sort alphabetically + const leftTitle = a[1].toLowerCase(); + const rightTitle = b[1].toLowerCase(); + if (leftTitle === rightTitle) return 0; + return leftTitle > rightTitle ? -1 : 1; // inverted is intentional + } + return leftScore > rightScore ? 1 : -1; +}; + +/** + * Default splitQuery function. Can be overridden in ``sphinx.search`` with a + * custom function per language. + * + * The regular expression works by splitting the string on consecutive characters + * that are not Unicode letters, numbers, underscores, or emoji characters. + * This is the same as ``\W+`` in Python, preserving the surrogate pair area. + */ +if (typeof splitQuery === "undefined") { + var splitQuery = (query) => + query + .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}]+/gu) + .filter((term) => term); // remove remaining empty strings +} + +/** + * Search Module + */ +const Search = { + _index: null, + _queued_query: null, + _pulse_status: -1, + + htmlToText: (htmlString, anchor) => { + const htmlElement = new DOMParser().parseFromString( + htmlString, + "text/html", + ); + for (const removalQuery of [".headerlink", "script", "style"]) { + htmlElement.querySelectorAll(removalQuery).forEach((el) => { + el.remove(); + }); + } + if (anchor) { + const anchorContent = htmlElement.querySelector( + `[role="main"] ${anchor}`, + ); + if (anchorContent) return anchorContent.textContent; + + console.warn( + `Anchored content block not found. Sphinx search tries to obtain it via DOM query '[role=main] ${anchor}'. Check your theme or template.`, + ); + } + + // if anchor not specified or not found, fall back to main content + const docContent = htmlElement.querySelector('[role="main"]'); + if (docContent) return docContent.textContent; + + console.warn( + "Content block not found. Sphinx search tries to obtain it via DOM query '[role=main]'. Check your theme or template.", + ); + return ""; + }, + + init: () => { + const query = new URLSearchParams(window.location.search).get("q"); + document + .querySelectorAll('input[name="q"]') + .forEach((el) => (el.value = query)); + if (query) Search.performSearch(query); + }, + + loadIndex: (url) => + (document.body.appendChild(document.createElement("script")).src = url), + + setIndex: (index) => { + Search._index = index; + if (Search._queued_query !== null) { + const query = Search._queued_query; + Search._queued_query = null; + Search.query(query); + } + }, + + hasIndex: () => Search._index !== null, + + deferQuery: (query) => (Search._queued_query = query), + + stopPulse: () => (Search._pulse_status = -1), + + startPulse: () => { + if (Search._pulse_status >= 0) return; + + const pulse = () => { + Search._pulse_status = (Search._pulse_status + 1) % 4; + Search.dots.innerText = ".".repeat(Search._pulse_status); + if (Search._pulse_status >= 0) window.setTimeout(pulse, 500); + }; + pulse(); + }, + + /** + * perform a search for something (or wait until index is loaded) + */ + performSearch: (query) => { + // create the required interface elements + const searchText = document.createElement("h2"); + searchText.textContent = _("Searching"); + const searchSummary = document.createElement("p"); + searchSummary.classList.add("search-summary"); + searchSummary.innerText = ""; + const searchList = document.createElement("ul"); + searchList.setAttribute("role", "list"); + searchList.classList.add("search"); + + const out = document.getElementById("search-results"); + Search.title = out.appendChild(searchText); + Search.dots = Search.title.appendChild(document.createElement("span")); + Search.status = out.appendChild(searchSummary); + Search.output = out.appendChild(searchList); + + const searchProgress = document.getElementById("search-progress"); + // Some themes don't use the search progress node + if (searchProgress) { + searchProgress.innerText = _("Preparing search..."); + } + Search.startPulse(); + + // index already loaded, the browser was quick! + if (Search.hasIndex()) Search.query(query); + else Search.deferQuery(query); + }, + + _parseQuery: (query) => { + // stem the search terms and add them to the correct list + const stemmer = new Stemmer(); + const searchTerms = new Set(); + const excludedTerms = new Set(); + const highlightTerms = new Set(); + const objectTerms = new Set(splitQuery(query.toLowerCase().trim())); + splitQuery(query.trim()).forEach((queryTerm) => { + const queryTermLower = queryTerm.toLowerCase(); + + // maybe skip this "word" + // stopwords set is from language_data.js + if (stopwords.has(queryTermLower) || queryTerm.match(/^\d+$/)) return; + + // stem the word + let word = stemmer.stemWord(queryTermLower); + // select the correct list + if (word[0] === "-") excludedTerms.add(word.substr(1)); + else { + searchTerms.add(word); + highlightTerms.add(queryTermLower); + } + }); + + if (SPHINX_HIGHLIGHT_ENABLED) { + // SPHINX_HIGHLIGHT_ENABLED is set in sphinx_highlight.js + localStorage.setItem( + "sphinx_highlight_terms", + [...highlightTerms].join(" "), + ); + } + + // console.debug("SEARCH: searching for:"); + // console.info("required: ", [...searchTerms]); + // console.info("excluded: ", [...excludedTerms]); + + return [query, searchTerms, excludedTerms, highlightTerms, objectTerms]; + }, + + /** + * execute search (requires search index to be loaded) + */ + _performSearch: ( + query, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + const allTitles = Search._index.alltitles; + const indexEntries = Search._index.indexentries; + + // Collect multiple result groups to be sorted separately and then ordered. + // Each is an array of [docname, title, anchor, descr, score, filename, kind]. + const normalResults = []; + const nonMainIndexResults = []; + + _removeChildren(document.getElementById("search-progress")); + + const queryLower = query.toLowerCase().trim(); + for (const [title, foundTitles] of Object.entries(allTitles)) { + if ( + title.toLowerCase().trim().includes(queryLower) + && queryLower.length >= title.length / 2 + ) { + for (const [file, id] of foundTitles) { + const score = Math.round( + (Scorer.title * queryLower.length) / title.length, + ); + const boost = titles[file] === title ? 1 : 0; // add a boost for document titles + normalResults.push([ + docNames[file], + titles[file] !== title ? `${titles[file]} > ${title}` : title, + id !== null ? "#" + id : "", + null, + score + boost, + filenames[file], + SearchResultKind.title, + ]); + } + } + } + + // search for explicit entries in index directives + for (const [entry, foundEntries] of Object.entries(indexEntries)) { + if (entry.includes(queryLower) && queryLower.length >= entry.length / 2) { + for (const [file, id, isMain] of foundEntries) { + const score = Math.round((100 * queryLower.length) / entry.length); + const result = [ + docNames[file], + titles[file], + id ? "#" + id : "", + null, + score, + filenames[file], + SearchResultKind.index, + ]; + if (isMain) { + normalResults.push(result); + } else { + nonMainIndexResults.push(result); + } + } + } + } + + // lookup as object + objectTerms.forEach((term) => + normalResults.push(...Search.performObjectSearch(term, objectTerms)), + ); + + // lookup as search terms in fulltext + normalResults.push( + ...Search.performTermsSearch(searchTerms, excludedTerms), + ); + + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + normalResults.forEach((item) => (item[4] = Scorer.score(item))); + nonMainIndexResults.forEach((item) => (item[4] = Scorer.score(item))); + } + + // Sort each group of results by score and then alphabetically by name. + normalResults.sort(_orderResultsByScoreThenName); + nonMainIndexResults.sort(_orderResultsByScoreThenName); + + // Combine the result groups in (reverse) order. + // Non-main index entries are typically arbitrary cross-references, + // so display them after other results. + let results = [...nonMainIndexResults, ...normalResults]; + + // remove duplicate search results + // note the reversing of results, so that in the case of duplicates, the highest-scoring entry is kept + let seen = new Set(); + results = results.reverse().reduce((acc, result) => { + let resultStr = result + .slice(0, 4) + .concat([result[5]]) + .map((v) => String(v)) + .join(","); + if (!seen.has(resultStr)) { + acc.push(result); + seen.add(resultStr); + } + return acc; + }, []); + + return results.reverse(); + }, + + query: (query) => { + const [ + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ] = Search._parseQuery(query); + const results = Search._performSearch( + searchQuery, + searchTerms, + excludedTerms, + highlightTerms, + objectTerms, + ); + + // for debugging + //Search.lastresults = results.slice(); // a copy + // console.info("search results:", Search.lastresults); + + // print the results + _displayNextItem(results, results.length, searchTerms, highlightTerms); + }, + + /** + * search for object names + */ + performObjectSearch: (object, objectTerms) => { + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const objects = Search._index.objects; + const objNames = Search._index.objnames; + const titles = Search._index.titles; + + const results = []; + + const objectSearchCallback = (prefix, match) => { + const name = match[4]; + const fullname = (prefix ? prefix + "." : "") + name; + const fullnameLower = fullname.toLowerCase(); + if (fullnameLower.indexOf(object) < 0) return; + + let score = 0; + const parts = fullnameLower.split("."); + + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullnameLower === object || parts.slice(-1)[0] === object) + score += Scorer.objNameMatch; + else if (parts.slice(-1)[0].indexOf(object) > -1) + score += Scorer.objPartialMatch; // matches in last name + + const objName = objNames[match[1]][2]; + const title = titles[match[0]]; + + // If more than one term searched for, we require other words to be + // found in the name/title/description + const otherTerms = new Set(objectTerms); + otherTerms.delete(object); + if (otherTerms.size > 0) { + const haystack = `${prefix} ${name} ${objName} ${title}`.toLowerCase(); + if ( + [...otherTerms].some((otherTerm) => haystack.indexOf(otherTerm) < 0) + ) + return; + } + + let anchor = match[3]; + if (anchor === "") anchor = fullname; + else if (anchor === "-") anchor = objNames[match[1]][1] + "-" + fullname; + + const descr = objName + _(", in ") + title; + + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) + score += Scorer.objPrio[match[2]]; + else score += Scorer.objPrioDefault; + + results.push([ + docNames[match[0]], + fullname, + "#" + anchor, + descr, + score, + filenames[match[0]], + SearchResultKind.object, + ]); + }; + Object.keys(objects).forEach((prefix) => + objects[prefix].forEach((array) => objectSearchCallback(prefix, array)), + ); + return results; + }, + + /** + * search for full-text terms in the index + */ + performTermsSearch: (searchTerms, excludedTerms) => { + // prepare search + const terms = Search._index.terms; + const titleTerms = Search._index.titleterms; + const filenames = Search._index.filenames; + const docNames = Search._index.docnames; + const titles = Search._index.titles; + + const scoreMap = new Map(); + const fileMap = new Map(); + + // perform the search on the required terms + searchTerms.forEach((word) => { + const files = []; + // find documents, if any, containing the query word in their text/title term indices + // use Object.hasOwnProperty to avoid mismatching against prototype properties + const arr = [ + { + files: terms.hasOwnProperty(word) ? terms[word] : undefined, + score: Scorer.term, + }, + { + files: titleTerms.hasOwnProperty(word) ? titleTerms[word] : undefined, + score: Scorer.title, + }, + ]; + // add support for partial matches + if (word.length > 2) { + const escapedWord = _escapeRegExp(word); + if (!terms.hasOwnProperty(word)) { + Object.keys(terms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: terms[term], score: Scorer.partialTerm }); + }); + } + if (!titleTerms.hasOwnProperty(word)) { + Object.keys(titleTerms).forEach((term) => { + if (term.match(escapedWord)) + arr.push({ files: titleTerms[term], score: Scorer.partialTitle }); + }); + } + } + + // no match but word was a required one + if (arr.every((record) => record.files === undefined)) return; + + // found search word in contents + arr.forEach((record) => { + if (record.files === undefined) return; + + let recordFiles = record.files; + if (recordFiles.length === undefined) recordFiles = [recordFiles]; + files.push(...recordFiles); + + // set score for the word in each file + recordFiles.forEach((file) => { + if (!scoreMap.has(file)) scoreMap.set(file, new Map()); + const fileScores = scoreMap.get(file); + fileScores.set(word, record.score); + }); + }); + + // create the mapping + files.forEach((file) => { + if (!fileMap.has(file)) fileMap.set(file, [word]); + else if (fileMap.get(file).indexOf(word) === -1) + fileMap.get(file).push(word); + }); + }); + + // now check if the files don't contain excluded terms + const results = []; + for (const [file, wordList] of fileMap) { + // check if all requirements are matched + + // as search terms with length < 3 are discarded + const filteredTermCount = [...searchTerms].filter( + (term) => term.length > 2, + ).length; + if ( + wordList.length !== searchTerms.size + && wordList.length !== filteredTermCount + ) + continue; + + // ensure that none of the excluded terms is in the search result + if ( + [...excludedTerms].some( + (term) => + terms[term] === file + || titleTerms[term] === file + || (terms[term] || []).includes(file) + || (titleTerms[term] || []).includes(file), + ) + ) + break; + + // select one (max) score for the file. + const score = Math.max(...wordList.map((w) => scoreMap.get(file).get(w))); + // add result to the result list + results.push([ + docNames[file], + titles[file], + "", + null, + score, + filenames[file], + SearchResultKind.text, + ]); + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words. + */ + makeSearchSummary: (htmlText, keywords, anchor) => { + const text = Search.htmlToText(htmlText, anchor); + if (text === "") return null; + + const textLower = text.toLowerCase(); + const actualStartPosition = [...keywords] + .map((k) => textLower.indexOf(k.toLowerCase())) + .filter((i) => i > -1) + .slice(-1)[0]; + const startWithContext = Math.max(actualStartPosition - 120, 0); + + const top = startWithContext === 0 ? "" : "..."; + const tail = startWithContext + 240 < text.length ? "..." : ""; + + let summary = document.createElement("p"); + summary.classList.add("context"); + summary.textContent = + top + text.substr(startWithContext, 240).trim() + tail; + + return summary; + }, +}; + +_ready(Search.init); diff --git a/docs/_static/sidebar.js b/docs/_static/sidebar.js new file mode 100644 index 0000000..ac7b39e --- /dev/null +++ b/docs/_static/sidebar.js @@ -0,0 +1,64 @@ +/* + * This script makes the Sphinx sidebar collapsible. + * + * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds + * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton + * used to collapse and expand the sidebar. + * + * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden + * and the width of the sidebar and the margin-left of the document + * are decreased. When the sidebar is expanded the opposite happens. + * This script saves a per-browser/per-session cookie used to + * remember the position of the sidebar among the pages. + * Once the browser is closed the cookie is deleted and the position + * reset to the default (expanded). + * + */ + +const initialiseSidebar = () => { + + + + + // global elements used by the functions. + const bodyWrapper = document.getElementsByClassName("bodywrapper")[0] + const sidebar = document.getElementsByClassName("sphinxsidebar")[0] + const sidebarWrapper = document.getElementsByClassName('sphinxsidebarwrapper')[0] + const sidebarButton = document.getElementById("sidebarbutton") + const sidebarArrow = sidebarButton.querySelector('span') + + // for some reason, the document has no sidebar; do not run into errors + if (typeof sidebar === "undefined") return; + + const flipArrow = element => element.innerText = (element.innerText === "»") ? "«" : "»" + + const collapse_sidebar = () => { + bodyWrapper.style.marginLeft = ".8em"; + sidebar.style.width = ".8em" + sidebarWrapper.style.display = "none" + flipArrow(sidebarArrow) + sidebarButton.title = _('Expand sidebar') + window.localStorage.setItem("sidebar", "collapsed") + } + + const expand_sidebar = () => { + bodyWrapper.style.marginLeft = "" + sidebar.style.removeProperty("width") + sidebarWrapper.style.display = "" + flipArrow(sidebarArrow) + sidebarButton.title = _('Collapse sidebar') + window.localStorage.setItem("sidebar", "expanded") + } + + sidebarButton.addEventListener("click", () => { + (sidebarWrapper.style.display === "none") ? expand_sidebar() : collapse_sidebar() + }) + + if (!window.localStorage.getItem("sidebar")) return + const value = window.localStorage.getItem("sidebar") + if (value === "collapsed") collapse_sidebar(); + else if (value === "expanded") expand_sidebar(); +} + +if (document.readyState !== "loading") initialiseSidebar() +else document.addEventListener("DOMContentLoaded", initialiseSidebar) \ No newline at end of file diff --git a/docs/_static/sphinx_highlight.js b/docs/_static/sphinx_highlight.js new file mode 100644 index 0000000..a74e103 --- /dev/null +++ b/docs/_static/sphinx_highlight.js @@ -0,0 +1,159 @@ +/* Highlighting utilities for Sphinx HTML documentation. */ +"use strict"; + +const SPHINX_HIGHLIGHT_ENABLED = true; + +/** + * highlight a given string on a node by wrapping it in + * span elements with the given class name. + */ +const _highlight = (node, addItems, text, className) => { + if (node.nodeType === Node.TEXT_NODE) { + const val = node.nodeValue; + const parent = node.parentNode; + const pos = val.toLowerCase().indexOf(text); + if ( + pos >= 0 + && !parent.classList.contains(className) + && !parent.classList.contains("nohighlight") + ) { + let span; + + const closestNode = parent.closest("body, svg, foreignObject"); + const isInSVG = closestNode && closestNode.matches("svg"); + if (isInSVG) { + span = document.createElementNS("http://www.w3.org/2000/svg", "tspan"); + } else { + span = document.createElement("span"); + span.classList.add(className); + } + + span.appendChild(document.createTextNode(val.substr(pos, text.length))); + const rest = document.createTextNode(val.substr(pos + text.length)); + parent.insertBefore(span, parent.insertBefore(rest, node.nextSibling)); + node.nodeValue = val.substr(0, pos); + /* There may be more occurrences of search term in this node. So call this + * function recursively on the remaining fragment. + */ + _highlight(rest, addItems, text, className); + + if (isInSVG) { + const rect = document.createElementNS( + "http://www.w3.org/2000/svg", + "rect", + ); + const bbox = parent.getBBox(); + rect.x.baseVal.value = bbox.x; + rect.y.baseVal.value = bbox.y; + rect.width.baseVal.value = bbox.width; + rect.height.baseVal.value = bbox.height; + rect.setAttribute("class", className); + addItems.push({ parent: parent, target: rect }); + } + } + } else if (node.matches && !node.matches("button, select, textarea")) { + node.childNodes.forEach((el) => _highlight(el, addItems, text, className)); + } +}; +const _highlightText = (thisNode, text, className) => { + let addItems = []; + _highlight(thisNode, addItems, text, className); + addItems.forEach((obj) => + obj.parent.insertAdjacentElement("beforebegin", obj.target), + ); +}; + +/** + * Small JavaScript module for the documentation. + */ +const SphinxHighlight = { + /** + * highlight the search words provided in localstorage in the text + */ + highlightSearchWords: () => { + if (!SPHINX_HIGHLIGHT_ENABLED) return; // bail if no highlight + + // get and clear terms from localstorage + const url = new URL(window.location); + const highlight = + localStorage.getItem("sphinx_highlight_terms") + || url.searchParams.get("highlight") + || ""; + localStorage.removeItem("sphinx_highlight_terms"); + // Update history only if '?highlight' is present; otherwise it + // clears text fragments (not set in window.location by the browser) + if (url.searchParams.has("highlight")) { + url.searchParams.delete("highlight"); + window.history.replaceState({}, "", url); + } + + // get individual terms from highlight string + const terms = highlight + .toLowerCase() + .split(/\s+/) + .filter((x) => x); + if (terms.length === 0) return; // nothing to do + + // There should never be more than one element matching "div.body" + const divBody = document.querySelectorAll("div.body"); + const body = divBody.length ? divBody[0] : document.querySelector("body"); + window.setTimeout(() => { + terms.forEach((term) => _highlightText(body, term, "highlighted")); + }, 10); + + const searchBox = document.getElementById("searchbox"); + if (searchBox === null) return; + searchBox.appendChild( + document + .createRange() + .createContextualFragment( + '", + ), + ); + }, + + /** + * helper function to hide the search marks again + */ + hideSearchWords: () => { + document + .querySelectorAll("#searchbox .highlight-link") + .forEach((el) => el.remove()); + document + .querySelectorAll("span.highlighted") + .forEach((el) => el.classList.remove("highlighted")); + localStorage.removeItem("sphinx_highlight_terms"); + }, + + initEscapeListener: () => { + // only install a listener if it is really needed + if (!DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS) return; + + document.addEventListener("keydown", (event) => { + // bail for input elements + if (BLACKLISTED_KEY_CONTROL_ELEMENTS.has(document.activeElement.tagName)) + return; + // bail with special keys + if (event.shiftKey || event.altKey || event.ctrlKey || event.metaKey) + return; + if ( + DOCUMENTATION_OPTIONS.ENABLE_SEARCH_SHORTCUTS + && event.key === "Escape" + ) { + SphinxHighlight.hideSearchWords(); + event.preventDefault(); + } + }); + }, +}; + +_ready(() => { + /* Do not call highlightSearchWords() when we are on the search page. + * It will highlight words from the *previous* search query. + */ + if (typeof Search === "undefined") SphinxHighlight.highlightSearchWords(); + SphinxHighlight.initEscapeListener(); +}); diff --git a/docs/cplex._internal.html b/docs/cplex._internal.html new file mode 100644 index 0000000..0d3bbc2 --- /dev/null +++ b/docs/cplex._internal.html @@ -0,0 +1,15866 @@ + + + + + + + + cplex._internal package — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex._internal package

+
+
undocumented:
+

Environment, _aux_functions, _list_array_utils, _ostream

+
+
+
+
+class Environment[source]
+

Bases: object

+
Inheritance diagram of cplex._internal.Environment
+ + +

non-public

+
+
+RESULTS_CHNL_IDX = 0
+
+ +
+
+WARNING_CHNL_IDX = 1
+
+ +
+
+ERROR_CHNL_IDX = 2
+
+ +
+
+LOG_CHNL_IDX = 3
+
+ +
+
+__init__()[source]
+

non-public

+
+ +
+
+__del__()[source]
+

non-public

+
+ +
+
+register_callback(callback_class)[source]
+

Registers a callback for use when solving.

+

callback_class must be a proper subclass of one of the +callback classes defined in the module callbacks. It must +override the __call__ method with a method that has signature +__call__(self) -> None. If callback_class is a subclass of +more than one callback class, it will only be called when its +first superclass is called. register_callback returns the +instance of callback_class registered for use. Any previously +registered callback of the same class will no longer be +registered.

+
+ +
+
+unregister_callback(callback_class)[source]
+

Unregisters a callback.

+

callback_class must be one of the callback classes defined in +the module callback or a subclass of one of them. This method +unregisters any previously registered callback of the same +class. If callback_class is a subclass of more than one +callback class, this method unregisters only the callback of the +same type as its first superclass. unregister_callback +returns the instance of callback_class just unregistered.

+
+ +
+
+set_results_stream(results_file, fn=None)[source]
+

Specifies where results will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which results will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_warning_stream(warning_file, fn=None)[source]
+

Specifies where warnings will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which warnings will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_error_stream(error_file, fn=None)[source]
+

Specifies where errors will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which errors will be written. To write +to this stream, use the write() method of this object.

+
+ +
+
+set_log_stream(log_file, fn=None)[source]
+

Specifies where the log will be printed.

+

The first argument must be either a file-like object (that is, an +object with a write method and a flush method) or the name of +a file to be written to (the later is deprecated since V12.9.0). +Use None as the first argument to suppress output.

+

The second optional argument is a function that takes a string +as input and returns a string. If specified, strings sent to +this stream will be processed by this function before being +written.

+

Returns the stream to which the log will be written. To write +to this stream, use this object’s write() method.

+
+ +
+
+get_version()[source]
+

Returns a string specifying the version of CPLEX.

+
+ +
+
+get_versionnumber()[source]
+

Returns an integer specifying the version of CPLEX.

+

The version of CPLEX is in the format vvrrmmff, where vv is +the version, rr is the release, mm is the modification, and ff +is the fixpack number. For example, for CPLEX version 12.5.0.1 +the returned value is 12050001.

+
+ +
+
+get_num_cores()[source]
+

Returns the number of cores on this machine.

+
+ +
+
+get_time()[source]
+

Returns a timestamp in CPU or wallclock seconds from CPLEX.

+
+ +
+
+get_dettime()[source]
+

Returns the current deterministic time in ticks.

+
+ +
+ +
+
+class ProblemType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal.ProblemType
+ + + +

Types of problems the Cplex object can encapsulate.

+

For explanations of the problem types, see those topics in the +CPLEX User’s Manual in the topic titled Continuous Optimization +for LP, QP, and QCP or the topic titled Discrete Optimization +for MILP, FIXEDMILP, NODELP, NODEQP, MIQCP, NODEQCP.

+
+
+LP = 0
+

See CPXPROB_LP in the C API.

+
+ +
+
+MILP = 1
+

See CPXPROB_MILP in the C API.

+
+ +
+
+fixed_MILP = 3
+

See CPXPROB_FIXEDMILP in the C API.

+
+ +
+
+node_LP = 4
+

See CPXPROB_NODELP in the C API.

+
+ +
+
+QP = 5
+

See CPXPROB_QP in the C API.

+
+ +
+
+MIQP = 7
+

See CPXPROB_MIQP in the C API.

+
+ +
+
+fixed_MIQP = 8
+

See CPXPROB_MIQP in the C API.

+
+ +
+
+node_QP = 9
+

See CPXPROB_NODEQP in the C API.

+
+ +
+
+QCP = 10
+

See CPXPROB_QCP in the C API.

+
+ +
+
+MIQCP = 11
+

See CPXPROB_MIQCP in the C API.

+
+ +
+
+node_QCP = 12
+

See CPXPROB_QCP in the C API.

+
+ +
+ +
+

Submodules

+
+

cplex._internal._subinterfaces module

+

Sub-interfaces of the CPLEX API.

+
+
+class Histogram[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._subinterfaces.Histogram
+ + +

A class to retrieve histogram data of the columns or rows of the +linear constraint matrix.

+

See VariablesInterface.get_histogram() and +LinearConstraintInterface.get_histogram().

+
+
+__init__(c, key)[source]
+
+ +
+
+__getitem__(key)[source]
+

Returns the number of columns/rows with a given nonzero count.

+
+ +
+
+__str__()[source]
+

Returns a string containing a histogram in human readable form.

+
+ +
+ +
+
+class AdvancedVariablesInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedVariablesInterface
+ + + +

Methods for advanced operations on variables.

+
+
+__init__(parent)[source]
+

Creates a new AdvancedVariablesInterface.

+

The advanced variables interface is exposed by the top-level +Cplex class as Cplex.variables.advanced. This constructor is +not meant to be used externally.

+
+ +
+
+protect(*args)[source]
+

Prevents variables from being aggregated during presolve.

+

protect may be called with either a single variable identifier +or a sequence of variable identifiers. A variable identifier +is either an index or a name of a variable.

+
+
Note

Subsequent calls to protect will replace previously protected +variables with the new set of protected variables.

+
+
Note

If presolve can fix a variable to a value, it will be removed +from the problem even if it has been protected.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["a", "b", "c", "d"])
+>>> c.variables.advanced.protect("a")
+>>> c.variables.advanced.protect(["b", "d"])
+
+
+
+ +
+
+get_protected()[source]
+

Returns the currently protected variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["a", "b", "c", "d"])
+>>> c.variables.advanced.protect("a")
+>>> c.variables.advanced.get_protected()
+[0]
+>>> c.variables.advanced.protect(["b", "d"])
+>>> c.variables.advanced.get_protected()
+[1, 3]
+
+
+
+ +
+
+tighten_lower_bounds(*args)[source]
+

Tightens the lower bounds on the specified variables.

+

There are two forms by which +variables.advanced.tighten_lower_bounds may be called.

+
+
variables.advanced.tighten_lower_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the lower bound of the variable whose index +or name is i to lb.

+
+
variables.advanced.tighten_lower_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the lower bound of the specified variables to +the corresponding values. Equivalent to +[variables.advanced.tighten_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.advanced.tighten_lower_bounds(0, 1.0)
+>>> c.variables.get_lower_bounds()
+[1.0, 0.0, 0.0]
+>>> c.variables.advanced.tighten_lower_bounds([(2, 3.0), ("x1", -1.0)])
+>>> c.variables.get_lower_bounds()
+[1.0, -1.0, 3.0]
+
+
+
+ +
+
+tighten_upper_bounds(*args)[source]
+

Tightens the upper bounds on the specified variables.

+

There are two forms by which +variables.advanced.tighten_upper_bounds may be called.

+
+
variables.advanced.tighten_upper_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the upper bound of the variable whose index +or name is i to lb.

+
+
variables.advanced.tighten_upper_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the upper bound of the specified variables to +the corresponding values. Equivalent to +[variables.advanced.tighten_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.advanced.tighten_upper_bounds(0, 1.0)
+>>> c.variables.advanced.tighten_upper_bounds([(2, 3.0), ("x1", 10.0)])
+>>> c.variables.get_upper_bounds()
+[1.0, 10.0, 3.0]
+
+
+
+ +
+ +
+
+class VarTypes[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.VarTypes
+ + + +

Constants defining variable types

+

For a definition of each type, see those topics in the CPLEX User’s +Manual.

+
+
+continuous = 'C'
+
+ +
+
+binary = 'B'
+
+ +
+
+integer = 'I'
+
+ +
+
+semi_integer = 'N'
+
+ +
+
+semi_continuous = 'S'
+
+ +
+ +
+
+class VariablesInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.VariablesInterface
+ + + +

Methods for adding, querying, and modifying variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> # default values for lower_bounds are 0.0
+>>> c.variables.get_lower_bounds()
+[0.0, 0.0, 0.0]
+>>> # values can be set either one at a time or many at a time
+>>> c.variables.set_lower_bounds(0, 1.0)
+>>> c.variables.set_lower_bounds([("x1", -1.0), (2, 3.0)])
+>>> # values can be queried as a range
+>>> c.variables.get_lower_bounds(0, "x1")
+[1.0, -1.0]
+>>> # values can be queried as a sequence in arbitrary order
+>>> c.variables.get_lower_bounds(["x1", "x2", 0])
+[-1.0, 3.0, 1.0]
+>>> # can query the number of variables
+>>> c.variables.get_num()
+3
+>>> c.variables.set_types(0, c.variables.type.binary)
+>>> c.variables.get_num_binary()
+1
+
+
+
+
+type = <cplex._internal._subinterfaces.VarTypes object>
+

See VarTypes()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new VariablesInterface.

+

The variables interface is exposed by the top-level Cplex class +as Cplex.variables. This constructor is not meant to be used +externally.

+
+ +
+
+advanced
+

See AdvancedVariablesInterface()

+
+ +
+
+get_num()[source]
+

Returns the number of variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.get_num()
+3
+
+
+
+ +
+
+get_num_integer()[source]
+

Returns the number of integer variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.get_num_integer()
+1
+
+
+
+ +
+
+get_num_binary()[source]
+

Returns the number of binary variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.binary, t.integer])
+>>> c.variables.get_num_binary()
+1
+
+
+
+ +
+
+get_num_semicontinuous()[source]
+

Returns the number of semi-continuous variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer])
+>>> c.variables.get_num_semicontinuous()
+1
+
+
+
+ +
+
+get_num_semiinteger()[source]
+

Returns the number of semi-integer variables in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.semi_continuous, t.semi_integer, t.semi_integer])
+>>> c.variables.get_num_semiinteger()
+2
+
+
+
+ +
+
+add(obj=None, lb=None, ub=None, types='', names=None, columns=None)[source]
+

Adds variables and related data to the problem.

+

variables.add accepts the keyword arguments obj, lb, ub, +types, names, and columns.

+

If more than one argument is specified, all arguments must +have the same length.

+

obj is a list of floats specifying the linear objective +coefficients of the variables.

+

lb is a list of floats specifying the lower bounds on the +variables.

+

ub is a list of floats specifying the upper bounds on the +variables.

+

types must be either a list of single-character strings or a +string containing the types of the variables.

+
+
Note

If types is specified, the problem type will be a MIP, even if +all variables are specified to be continuous.

+
+
+

names is a list of strings.

+

columns may be either a list of sparse vectors or a matrix in +list-of-lists format.

+
+
Note

The entries of columns must not contain duplicate indices. +If an entry of columns references a row more than once, +either by index, name, or a combination of index and name, +an exception will be raised.

+
+
+

Returns an iterator containing the indices of the added +variables.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=["c0", "c1", "c2"])
+>>> indices = c.variables.add(
+...     obj=[1.0, 2.0, 3.0],
+...     types=[c.variables.type.integer] * 3)
+>>> indices = c.variables.add(
+...     obj=[1.0, 2.0, 3.0],
+...     lb=[-1.0, 1.0, 0.0],
+...     ub=[100.0, cplex.infinity, cplex.infinity],
+...     types=[c.variables.type.integer] * 3,
+...     names=["0", "1", "2"],
+...     columns=[cplex.SparsePair(ind=['c0', 2],
+...                               val=[1.0, -1.0]),
+...              [['c2'],[2.0]],
+...              cplex.SparsePair(ind=[0, 1],
+...                               val=[3.0, 4.0])])
+>>> c.variables.get_lower_bounds()
+[0.0, 0.0, 0.0, -1.0, 1.0, 0.0]
+>>> c.variables.get_cols("1")
+SparsePair(ind = [2], val = [2.0])
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes variables from the problem.

+

There are four forms by which variables.delete may be called.

+
+
variables.delete()

deletes all variables from the problem.

+
+
variables.delete(i)

i must be a variable name or index. Deletes the variable +whose index or name is i.

+
+
variables.delete(s)

s must be a sequence of variable names or indices. Deletes +the variables with names or indices contained within s. +Equivalent to [variables.delete(i) for i in s].

+
+
variables.delete(begin, end)

begin and end must be variable indices or variable names. +Deletes the variables with indices between begin and end, +inclusive of end. Equivalent to +variables.delete(range(begin, end + 1)). This will give the +best performance when deleting batches of variables.

+
+
+

See CPXdelcols in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.delete(8)
+>>> c.variables.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.variables.delete("1", 3)
+>>> c.variables.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.variables.delete([2, "0", 5])
+>>> c.variables.get_names()
+['4', '6', '7']
+>>> c.variables.delete()
+>>> c.variables.get_names()
+[]
+
+
+
+ +
+
+set_lower_bounds(*args)[source]
+

Sets the lower bound for a variable or set of variables.

+

There are two forms by which variables.set_lower_bounds may be +called.

+
+
variables.set_lower_bounds(i, lb)

i must be a variable name or index and lb must be a real +number. Sets the lower bound of the variable whose index +or name is i to lb.

+
+
variables.set_lower_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lb) pairs, each +of which consists of a variable name or index and a real +number. Sets the lower bound of the specified variables to +the corresponding values. Equivalent to +[variables.set_lower_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.set_lower_bounds(0, 1.0)
+>>> c.variables.get_lower_bounds()
+[1.0, 0.0, 0.0]
+>>> c.variables.set_lower_bounds([(2, 3.0), ("x1", -1.0)])
+>>> c.variables.get_lower_bounds()
+[1.0, -1.0, 3.0]
+
+
+
+ +
+
+set_upper_bounds(*args)[source]
+

Sets the upper bound for a variable or set of variables.

+

There are two forms by which variables.set_upper_bounds may be +called.

+
+
variables.set_upper_bounds(i, ub)

i must be a variable name or index and ub must be a real +number. Sets the upper bound of the variable whose index +or name is i to ub.

+
+
variables.set_upper_bounds(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, ub) pairs, each +of which consists of a variable name or index and a real +number. Sets the upper bound of the specified variables to +the corresponding values. Equivalent to +[variables.set_upper_bounds(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1", "x2"])
+>>> c.variables.set_upper_bounds(0, 1.0)
+>>> c.variables.set_upper_bounds([("x1", 10.0), (2, 3.0)])
+>>> c.variables.get_upper_bounds()
+[1.0, 10.0, 3.0]
+
+
+
+ +
+
+set_names(*args)[source]
+

Sets the name of a variable or set of variables.

+

There are two forms by which variables.set_names may be +called.

+
+
variables.set_names(i, name)

i must be a variable name or index and name must be a +string.

+
+
variables.set_names(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, name) pairs, +each of which consists of a variable name or index and a +string. Sets the name of the specified variables to the +corresponding strings. Equivalent to +[variables.set_names(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(types = [t.continuous, t.binary, t.integer])
+>>> c.variables.set_names(0, "first")
+>>> c.variables.set_names([(2, "third"), (1, "second")])
+>>> c.variables.get_names()
+['first', 'second', 'third']
+
+
+
+ +
+
+set_types(*args)[source]
+

Sets the type of a variable or set of variables.

+

There are two forms by which variables.set_types may be +called.

+
+
variables.set_types(i, type)

i must be a variable name or index and name must be a +single-character string.

+
+
variables.set_types(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, type) pairs, +each of which consists of a variable name or index and a +single-character string. Sets the type of the specified +variables to the corresponding strings. Equivalent to +[variables.set_types(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
Note

If the types are set, the problem will be treated as a MIP, +even if all variable types are continuous.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(5)])
+>>> c.variables.set_types(0, c.variables.type.continuous)
+>>> c.variables.set_types([("1", c.variables.type.integer),
+                           ("2", c.variables.type.binary),
+                           ("3", c.variables.type.semi_continuous),
+                           ("4", c.variables.type.semi_integer)])
+>>> c.variables.get_types()
+['C', 'I', 'B', 'S', 'N']
+>>> c.variables.type[c.variables.get_types(0)]
+'continuous'
+
+
+
+ +
+
+get_lower_bounds(*args)[source]
+

Returns the lower bounds on variables from the problem.

+

There are four forms by which variables.get_lower_bounds may be called.

+
+
variables.get_lower_bounds()

return the lower bounds on all variables from the problem.

+
+
variables.get_lower_bounds(i)

i must be a variable name or index. Returns the lower +bound on the variable whose index or name is i.

+
+
variables.get_lower_bounds(s)

s must be a sequence of variable names or indices. Returns +the lower bounds on the variables with indices the members +of s. Equivalent to +[variables.get_lower_bounds(i) for i in s]

+
+
variables.get_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns the lower bounds on the variables with indices between +begin and end, inclusive of end. Equivalent to +variables.get_lower_bounds(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(lb = [1.5 * i for i in range(10)],
+                              names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_lower_bounds(8)
+12.0
+>>> c.variables.get_lower_bounds("1",3)
+[1.5, 3.0, 4.5]
+>>> c.variables.get_lower_bounds([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.variables.get_lower_bounds()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_upper_bounds(*args)[source]
+

Returns the upper bounds on variables from the problem.

+

There are four forms by which variables.get_upper_bounds may be called.

+
+
variables.get_upper_bounds()

return the upper bounds on all variables from the problem.

+
+
variables.get_upper_bounds(i)

i must be a variable name or index. Returns the upper +bound on the variable whose index or name is i.

+
+
variables.get_upper_bounds(s)

s must be a sequence of variable names or indices. Returns +the upper bounds on the variables with indices the members +of s. Equivalent to +[variables.get_upper_bounds(i) for i in s]

+
+
variables.get_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns the upper bounds on the variables with indices between +begin and end, inclusive of end. Equivalent to +variables.get_upper_bounds(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(ub = [(1.5 * i) + 1.0 for i in range(10)],
+                              names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_upper_bounds(8)
+13.0
+>>> c.variables.get_upper_bounds("1",3)
+[2.5, 4.0, 5.5]
+>>> c.variables.get_upper_bounds([2,"0",5])
+[4.0, 1.0, 8.5]
+>>> c.variables.get_upper_bounds()
+[1.0, 2.5, 4.0, 5.5, 7.0, 8.5, 10.0, 11.5, 13.0, 14.5]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of variables from the problem.

+

There are four forms by which variables.get_names may be called.

+
+
variables.get_names()

return the names of all variables from the problem.

+
+
variables.get_names(i)

i must be a variable index. Returns the name of variable i.

+
+
variables.get_names(s)

s must be a sequence of variable indices. Returns the +names of the variables with indices the members of s. +Equivalent to [variables.get_names(i) for i in s]

+
+
variables.get_names(begin, end)

begin and end must be variable indices. Returns the names of +the variables with indices between begin and end, inclusive of +end. Equivalent to variables.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x' + str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.variables.get_names(8)
+'x8'
+>>> c.variables.get_names(1,3)
+['x1', 'x2', 'x3']
+>>> c.variables.get_names([2,0,5])
+['x2', 'x0', 'x5']
+>>> c.variables.get_names()
+['x0', 'x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'x8', 'x9']
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the types of variables from the problem.

+

There are four forms by which variables.types may be called.

+
+
variables.types()

return the types of all variables from the problem.

+
+
variables.types(i)

i must be a variable name or index. Returns the type of +the variable whose index or name is i.

+
+
variables.types(s)

s must be a sequence of variable names or indices. Returns +the types of the variables with indices the members of s. +Equivalent to [variables.get_types(i) for i in s]

+
+
variables.types(begin, end)

begin and end must be variable indices or variable names. +Returns the types of the variables with indices between begin +and end, inclusive of end. Equivalent to +variables.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> t = c.variables.type
+>>> indices = c.variables.add(names = [str(i) for i in range(5)],
+                              types = [t.continuous, t.integer,
+                              t.binary, t.semi_continuous, t.semi_integer])
+>>> c.variables.get_num()
+5
+>>> c.variables.get_types(3)
+'S'
+>>> c.variables.get_types(1,3)
+['I', 'B', 'S']
+>>> c.variables.get_types([2,0,4])
+['B', 'C', 'N']
+>>> c.variables.get_types()
+['C', 'I', 'B', 'S', 'N']
+
+
+
+ +
+
+get_cols(*args)[source]
+

Returns a set of columns of the linear constraint matrix.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

There are four forms by which variables.get_cols may be called.

+
+
variables.get_cols()

return the entire linear constraint matrix.

+
+
variables.get_cols(i)

i must be a variable name or index. Returns the column of +the linear constraint matrix associated with variable i.

+
+
variables.get_cols(s)

s must be a sequence of variable names or indices. Returns +the columns of the linear constraint matrix associated with +the variables with indices the members of s. Equivalent to +[variables.get_cols(i) for i in s]

+
+
variables.get_cols(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the linear constraint matrix associated +with the variables with indices between begin and end, +inclusive of end. Equivalent to +variables.get_cols(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=['c1', 'c2'])
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(3)],
+...     columns=[cplex.SparsePair(ind=['c1'], val=[1.0]),
+...     cplex.SparsePair(ind=['c2'], val=[2.0]),
+...     cplex.SparsePair(ind=['c1','c2'], val=[3.0, 4.0])])
+>>> c.variables.get_num()
+3
+>>> c.variables.get_cols(2)
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+>>> for col in c.variables.get_cols(1, 2):
+...     print(col)
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+>>> for col in c.variables.get_cols([2, 0, 1]):
+...     print(col)
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+>>> for col in c.variables.get_cols():
+...     print(col)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [0, 1], val = [3.0, 4.0])
+
+
+
+ +
+
+get_histogram()[source]
+

Returns a histogram of the columns of the linear constraint matrix.

+

To access the number of columns with given nonzero counts, use +slice notation. If a negative nonzero count is queried in +this manner an IndexError will be raised.

+

The __str__ method of the Histogram object returns a string +displaying the number of columns with given nonzeros counts in +human readable form.

+

The data member “orientation” of the histogram object is +“column”, indicating that the histogram shows the nonzero +counts for the columns of the linear constraint matrix.

+
>>> import cplex
+>>> c = cplex.Cplex("ind.lp")
+>>> histogram = c.variables.get_histogram()
+>>> print(histogram)
+Column counts (excluding fixed variables):
+
+    Nonzero Count:   1   2   3
+Number of Columns:   1   6  36
+
+
+>>> histogram[2]
+6
+>>> histogram[0:4]
+[0, 1, 6, 36]
+
+
+
+ +
+ +
+
+class AdvancedLinearConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedLinearConstraintInterface
+ + + +

Methods for handling lazy cuts and user cuts.

+

Lazy cuts are constraints not specified in the constraint +matrix of the MIP problem, but that must be not be violated +in a solution. Using lazy cuts makes sense when there are a +large number of constraints that must be satisfied at a solution, +but are unlikely to be violated if they are left out. When +you add lazy cuts to your model, set the CPLEX parameter +c.parameters.preprocessing.reduce to 0 (zero) or 1 (one) +in order to turn off dual reductions.

+

User cuts are constraints that are implied by the constraint +matrix and integrality requirements. Adding user cuts is helpful +to tighten the MIP formulation. When you add user cuts, set +the CPLEX parameter cplex.parameters.preprocessing.reformulations to +cplex.parameters.preprocessing.reformulations.values.interfere_uncrush or +cplex.parameters.preprocessing.reformulations.values.none to make sure +that CPLEX makes only reductions that do not interfere with crushing +linear forms (cuts in this case).

+
+
+__init__(parent)[source]
+

Creates a new AdvancedLinearConstraintInterface.

+

The advanced linear constraints interface is exposed by the +top-level Cplex class as Cplex.linear_constraints.advanced. +This constructor is not meant to be used externally.

+
+ +
+
+get_num_lazy_constraints()[source]
+

Returns the number of lazy cuts in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["lz1"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+1
+
+
+
+ +
+
+get_num_user_cuts()[source]
+

Returns the number of user cuts in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["usr1"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+1
+
+
+
+ +
+
+add_lazy_constraints(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds lazy constraints to the problem.

+

linear_constraints.advanced.add_lazy_constraints accepts the +keyword arguments lin_expr, senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+

Returns an iterator containing the indices of the added lazy +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["lz1"])
+>>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0])
+>>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr=[cut2, cut3],
+...     senses="EE",
+...     rhs=[0.0, 0.0],
+...     names=["lz2", "lz3"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+3
+
+
+
+ +
+
+add_user_cuts(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds user cuts to the problem.

+

linear_constraints.advanced.add_user_cuts accepts the keyword +arguments lin_expr, senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     names=["usr1"],
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0])
+>>> cut2 = cplex.SparsePair(ind=[0, 2, 4], val=[1.0, 1.0, 1.0])
+>>> cut3 = cplex.SparsePair(ind=[0, 2, 5], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut2, cut3],
+...     senses = "EE",
+...     rhs=[0.0, 0.0],
+...     names=["usr2", "usr3"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+3
+
+
+
+ +
+
+free_lazy_constraints()[source]
+

Removes all lazy constraints from the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_lazy_constraints(
+...     lin_expr = [cut],
+...     senses = "E",
+...     rhs = [0.0],
+...     names = ["lz1"])
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+1
+>>> c.linear_constraints.advanced.free_lazy_constraints()
+>>> c.linear_constraints.advanced.get_num_lazy_constraints()
+0
+
+
+
+ +
+
+free_user_cuts()[source]
+

Removes all user cuts from the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> cut = cplex.SparsePair(ind=[0, 1, 4], val=[1.0, 1.0, 1.0])
+>>> indices = c.linear_constraints.advanced.add_user_cuts(
+...     lin_expr=[cut],
+...     senses="E",
+...     rhs=[0.0],
+...     names=["usr1"])
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+1
+>>> c.linear_constraints.advanced.free_user_cuts()
+>>> c.linear_constraints.advanced.get_num_user_cuts()
+0
+
+
+
+ +
+ +
+
+class LinearConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.LinearConstraintInterface
+ + + +

Methods for adding, modifying, and querying linear constraints.

+
+
+__init__(cplex)[source]
+

Creates a new LinearConstraintInterface.

+

The linear constraints interface is exposed by the top-level +Cplex class as Cplex.linear_constraints. This constructor is +not meant to be used externally.

+
+ +
+
+advanced
+

See AdvancedLinearConstraintInterface()

+
+ +
+
+get_num()[source]
+

Returns the number of linear constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c1", "c2", "c3"])
+>>> c.linear_constraints.get_num()
+3
+
+
+
+ +
+
+add(lin_expr=None, senses='', rhs=None, range_values=None, names=None)[source]
+

Adds linear constraints to the problem.

+

linear_constraints.add accepts the keyword arguments lin_expr, +senses, rhs, range_values, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the senses of the linear constraints. +Each entry must +be one of ‘G’, ‘L’, ‘E’, and ‘R’, indicating +greater-than-or-equal-to (>=), less-than-or-equal-to (<=), +equality (=), and ranged constraints, respectively.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

range_values is a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

names is a list of strings.

+

Returns an iterator containing the indices of the added linear +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+        lin_expr = [cplex.SparsePair(ind = ["x1", "x3"], val = [1.0, -1.0]),
+                    cplex.SparsePair(ind = ["x1", "x2"], val = [1.0, 1.0]),
+                    cplex.SparsePair(ind = ["x1", "x2", "x3"], val = [-1.0] * 3),
+                    cplex.SparsePair(ind = ["x2", "x3"], val = [10.0, -2.0])],
+        senses = ["E", "L", "G", "R"],
+        rhs = [0.0, 1.0, -1.0, 2.0],
+        range_values = [0.0, 0.0, 0.0, -10.0],
+        names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+delete(*args)[source]
+

Removes linear constraints from the problem.

+

There are four forms by which linear_constraints.delete may be +called.

+
+
linear_constraints.delete()

deletes all linear constraints from the problem.

+
+
linear_constraints.delete(i)

i must be a linear constraint name or index. Deletes the +linear constraint whose index or name is i.

+
+
linear_constraints.delete(s)

s must be a sequence of linear constraint names or indices. +Deletes the linear constraints with names or indices contained +within s. Equivalent to [linear_constraints.delete(i) for i in s].

+
+
linear_constraints.delete(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Deletes the linear constraints with indices +between begin and end, inclusive of end. Equivalent to +linear_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of linear +constraints.

+
+
+

See CPXdelrows in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=[str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.delete(8)
+>>> c.linear_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.linear_constraints.delete("1", 3)
+>>> c.linear_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.linear_constraints.delete([2, "0", 5])
+>>> c.linear_constraints.get_names()
+['4', '6', '7']
+>>> c.linear_constraints.delete()
+>>> c.linear_constraints.get_names()
+[]
+
+
+
+ +
+
+set_rhs(*args)[source]
+

Sets the righthand side of a set of linear constraints.

+

There are two forms by which linear_constraints.set_rhs may be +called.

+
+
linear_constraints.set_rhs(i, rhs)

i must be a row name or index and rhs must be a real number. +Sets the righthand side of the row whose index or name is +i to rhs.

+
+
linear_constraints.set_rhs(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, rhs) pairs, each +of which consists of a row name or index and a real +number. Sets the righthand side of the specified rows to +the corresponding values. Equivalent to +[linear_constraints.set_rhs(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_rhs()
+[0.0, 0.0, 0.0, 0.0]
+>>> c.linear_constraints.set_rhs("c1", 1.0)
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, 0.0, 0.0]
+>>> c.linear_constraints.set_rhs([("c3", 2.0), (2, -1.0)])
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+set_names(*args)[source]
+

Sets the name of a linear constraint or set of linear constraints.

+

There are two forms by which linear_constraints.set_names may be +called.

+
+
linear_constraints.set_names(i, name)

i must be a linear constraint name or index and name must be a +string.

+
+
linear_constraints.set_names(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, name) pairs, +each of which consists of a linear constraint name or index and a +string. Sets the name of the specified linear constraints to the +corresponding strings. Equivalent to +[linear_constraints.set_names(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.set_names("c1", "second")
+>>> c.linear_constraints.get_names(1)
+'second'
+>>> c.linear_constraints.set_names([("c3", "last"), (2, "middle")])
+>>> c.linear_constraints.get_names()
+['c0', 'second', 'middle', 'last']
+
+
+
+ +
+
+set_senses(*args)[source]
+

Sets the sense of a linear constraint or set of linear constraints.

+

There are two forms by which linear_constraints.set_senses may be +called.

+
+
linear_constraints.set_senses(i, type)

i must be a row name or index and name must be a +single-character string.

+
+
linear_constraints.set_senses(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, sense) pairs, +each of which consists of a row name or index and a +single-character string. Sets the sense of the specified +rows to the corresponding strings. Equivalent to +[linear_constraints.set_senses(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+

The senses of the constraints must be one of ‘G’, ‘L’, ‘E’, +and ‘R’, indicating greater-than-or-equal-to (>=), +less-than-or-equal-to (<=), equality (=), and ranged constraints, +respectively.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.get_senses()
+['E', 'E', 'E', 'E']
+>>> c.linear_constraints.set_senses("c1", "G")
+>>> c.linear_constraints.get_senses(1)
+'G'
+>>> c.linear_constraints.set_senses([("c3", "L"), (2, "R")])
+>>> c.linear_constraints.get_senses()
+['E', 'G', 'R', 'L']
+
+
+
+ +
+
+set_linear_components(*args)[source]
+

Sets a linear constraint or set of linear constraints.

+

There are two forms by which this method may be called:

+
+
linear_constraints.set_linear_components(i, lin)

i must be a row name or index and lin must be either a +SparsePair or a pair of sequences, the first of which +consists of variable names or indices, the second of which +consists of floats.

+
+
linear_constraints.set_linear_components(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, lin) pairs, +each of which consists of a row name or index and a vector +as described above. Sets the specified rows +to the corresponding vector. Equivalent to +[linear_constraints.set_linear_components(pair[0], pair[1]) +for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names=["c0", "c1", "c2", "c3"])
+>>> indices = c.variables.add(names=["x0", "x1"])
+>>> c.linear_constraints.set_linear_components("c0", [["x0"], [1.0]])
+>>> c.linear_constraints.get_rows("c0")
+SparsePair(ind = [0], val = [1.0])
+>>> c.linear_constraints.set_linear_components([
+...     ("c3", cplex.SparsePair(ind=["x1"], val=[-1.0])),
+...     (2, [[0, 1], [-2.0, 3.0]])])
+>>> c.linear_constraints.get_rows("c3")
+SparsePair(ind = [1], val = [-1.0])
+>>> c.linear_constraints.get_rows(2)
+SparsePair(ind = [0, 1], val = [-2.0, 3.0])
+
+
+
+ +
+
+set_range_values(*args)[source]
+

Sets the range values for a set of linear constraints.

+

That is, this method sets the lefthand side (lhs) for each ranged +constraint of the form lhs <= lin_expr <= rhs.

+

The range values are a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

Note that changing the range values will not change the sense of a +constraint; you must call the method set_senses() of the class +LinearConstraintInterface to change the sense of a ranged row if +the previous range value was 0 (zero) and the constraint sense was not +‘R’. Similarly, changing the range coefficient from a nonzero value to +0 (zero) will not change the constraint sense from ‘R” to “E”; an +additional call of setsenses() is required to accomplish that.

+

There are two forms by which linear_constraints.set_range_values may be +called.

+
+
linear_constraints.set_range_values(i, range)

i must be a row name or index and range must be a real +number. Sets the range value of the row whose index or +name is i to range.

+
+
linear_constraints.set_range_values(seq_of_pairs)

seq_of_pairs must be a list or tuple of (i, range) pairs, each +of which consists of a row name or index and a real +number. Sets the range values for the specified rows to +the corresponding values. Equivalent to +[linear_constraints.set_range_values(pair[0], pair[1]) for pair in seq_of_pairs].

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> c.linear_constraints.set_range_values("c1", 1.0)
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.0, 0.0, 0.0]
+>>> c.linear_constraints.set_range_values([("c3", 2.0), (2, -1.0)])
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.0, -1.0, 2.0]
+
+
+
+ +
+
+set_coefficients(*args)[source]
+

Sets individual coefficients of the linear constraint matrix.

+

There are two forms by which +linear_constraints.set_coefficients may be called.

+
+
linear_constraints.set_coefficients(row, col, val)

row and col must be indices or names of a linear constraint +and variable, respectively. The corresponding coefficient +is set to val.

+
+
linear_constraints.set_coefficients(coefficients)

coefficients must be a list of (row, col, val) triples as +described above.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c0", "c1", "c2", "c3"])
+>>> indices = c.variables.add(names = ["x0", "x1"])
+>>> c.linear_constraints.set_coefficients("c0", "x1", 1.0)
+>>> c.linear_constraints.get_rows(0)
+SparsePair(ind = [1], val = [1.0])
+>>> c.linear_constraints.set_coefficients([("c2", "x0", 2.0),
+                                           ("c2", "x1", -1.0)])
+>>> c.linear_constraints.get_rows("c2")
+SparsePair(ind = [0, 1], val = [2.0, -1.0])
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of constraints from the problem.

+

Can be called by four forms.

+
+
linear_constraints.get_rhs()

return the righthand side of all linear constraints from +the problem.

+
+
linear_constraints.get_rhs(i)

i must be a linear constraint name or index. Returns the +righthand side of the linear constraint whose index or +name is i.

+
+
linear_constraints.get_rhs(s)

s must be a sequence of linear constraint names or indices. +Returns the righthand side of the linear constraints with +indices the members of s. Equivalent to +[linear_constraints.get_rhs(i) for i in s]

+
+
linear_constraints.get_rhs(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the righthand side of the linear +constraints with indices between begin and end, inclusive +of end. Equivalent to +linear_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(rhs = [1.5 * i for i in range(10)],
+                             names = [str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_rhs(8)
+12.0
+>>> c.linear_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.linear_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.linear_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the senses of constraints from the problem.

+

Can be called by four forms.

+
+
linear_constraints.get_senses()

return the senses of all linear constraints from the +problem.

+
+
linear_constraints.get_senses(i)

i must be a linear constraint name or index. Returns the +sense of the linear constraint whose index or name is i.

+
+
linear_constraints.get_senses(s)

s must be a sequence of linear constraint names or indices. +Returns the senses of the linear constraints with indices +the members of s. Equivalent to +[linear_constraints.get_senses(i) for i in s]

+
+
linear_constraints.get_senses(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the senses of the linear constraints +with indices between begin and end, inclusive of end. +Equivalent to +linear_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(
+...     senses=["E", "G", "L", "R"],
+...     names=[str(i) for i in range(4)])
+>>> c.linear_constraints.get_num()
+4
+>>> c.linear_constraints.get_senses(1)
+'G'
+>>> c.linear_constraints.get_senses("1",3)
+['G', 'L', 'R']
+>>> c.linear_constraints.get_senses([2,"0",1])
+['L', 'E', 'G']
+>>> c.linear_constraints.get_senses()
+['E', 'G', 'L', 'R']
+
+
+
+ +
+
+get_range_values(*args)[source]
+

Returns the range values of linear constraints from the problem.

+

That is, this method returns the lefthand side (lhs) for each +ranged constraint of the form lhs <= lin_expr <= rhs. This method +makes sense only for ranged constraints, that is, linear constraints +of sense ‘R’.

+

The range values are a list of floats, specifying the difference +between lefthand side and righthand side of each linear constraint. +If range_values[i] > 0 (zero) then the constraint i is defined as +rhs[i] <= rhs[i] + range_values[i]. If range_values[i] < 0 (zero) +then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

Can be called by four forms.

+
+
linear_constraints.get_range_values()

return the range values of all linear constraints from the +problem.

+
+
linear_constraints.get_range_values(i)

i must be a linear constraint name or index. Returns the +range value of the linear constraint whose index or name is i.

+
+
linear_constraints.get_range_values(s)

s must be a sequence of linear constraint names or indices. +Returns the range values of the linear constraints with +indices the members of s. Equivalent to +[linear_constraints.get_range_values(i) for i in s]

+
+
linear_constraints.get_range_values(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the range values of the linear +constraints with indices between begin and end, inclusive +of end. Equivalent to +linear_constraints.get_range_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(
+        range_values = [1.5 * i for i in range(10)],
+        senses = ["R"] * 10,
+        names = [str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_range_values(8)
+12.0
+>>> c.linear_constraints.get_range_values("1",3)
+[1.5, 3.0, 4.5]
+>>> c.linear_constraints.get_range_values([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.linear_constraints.get_range_values()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_coefficients(*args)[source]
+

Returns coefficients by row, column coordinates.

+

There are two forms by which +linear_constraints.get_coefficients may be called.

+
+
linear_constraints.get_coefficients(row, col)

returns the coefficient.

+
+
linear_constraints.get_coefficients(sequence_of_pairs)

returns a list of coefficients.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0", "x1"])
+>>> indices = c.linear_constraints.add(
+        names = ["c0", "c1"],
+        lin_expr = [[[1], [1.0]], [[0, 1], [2.0, -1.0]]])
+>>> c.linear_constraints.get_coefficients("c0", "x1")
+1.0
+>>> c.linear_constraints.get_coefficients([("c1", "x0"), ("c1", "x1")])
+[2.0, -1.0]
+
+
+
+ +
+
+get_rows(*args)[source]
+

Returns a set of rows of the linear constraint matrix.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

There are four forms by which linear_constraints.get_rows may be +called.

+
+
linear_constraints.get_rows()

return the entire linear constraint matrix.

+
+
linear_constraints.get_rows(i)

i must be a row name or index. Returns the ith row of +the linear constraint matrix.

+
+
linear_constraints.get_rows(s)

s must be a sequence of row names or indices. Returns the +rows of the linear constraint matrix indexed by the members +of s. Equivalent to +[linear_constraints.get_rows(i) for i in s]

+
+
linear_constraints.get_rows(begin, end)

begin and end must be row indices or row names. Returns the +rows of the linear constraint matrix with indices between begin +and end, inclusive of end. Equivalent to +linear_constraints.get_rows(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+...     names=["c0", "c1", "c2", "c3"],
+...     lin_expr=[
+...         cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]),
+...         cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]),
+...         cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3),
+...         cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0])
+...     ]
+... )
+>>> c.linear_constraints.get_rows(0)
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+>>> for row in c.linear_constraints.get_rows(1,3):
+...     print(row)
+SparsePair(ind = [0, 1], val = [1.0, 1.0])
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [1, 2], val = [10.0, -2.0])
+>>> for row in c.linear_constraints.get_rows(["c2", 0]):
+...     print(row)
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+>>> for row in c.linear_constraints.get_rows():
+...     print(row)
+SparsePair(ind = [0, 2], val = [1.0, -1.0])
+SparsePair(ind = [0, 1], val = [1.0, 1.0])
+SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, -1.0])
+SparsePair(ind = [1, 2], val = [10.0, -2.0])
+
+
+
+ +
+
+get_num_nonzeros()[source]
+

Returns the number of nonzeros in the linear constraint +matrix.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.linear_constraints.add(
+...     names=["c0", "c1", "c2", "c3"],
+...     lin_expr=[
+...         cplex.SparsePair(ind=["x1", "x3"], val=[1.0, -1.0]),
+...         cplex.SparsePair(ind=["x1", "x2"], val=[1.0, 1.0]),
+...         cplex.SparsePair(ind=["x1", "x2", "x3"], val=[-1.0] * 3),
+...         cplex.SparsePair(ind=["x2", "x3"], val=[10.0, -2.0])
+...     ]
+... )
+>>> c.linear_constraints.get_num_nonzeros()
+9
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of linear constraints from the problem.

+

There are four forms by which linear_constraints.get_names may be called.

+
+
linear_constraints.get_names()

return the names of all linear constraints from the problem.

+
+
linear_constraints.get_names(i)

i must be a linear constraint index. Returns the name of row i.

+
+
linear_constraints.get_names(s)

s must be a sequence of row indices. Returns the names of +the linear constraints with indices the members of s. +Equivalent to [linear_constraints.get_names(i) for i in s]

+
+
linear_constraints.get_names(begin, end)

begin and end must be linear constraint indices. Returns the +names of the linear constraints with indices between begin and +end, inclusive of end. Equivalent to +linear_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.linear_constraints.add(names = ["c" + str(i) for i in range(10)])
+>>> c.linear_constraints.get_num()
+10
+>>> c.linear_constraints.get_names(8)
+'c8'
+>>> c.linear_constraints.get_names(1, 3)
+['c1', 'c2', 'c3']
+>>> c.linear_constraints.get_names([2, 0, 5])
+['c2', 'c0', 'c5']
+>>> c.linear_constraints.get_names()
+['c0', 'c1', 'c2', 'c3', 'c4', 'c5', 'c6', 'c7', 'c8', 'c9']
+
+
+
+ +
+
+get_histogram()[source]
+

Returns a histogram of the rows of the linear constraint matrix.

+

To access the number of rows with given nonzero counts, use +slice notation. If a negative nonzero count is queried in +this manner an IndexError will be raised.

+

The __str__ method of the Histogram object returns a string +displaying the number of rows with given nonzeros counts in +human readable form.

+

The data member “orientation” of the histogram object is +“row”, indicating that the histogram shows the nonzero +counts for the rows of the linear constraint matrix.

+
>>> import cplex
+>>> c = cplex.Cplex("ind.lp")
+>>> histogram = c.linear_constraints.get_histogram()
+>>> print(histogram)
+Row counts (excluding fixed variables):
+
+ Nonzero Count:   3   4   5  10  37
+Number of Rows:   1   9   1   4   1
+
+
+>>> histogram[4]
+9
+>>> histogram[2:7]
+[0, 1, 9, 1, 0]
+
+
+
+ +
+ +
+
+class IndicatorType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.IndicatorType
+ + + +

Identifiers for types of indicator constraints.

+
+
+if_ = 1
+

CPX_INDICATOR_IF (‘->’).

+
+ +
+
+onlyif = 2
+

CPX_INDICATOR_ONLYIF (‘<-‘)

+
+ +
+
+iff = 3
+

CPX_INDICATOR_IFANDONLYIF (‘<->’)

+
+ +
+ +
+
+class IndicatorConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.IndicatorConstraintInterface
+ + + +

Methods for adding, modifying, and querying indicator constraints.

+
+
+type_ = <cplex._internal._subinterfaces.IndicatorType object>
+

See IndicatorType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new IndicatorConstraintInterface.

+

The indicator constraints interface is exposed by the top-level +Cplex class as Cplex.indicator_constraints. This constructor +is not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of indicator constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.indicator_constraints.add(name="ind1")
+0
+>>> c.indicator_constraints.get_num()
+1
+
+
+
+ +
+
+add_batch(lin_expr=None, sense=None, rhs=None, indvar=None, complemented=None, name=None, indtype=None)[source]
+

Adds indicator constraints to the problem.

+

Takes up to eight keyword arguments.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr : either a list of SparsePair instances or a matrix in +list-of-lists format.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

sense : must be either a list of single-character strings or a +string containing the senses of the indicator constraints. +Each entry must be one of ‘G’, ‘L’, ‘E’, indicating +greater-than-or-equal-to (>=), less-than-or-equal-to (<=), and +equality (=), respectively. Left unspecified, the default is ‘E’.

+

rhs : a list of floats, specifying the righthand side of each +indicator constraint.

+

indvar : a list of names or indices (or a mixture of the two), of +the variables that control whether the constraint is active or +not.

+

complemented : a list of values (0 or 1). Default value of 0 +instructs CPLEX to interpret indicator constraint as active when +the indicator variable is 1. Set complemented to 1 to instruct +CPLEX that the indicator constraint is active when indvar = 0.

+

name : a list of strings that determine the names of the +individual constraints.

+

indtype : a list of the types of indicator constraints. Defaults +to CPX_INDICATOR_IF (‘->’). See IndicatorType().

+

Returns an iterator containing the indices of the added indicator +constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["x1", "x2", "x3"])
+>>> indices = c.indicator_constraints.add_batch(
+...     lin_expr=[cplex.SparsePair(ind=["x2"], val=[2.0]),
+...               cplex.SparsePair(ind=["x3"], val=[2.0])],
+...     sense="LL",
+...     rhs=[1.0, 1.0],
+...     indvar=["x1", "x2"],
+...     complemented=[0, 0],
+...     name=["ind1", "ind2"],
+...     indtype=[c.indicator_constraints.type_.if_,
+...              c.indicator_constraints.type_.if_])
+>>> len(list(indices))
+2
+
+
+
+ +
+
+add(lin_expr=None, sense='E', rhs=0.0, indvar=0, complemented=0, name='', indtype=1)[source]
+

Adds an indicator constraint to the problem.

+

Takes up to eight keyword arguments.

+

lin_expr : either a SparsePair or a list of two lists, the first of +which contains variable indices or names, the second of which +contains values.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

sense : the sense of the constraint, may be “L”, “G”, or “E”: +default is “E”

+

rhs : a float defining the righthand side of the constraint

+

indvar : the name or index of the variable that controls if +the constraint is active

+

complemented : default value of 0 instructs CPLEX to interpret +indicator constraint as active when the indicator variable is 1. +Set complemented to 1 to instruct CPLEX that the indicator +constraint is active when indvar = 0.

+

name : the name of the constraint.

+

indtype : the type of indicator constraint. Defaults to +CPX_INDICATOR_IF (‘->’). See IndicatorType().

+

Returns the index of the added indicator constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x1", "x2"])
+>>> c.indicator_constraints.add(
+...     indvar="x1",
+...     complemented=0,
+...     rhs=1.0,
+...     sense="G",
+...     lin_expr=cplex.SparsePair(ind=["x2"], val=[2.0]),
+...     name="ind1",
+...     indtype=c.indicator_constraints.type_.if_)
+0
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes indicator constraints from the problem.

+

There are four forms by which indicator_constraints.delete may be +called.

+
+
indicator_constraints.delete()

deletes all indicator constraints from the problem.

+
+
indicator_constraints.delete(i)

i must be an indicator constraint name or index. Deletes +the indicator constraint whose index or name is i.

+
+
indicator_constraints.delete(s)

s must be a sequence of indicator constraint names or +indices. Deletes the indicator constraints with names or +indices contained within s. Equivalent to +[indicator_constraints.delete(i) for i in s].

+
+
indicator_constraints.delete(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Deletes the indicator constraints with +indices between begin and end, inclusive of end. Equivalent to +indicator_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of indicator +constraints.

+
+
+

See CPXdelindconstrs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name=str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.delete(8)
+>>> c.indicator_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.indicator_constraints.delete("1", 3)
+>>> c.indicator_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.indicator_constraints.delete([2, "0", 5])
+>>> c.indicator_constraints.get_names()
+['4', '6', '7']
+>>> c.indicator_constraints.delete()
+>>> c.indicator_constraints.get_names()
+[]
+
+
+
+ +
+
+get_indicator_variables(*args)[source]
+

Returns the indicator variables of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_indicator_variables()

return the indicator variables of all indicator constraints +from the problem.

+
+
indicator_constraints.get_indicator_variables(i)

i must be an indicator constraint name or index. Returns the +indicator variables of the indicator constraint whose index +or name is i.

+
+
indicator_constraints.get_indicator_variables(s)

s must be a sequence of indicator constraint names or +indices. Returns the indicator variables of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_indicator_variables(i) for i in s]

+
+
indicator_constraints.get_indicator_variables(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the indicator variables of the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_indicator_variables(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=i,
+...      lin_expr=cplex.SparsePair(ind=[i+1], val=[1.0]))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_indicator_variables(8)
+8
+>>> c.indicator_constraints.get_indicator_variables("1",3)
+[1, 2, 3]
+>>> c.indicator_constraints.get_indicator_variables([2,"0",5])
+[2, 0, 5]
+>>> c.indicator_constraints.get_indicator_variables()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_complemented(*args)[source]
+

Returns whether a set of indicator constraints is complemented.

+

May be called by four forms.

+
+
indicator_constraints.get_complemented()

return whether or not all indicator constraints from the +problem are complemented.

+
+
indicator_constraints.get_complemented(i)

i must be an indicator constraint name or index. Returns +whether or not the indicator constraint whose index or name +is i is complemented.

+
+
indicator_constraints.get_complemented(s)

s must be a sequence of indicator constraint names or +indices. Returns whether or not the indicator constraints +with indices the members of s are complemented. Equivalent +to [indicator_constraints.get_complemented(i) for i in s]

+
+
indicator_constraints.get_complemented(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns whether or not the indicator +constraints with indices between begin and end, inclusive of +end, are complemented. Equivalent to +indicator_constraints.get_complemented(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=10,
+...      complemented=i % 2)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_complemented(8)
+0
+>>> c.indicator_constraints.get_complemented("1",3)
+[1, 0, 1]
+>>> c.indicator_constraints.get_complemented([2,"0",5])
+[0, 0, 1]
+>>> c.indicator_constraints.get_complemented()
+[0, 1, 0, 1, 0, 1, 0, 1, 0, 1]
+
+
+
+ +
+
+get_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_num_nonzeros()

return the number of nonzeros in all indicator constraints +from the problem.

+
+
indicator_constraints.get_num_nonzeros(i)

i must be an indicator constraint name or index. Returns the +number of nonzeros in the indicator constraint whose index +or name is i.

+
+
indicator_constraints.get_num_nonzeros(s)

s must be a sequence of indicator constraint names or +indices. Returns the number of nonzeros in the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_num_nonzeros(i) for i in s]

+
+
indicator_constraints.get_num_nonzeros(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the number of nonzeros in the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=10,
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_num_nonzeros(8)
+8
+>>> c.indicator_constraints.get_num_nonzeros("1",3)
+[1, 2, 3]
+>>> c.indicator_constraints.get_num_nonzeros([2,"0",5])
+[2, 0, 5]
+>>> c.indicator_constraints.get_num_nonzeros()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_rhs()

return the righthand side of all indicator constraints +from the problem.

+
+
indicator_constraints.get_rhs(i)

i must be an indicator constraint name or index. Returns the +righthand side of the indicator constraint whose index or +name is i.

+
+
indicator_constraints.get_rhs(s)

s must be a sequence of indicator constraint names or +indices. Returns the righthand side of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_rhs(i) for i in s]

+
+
indicator_constraints.get_rhs(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the righthand side of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(rhs=1.5 * i, name=str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_rhs(8)
+12.0
+>>> c.indicator_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.indicator_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.indicator_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the sense of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_senses()

return the senses of all indicator constraints from the +problem.

+
+
indicator_constraints.get_senses(i)

i must be an indicator constraint name or index. Returns the +sense of the indicator constraint whose index or name is i.

+
+
indicator_constraints.get_senses(s)

s must be a sequence of indicator constraint names or +indices. Returns the senses of the indicator constraints +with indices the members of s. Equivalent to +[indicator_constraints.get_senses(i) for i in s]

+
+
indicator_constraints.get_senses(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the senses of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name=str(i), sense=j)
+...  for i, j in enumerate("EGLE")]
+[0, 1, 2, 3]
+>>> c.indicator_constraints.get_num()
+4
+>>> c.indicator_constraints.get_senses(1)
+'G'
+>>> c.indicator_constraints.get_senses("1",3)
+['G', 'L', 'E']
+>>> c.indicator_constraints.get_senses([2,"0",1])
+['L', 'E', 'G']
+>>> c.indicator_constraints.get_senses()
+['E', 'G', 'L', 'E']
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the type of a set of indicator constraints.

+

See IndicatorType().

+

May be called by four forms.

+
+
indicator_constraints.get_types()

return the types of all indicator constraints from the +problem.

+
+
indicator_constraints.get_types(i)

i must be an indicator constraint name or index. Returns the +type of the indicator constraint whose index or name is i.

+
+
indicator_constraints.get_types(s)

s must be a sequence of indicator constraint names or +indices. Returns the types of the indicator constraints +with indices the members of s. Equivalent to +[indicator_constraints.get_types(i) for i in s]

+
+
indicator_constraints.get_types(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the types of the indicator +constraints with indices between begin and end, inclusive of +end. Equivalent to +indicator_constraints.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.indicator_constraints.add(name='i1')
+>>> c.indicator_constraints.get_types(idx)
+1
+>>> c.indicator_constraints.type_[1]
+'if_'
+
+
+
+ +
+
+get_linear_components(*args)[source]
+

Returns the linear constraint of a set of indicator +constraints.

+

Returns a list of SparsePair instances or a single SparsePair +instance, depending on the form by which it was called.

+

May be called by four forms.

+
+
indicator_constraints.get_linear_components()

return the linear components of all indicator constraints +from the problem.

+
+
indicator_constraints.get_linear_components(i)

i must be an indicator constraint name or index. Returns the +linear component of the indicator constraint whose index or +name is i.

+
+
indicator_constraints.get_linear_components(s)

s must be a sequence of indicator constraint names or +indices. Returns the linear components of the indicator +constraints with indices the members of s. Equivalent to +[indicator_constraints.get_linear_components(i) for i in s]

+
+
indicator_constraints.get_linear_components(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the linear components of the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +indicator_constraints.get_linear_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.indicator_constraints.add(
+...      name=str(i), indvar=3,
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(3)]
+[0, 1, 2]
+>>> c.indicator_constraints.get_num()
+3
+>>> c.indicator_constraints.get_linear_components(2)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for row in c.indicator_constraints.get_linear_components("0", 1):
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+>>> for row in c.indicator_constraints.get_linear_components([1, "0"]):
+...     print(row)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> for row in c.indicator_constraints.get_linear_components():
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of indicator constraints.

+

May be called by four forms.

+
+
indicator_constraints.get_names()

return the names of all indicator constraints from the +problem.

+
+
indicator_constraints.get_names(i)

i must be an indicator constraint index. Returns the name +of constraint i.

+
+
indicator_constraints.get_names(s)

s must be a sequence of indicator constraint indices. +Returns the names of the indicator constraints with indices +the members of s. Equivalent to +[indicator_constraints.get_names(i) for i in s]

+
+
indicator_constraints.get_names(begin, end)

begin and end must be indicator constraint indices. Returns the +names of the indicator constraints with indices between begin +and end, inclusive of end. Equivalent to +indicator_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.indicator_constraints.add(name="i" + str(i))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.indicator_constraints.get_num()
+10
+>>> c.indicator_constraints.get_names(8)
+'i8'
+>>> c.indicator_constraints.get_names(1, 3)
+['i1', 'i2', 'i3']
+>>> c.indicator_constraints.get_names([2, 0, 5])
+['i2', 'i0', 'i5']
+>>> c.indicator_constraints.get_names()
+['i0', 'i1', 'i2', 'i3', 'i4', 'i5', 'i6', 'i7', 'i8', 'i9']
+
+
+
+ +
+ +
+
+class QuadraticConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.QuadraticConstraintInterface
+ + + +

Methods for adding, modifying, and querying quadratic constraints.

+
+
+__init__(cplex)[source]
+

Creates a new QuadraticConstraintInterface.

+

The quadratic constraints interface is exposed by the top-level +Cplex class as Cplex.quadratic_constraints. This constructor +is not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of quadratic constraints.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'])
+>>> l = cplex.SparsePair(ind = ['x'], val = [1.0])
+>>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0])
+>>> [c.quadratic_constraints.add(name=str(i), lin_expr=l, quad_expr=q)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+
+
+
+ +
+
+add(lin_expr=None, quad_expr=None, sense='L', rhs=0.0, name='')[source]
+

Adds a quadratic constraint to the problem.

+

Takes up to five keyword arguments:

+

lin_expr : either a SparsePair or a list of two lists specifying +the linear component of the constraint.

+
+
Note

lin_expr must not contain duplicate indices. If lin_expr +references a variable more than once, either by index, name, +or a combination of index and name, an exception will be +raised.

+
+
+

quad_expr : either a SparseTriple or a list of three lists +specifying the quadratic component of the constraint.

+
+
Note

quad_expr must not contain duplicate indices. If quad_expr +references a matrix entry more than once, either by indices, +names, or a combination of indices and names, an exception +will be raised.

+
+
+

sense : either “L”, “G”, or “E”

+

rhs : a float specifying the righthand side of the constraint.

+

name : the name of the constraint.

+

Returns the index of the added quadratic constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'])
+>>> l = cplex.SparsePair(ind = ['x'], val = [1.0])
+>>> q = cplex.SparseTriple(ind1 = ['x'], ind2 = ['y'], val = [1.0])
+>>> c.quadratic_constraints.add(name = "my_quad",
+...                             lin_expr = l,
+...                             quad_expr = q,
+...                             rhs = 1.0,
+...                             sense = "G")
+0
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes quadratic constraints from the problem.

+

There are four forms by which quadratic_constraints.delete may be +called.

+
+
quadratic_constraints.delete()

deletes all quadratic constraints from the problem.

+
+
quadratic_constraints.delete(i)

i must be a quadratic constraint name or index. Deletes +the quadratic constraint whose index or name is i.

+
+
quadratic_constraints.delete(s)

s must be a sequence of quadratic constraint names or +indices. Deletes the quadratic constraints with names or +indices contained within s. Equivalent to +[quadratic_constraints.delete(i) for i in s].

+
+
quadratic_constraints.delete(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Deletes the quadratic constraints with +indices between begin and end, inclusive of end. Equivalent to +quadratic_constraints.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of quadratic +constraints.

+
+
+

See CPXdelqconstrs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'])
+>>> l = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> q = cplex.SparseTriple(ind1=['x'], ind2=['y'], val=[1.0])
+>>> [c.quadratic_constraints.add(
+...      name=str(i), lin_expr=l, quad_expr=q)
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.delete(8)
+>>> c.quadratic_constraints.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.quadratic_constraints.delete("1", 3)
+>>> c.quadratic_constraints.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.quadratic_constraints.delete([2, "0", 5])
+>>> c.quadratic_constraints.get_names()
+['4', '6', '7']
+>>> c.quadratic_constraints.delete()
+>>> c.quadratic_constraints.get_names()
+[]
+
+
+
+ +
+
+get_rhs(*args)[source]
+

Returns the righthand side of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_rhs()

return the righthand side of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_rhs(i)

i must be a quadratic constraint name or index. Returns the +righthand side of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_rhs(s)

s must be a sequence of quadratic constraint names or +indices. Returns the righthand side of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_rhs(i) for i in s]

+
+
quadratic_constraints.get_rhs(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the righthand side of the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +quadratic_constraints.get_rhs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(10)])
+>>> [c.quadratic_constraints.add(rhs=1.5 * i, name=str(i))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_rhs(8)
+12.0
+>>> c.quadratic_constraints.get_rhs("1",3)
+[1.5, 3.0, 4.5]
+>>> c.quadratic_constraints.get_rhs([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.quadratic_constraints.get_rhs()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_senses(*args)[source]
+

Returns the senses of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_senses()

return the senses of all quadratic constraints from the +problem.

+
+
quadratic_constraints.get_senses(i)

i must be a quadratic constraint name or index. Returns the +sense of the quadratic constraint whose index or name is i.

+
+
quadratic_constraints.get_senses(s)

s must be a sequence of quadratic constraint names or +indices. Returns the senses of the quadratic constraints +with indices the members of s. Equivalent to +[quadratic_constraints.get_senses(i) for i in s]

+
+
quadratic_constraints.get_senses(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the senses of the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +quadratic_constraints.get_senses(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0"])
+>>> [c.quadratic_constraints.add(name=str(i), sense=j)
+...  for i, j in enumerate("GGLL")]
+[0, 1, 2, 3]
+>>> c.quadratic_constraints.get_num()
+4
+>>> c.quadratic_constraints.get_senses(1)
+'G'
+>>> c.quadratic_constraints.get_senses("1",3)
+['G', 'L', 'L']
+>>> c.quadratic_constraints.get_senses([2,"0",1])
+['L', 'G', 'G']
+>>> c.quadratic_constraints.get_senses()
+['G', 'G', 'L', 'L']
+
+
+
+ +
+
+get_linear_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in the linear part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_linear_num_nonzeros()

return the number of nonzeros in all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_linear_num_nonzeros(i)

i must be a quadratic constraint name or index. Returns the +number of nonzeros in the quadratic constraint whose index +or name is i.

+
+
quadratic_constraints.get_linear_num_nonzeros(s)

s must be a sequence of quadratic constraint names or +indices. Returns the number of nonzeros in the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_linear_num_nonzeros(i) for i in s]

+
+
quadratic_constraints.get_linear_num_nonzeros(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the number of nonzeros in the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_linear_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.quadratic_constraints.add(
+...      name = str(i),
+...      lin_expr = [range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_linear_num_nonzeros(8)
+8
+>>> c.quadratic_constraints.get_linear_num_nonzeros("1",3)
+[1, 2, 3]
+>>> c.quadratic_constraints.get_linear_num_nonzeros([2,"0",5])
+[2, 0, 5]
+>>> c.quadratic_constraints.get_linear_num_nonzeros()
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+
+
+
+ +
+
+get_linear_components(*args)[source]
+

Returns the linear part of a set of quadratic constraints.

+

Returns a list of SparsePair instances or one SparsePair +instance.

+

Can be called by four forms.

+
+
quadratic_constraints.get_linear_components()

return the linear components of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_linear_components(i)

i must be a quadratic constraint name or index. Returns the +linear component of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_linear_components(s)

s must be a sequence of quadratic constraint names or +indices. Returns the linear components of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_linear_components(i) for i in s]

+
+
quadratic_constraints.get_linear_components(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the linear components of the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_linear_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.quadratic_constraints.add(
+...      name=str(i),
+...      lin_expr=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(3)]
+[0, 1, 2]
+>>> c.quadratic_constraints.get_num()
+3
+>>> c.quadratic_constraints.get_linear_components(2)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for row in c.quadratic_constraints.get_linear_components("0", 1):
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+>>> for row in c.quadratic_constraints.get_linear_components([1, "0"]):
+...     print(row)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> for row in c.quadratic_constraints.get_linear_components():
+...     print(row)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_quad_num_nonzeros(*args)[source]
+

Returns the number of nonzeros in the quadratic part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_quad_num_nonzeros()

Returns the number of nonzeros in all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_quad_num_nonzeros(i)

i must be a quadratic constraint name or index. Returns the +number of nonzeros in the quadratic constraint whose index +or name is i.

+
+
quadratic_constraints.get_quad_num_nonzeros(s)

s must be a sequence of quadratic constraint names or +indices. Returns the number of nonzeros in the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_quad_num_nonzeros(i) for i in s]

+
+
quadratic_constraints.get_quad_num_nonzeros(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the number of nonzeros in the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_quad_num_nonzeros(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)])
+>>> [c.quadratic_constraints.add(
+...      name = str(i),
+...      quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_quad_num_nonzeros(8)
+9
+>>> c.quadratic_constraints.get_quad_num_nonzeros("1",2)
+[1, 2, 3]
+>>> c.quadratic_constraints.get_quad_num_nonzeros([2,"1",5])
+[3, 1, 6]
+>>> c.quadratic_constraints.get_quad_num_nonzeros()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_quadratic_components(*args)[source]
+

Returns the quadratic part of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_quadratic_components()

return the quadratic components of all quadratic constraints +from the problem.

+
+
quadratic_constraints.get_quadratic_components(i)

i must be a quadratic constraint name or index. Returns the +quadratic component of the quadratic constraint whose index or +name is i.

+
+
quadratic_constraints.get_quadratic_components(s)

s must be a sequence of quadratic constraint names or +indices. Returns the quadratic components of the quadratic +constraints with indices the members of s. Equivalent to +[quadratic_constraints.get_quadratic_components(i) for i in s]

+
+
quadratic_constraints.get_quadratic_components(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the quadratic components of the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +quadratic_constraints.get_quadratic_components(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)]
+... )
+>>> [c.quadratic_constraints.add(
+...      name="q{0}".format(i),
+...      quad_expr=[range(i), range(i),
+...                 [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 3)]
+[0, 1]
+>>> c.quadratic_constraints.get_num()
+2
+>>> c.quadratic_constraints.get_quadratic_components(1)
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components("q1", 1):
+...     print(quad)
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components(["q2", 0]):
+...     print(quad)
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+>>> for quad in c.quadratic_constraints.get_quadratic_components():
+...     print(quad)
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+SparseTriple(ind1 = [0, 1], ind2 = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of quadratic constraints.

+

Can be called by four forms.

+
+
quadratic_constraints.get_names()

return the names of all quadratic constraints from the +problem.

+
+
quadratic_constraints.get_names(i)

i must be a quadratic constraint index. Returns the name +of constraint i.

+
+
quadratic_constraints.get_names(s)

s must be a sequence of quadratic constraint indices. +Returns the names of the quadratic constraints with indices +the members of s. Equivalent to +[quadratic_constraints.get_names(i) for i in s]

+
+
quadratic_constraints.get_names(begin, end)

begin and end must be quadratic constraint indices. Returns +the names of the quadratic constraints with indices between +begin and end, inclusive of end. Equivalent to +quadratic_constraints.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)])
+>>> [c.quadratic_constraints.add(
+...      name = "q" + str(i),
+...      quad_expr = [range(i), range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.quadratic_constraints.get_num()
+10
+>>> c.quadratic_constraints.get_names(8)
+'q9'
+>>> c.quadratic_constraints.get_names(1, 3)
+['q2', 'q3', 'q4']
+>>> c.quadratic_constraints.get_names([2, 0, 5])
+['q3', 'q1', 'q6']
+>>> c.quadratic_constraints.get_names()
+['q1', 'q2', 'q3', 'q4', 'q5', 'q6', 'q7', 'q8', 'q9', 'q10']
+
+
+
+ +
+ +
+
+class SOSType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SOSType
+ + + +

Constants defining the type of special ordered sets.

+

For a definition of SOS type 1 and 2, see those topics in the CPLEX +User’s Manual.

+
+
+SOS1 = '1'
+
+ +
+
+SOS2 = '2'
+
+ +
+ +
+
+class SOSInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SOSInterface
+ + + +

Class containing methods for Special Ordered Sets (SOS).

+
+
+type = <cplex._internal._subinterfaces.SOSType object>
+

See SOSType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new SOSInterface.

+

The SOS interface is exposed by the top-level Cplex class as +Cplex.SOS. This constructor is not meant to be used +externally.

+
+ +
+
+get_num()[source]
+

Returns the number of special ordered sets.

+
+ +
+
+add(type='1', SOS=None, name='')[source]
+

Adds a special ordered set constraint to the problem.

+

Takes three keyword arguments.

+

type : can be either SOS.type.SOS1 or SOS.type.SOS2

+

SOS : either a SparsePair or a list of two lists, the first of +which contains variable indices or names, the second of which +contains the weights to assign to those variables.

+

name: the name of the SOS

+

Returns the index of the added SOS constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(10)])
+>>> c.SOS.add(type = "1", name = "type_one",
+...           SOS = cplex.SparsePair(ind = ["2", "3"],
+...                                  val = [25.0, 18.0]))
+0
+>>> c.SOS.add(type = "2", name = "type_two",
+...           SOS = cplex.SparsePair(ind = ["2", "4", "7", "3"],
+...                                  val = [1.0, 3.0, 25.0, 18.0]))
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes special ordered sets from the problem.

+

There are four forms by which SOS.delete may be called.

+
+
SOS.delete()

deletes all SOS constraints from the problem.

+
+
SOS.delete(i)

i must be a SOS constraint name or index. Deletes the SOS +constraint indexed as i or named i.

+
+
SOS.delete(s)

s must be a sequence of SOS constraint names or indices. +Deletes the SOS constraints with names or indices contained +within s. Equivalent to [SOS.delete(i) for i in s].

+
+
SOS.delete(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Deletes the SOS constraints with indices between begin +and end, inclusive of end. Equivalent to +SOS.delete(range(begin, end + 1)). This will give the best +performance when deleting batches of SOS constraints.

+
+
+

See CPXdelsos in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'])
+>>> l = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.SOS.add(name=str(i), SOS=l) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.delete(8)
+>>> c.SOS.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.SOS.delete("1", 3)
+>>> c.SOS.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.SOS.delete([2, "0", 5])
+>>> c.SOS.get_names()
+['4', '6', '7']
+>>> c.SOS.delete()
+>>> c.SOS.get_names()
+[]
+
+
+
+ +
+
+get_sets(*args)[source]
+

Returns the sets of variables and their corresponding weights.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
SOS.get_sets()

return the set of variables and weights of all SOS +constraints from the problem.

+
+
SOS.get_sets(i)

i must be a SOS constraint name or index. Returns the set +of variables and weights of the SOS constraint whose index +or name is i.

+
+
SOS.get_sets(s)

s must be a sequence of SOS constraint names or indices. +Returns the variables and weights of the SOS constraints +with indices the members of s. Equivalent to +[SOS.get_sets(i) for i in s]

+
+
SOS.get_sets(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the variables and weights of the SOS constraints +with indices between begin and end, inclusive of end. +Equivalent to SOS.get_sets(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(4)],
+...     types="B" * 4
+... )
+>>> [c.SOS.add(
+...      name="s{0}".format(i),
+...      SOS=[range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1, 3)]
+[0, 1]
+>>> c.SOS.get_num()
+2
+>>> c.SOS.get_sets(1)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for s in c.SOS.get_sets("s1", 1):
+...     print(s)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+>>> for s in c.SOS.get_sets(["s2", 0]):
+...     print(s)
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+SparsePair(ind = [0], val = [1.0])
+>>> for s in c.SOS.get_sets():
+...     print(s)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the type of a set of special ordered sets.

+

Return values are attributes of Cplex.SOS.type.

+

Can be called by four forms.

+
+
SOS.get_types()

return the type of all SOS constraints.

+
+
SOS.get_types(i)

i must be a SOS constraint name or index. Returns the type +of the SOS constraint whose index or name is i.

+
+
SOS.get_types(s)

s must be a sequence of SOS constraint names or indices. +Returns the type of the SOS constraints with indices the +members of s. Equivalent to [SOS.get_types(i) for i in s]

+
+
SOS.get_types(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the type of the SOS constraints with indices +between begin and end, inclusive of end. Equivalent to +SOS.get_types(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.SOS.add(name = str(i), type = str(i % 2 + 1))
+...  for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_types(8)
+'1'
+>>> c.SOS.get_types("1",3)
+['2', '1', '2']
+>>> c.SOS.get_types([2,"0",5])
+['1', '1', '2']
+>>> c.SOS.get_types()
+['1', '2', '1', '2', '1', '2', '1', '2', '1', '2']
+
+
+
+ +
+
+get_num_members(*args)[source]
+

Returns the size of a set of special ordered sets.

+

Can be called by four forms.

+
+
SOS.get_num_members()

return the number of variables in all SOS constraints from +the problem.

+
+
SOS.get_num_members(i)

i must be a SOS constraint name or index. Returns the +number of variables in the SOS constraint whose index or +name is i.

+
+
SOS.get_num_members(s)

s must be a sequence of SOS constraint names or indices. +Returns the number of variables in the SOS constraints with +indices the members of s. Equivalent to +[SOS.get_num_members(i) for i in s]

+
+
SOS.get_num_members(begin, end)

begin and end must be SOS constraint indices or SOS constraint +names. Returns the number of variables in the SOS constraints +with indices between begin and end, inclusive of end. +Equivalent to SOS.get_num_members(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)], types = "B" * 11)
+>>> [c.SOS.add(name = str(i),
+...            SOS = [range(i), [1.0 * (j+1.0) for j in range(i)]])
+...  for i in range(1,11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_num_members(7)
+8
+>>> c.SOS.get_num_members("1",2)
+[1, 2, 3]
+>>> c.SOS.get_num_members([3,"1",4])
+[4, 1, 5]
+>>> c.SOS.get_num_members()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of special ordered sets.

+

Can be called by four forms.

+
+
SOS.get_names()

return the names of all SOS constraints from the problem.

+
+
SOS.get_names(i)

i must be an SOS constraint index. Returns the name of +SOS constraint i.

+
+
SOS.get_names(s)

s must be a sequence of SOS constraint indices. Returns +the names of the SOS constraints with indices the members +of s. Equivalent to [SOS.get_names(i) for i in s]

+
+
SOS.get_names(begin, end)

begin and end must be SOS constraint indices. Returns the names +of the SOS constraints with indices between begin and end, +inclusive of end. Equivalent to +SOS.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ["x0"])
+>>> [c.SOS.add(name = "sos" + str(i)) for i in range(1, 11)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.SOS.get_num()
+10
+>>> c.SOS.get_names(8)
+'sos9'
+>>> c.SOS.get_names(1, 3)
+['sos2', 'sos3', 'sos4']
+>>> c.SOS.get_names([2, 0, 5])
+['sos3', 'sos1', 'sos6']
+>>> c.SOS.get_names()
+['sos1', 'sos2', 'sos3', 'sos4', 'sos5', 'sos6', 'sos7', 'sos8', 'sos9', 'sos10']
+
+
+
+ +
+ +
+
+class EffortLevel[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.EffortLevel
+ + + +

Effort levels associated with a MIP start

+
+
+auto = 0
+
+ +
+
+check_feasibility = 1
+
+ +
+
+solve_fixed = 2
+
+ +
+
+solve_MIP = 3
+
+ +
+
+repair = 4
+
+ +
+
+no_check = 5
+
+ +
+ +
+
+class MIPStartsInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.MIPStartsInterface
+ + + +

Contains methods pertaining to MIP starts.

+
+
+effort_level = <cplex._internal._subinterfaces.EffortLevel object>
+

See EffortLevel()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new MIPStartsInterface.

+

The MIP starts interface is exposed by the top-level Cplex +class as Cplex.MIP_starts. This constructor is not meant to be +used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of MIP starts currently stored.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(5)])
+>>> c.MIP_starts.get_num()
+5
+
+
+
+ +
+
+read(filename)[source]
+

Reads MIP starts from a file.

+

This method reads a file in the format MST and copies the +information of all the MIP starts contained in that file into a +CPLEX problem object. The parameter cplex.parameters.advance +must be set to cplex.parameters.advance.values.standard, its +default value, or cplex.parameters.advance.values.alternate +in order for the MIP starts to be used.

+
+
Note

If the MIP start file is successfully read, then any +previously existing MIP starts will be deleted.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.MIP_starts.write("test_all.mst")
+>>> c.MIP_starts.read("test_all.mst")
+
+
+
+ +
+
+write(filename, begin=-1, end=-1)[source]
+

Writes a set of MIP starts to a file.

+

If called with only a filename, writes all MIP starts to that +file.

+

If called with a filename and one index or name of a MIP +start, writes only that MIP start to the file.

+

If called with a filename and two indices or names of MIP +starts, writes all MIP starts between the first and second +index or name, inclusive of begin and end, to the file.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)], types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(5)])
+>>> c.MIP_starts.write("test_all.mst")
+>>> c.MIP_starts.write("test_one.mst", 1)
+>>> c.MIP_starts.write("test_four.mst", 1, 4)
+
+
+
+ +
+
+add(*args)[source]
+

Adds MIP starts to the problem.

+

To add a single MIP start, call this method as

+

cpx.MIP_starts.add(start, effort_level, name)

+

The first argument, start, must be either a SparsePair +instance or a list of two lists, the first of which contains +variable indices or names, the second of which contains the +values that those variables take.

+

The second argument, effort_level, must be an attribute of +MIP_starts.effort_level.

+

The third optional argument is the name of the MIP start.

+

To add a set of MIP starts, call this method as

+

cpx.MIP_starts.add(sequence)

+

where sequence is a list or tuple of pairs (start, +effort_level) or triples (start, effort_level, name) as +described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(11)],
+...                           types = "I" * 11)
+>>> indices = c.MIP_starts.add(
+...     cplex.SparsePair(ind = [0], val = [0.0]),
+...     c.MIP_starts.effort_level.repair, "first")
+>>> indices = c.MIP_starts.add(
+...     cplex.SparsePair(ind = [1], val = [0.0]),
+...     c.MIP_starts.effort_level.solve_MIP)
+>>> indices = c.MIP_starts.add(
+...     [([[2, 4], [0.0, 1.0]],
+...       c.MIP_starts.effort_level.auto, "third"),
+...      ([[3, 4], [1.0, 3.0]],
+...       c.MIP_starts.effort_level.check_feasibility)])
+>>> c.MIP_starts.get_num()
+4
+>>> c.MIP_starts.get_names()
+['first', 'm2', 'third', 'm4']
+
+
+
+ +
+
+change(*args)[source]
+

Changes a MIP start or set of MIP starts.

+

To change a single MIP start, call this method as

+

cpx.MIP_starts.change(ID, start, effort_level)

+

The first argument, ID, must be an index or name of an +existing MIP start.

+

The second argument, start, must be either a SparsePair +instance or a list of two lists, the first of which contains +variable indices or names, the second of which contains the +values that those variables take. If the MIP start identified +by ID already has a value for a variable specified by start, +that value is replaced.

+

The third argument, effort_level, must be an attribute of +MIP_starts.effort_level.

+

To change multiple MIP starts, call this method as

+

cpx.MIP_starts.change(sequence)

+

where sequence is a list of tuple of triples (ID, start, +effort_level) as described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = ["x{0}".format(i) for i in range(4)],
+...     types = "I" * 4
+... )
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [0.0]),
+...       c.MIP_starts.effort_level.auto) for i in range(3)])
+>>> for s in c.MIP_starts.get_starts():
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [0.0]), 0)
+(SparsePair(ind = [2], val = [0.0]), 0)
+>>> c.MIP_starts.get_names()
+['m1', 'm2', 'm3']
+>>> check = c.MIP_starts.effort_level.check_feasibility
+>>> repair = c.MIP_starts.effort_level.repair
+>>> c.MIP_starts.change("m1", [["x0", "x1"], [1.0, 2.0]], check)
+>>> c.MIP_starts.get_starts("m1")
+(SparsePair(ind = [0, 1], val = [1.0, 2.0]), 1)
+>>> c.MIP_starts.change(1, [[1, 2], [-1.0, -2.0]], repair)
+>>> c.MIP_starts.get_starts("m2")
+(SparsePair(ind = [1, 2], val = [-1.0, -2.0]), 4)
+>>> c.MIP_starts.change([(1, [[0, 2], [-1.0, 2.0]], check),
+...                      ("m3", [["x0", 2], [3.0, 2.0]], repair)])
+>>> for s in c.MIP_starts.get_starts(["m2", "m3"]):
+...     print(s)
+(SparsePair(ind = [0, 1, 2], val = [-1.0, -1.0, 2.0]), 1)
+(SparsePair(ind = [0, 2], val = [3.0, 2.0]), 4)
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes MIP starts from the problem.

+

There are four forms by which MIP_starts.delete may be called.

+
+
MIP_starts.delete()

deletes all MIP starts from the problem.

+
+
MIP_starts.delete(i)

i must be a MIP start name or index. Deletes the MIP start +whose index or name is i.

+
+
MIP_starts.delete(s)

s must be a sequence of MIP start names or indices. +Deletes the MIP starts with names or indices contained within +s. Equivalent to [MIP_starts.delete(i) for i in s].

+
+
MIP_starts.delete(begin, end)

begin and end must be MIP start indices or MIP start names. +Deletes the MIP starts with indices between begin and end, +inclusive of end. Equivalent to +MIP_starts.delete(range(begin, end + 1)). This will give the +best performance when deleting batches of MIP starts.

+
+
+

See CPXdelmipstarts in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["II"])
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind=['x'], val=[1.0]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.delete(8)
+>>> c.MIP_starts.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.MIP_starts.delete("1", 3)
+>>> c.MIP_starts.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.MIP_starts.delete([2, "0", 5])
+>>> c.MIP_starts.get_names()
+['4', '6', '7']
+>>> c.MIP_starts.delete()
+>>> c.MIP_starts.get_names()
+[]
+
+
+
+ +
+
+get_starts(*args)[source]
+

Returns a set of MIP starts.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
MIP_starts.get_starts()

return the starting vector for all MIP starts from the +problem.

+
+
MIP_starts.get_starts(i)

i must be a MIP start name or index. Returns the starting +vector for the MIP start whose index or name is i.

+
+
MIP_starts.get_starts(s)

s must be a sequence of MIP start names or indices. +Returns the starting vector for the MIP starts with indices +the members of s. Equivalent to [MIP_starts.get_starts(i) +for i in s]

+
+
MIP_starts.get_starts(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the starting vector for the MIP starts with indices +between begin and end, inclusive of end. Equivalent to +MIP_starts.get_starts(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=[str(i) for i in range(11)],
+...     types="B" * 11)
+>>> indices =c.MIP_starts.add(
+...     [(cplex.SparsePair(ind=[i], val=[1.0 * i]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_starts(7)
+(SparsePair(ind = [7], val = [7.0]), 0)
+>>> for s in c.MIP_starts.get_starts("0", 2):
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [1.0]), 0)
+(SparsePair(ind = [2], val = [2.0]), 0)
+>>> for s in c.MIP_starts.get_starts([2, "0", 5]):
+...     print(s)
+(SparsePair(ind = [2], val = [2.0]), 0)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [5], val = [5.0]), 0)
+>>> c.MIP_starts.delete(3,9)
+>>> for s in c.MIP_starts.get_starts():
+...     print(s)
+(SparsePair(ind = [0], val = [0.0]), 0)
+(SparsePair(ind = [1], val = [1.0]), 0)
+(SparsePair(ind = [2], val = [2.0]), 0)
+>>> c.MIP_starts.effort_level[0]
+'auto'
+
+
+
+ +
+
+get_effort_levels(*args)[source]
+

Returns the effort levels for a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_effort_levels()

return the effort level for all MIP starts from the +problem.

+
+
MIP_starts.get_effort_levels(i)

i must be a MIP start name or index. Returns the effort +level for the MIP start whose index or name is i.

+
+
MIP_starts.get_effort_levels(s)

s must be a sequence of MIP start names or indices. +Returns the effort level for the MIP starts with indices +the members of s. Equivalent to +[MIP_starts.get_effort_levels(i) for i in s]

+
+
MIP_starts.get_effort_levels(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the effort level for the MIP starts with indices +between begin and end, inclusive of end. Equivalent to +MIP_starts.get_effort_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(10)],
+...     types = "B" * 10)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = [i], val = [1.0 * i]),
+...       c.MIP_starts.effort_level.auto, str(i))
+...      for i in range(10)])
+>>> c.MIP_starts.change([(1, [[0], [0.0]], c.MIP_starts.effort_level.check_feasibility),
+                         (2, [[0], [0.0]], c.MIP_starts.effort_level.solve_fixed),
+                         (3, [[0], [0.0]], c.MIP_starts.effort_level.solve_MIP),
+                         (4, [[0], [0.0]], c.MIP_starts.effort_level.repair),
+                         (5, [[0], [0.0]], c.MIP_starts.effort_level.no_check)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.effort_level[c.MIP_starts.get_effort_levels(3)]
+'solve_MIP'
+>>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels("0",2)]
+['auto', 'check_feasibility', 'solve_fixed']
+>>> [c.MIP_starts.effort_level[i] for i in c.MIP_starts.get_effort_levels([2,"0",5])]
+['solve_fixed', 'auto', 'no_check']
+>>> c.MIP_starts.get_effort_levels()
+[0, 1, 2, 3, 4, 5, 0, 0, 0, 0]
+
+
+
+ +
+
+get_num_entries(*args)[source]
+

Returns the number of variables specified by a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_num_entries()

return the length of the starting vector for all MIP starts +from the problem.

+
+
MIP_starts.get_num_entries(i)

i must be a MIP start name or index. Returns the length of +the starting vector for the MIP start whose index or name +is i.

+
+
MIP_starts.get_num_entries(s)

s must be a sequence of MIP start names or indices. +Returns the length of the starting vector for the MIP +starts with indices the members of s. Equivalent to +[MIP_starts.get_num_entries(i) for i in s]

+
+
MIP_starts.get_num_entries(begin, end)

begin and end must be MIP start indices or MIP start names. +Returns the length of the starting vector for the MIP starts +with indices between begin and end, inclusive of end. +Equivalent to +MIP_starts.get_num_entries(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "B" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = range(i), val = [0.0] * i),
+...       c.MIP_starts.effort_level.auto, str(i - 1))
+...      for i in range(1, 11)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_num_entries(3)
+4
+>>> c.MIP_starts.get_num_entries("0",2)
+[1, 2, 3]
+>>> c.MIP_starts.get_num_entries([2,"0",5])
+[3, 1, 6]
+>>> c.MIP_starts.get_num_entries()
+[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of MIP starts.

+

Can be called by four forms.

+
+
MIP_starts.get_names()

return the names of all MIP starts from the problem.

+
+
MIP_starts.get_names(i)

i must be a MIP start index. Returns the name of MIP start i.

+
+
MIP_starts.get_names(s)

s must be a sequence of MIP start indices. Returns the +names of the MIP starts with indices the members of s. +Equivalent to [MIP_starts.get_names(i) for i in s]

+
+
MIP_starts.get_names(begin, end)

begin and end must be MIP start indices. Returns the names of +the MIP starts with indices between begin and end, inclusive of +end. Equivalent to MIP_starts.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names = [str(i) for i in range(11)],
+...     types = "B" * 11)
+>>> indices = c.MIP_starts.add(
+...     [(cplex.SparsePair(ind = range(i), val = [0.0] * i),
+...       c.MIP_starts.effort_level.auto, "mst" + str(i - 1))
+...      for i in range(1, 11)])
+>>> c.MIP_starts.get_num()
+10
+>>> c.MIP_starts.get_names(8)
+'mst8'
+>>> c.MIP_starts.get_names(1, 3)
+['mst1', 'mst2', 'mst3']
+>>> c.MIP_starts.get_names([2, 0, 5])
+['mst2', 'mst0', 'mst5']
+>>> c.MIP_starts.get_names()
+['mst0', 'mst1', 'mst2', 'mst3', 'mst4', 'mst5', 'mst6', 'mst7', 'mst8', 'mst9']
+
+
+
+ +
+ +
+
+class ObjSense[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ObjSense
+ + + +

Constants defining the sense of the objective function.

+

See CPXgetobjsen in the Callable Library Reference +Manual for more detail.

+
+
+maximize = -1
+

See CPX_MAX in the C API.

+
+ +
+
+minimize = 1
+

See CPX_MIN in the C API.

+
+ +
+ +
+
+class ObjectiveInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ObjectiveInterface
+ + + +

Contains methods for querying and modifying the objective function.

+
+
+sense = <cplex._internal._subinterfaces.ObjSense object>
+

See ObjSense()

+
+ +
+
+set_linear(*args)[source]
+

Changes the linear part of the objective function.

+

Can be called by two forms:

+
+
objective.set_linear(var, value)

var must be a variable index or name and value must be a +float. Changes the coefficient of the variable identified +by var to value.

+
+
objective.set_linear(sequence)

sequence is a sequence of pairs (var, value) as described +above. Changes the coefficients for the specified +variables to the given values.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(4)])
+>>> c.objective.get_linear()
+[0.0, 0.0, 0.0, 0.0]
+>>> c.objective.set_linear(0, 1.0)
+>>> c.objective.get_linear()
+[1.0, 0.0, 0.0, 0.0]
+>>> c.objective.set_linear("3", -1.0)
+>>> c.objective.get_linear()
+[1.0, 0.0, 0.0, -1.0]
+>>> c.objective.set_linear([("2", 2.0), (1, 0.5)])
+>>> c.objective.get_linear()
+[1.0, 0.5, 2.0, -1.0]
+
+
+
+ +
+
+set_quadratic(*args)[source]
+

Sets the quadratic part of the objective function.

+

Call this method with a list with length equal to the number +of variables in the problem.

+

If the quadratic objective function is separable, the entries +of the list must all be of type float or int.

+

If the quadratic objective function is not separable, the +entries of the list must be either SparsePair instances or +lists of two lists, the first of which contains variable +indices or names, the second of which contains the values that +those variables take.

+
+
Note

Successive calls to set_quadratic will overwrite any previous +quadratic objective function. To modify only part of the +quadratic objective function, use the method +set_quadratic_coefficients.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(3)])
+>>> c.objective.set_quadratic(
+...     [cplex.SparsePair(ind=[0, 1, 2], val=[1.0, -2.0, 0.5]),
+...      cplex.SparsePair(ind=[0, 1], val=[-2.0, -1.0]),
+...      cplex.SparsePair(ind=[0, 2], val=[0.5, -3.0])]
+... )
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [0, 1, 2], val = [1.0, -2.0, 0.5])
+SparsePair(ind = [0, 1], val = [-2.0, -1.0])
+SparsePair(ind = [0, 2], val = [0.5, -3.0])
+>>> c.objective.set_quadratic([1.0, 2.0, 3.0])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [1], val = [2.0])
+SparsePair(ind = [2], val = [3.0])
+
+
+
+ +
+
+set_quadratic_coefficients(*args)[source]
+

Sets coefficients of the quadratic component of the objective +function.

+

To set a single coefficient, call this method as

+

objective.set_quadratic_coefficients(v1, v2, val)

+

where v1 and v2 are names or indices of variables and val is +the value for the coefficient.

+

To set multiple coefficients, call this method as

+

objective.set_quadratic_coefficients(sequence)

+

where sequence is a list or tuple of triples (v1, v2, val) as +described above.

+
+
Note

Since the quadratic objective function must be symmetric, each +triple in which v1 is different from v2 is used to set both +the (v1, v2) coefficient and the (v2, v1) coefficient. If +(v1, v2) and (v2, v1) are set with a single call, the second +value is stored.

+
+
Note

Attempting to set many coefficients with set_quadratic_coefficients +can be time consuming. Instead, use the method set_quadratic to set +the quadratic part of the objective efficiently.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1], val = [1.0])
+SparsePair(ind = [0], val = [1.0])
+SparsePair(ind = [], val = [])
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0),
+...                                         (0, 2, 3.0)])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1, 2], val = [1.0, 3.0])
+SparsePair(ind = [0, 1], val = [1.0, 2.0])
+SparsePair(ind = [0], val = [3.0])
+>>> c.objective.set_quadratic_coefficients([(0, 1, 4.0),
+...                                         (1, 0, 5.0)])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [1, 2], val = [5.0, 3.0])
+SparsePair(ind = [0, 1], val = [5.0, 2.0])
+SparsePair(ind = [0], val = [3.0])
+
+
+
+ +
+
+set_sense(sense)[source]
+

Sets the sense of the objective function.

+

The argument to this method must be either +objective.sense.minimize or objective.sense.maximize.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+>>> c.objective.set_sense(c.objective.sense.maximize)
+>>> c.objective.sense[c.objective.get_sense()]
+'maximize'
+>>> c.objective.set_sense(c.objective.sense.minimize)
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+
+
+
+ +
+
+set_name(name)[source]
+

Sets the name of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_name("cost")
+>>> c.objective.get_name()
+'cost'
+
+
+
+ +
+
+get_linear(*args)[source]
+

Returns the linear coefficients of a set of variables.

+

Can be called by four forms.

+
+
objective.get_linear()

return the linear objective coefficients of all variables +from the problem.

+
+
objective.get_linear(i)

i must be a variable name or index. Returns the linear +objective coefficient of the variable whose index or name +is i.

+
+
objective.get_linear(s)

s must be a sequence of variable names or indices. Returns +the linear objective coefficient of the variables with +indices the members of s. Equivalent to +[objective.get_linear(i) for i in s]

+
+
objective.get_linear(begin, end)

begin and end must be variable indices or variable names. +Returns the linear objective coefficient of the variables with +indices between begin and end, inclusive of end. Equivalent to +objective.get_linear(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj = [1.5 * i for i in range(10)],
+                    names = [str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.objective.get_linear(8)
+12.0
+>>> c.objective.get_linear("1",3)
+[1.5, 3.0, 4.5]
+>>> c.objective.get_linear([2,"0",5])
+[3.0, 0.0, 7.5]
+>>> c.objective.get_linear()
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+get_quadratic(*args)[source]
+

Returns a set of columns of the quadratic component of the +objective function.

+

Returns a SparsePair instance or a list of SparsePair instances.

+

Can be called by four forms.

+
+
objective.get_quadratic()

return the entire quadratic objective function.

+
+
objective.get_quadratic(i)

i must be a variable name or index. Returns the column of +the quadratic objective function associated with the +variable whose index or name is i.

+
+
objective.get_quadratic(s)

s must be a sequence of variable names or indices. Returns +the columns of the quadratic objective function associated +with the variables with indices the members of s. +Equivalent to [objective.get_quadratic(i) for i in s]

+
+
objective.get_quadratic(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the quadratic objective function +associated with the variables with indices between begin and +end, inclusive of end. Equivalent to +objective.get_quadratic(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.objective.set_quadratic([1.5 * i for i in range(10)])
+>>> c.objective.get_quadratic(8)
+SparsePair(ind = [8], val = [12.0])
+>>> for q in c.objective.get_quadratic("1", 3):
+...     print(q)
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [2], val = [3.0])
+SparsePair(ind = [3], val = [4.5])
+>>> for q in c.objective.get_quadratic([3, "1", 5]):
+...     print(q)
+SparsePair(ind = [3], val = [4.5])
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [5], val = [7.5])
+>>> for q in c.objective.get_quadratic():
+...     print(q)
+SparsePair(ind = [], val = [])
+SparsePair(ind = [1], val = [1.5])
+SparsePair(ind = [2], val = [3.0])
+SparsePair(ind = [3], val = [4.5])
+SparsePair(ind = [4], val = [6.0])
+SparsePair(ind = [5], val = [7.5])
+SparsePair(ind = [6], val = [9.0])
+SparsePair(ind = [7], val = [10.5])
+SparsePair(ind = [8], val = [12.0])
+SparsePair(ind = [9], val = [13.5])
+
+
+
+ +
+
+get_quadratic_coefficients(*args)[source]
+

Returns individual coefficients from the quadratic objective function.

+

To query a single coefficient, call this as

+

objective.get_quadratic_coefficients(v1, v2)

+

where v1 and v2 are indices or names of variables.

+

To query multiple coefficients, call this method as

+

objective.get_quadratic_coefficients(sequence)

+

where sequence is a list or tuple of pairs (v1, v2) as +described above.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_quadratic_coefficients("1", 0)
+1.0
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0), (1, 0, 5.0)])
+>>> c.objective.get_quadratic_coefficients([(1, 0), (1, "1"), (2, "0")])
+[5.0, 2.0, 3.0]
+
+
+
+ +
+
+get_sense()[source]
+

Returns the sense of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+>>> c.objective.set_sense(c.objective.sense.maximize)
+>>> c.objective.sense[c.objective.get_sense()]
+'maximize'
+>>> c.objective.set_sense(c.objective.sense.minimize)
+>>> c.objective.sense[c.objective.get_sense()]
+'minimize'
+
+
+
+ +
+
+get_name()[source]
+

Returns the name of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_name("cost")
+>>> c.objective.get_name()
+'cost'
+
+
+
+ +
+
+get_num_quadratic_variables()[source]
+

Returns the number of variables with quadratic coefficients.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_num_quadratic_variables()
+2
+>>> c.objective.set_quadratic([1.0, 0.0, 0.0])
+>>> c.objective.get_num_quadratic_variables()
+1
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)])
+>>> c.objective.get_num_quadratic_variables()
+3
+
+
+
+ +
+
+get_num_quadratic_nonzeros()[source]
+

Returns the number of nonzeros in the quadratic objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(3)])
+>>> c.objective.set_quadratic_coefficients(0, 1, 1.0)
+>>> c.objective.get_num_quadratic_nonzeros()
+2
+>>> c.objective.set_quadratic_coefficients([(1, 1, 2.0), (0, 2, 3.0)])
+>>> c.objective.get_num_quadratic_nonzeros()
+5
+>>> c.objective.set_quadratic_coefficients([(0, 1, 4.0), (1, 0, 0.0)])
+>>> c.objective.get_num_quadratic_nonzeros()
+3
+
+
+
+ +
+
+get_offset()[source]
+

Returns the constant offset of the objective function for a problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> offset = c.objective.get_offset()
+>>> abs(offset - 0.0) < 1e-6
+True
+
+
+
+ +
+
+set_offset(offset)[source]
+

Sets the constant offset of the objective function for a problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.objective.set_offset(3.14)
+>>> offset = c.objective.get_offset()
+>>> abs(offset - 3.14) < 1e-6
+True
+
+
+
+ +
+ +
+
+class ProgressInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ProgressInterface
+ + + +

Methods to query the progress of optimization.

+
+
+__init__(parent)[source]
+

Creates a new ProgressInterface.

+

The progress interface is exposed by the top-level Cplex +class as Cplex.solution.progress. This constructor is not +meant to be used externally.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations executed so far.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_iterations()
+
+
+
+ +
+
+get_num_barrier_iterations()[source]
+

Returns the number of barrier iterations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_barrier_iterations()
+
+
+
+ +
+
+get_num_sifting_iterations()[source]
+

Returns the number of sifting iterations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting)
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_sifting_iterations()
+
+
+
+ +
+
+get_num_phase_one_iterations()[source]
+

Returns the number of iterations to find a feasible solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_phase_one_iterations()
+
+
+
+ +
+
+get_num_sifting_phase_one_iterations()[source]
+

Returns the number of sifting iterations to find a feasible solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.sifting)
+>>> c.solve()
+>>> num_iter = c.solution.progress.get_num_sifting_phase_one_iterations()
+
+
+
+ +
+
+get_num_nodes_processed()[source]
+

Returns the number of nodes processed.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num_nodes = c.solution.progress.get_num_nodes_processed()
+
+
+
+ +
+
+get_num_nodes_remaining()[source]
+

Returns the number of nodes left to process.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num_nodes = c.solution.progress.get_num_nodes_remaining()
+
+
+
+ +
+
+get_num_primal_push()[source]
+

Returns the number of primal push operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_push = c.solution.progress.get_num_primal_push()
+
+
+
+ +
+
+get_num_primal_exchange()[source]
+

Returns the number of primal exchange operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_exch = c.solution.progress.get_num_primal_exchange()
+
+
+
+ +
+
+get_num_dual_push()[source]
+

Returns the number of dual push operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_push = c.solution.progress.get_num_dual_push()
+
+
+
+ +
+
+get_num_dual_exchange()[source]
+

Returns the number of dual exchange operations.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.barrier)
+>>> c.solve()
+>>> num_exch = c.solution.progress.get_num_dual_exchange()
+
+
+
+ +
+
+get_num_conflict_passes()[source]
+

Returns the number of passes performed by the conflict +refiner.

+

See CPXgetconflictnumpasses in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine()
+>>> c.solution.progress.get_num_conflict_passes()
+5
+
+
+
+ +
+ +
+
+class InfeasibilityInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.InfeasibilityInterface
+ + + +

Methods for computing degree of infeasibility in a solution vector.

+

Each of these methods takes one required argument, x, which must +be a list of floats with length equal to the number of variables.

+

If no other arguments are provided, the methods return the +violation for all constraints of the given type.

+

If one string or integer is provided, it is taken to be the name +or index of a constraint of the given type. The methods return +the violation of that constraint.

+

If two strings or integers are provided, they are taken to be the +names or indices of constraints of the given type. All violations +for constraints between the first and second, inclusive, are +returned in a list.

+

If a sequence of strings or integers are provided, they are taken +to be the names or indices of constraints of the given type. All +violations for constraints identified in the sequence are returned +in a list.

+
+
+__init__(parent)[source]
+

Creates a new InfeasibilityInterface.

+

The infeasibility interface is exposed by the top-level Cplex +class as Cplex.solution.infeasibility. This constructor is not +meant to be used externally.

+
+ +
+
+bound_constraints(x, *args)[source]
+

Returns the amount by which variable bounds are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), 2)
+0.0
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), "x10")
+0.0
+>>> c.solution.infeasibility.bound_constraints(c.solution.get_values(), ["x10", 8])
+[0.0, 0.0]
+>>> bd = c.solution.infeasibility.bound_constraints(c.solution.get_values())
+>>> bd[15]
+0.0
+
+
+
+ +
+
+linear_constraints(x, *args)[source]
+

Returns the amount by which a set of linear constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> sol_vals = c.solution.get_values()
+>>> getrowinfeas = c.solution.infeasibility.linear_constraints
+>>> abs(getrowinfeas(sol_vals, "c10"))
+0.0
+>>> abs(getrowinfeas(sol_vals, 7))
+0.0
+>>> [abs(x) for x in getrowinfeas(sol_vals, ["c13", 4])]
+[0.0, 0.0]
+>>> lconstraint = getrowinfeas(sol_vals)
+>>> abs(lconstraint[5])
+0.0
+
+
+
+ +
+
+quadratic_constraints(x, *args)[source]
+

Returns the amount by which a set of quadratic constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> getqconstrinfeas = c.solution.infeasibility.quadratic_constraints
+>>> abs(getqconstrinfeas(c.solution.get_values(), 2)) < 1e-6
+True
+>>> abs(getqconstrinfeas(c.solution.get_values(), "QC3")) < 1e-6
+True
+>>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values(), [1, "QC1"])]
+[True, True]
+>>> [abs(x) < 1e-6 for x in getqconstrinfeas(c.solution.get_values())]
+[True, True, True, True]
+
+
+
+ +
+
+indicator_constraints(x, *args)[source]
+

Returns the amount by which indicator constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), 3)
+0.0
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), "c21")
+0.0
+>>> c.solution.infeasibility.indicator_constraints(c.solution.get_values(), ["c21", 10])
+[0.0, 0.0]
+>>> iconstraint = c.solution.infeasibility.indicator_constraints(c.solution.get_values())
+>>> iconstraint[5]
+0.0
+
+
+
+ +
+
+SOS_constraints(x, *args)[source]
+

Returns the amount by which SOS constraints are violated by x.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), 0)
+0.0
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), "set1")
+0.0
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values(), ["set1", 0])
+[0.0, 0.0]
+>>> c.solution.infeasibility.SOS_constraints(c.solution.get_values())
+[0.0]
+
+
+
+ +
+ +
+
+class CutType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.CutType
+ + + +

Identifiers for types of cuts.

+
+
+cover = 0
+
+ +
+
+GUB_cover = 1
+
+ +
+
+flow_cover = 2
+
+ +
+
+clique = 3
+
+ +
+
+fractional = 4
+
+ +
+
+MIR = 5
+
+ +
+
+flow_path = 6
+
+ +
+
+disjunctive = 7
+
+ +
+
+implied_bound = 8
+
+ +
+
+zero_half = 9
+
+ +
+
+multi_commodity_flow = 10
+
+ +
+
+lift_and_project = 14
+
+ +
+
+user = 15
+
+ +
+
+table = 16
+
+ +
+
+solution_pool = 17
+
+ +
+
+local_implied_bound = 18
+
+ +
+
+BQP = 19
+
+ +
+
+RLT = 20
+
+ +
+
+benders = 21
+
+ +
+ +
+
+class MIPSolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.MIPSolutionInterface
+ + + +

Methods for accessing solutions to a MIP.

+
+
+cut_type = <cplex._internal._subinterfaces.CutType object>
+

See CutType()

+
+ +
+
+__init__(parent)[source]
+

Creates a new MIPSolutionInterface.

+

The MIP solution interface is exposed by the top-level Cplex +class as Cplex.solution.MIP. This constructor is not meant to +be used externally.

+
+ +
+
+get_best_objective()[source]
+

Returns the currently best known bound of all the remaining +open nodes in a branch-and-cut tree.

+

It is computed for a minimization problem as the minimum +objective function value of all remaining unexplored nodes. +Similarly, it is computed for a maximization problem as the +maximum objective function value of all remaining unexplored +nodes.

+

For a regular MIP optimization, this value is also the best known +bound on the optimal solution value of the MIP problem. In fact, +when a problem has been solved to optimality, this value matches +the optimal solution value.

+

However, for the populate method, the value can also exceed the +optimal solution value if CPLEX has already solved the model to +optimality but continues to search for additional solutions.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> best_obj = c.solution.MIP.get_best_objective()
+>>> abs(best_obj - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_cutoff()[source]
+

Returns the MIP cutoff value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> cutoff = c.solution.MIP.get_cutoff()
+>>> abs(cutoff - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_mip_relative_gap()[source]
+

Returns the MIP relative gap.

+

See CPXgetmiprelgap in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.MIP.get_mip_relative_gap()
+0.0
+
+
+
+ +
+
+get_incumbent_node()[source]
+

Returns the node number of the best solution found.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.threads.set(1)
+>>> c.solve()
+>>> c.solution.MIP.get_incumbent_node() >= 0
+True
+
+
+
+ +
+
+get_num_cuts(cut_type)[source]
+

Returns the number of cuts of the specified type.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> ncuts = c.solution.MIP.get_num_cuts(
+...     c.solution.MIP.cut_type.zero_half)
+
+
+
+ +
+
+get_subproblem_status()[source]
+

Returns the solution status of the last subproblem optimization.

+

Returns an attribute of Cplex.solution.status if there was an +error termination where a subproblem could not be solved to +completion during mixed integer optimization. Otherwise 0 +(zero) is returned if no error occurred.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.MIP.get_subproblem_status()
+0
+
+
+
+ +
+ +
+
+class BasisVarStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.BasisVarStatus
+ + + +

Status values returned by basis query methods.

+
+
+at_lower_bound = 0
+
+ +
+
+basic = 1
+
+ +
+
+at_upper_bound = 2
+
+ +
+
+free_nonbasic = 3
+
+ +
+ +
+
+class BasisInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.BasisInterface
+ + + +

Methods for accessing the basis of a solution.

+
+
+status = <cplex._internal._subinterfaces.BasisVarStatus object>
+

See BasisVarStatus()

+
+ +
+
+__init__(parent)[source]
+

Creates a new BasisInterface.

+

The basis interface is exposed by the top-level Cplex class as +Cplex.solution.basis. This constructor is not meant to be used +externally.

+
+ +
+
+get_basis()[source]
+

Returns the status of structural and slack variables.

+

Returns a pair of lists of attributes of solution.basis.status. +The first lists the status of the structural variables (of length +equal to the number of variables), the second lists the status of +the slack variables (of length equal to the number of linear +constraints).

+

See CPXgetbase in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> pair_of_lists = c.solution.basis.get_basis()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the basis to a file.

+

See CPXmbasewrite in the Callable Library Reference +Manual and also InitialInterface.read_basis().

+

Example:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.basis.write("lpex.bas")
+
+
+
+ +
+
+get_header()[source]
+

Returns the basis header.

+

Returns a pair (head, x), where head is a list of variable +indices and x is a list of floats indicating the values of +those variables. Indices of basic slacks are specified by +-rowindex - 1.

+
+ +
+
+get_basic_row_index(row)[source]
+

Returns the position of a basic slack variable in the basis header.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.basis.get_basic_row_index(2)
+3
+
+
+
+ +
+
+get_basic_col_index(col)[source]
+

Returns the position of a basic structural variable in the basis header.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.basis.get_basic_col_index(2)
+1
+
+
+
+ +
+
+get_primal_norms()[source]
+

Returns norms from the primal steepest edge.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.parameters.simplex.pgradient.set(c.parameters.simplex.pgradient.values.steep)
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal)
+>>> c.solve()
+>>> pnorm = c.solution.basis.get_primal_norms()
+>>> for i, j in zip(pnorm[1], [1.722656, 1.691406, 2.0, 1.062499]):
+...     abs(i - j) < 1e-6
+...
+True
+True
+True
+True
+
+
+
+ +
+
+get_dual_norms()[source]
+

Returns norms from the dual steepest edge.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.solve()
+>>> c.solution.basis.get_dual_norms()
+([1.0, 1.0, 1.0, 1.0], [1, 2, 3, -3])
+
+
+
+ +
+
+get_basis_dual_norms()[source]
+

Returns basis and dual norms.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.solve()
+>>> c.solution.basis.get_basis_dual_norms()
+([2, 1, 1, 1], [0, 0, 1, 0], [1.0, 1.0, 1.0, 1.0])
+
+
+
+ +
+
+get_num_primal_superbasic()[source]
+

Returns the number of primal superbasic variables.

+
+ +
+
+get_num_dual_superbasic()[source]
+

Returns the number of primal superbasic variables.

+
+ +
+ +
+
+class SensitivityInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SensitivityInterface
+ + + +

Methods for sensitivity analysis.

+
+
+__init__(parent)[source]
+

Creates a new SensitivityInterface.

+

The sensitivity interface is exposed by the top-level Cplex +class as Cplex.solution.sensitivity. This constructor is not +meant to be used externally.

+
+ +
+
+lower_bounds(*args)[source]
+

Returns the sensitivity of a set of lower bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.lower_bounds(1)
+(-1e+20, 17.5)
+>>> c.solution.sensitivity.lower_bounds('x3')
+(-1e+20, 42.5)
+>>> c.solution.sensitivity.lower_bounds(["x3", 0])
+[(-1e+20, 42.5), (-1e+20, 40.0)]
+>>> c.solution.sensitivity.lower_bounds()
+[(-1e+20, 40.0), (-1e+20, 17.5), (-1e+20, 42.5), (-1e+20, 0.625)]
+
+
+
+ +
+
+upper_bounds(*args)[source]
+

Returns the sensitivity of a set of upper bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.upper_bounds(1)
+(17.5, 1e+20)
+>>> c.solution.sensitivity.upper_bounds("x3")
+(42.5, 1e+20)
+>>> bupper = c.solution.sensitivity.upper_bounds(["x3", 0])
+>>> for i, j in zip(bupper, [(42.5, 1e+20), (36.428571, 155.0)]):
+...     abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6
+...
+True
+True
+>>> bupper = c.solution.sensitivity.upper_bounds()
+>>> for i, j in zip(bupper[3], (0.625, 1e+20)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+
+bounds(*args)[source]
+

Returns the sensitivity of a set of both lower and upper bounds.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.bounds(1)
+(-1e+20, 17.5, 17.5, 1e+20)
+>>> c.solution.sensitivity.bounds("x3")
+(-1e+20, 42.5, 42.5, 1e+20)
+>>> c.solution.sensitivity.bounds(["x3", 1])
+[(-1e+20, 42.5, 42.5, 1e+20), (-1e+20, 17.5, 17.5, 1e+20)]
+>>> bd = c.solution.sensitivity.bounds()
+>>> bd[1]
+(-1e+20, 17.5, 17.5, 1e+20)
+
+
+
+ +
+
+objective(*args)[source]
+

Returns the sensitivity of part of the objective function.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.sensitivity.objective(1)
+(-3.0, 5.0)
+>>> c.solution.sensitivity.objective("x3")
+(-1e+20, -2.0)
+>>> c.solution.sensitivity.objective(["x3", 1])
+[(-1e+20, -2.0), (-3.0, 5.0)]
+>>> c.solution.sensitivity.objective()
+[(-1e+20, 2.5), (-3.0, 5.0), (-1e+20, -2.0), (0.0, 4.0)]
+
+
+
+ +
+
+rhs(*args)[source]
+

Returns the sensitivity of the righthand side of a set of linear constraints.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> rhssa = c.solution.sensitivity.rhs(1)
+>>> for i, j in zip(rhssa, (20.0, 46.666666)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+>>> c.solution.sensitivity.rhs("c3")
+(-1e+20, 112.5)
+>>> rhssa = c.solution.sensitivity.rhs(["c3", 1])
+>>> for i, j in zip(rhssa, [(-1e+20, 112.5), (20.0, 46.666666)]):
+...     abs(i[0] - j[0]) < 1e-6 and abs(i[1]- j[1]) < 1e-6
+...
+True
+True
+>>> rhssa = c.solution.sensitivity.rhs()
+>>> for i, j in zip(rhssa[3], (-1e+20, 42.5)):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+ +
+
+class FilterType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.FilterType
+ + + +

Attributes define the filter types.

+
+
+diversity = 1
+
+ +
+
+range = 2
+
+ +
+ +
+
+class SolnPoolFilterInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolnPoolFilterInterface
+ + + +

Methods for solution pool filters.

+
+
+type = <cplex._internal._subinterfaces.FilterType object>
+

See FilterType()

+
+ +
+
+__init__(parent)[source]
+

Creates a new SolnPoolFilterInterface.

+

The solution pool filter interface is exposed by the top-level +Cplex class as Cplex.solution.pool.filter. This constructor +is not meant to be used externally.

+
+ +
+
+add_diversity_filter(lb, ub, expression, weights=None, name='')[source]
+

Adds a diversity filter to the solution pool.

+

The arguments determine, in order,

+

the lower bound (float)

+

the upper bound (float)

+

the variables and values it takes as either a SparsePair or a +list of two lists.

+

a set of weights (a list of floats with the same length as +expression). If an empty list is given, then weights of 1.0 +(one) will be used.

+

name (string)

+

Returns the index of the added diversity filter.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_diversity_filter(
+...     300, 600, [['x1','x2'], [1,1]], [2,1], "")
+0
+
+
+
+ +
+
+add_range_filter(lb, ub, expression, name='')[source]
+

Adds a range filter to the solution pool.

+

The arguments determine, in order,

+

the lower bound (float)

+

the upper bound (float)

+

the variables and values it takes as either a SparsePair or a +list of two lists.

+

name (string)

+

Returns the index of the added range filter.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+
+
+
+ +
+
+get_diversity_filters(*args)[source]
+

Returns a set of diversity filters.

+

Returns filters as pairs of (SparsePair, weights), where +weights is a list of floats.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["BB"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], str(i))
+...  for i in range(2)]
+[0, 1]
+>>> c.solution.pool.filter.get_diversity_filters(0)
+(SparsePair(ind = [0], val = [1.0]), [1.0])
+>>> c.solution.pool.filter.get_diversity_filters("1")
+(SparsePair(ind = [0], val = [1.0]), [1.0])
+>>> c.solution.pool.filter.get_diversity_filters([0, "1"])
+[(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])]
+>>> c.solution.pool.filter.get_diversity_filters()
+[(SparsePair(ind = [0], val = [1.0]), [1.0]), (SparsePair(ind = [0], val = [1.0]), [1.0])]
+
+
+
+ +
+
+get_range_filters(*args)[source]
+

Returns a set of range filters.

+

Returns filters as SparsePair instances.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(2)]
+[0, 1]
+>>> c.solution.pool.filter.get_range_filters(0)
+SparsePair(ind = [0], val = [1.0])
+>>> c.solution.pool.filter.get_range_filters("1")
+SparsePair(ind = [0], val = [1.0])
+>>> c.solution.pool.filter.get_range_filters([0, "1"])
+[SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])]
+>>> c.solution.pool.filter.get_range_filters()
+[SparsePair(ind = [0], val = [1.0]), SparsePair(ind = [0], val = [1.0])]
+
+
+
+ +
+
+get_bounds(*args)[source]
+

Returns (lb, ub) pairs for a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["BB"])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], "div{0}".format(i)) for i in range(2)]
+[0, 1]
+>>> [c.solution.pool.filter.add_range_filter(
+...      0, 1, f, "rng{0}".format(i)) for i in range(2)]
+[2, 3]
+>>> c.solution.pool.filter.get_bounds(0)
+(0.0, 1.0)
+>>> c.solution.pool.filter.get_bounds("rng0")
+(0.0, 1.0)
+>>> c.solution.pool.filter.get_bounds(["div0", 2])
+[(0.0, 1.0), (0.0, 1.0)]
+>>> c.solution.pool.filter.get_bounds()
+[(0.0, 1.0), (0.0, 1.0), (0.0, 1.0), (0.0, 1.0)]
+
+
+
+ +
+
+get_num_nonzeros(*args)[source]
+

Returns the number of variables specified by a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=["BB"])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_diversity_filter(
+...      0, 1, f, [1], "div{0}".format(i)) for i in range(2)]
+[0, 1]
+>>> [c.solution.pool.filter.add_range_filter(
+...      0, 1, f, "rng{0}".format(i)) for i in range(2)]
+[2, 3]
+>>> c.solution.pool.filter.get_num_nonzeros(0)
+1
+>>> c.solution.pool.filter.get_num_nonzeros("rng0")
+1
+>>> c.solution.pool.filter.get_num_nonzeros(["div0", 2])
+[1, 1]
+>>> c.solution.pool.filter.get_num_nonzeros()
+[1, 1, 1, 1]
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes filters from the problem.

+

There are four forms by which filters.delete may be called.

+
+
filters.delete()

deletes all filters from the problem.

+
+
filters.delete(i)

i must be a filter name or index. Deletes the filter whose +index or name is i.

+
+
filters.delete(s)

s must be a sequence of filter names or indices. Deletes +the filters with names or indices contained within s. +Equivalent to [filters.delete(i) for i in s].

+
+
filters.delete(begin, end)

begin and end must be filter indices or filter names. Deletes +the filters with indices between begin and end, inclusive of +end. Equivalent to filters.delete(range(begin, end + 1)). This +will give the best performance when deleting batches of +filters.

+
+
+

See CPXdelsolnpoolfilters in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x', 'y'], types=['II'])
+>>> f = cplex.SparsePair(ind=['x'], val=[1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_num()
+10
+>>> c.solution.pool.filter.delete(8)
+>>> c.solution.pool.filter.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '9']
+>>> c.solution.pool.filter.delete('1', 3)
+>>> c.solution.pool.filter.get_names()
+['0', '4', '5', '6', '7', '9']
+>>> c.solution.pool.filter.delete([2, '0', 5])
+>>> c.solution.pool.filter.get_names()
+['4', '6', '7']
+>>> c.solution.pool.filter.delete()
+>>> c.solution.pool.filter.get_names()
+[]
+
+
+
+ +
+
+get_types(*args)[source]
+

Returns the types of a set of filters.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_types(3)
+2
+>>> c.solution.pool.filter.get_types("5")
+2
+>>> c.solution.pool.filter.get_types([2, "8"])
+[2, 2]
+>>> c.solution.pool.filter.get_types()
+[2, 2, 2, 2, 2, 2, 2, 2, 2, 2]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of filters, given their indices.

+

There are four forms by which solution.pool.filter.get_names may be called.

+
+
solution.pool.filter.get_names()

return the names of all solution pool filters from the problem.

+
+
solution.pool.filter.get_names(i)

i must be a solution filter index. Returns the name of row i.

+
+
solution.pool.filter.get_names(s)

s must be a sequence of row indices. Returns the names of +the solution pool filters with indices the members of s. +Equivalent to [solution.pool.filter.get_names(i) for i in s]

+
+
solution.pool.filter.get_names(begin, end)

begin and end must be solution filter indices. Returns the +names of the solution pool filter with indices between begin +and end, inclusive of end. Equivalent to +solution.pool.filter.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = ['x','y'], types = ["II"])
+>>> f = cplex.SparsePair(ind = ['x'],val = [1.0])
+>>> [c.solution.pool.filter.add_range_filter(
+...      0.0, 1.0, f, str(i)) for i in range(10)]
+[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
+>>> c.solution.pool.filter.get_names()
+['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
+>>> c.solution.pool.filter.get_names(6)
+'6'
+>>> c.solution.pool.filter.get_names([5, 3])
+['5', '3']
+>>> c.solution.pool.filter.get_names(3, 5)
+['3', '4', '5']
+
+
+
+ +
+
+write(filename)[source]
+

Writes the filters to a file.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.write("ind.flt")
+
+
+
+ +
+
+read(filename)[source]
+

Reads filters from a file.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.write("ind.flt")
+>>> c.solution.pool.filter.read("ind.flt")
+
+
+
+ +
+
+get_num()[source]
+

Returns the number of filters in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.filter.add_range_filter(
+...     300, 600, [['x1','x2'], [1,1]], "")
+0
+>>> c.solution.pool.filter.get_num()
+1
+
+
+
+ +
+ +
+
+class QualityMetric[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.QualityMetric
+ + + +

Measures of solution quality.

+
+
+max_primal_infeasibility = 1
+
+ +
+
+max_scaled_primal_infeasibility = 2
+
+ +
+
+sum_primal_infeasibilities = 3
+
+ +
+
+sum_scaled_primal_infeasibilities = 4
+
+ +
+
+max_dual_infeasibility = 5
+
+ +
+
+max_scaled_dual_infeasibility = 6
+
+ +
+
+sum_dual_infeasibilities = 7
+
+ +
+
+sum_scaled_dual_infeasibilities = 8
+
+ +
+
+max_int_infeasibility = 9
+
+ +
+
+sum_integer_infeasibilities = 10
+
+ +
+
+max_primal_residual = 11
+
+ +
+
+max_scaled_primal_residual = 12
+
+ +
+
+sum_primal_residual = 13
+
+ +
+
+sum_scaled_primal_residual = 14
+
+ +
+
+max_dual_residual = 15
+
+ +
+
+max_scaled_dual_residual = 16
+
+ +
+
+sum_dual_residual = 17
+
+ +
+
+sum_scaled_dual_residual = 18
+
+ +
+
+max_comp_slack = 19
+
+ +
+
+sum_comp_slack = 21
+
+ +
+
+max_x = 23
+
+ +
+
+max_scaled_x = 24
+
+ +
+
+max_pi = 25
+
+ +
+
+max_scaled_pi = 26
+
+ +
+
+max_slack = 27
+
+ +
+
+max_scaled_slack = 28
+
+ +
+
+max_reduced_cost = 29
+
+ +
+
+max_scaled_reduced_cost = 30
+
+ +
+
+sum_x = 31
+
+ +
+
+sum_scaled_x = 32
+
+ +
+
+sum_pi = 33
+
+ +
+
+sum_scaled_pi = 34
+
+ +
+
+sum_slack = 35
+
+ +
+
+sum_scaled_slack = 36
+
+ +
+
+sum_reduced_cost = 37
+
+ +
+
+sum_scaled_reduced_cost = 38
+
+ +
+
+kappa = 39
+
+ +
+
+objective_gap = 40
+
+ +
+
+dual_objective = 41
+
+ +
+
+primal_objective = 42
+
+ +
+
+max_quadratic_primal_residual = 43
+
+ +
+
+sum_quadratic_primal_residual = 44
+
+ +
+
+max_quadratic_slack_infeasibility = 45
+
+ +
+
+sum_quadratic_slack_infeasibility = 46
+
+ +
+
+max_quadratic_slack = 47
+
+ +
+
+sum_quadratic_slack = 48
+
+ +
+
+max_indicator_slack_infeasibility = 49
+
+ +
+
+sum_indicator_slack_infeasibility = 50
+
+ +
+
+max_pwl_slack_infeasibility = 58
+
+ +
+
+sum_pwl_slack_infeasibility = 59
+
+ +
+
+exact_kappa = 51
+
+ +
+
+kappa_stable = 52
+
+ +
+
+kappa_suspicious = 53
+
+ +
+
+kappa_unstable = 54
+
+ +
+
+kappa_illposed = 55
+
+ +
+
+kappa_max = 56
+
+ +
+
+kappa_attention = 57
+
+ +
+ +
+
+class QualityMetrics[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._subinterfaces.QualityMetrics
+ + +

A class containing measures of the quality of a solution.

+

The __str__ method of this class prints all available measures of +the quality of the solution in human readable form.

+

This class may have a different set of data members depending on +the optimization algorithm used and the quality metrics that are +available.

+

An instance of this class always has the member quality_type, +which is one of the following strings:

+
+
    +
  • “feasopt”

  • +
  • “simplex”

  • +
  • “quadratically_constrained”

  • +
  • “barrier”

  • +
  • “MIP”

  • +
+
+

If self.quality_type is “feasopt” this instance has the following +members:

+
+
    +
  • scaled

  • +
  • max_x

  • +
  • max_bound_infeas

  • +
  • max_Ax_minus_b

  • +
  • max_slack

  • +
+
+

If self.scaled is 1, this instance also has the members:

+
+
    +
  • max_scaled_x

  • +
  • max_scaled_bound_infeas

  • +
  • max_scaled_Ax_minus_b

  • +
  • max_scaled_slack

  • +
+
+

If self.quality_type is “simplex” this instance has the following +members:

+
+
    +
  • scaled

  • +
  • max_x

  • +
  • max_pi

  • +
  • max_reduced_cost

  • +
  • max_bound_infeas

  • +
  • max_reduced_cost_infeas

  • +
  • max_Ax_minus_b

  • +
  • max_c_minus_Bpi

  • +
  • max_slack

  • +
+
+

If self.scaled is 1, this instance also has the members:

+
+
    +
  • max_scaled_x

  • +
  • max_scaled_pi

  • +
  • max_scaled_reduced_cost

  • +
  • max_scaled_bound_infeas

  • +
  • max_scaled_reduced_cost_infeas

  • +
  • max_scaled_Ax_minus_b

  • +
  • max_scaled_c_minus_Bpi

  • +
  • max_scaled_slack

  • +
+
+

If the condition number of the final basis is available, this +instance has the member:

+
+
    +
  • kappa

  • +
+
+

If self.quality_type is “quadratically_constrained” this instance +has the following members:

+
+
    +
  • objective

  • +
  • norm_total

  • +
  • norm_max

  • +
  • error_Ax_b_total

  • +
  • error_Ax_b_max

  • +
  • error_xQx_dx_f_total

  • +
  • error_xQx_dx_f_max

  • +
  • x_bound_error_total

  • +
  • x_bound_error_max

  • +
  • slack_bound_error_total

  • +
  • slack_bound_error_max

  • +
  • quadratic_slack_bound_error_total

  • +
  • quadratic_slack_bound_error_max

  • +
  • normalized_error_max

  • +
+
+

If self.quality_type is “barrier” this instance has the following +members:

+
+
    +
  • primal_objective

  • +
  • dual_objective

  • +
  • duality_gap

  • +
  • complementarity_total

  • +
  • column_complementarity_total

  • +
  • column_complementarity_max

  • +
  • row_complementarity_total

  • +
  • row_complementarity_max

  • +
  • primal_norm_total

  • +
  • primal_norm_max

  • +
  • dual_norm_total

  • +
  • dual_norm_max

  • +
  • primal_error_total

  • +
  • primal_error_max

  • +
  • dual_error_total

  • +
  • dual_error_max

  • +
  • primal_x_bound_error_total

  • +
  • primal_x_bound_error_max

  • +
  • primal_slack_bound_error_total

  • +
  • primal_slack_bound_error_max

  • +
  • dual_pi_bound_error_total

  • +
  • dual_pi_bound_error_max

  • +
  • dual_reduced_cost_bound_error_total

  • +
  • dual_reduced_cost_bound_error_max

  • +
  • primal_normalized_error

  • +
  • dual_normalized_error

  • +
+
+

If self.quality_type is “MIP” and this instance was generated for +a specific member of the solution pool, it has the members:

+
+
    +
  • solution_name

  • +
  • num_solutions

  • +
+
+

If self.quality_type is “MIP”, this instance was not generated for +a specific member of the solution pool, and kappa statistics are +available, it has the members:

+
+
    +
  • max_kappa

  • +
  • pct_kappa_stable

  • +
  • pct_kappa_suspicious

  • +
  • pct_kappa_unstable

  • +
  • pct_kappa_illposed

  • +
  • kappa_attention

  • +
+
+

If self.quality_type is “MIP” and this instance was generated for +the incumbent solution, it has the members:

+
+
    +
  • solver

  • +
  • objective

  • +
  • x_norm_total

  • +
  • x_norm_max

  • +
  • error_Ax_b_total

  • +
  • error_Ax_b_max

  • +
  • x_bound_error_total

  • +
  • x_bound_error_max

  • +
  • integrality_error_total

  • +
  • integrality_error_max

  • +
  • slack_bound_error_total

  • +
  • slack_bound_error_max

  • +
+
+

If in addition the problem this instance was generated for has +indicator constraints, it has the members:

+
+
    +
  • indicator_slack_bound_error_total

  • +
  • indicator_slack_bound_error_max

  • +
+
+

if in addition the problem this instance was generated for has +piecewise linear constraints, it has the members:

+
+
    +
  • piecewise_linear_error_total

  • +
  • piecewise_linear_error_max

  • +
+
+

If solver is “MIQCP” this instance also has the members:

+
+
    +
  • error_xQx_dx_f_total

  • +
  • error_xQx_dx_f_max

  • +
  • quadratic_slack_bound_error_total

  • +
  • quadratic_slack_bound_error_max

  • +
+
+

See also SolutionInterface.get_quality_metrics and +SolnPoolInterface.get_quality_metrics.

+
+
+__init__(c, soln=-1)[source]
+
+ +
+
+__str__()[source]
+

Returns a string containing quality metrics in human readable form.

+
+ +
+ +
+
+class SolnPoolInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolnPoolInterface
+ + + +

Methods for accessing the solution pool.

+
+
+incumbent = -1
+

See _constants.CPX_INCUMBENT_ID

+
+ +
+
+quality_metric = <cplex._internal._subinterfaces.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+__init__(parent)[source]
+

Creates a new SolnPoolInterface.

+

The solution pool interface is exposed by the top-level Cplex +class as Cplex.solution.pool. This constructor is not meant to +be used externally.

+
+ +
+
+filter
+

See SolnPoolFilterInterface()

+
+ +
+
+get_objective_value(soln)[source]
+

Returns the objective value for a member of the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> obj_val = c.solution.pool.get_objective_value(0)
+>>> abs(obj_val - 499.0) < 1e-6
+True
+
+
+
+ +
+
+get_values(soln, *args)[source]
+

Returns the values of a set of variables for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> v1 = c.solution.pool.get_values(1, 2)
+>>> v2 = c.solution.pool.get_values(1, "x2")
+>>> somevals = c.solution.pool.get_values(1, [2, "x2"])
+>>> v1 == somevals[0], v2 == somevals[1]
+(True, True)
+>>> allvals = c.solution.pool.get_values(1)
+>>> v1 == allvals[2]
+True
+
+
+
+ +
+
+get_linear_slacks(soln, *args)[source]
+

Returns a set of linear slacks for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> s1 = c.solution.pool.get_linear_slacks(1, 1)
+>>> s2 = c.solution.pool.get_linear_slacks(1, "c2")
+>>> someslacks = c.solution.pool.get_linear_slacks(1, [1, "c2"])
+>>> s1 == someslacks[0], s2 == someslacks[1]
+(True, True)
+>>> allslacks = c.solution.pool.get_linear_slacks(1)
+>>> s1 == allslacks[1]
+True
+
+
+
+ +
+
+get_quadratic_slacks(soln, *args)[source]
+

Returns a set of quadratic slacks for a given solution.

+

Can be called by four forms.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("miqcp.lp")
+>>> c.solve()
+>>> var = c.solution.pool.get_quadratic_slacks(1, 1)
+>>> var = c.solution.pool.get_quadratic_slacks(1, "QC3")
+>>> vars = c.solution.pool.get_quadratic_slacks(1, ["QC3", 1])
+>>> vars = c.solution.pool.get_quadratic_slacks(1)
+
+
+
+ +
+
+get_integer_quality(soln, which)[source]
+

Returns the integer quality of a given solution.

+

The integer quality of a solution can either be a single attribute of +solution.pool.quality_metrics or a sequence of such +attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetsolnpoolintquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> quality_metric = c.solution.pool.quality_metric
+>>> misi = quality_metric.max_indicator_slack_infeasibility
+>>> c.solution.pool.get_integer_quality(1, misi)
+0
+
+
+
+ +
+
+get_float_quality(soln, which)[source]
+

Returns the float quality of a given solution.

+

The float quality of a solution can either be a single attribute of +solution.pool.quality_metrics or a sequence of such +attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetsolnpooldblquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> qual = c.solution.pool.get_float_quality(1,
+                         c.solution.pool.quality_metric.max_indicator_slack_infeasibility)
+>>> abs(qual) < 1.e-6
+True
+
+
+
+ +
+
+get_mean_objective_value()[source]
+

Returns the average among the objective values in the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> mov = c.solution.pool.get_mean_objective_value()
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes solutions from the solution pool.

+

There are four forms by which pool.delete may be called.

+
+
pool.delete()

deletes all solutions from the problem.

+
+
pool.delete(i)

i must be a solution name or index. Deletes the solution +whose index or name is i.

+
+
pool.delete(s)

s must be a sequence of solution names or indices. Deletes +the solutions with names or indices contained within s. +Equivalent to [pool.delete(i) for i in s].

+
+
pool.delete(begin, end)

begin and end must be solution indices or solution names. +Deletes the solutions with indices between begin and end, +inclusive of end. Equivalent to +pool.delete(range(begin, end + 1)). This will give the best +performance when deleting batches of solutions from the +solution pool.

+
+
+

See CPXdelsolnpoolsolns in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(5)
+>>> c.populate_solution_pool()
+>>> names = c.solution.pool.get_names()
+>>> c.solution.pool.delete(1)
+>>> n = c.solution.pool.get_names()
+>>> del names[1]
+>>> n == names
+True
+>>> c.solution.pool.delete(names[1])
+>>> n = c.solution.pool.get_names()
+>>> names.remove(names[1])
+>>> n == names
+True
+>>> c.solution.pool.delete([names[1], 0])
+>>> n = c.solution.pool.get_names()
+>>> names.remove(names[1])
+>>> del names[0]
+>>> n == names
+True
+>>> c.solution.pool.delete()
+>>> c.solution.pool.get_names()
+[]
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of solutions.

+

There are four forms by which solution.pool.get_names may be called.

+
+
solution.pool.get_names()

return the names of all solutions from the problem.

+
+
solution.pool.get_names(i)

i must be a solution index. Returns the name of row i.

+
+
solution.pool.get_names(s)

s must be a sequence of row indices. Returns the names of +the solutions with indices the members of s. +Equivalent to [solution.pool.get_names(i) for i in s]

+
+
solution.pool.get_names(begin, end)

begin and end must be solution indices. Returns the names of +the solutions with indices between begin and end, inclusive of +end. Equivalent to +solution.pool.get_names(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(10)
+>>> c.populate_solution_pool()
+>>> names = c.solution.pool.get_names()
+>>> names[1] == c.solution.pool.get_names(1)
+True
+>>> [names[i] for i in [1,2]] == c.solution.pool.get_names([1,2])
+True
+>>> names[1:5] == c.solution.pool.get_names(1, 4)
+True
+
+
+
+ +
+
+get_num_replaced()[source]
+

Returns the number of solution pool members that have been replaced.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.pool.get_num_replaced()
+0
+
+
+
+ +
+
+get_num()[source]
+

Returns the number of solutions in the solution pool.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> num = c.solution.pool.get_num()
+
+
+
+ +
+
+write(filename, which=None)[source]
+

Writes solutions to a file.

+

If no second argument is provided, all solutions are written +to file.

+

If a second argument is provided, it is the index of a +solution in the solution pool. Only that solution will be +written to file.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.parameters.randomseed.set(1)
+>>> c.parameters.mip.limits.populate.set(10)
+>>> c.populate_solution_pool()
+>>> c.solution.pool.write("ind.sol",4)
+
+
+
+ +
+
+get_quality_metrics(soln)[source]
+

Returns an object containing measures of the quality of the +specified solution.

+

See QualityMetrics.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.randomseed.set(1)
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> qm = c.solution.pool.get_quality_metrics(0)
+
+
+
+ +
+ +
+
+class AdvancedSolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedSolutionInterface
+ + + +

Advanced methods for accessing solution information.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvcol = c.solution.advanced.binvcol()
+>>> binvrow = c.solution.advanced.binvrow()
+>>> binvacol = c.solution.advanced.binvacol()
+>>> binvarow = c.solution.advanced.binvarow()
+>>> binvcol[0][24], binvcol[1][6]
+(-0.215, 1.0)
+>>> binvrow[24][0], binvrow[6][1]
+(-0.215, 1.0)
+>>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)]
+([1.0, 0.0, 0.0], [0.0, 1.0, 0.0])
+>>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)]
+([1.0, 0.0], [0.0, 1.0], [0.0, 0.0])
+>>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num())
+>>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)]
+>>> [x if x else 0.0 for x in bbtran]
+[0.0, 2.0, 1.0]
+>>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num())
+>>> ftran[0]
+2.891
+
+
+
+
+__init__(parent)[source]
+

Creates a new AdvancedSolutionInterface.

+

The advanced solution interface is exposed by the top-level +Cplex class as Cplex.solution.advanced. This constructor is +not meant to be used externally.

+
+ +
+
+binvcol(*args)[source]
+

Returns a set of columns of the inverted basis matrix.

+

Can be called by four forms.

+
+
solution.advanced.binvcol()

returns the inverted basis matrix as a list of columns.

+
+
solution.advanced.binvcol(i)

i must be a linear constraint name or index. Returns the +column of the inverted basis matrix associated with i.

+
+
solution.advanced.binvcol(s)

s must be a sequence of linear constraint names or indices. +Returns the columns of the inverted basis matrix associated +with the members of s. Equivalent to +[solution.advanced.binvcol(i) for i in s]

+
+
solution.advanced.binvcol(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the columns of the inverted basis +matrix associated with the linear constraints between begin +and end, inclusive of end. Equivalent to +solution.advanced.binvcol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvcol = c.solution.advanced.binvcol()
+>>> binvcol[0][24], binvcol[1][6]
+(-0.215, 1.0)
+
+
+
+ +
+
+binvrow(*args)[source]
+

Returns a set of rows of the inverted basis matrix.

+

Can be called by four forms.

+
+
solution.advanced.binvrow()

returns the inverted basis matrix as a list of rows.

+
+
solution.advanced.binvrow(i)

i must be a linear constraint name or index. Returns the +row of the inverted basis matrix associated with i.

+
+
solution.advanced.binvrow(s)

s must be a sequence of linear constraint names or indices. +Returns the rows of the inverted basis matrix associated +with the members of s. Equivalent to +[solution.advanced.binvrow(i) for i in s]

+
+
solution.advanced.binvrow(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the rows of the inverted basis matrix +associated with the linear constraints between begin and end, +inclusive of end. Equivalent to +solution.advanced.binvrow(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvrow = c.solution.advanced.binvrow()
+>>> binvrow[24][0], binvrow[6][1]
+(-0.215, 1.0)
+
+
+
+ +
+
+binvacol(*args)[source]
+

Returns a set of columns of the tableau.

+

Can be called by four forms.

+
+
solution.advanced.binvacol()

returns the tableau as a list of columns.

+
+
solution.advanced.binvacol(i)

i must be a variable name or index. Returns the column of +the tableau associated with i.

+
+
solution.advanced.binvacol(s)

s must be a sequence of variable names or indices. Returns +the columns of the tableau associated with the members of s. +Equivalent to [solution.advanced.binvacol(i) for i in s]

+
+
solution.advanced.binvacol(begin, end)

begin and end must be variable indices or variable names. +Returns the columns of the tableau associated with the +variables between begin and end, inclusive of end. Equivalent +to solution.advanced.binvacol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvacol = c.solution.advanced.binvacol()
+>>> [x for i,x in enumerate(binvacol[0]) if i in range(0,3)], [x for i,x in enumerate(binvacol[1]) if i in range(0,3)]
+([1.0, 0.0, 0.0], [0.0, 1.0, 0.0])
+
+
+
+ +
+
+binvarow(*args)[source]
+

Returns a set of rows of the tableau.

+

Can be called by four forms.

+
+
solution.advanced.binvacol()

returns the tableau as a list of rows.

+
+
solution.advanced.binvacol(i)

i must be a linear constraint name or index. Returns the +row of the tableau associated with i.

+
+
solution.advanced.binvacol(s)

s must be a sequence of linear constraint names or indices. +Returns the rows of the tableau associated with the members +of s. Equivalent to [solution.advanced.binvacol(i) +for i in s]

+
+
solution.advanced.binvacol(begin, end)

begin and end must be linear constraint indices or variable +names. Returns the rows of the tableau associated with the +variables between begin and end, inclusive of end. Equivalent +to solution.advanced.binvacol(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> binvarow = c.solution.advanced.binvarow()
+>>> [x for i,x in enumerate(binvarow[0]) if i in range(0,2)], [x for i,x in enumerate(binvarow[1]) if i in range(0,2)], [x for i,x in enumerate(binvarow[2]) if i in range(0,2)]
+([1.0, 0.0], [0.0, 1.0], [0.0, 0.0])
+
+
+
+ +
+
+btran(y)[source]
+

Performs a backward linear solve using the basis matrix.

+

Returns the solution to the linear system

+

x^T B = y^T

+

y must be a list of floats with length equal to the number of +linear constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> btran = c.solution.advanced.btran([1.0] * c.linear_constraints.get_num())
+>>> bbtran = [x if x else 0.0 for i,x in enumerate(btran) if i in range(14,17)]
+>>> [x if x else 0.0 for x in bbtran]
+[0.0, 2.0, 1.0]
+
+
+
+ +
+
+ftran(x)[source]
+

Performs a linear solve using the basis matrix.

+

Returns the solution to the linear system

+

B x = y

+

y must be a list of floats with length equal to the number of +linear constraints.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> ftran = c.solution.advanced.ftran([1.0] * c.linear_constraints.get_num())
+>>> ftran[0]
+2.891
+
+
+
+ +
+
+get_gradients(*args)[source]
+

Returns information useful in post-solution analysis after an +LP has been solved and a basis is available.

+

See CPXgetgrad in the Callable Library Reference Manual +for more detail.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> grad = c.solution.advanced.get_gradients(1)
+>>> grad.ind[1]
+1
+>>> grad.val[1]
+1.0
+
+
+
+ +
+
+get_linear_slacks_from_x(x)[source]
+

Computes the slack values from the given solution x

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> slack = c.solution.advanced.get_linear_slacks_from_x(c.solution.get_values())
+>>> abs(slack[3]) < 1e-6
+True
+
+
+
+ +
+
+get_quadratic_slacks_from_x(x)[source]
+

Computes the slack values for quadratic constraints from the given solution x

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> qslack = c.solution.advanced.get_quadratic_slacks_from_x(c.solution.get_values())
+>>> abs(qslack[0]) < 1e-6
+True
+
+
+
+ +
+
+get_linear_reduced_costs_from_pi(pi)[source]
+

Computes the reduced costs from the given dual solution pi

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> reducedcost = c.solution.advanced.get_linear_reduced_costs_from_pi(
+                                                            c.solution.get_dual_values())
+>>> abs(reducedcost[0]) < 1e-6
+True
+
+
+
+ +
+
+get_quadratic_reduced_costs_from_pi(pi, x)[source]
+

Computes the reduced costs for QP from the given solution (pi, x)

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qp.lp")
+>>> c.solve()
+>>> qreducedcost = c.solution.advanced.get_quadratic_reduced_costs_from_pi(
+                                                            c.solution.get_dual_values(),
+                                                            c.solution.get_values())
+>>> abs(qreducedcost[0]) < 1e-6
+True
+
+
+
+ +
+
+get_Driebeek_penalties(basic_variables)[source]
+

Returns values known as Driebeek penalties for a sequence of basic variables.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c_stat, _ = c.solution.basis.get_basis()
+>>> b = [i for i, v in enumerate(c_stat) if v == c.solution.basis.status.basic]
+>>> penalties = c.solution.advanced.get_Driebeek_penalties(b)
+>>> penalties[0]
+(0.34477142857142856, 8.021494102228047)
+
+
+
+ +
+
+get_quadratic_indefinite_certificate()[source]
+

Compute a vector x that satisfies x’Qx < 0

+

Such a vector demonstrates that the matrix Q violates the +assumption of positive semi-definiteness, and can be an aid in +debugging a user’s program if indefiniteness is an unexpected +outcome.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("qpindef.lp")
+>>> x = c.solution.advanced.get_quadratic_indefinite_certificate()
+>>> abs(-0.5547001 - x[1]) < 1e-6
+True
+
+
+
+ +
+
+dual_farkas()[source]
+

Returns Farkas proof of infeasibility for the active LP model after proven infeasibility.

+

See CPXdualfarkas in the Callable Library Reference +Manual for more detail.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.linear_constraints.add(senses="L", rhs=[-1])
+>>> indices = c.variables.add(lb=[1], ub=[2],columns=[[[0],[1]]])
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> y = c.solution.advanced.dual_farkas()
+>>> y[1]
+2.0
+
+
+
+ +
+
+get_diverging_index()[source]
+

Returns the index of the diverging row or column

+

if the problem is not unbounded, get_diverging_index returns -1.

+

If the problem is unbounded, get_diverging_index returns the +index of the diverging variable in the augmented form of the +constraint matrix. In other words, if the diverging variable +is a structural variable, get_diverging_index returns its +index; if the diverging variable is a slack or ranged +variable, get_diverging_index returns the sum of the number of +structural variables and the index of the corresponding +constraint.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.variables.add(obj=[1,1],lb=[1,-cplex.infinity],ub=[2,cplex.infinity])
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.primal)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> idx = c.solution.advanced.get_diverging_index()
+>>> idx
+1
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> indices = c.variables.add(obj=[-1,-1],lb=[1,1],ub=[2,2])
+>>> indices = c.linear_constraints.add(lin_expr = [[[0,1],[-1,-1]]], rhs=[-10], senses="L")
+>>> c.parameters.lpmethod.set(c.parameters.lpmethod.values.dual)
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> idx = c.solution.advanced.get_diverging_index()
+>>> idx
+2
+
+
+
+ +
+
+get_ray()[source]
+

Returns an unbounded direction, i.e., ray, if a LP model is unbounded

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("unblp.lp")
+>>> c.parameters.preprocessing.presolve.set(c.parameters.preprocessing.presolve.values.off)
+>>> c.solve()
+>>> ray = c.solution.advanced.get_ray()
+>>> ray[0]
+-1.0
+
+
+
+ +
+ +
+
+class SolutionMethod[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionMethod
+ + + +

Solution methods.

+
+
+none = -1
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+feasopt = 11
+
+ +
+
+MIP = 12
+
+ +
+
+pivot = 10
+
+ +
+
+pivot_in = 8
+
+ +
+
+pivot_out = 9
+
+ +
+ +
+
+class SolutionStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionStatus
+ + + +

Solution status codes.

+

For documentation of each status code, see the reference manual +of the CPLEX Callable Library, especially the group +optim.cplex.callable.solutionstatus.

+
+
+unknown = 0
+
+ +
+
+optimal = 1
+
+ +
+
+unbounded = 2
+
+ +
+
+infeasible = 3
+
+ +
+
+feasible = 23
+
+ +
+
+infeasible_or_unbounded = 4
+
+ +
+
+optimal_infeasible = 5
+
+ +
+
+num_best = 6
+
+ +
+
+feasible_relaxed_sum = 14
+
+ +
+
+optimal_relaxed_sum = 15
+
+ +
+
+feasible_relaxed_inf = 16
+
+ +
+
+optimal_relaxed_inf = 17
+
+ +
+
+feasible_relaxed_quad = 18
+
+ +
+
+optimal_relaxed_quad = 19
+
+ +
+
+abort_obj_limit = 12
+
+ +
+
+abort_primal_obj_limit = 21
+
+ +
+
+abort_dual_obj_limit = 22
+
+ +
+
+first_order = 24
+
+ +
+
+abort_iteration_limit = 10
+
+ +
+
+abort_time_limit = 11
+
+ +
+
+abort_dettime_limit = 25
+
+ +
+
+abort_user = 13
+
+ +
+
+optimal_face_unbounded = 20
+
+ +
+
+conflict_feasible = 30
+
+ +
+
+conflict_minimal = 31
+
+ +
+
+conflict_abort_contradiction = 32
+
+ +
+
+conflict_abort_time_limit = 33
+
+ +
+
+conflict_abort_dettime_limit = 39
+
+ +
+
+conflict_abort_iteration_limit = 34
+
+ +
+
+conflict_abort_node_limit = 35
+
+ +
+
+conflict_abort_obj_limit = 36
+
+ +
+
+conflict_abort_memory_limit = 37
+
+ +
+
+conflict_abort_user = 38
+
+ +
+
+relaxation_unbounded = 133
+
+ +
+
+abort_relaxed = 126
+
+ +
+
+optimal_tolerance = 102
+
+ +
+
+solution_limit = 104
+
+ +
+
+populate_solution_limit = 128
+
+ +
+
+node_limit_feasible = 105
+
+ +
+
+node_limit_infeasible = 106
+
+ +
+
+fail_feasible = 109
+
+ +
+
+fail_infeasible = 110
+
+ +
+
+mem_limit_feasible = 111
+
+ +
+
+mem_limit_infeasible = 112
+
+ +
+
+fail_feasible_no_tree = 116
+
+ +
+
+fail_infeasible_no_tree = 117
+
+ +
+
+optimal_populated = 129
+
+ +
+
+optimal_populated_tolerance = 130
+
+ +
+
+benders_num_best = 41
+
+ +
+
+MIP_optimal = 101
+
+ +
+
+MIP_infeasible = 103
+
+ +
+
+MIP_time_limit_feasible = 107
+
+ +
+
+MIP_time_limit_infeasible = 108
+
+ +
+
+MIP_dettime_limit_feasible = 131
+
+ +
+
+MIP_dettime_limit_infeasible = 132
+
+ +
+
+MIP_abort_feasible = 113
+
+ +
+
+MIP_abort_infeasible = 114
+
+ +
+
+MIP_optimal_infeasible = 115
+
+ +
+
+MIP_unbounded = 118
+
+ +
+
+MIP_infeasible_or_unbounded = 119
+
+ +
+
+MIP_feasible_relaxed_sum = 120
+
+ +
+
+MIP_optimal_relaxed_sum = 121
+
+ +
+
+MIP_feasible_relaxed_inf = 122
+
+ +
+
+MIP_optimal_relaxed_inf = 123
+
+ +
+
+MIP_feasible_relaxed_quad = 124
+
+ +
+
+MIP_optimal_relaxed_quad = 125
+
+ +
+
+MIP_feasible = 127
+
+ +
+
+multiobj_optimal = 301
+
+ +
+
+multiobj_infeasible = 302
+
+ +
+
+multiobj_inforunbd = 303
+
+ +
+
+multiobj_non_optimal = 305
+
+ +
+
+multiobj_stopped = 306
+
+ +
+
+multiobj_unbounded = 304
+
+ +
+ +
+
+class SolutionType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionType
+ + + +

Solution types

+
+
+none = 0
+
+ +
+
+basic = 1
+
+ +
+
+nonbasic = 2
+
+ +
+
+primal = 3
+
+ +
+ +
+
+class SolutionInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.SolutionInterface
+ + + +

Methods for querying the solution to an optimization problem.

+
+
+method = <cplex._internal._subinterfaces.SolutionMethod object>
+

See SolutionMethod()

+
+ +
+
+quality_metric = <cplex._internal._subinterfaces.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See SolutionStatus()

+
+ +
+
+type = <cplex._internal._subinterfaces.SolutionType object>
+

See SolutionType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new SolutionInterface.

+

The solution interface is exposed by the top-level Cplex class +as Cplex.solution. This constructor is not meant to be used +externally.

+
+ +
+
+progress
+

See ProgressInterface()

+
+ +
+
+infeasibility
+

See InfeasibilityInterface()

+
+ +
+
+MIP
+

See MIPSolutionInterface()

+
+ +
+
+basis
+

See BasisInterface()

+
+ +
+
+sensitivity
+

See SensitivityInterface()

+
+ +
+
+pool
+

See SolnPoolInterface()

+
+ +
+
+advanced
+

See AdvancedSolutionInterface()

+
+ +
+
+multiobj
+

See MultiObjSolnInterface()

+
+ +
+
+get_status()[source]
+

Returns the status of the solution.

+

Returns an attribute of Cplex.solution.status. +For interpretations of the status codes, see the +reference manual of the CPLEX Callable Library, +especially the group optim.cplex.callable.solutionstatus

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_status()
+1
+
+
+
+ +
+
+get_method()[source]
+

Returns the method used to solve the problem.

+

Returns an attribute of Cplex.solution.method.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_method()
+2
+
+
+
+ +
+
+get_status_string(status_code=None)[source]
+

Returns a string describing the status of the solution.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_status_string()
+'optimal'
+
+
+
+ +
+
+get_objective_value()[source]
+

Returns the value of the objective function.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.solve()
+>>> c.solution.get_objective_value()
+-202.5
+
+
+
+ +
+
+get_values(*args)[source]
+

Returns the values of a set of variables at the solution.

+

Can be called by four forms.

+
+
solution.get_values()

return the values of all variables from the problem.

+
+
solution.get_values(i)

i must be a variable name or index. Returns the value of +the variable whose index or name is i.

+
+
solution.get_values(s)

s must be a sequence of variable names or indices. Returns +the values of the variables with indices the members of s. +Equivalent to [solution.get_values(i) for i in s]

+
+
solution.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns the values of the variables with indices between begin +and end, inclusive of end. Equivalent to +solution.get_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_values([0, 4, 5])
+[25.5, 0.0, 80.0]
+
+
+
+ +
+
+get_reduced_costs(*args)[source]
+

Returns the reduced costs of a set of variables.

+

The values returned by this method are defined to be the dual +multipliers for bound constraints on the specified variables.

+

Can be called by four forms.

+
+
solution.get_reduced_costs()

return the reduced costs of all variables from the problem.

+
+
solution.get_reduced_costs(i)

i must be a variable name or index. Returns the reduced +cost of the variable whose index or name is i.

+
+
solution.get_reduced_costs(s)

s must be a sequence of variable names or indices. Returns +the reduced costs of the variables with indices the members +of s. Equivalent to [solution.get_reduced_costs(i) for i +in s]

+
+
solution.get_reduced_costs(begin, end)

begin and end must be variable indices or variable names. +Returns the reduced costs of the variables with indices between +begin and end, inclusive of end. Equivalent to +solution.get_reduced_costs(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_reduced_costs([0, 4, 5])
+[0.0, 10.0, 0.0]
+
+
+
+ +
+
+get_dual_values(*args)[source]
+

Returns a set of dual values.

+

Note that the values returned by this function are not only +meaningful for linear programs. Also for second order cone +programs, they provide information about the dual solution. +Refer to the user manual to see how to use the values returned by +this function for second order cone programs.

+

Can be called by four forms.

+
+
solution.get_dual_values()

return all dual values from the problem.

+
+
solution.get_dual_values(i)

i must be a linear constraint name or index. Returns the +dual value associated with the linear constraint whose +index or name is i.

+
+
solution.get_dual_values(s)

s must be a sequence of linear constraint names or indices. +Returns the dual values associated with the linear +constraints with indices the members of s. Equivalent to +[solution.get_dual_values(i) for i in s]

+
+
solution.get_dual_values(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the dual values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_dual_values(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> pi = c.solution.get_dual_values([0, 1])
+>>> for i, j in zip(pi, [-0.628571, 0.0]):
+...     abs(i - j) < 1e-6
+...
+True
+True
+
+
+
+ +
+
+get_quadratic_dualslack(*args)[source]
+

Returns the dual slack for a quadratic constraint.

+

The function returns the dual slack vector of its arguments as a +SparsePair. +The function argument may be either the index or the name of a +quadratic constraint.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks.

+

Can be called by four forms.

+
+
solution.get_linear_slacks()

return all linear slack values from the problem.

+
+
solution.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
solution.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[solution.get_linear_slacks(i) for i in s]

+
+
solution.get_linear_slacks(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_linear_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> abs(c.solution.get_linear_slacks(5)) < 1e-6
+True
+
+
+
+ +
+
+get_indicator_slacks(*args)[source]
+

Returns a set of indicator slacks.

+

Can be called by four forms.

+
+
solution.get_indicator_slacks()

return all indicator slack values from the problem.

+
+
solution.get_indicator_slacks(i)

i must be a indicator constraint name or index. Returns +the slack values associated with the indicator constraint +whose index or name is i.

+
+
solution.get_indicator_slacks(s)

s must be a sequence of indicator constraint names or +indices. Returns the slack values associated with the +indicator constraints with indices the members of s. +Equivalent to [solution.get_indicator_slacks(i) for i in s]

+
+
solution.get_indicator_slacks(begin, end)

begin and end must be indicator constraint indices or indicator +constraint names. Returns the slack values associated with the +indicator constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_indicator_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("ind.lp")
+>>> c.solve()
+>>> c.solution.get_indicator_slacks([0, 18])
+[1e+20, 0.0]
+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks.

+

Can be called by four forms.

+
+
solution.get_quadratic_slacks()

return all quadratic slack values from the problem.

+
+
solution.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
solution.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [solution.get_quadratic_slacks(i) for i in s]

+
+
solution.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +solution.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> slack = c.solution.get_quadratic_slacks(0)
+>>> abs(slack) < 1e-6
+True
+
+
+
+ +
+
+get_integer_quality(which)[source]
+

Returns a measure of the quality of the solution.

+

The measure of the quality of a solution can be a single attribute of +solution.quality_metrics or a sequence of such +attributes.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> m = c.solution.quality_metric
+>>> c.solution.get_integer_quality([m.max_x, m.max_dual_infeasibility])
+[18, -1]
+
+
+
+ +
+
+get_float_quality(which)[source]
+

Returns a measure of the quality of the solution.

+

The measure of the quality of a solution can be a single attribute of +solution.quality_metrics or a sequence of such attributes.

+
+
Note

This corresponds to the CPLEX callable library function +CPXgetdblquality.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> m = c.solution.quality_metric
+>>> c.solution.get_float_quality([m.max_x, m.max_dual_infeasibility])
+[500.0, 0.0]
+
+
+
+ +
+
+get_solution_type()[source]
+

Returns the type of the solution.

+

Returns an attribute of Cplex.solution.type.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_solution_type()
+1
+
+
+
+ +
+
+is_primal_feasible()[source]
+

Returns whether or not the solution is known to be primal feasible.

+
+
Note

Returning False does not necessarily mean that the problem is +not primal feasible, only that it is not proved to be primal +feasible.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.is_primal_feasible()
+True
+
+
+
+ +
+
+is_dual_feasible()[source]
+

Returns whether or not the solution is known to be dual feasible.

+
+
Note

Returning False does not necessarily mean that the problem is +not dual feasible, only that it is not proved to be dual +feasible.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.is_dual_feasible()
+True
+
+
+
+ +
+
+get_activity_levels(*args)[source]
+

Returns the activity levels for set of linear constraints.

+

Can be called by four forms.

+
+
solution.get_activity_levels()

return the activity levels for all linear constraints from +the problem.

+
+
solution.get_activity_levels(i)

i must be a linear constraint name or index. Returns the +activity levels for the linear constraint whose index or +name is i.

+
+
solution.get_activity_levels(s)

s must be a sequence of linear constraint names or indices. +Returns the activity levels for the linear constraints with +indices the members of s. Equivalent to +[solution.get_activity_levels(i) for i in s]

+
+
solution.get_activity_levels(begin, end)

begin and end must be linear constraint indices or linear +constraint names. Returns the activity levels for the linear +constraints with indices between begin and end, inclusive of +end. Equivalent to +solution.get_activity_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.get_activity_levels([2, 3, 12])
+[80.0, 0.0, 500.0]
+
+
+
+ +
+
+get_quadratic_activity_levels(*args)[source]
+

Returns the activity levels for set of quadratic constraints.

+

Can be called by four forms.

+
+
solution.get_quadratic_activity_levels()

return the activity levels for all quadratic constraints +from the problem.

+
+
solution.get_quadratic_activity_levels(i)

i must be a quadratic constraint name or index. Returns +the activity levels for the quadratic constraint whose +index or name is i.

+
+
solution.get_quadratic_activity_levels(s)

s must be a sequence of quadratic constraint names or +indices. Returns the activity levels for the quadratic +constraints with indices the members of s. Equivalent to +[solution.get_quadratic_activity_levels(i) for i in s]

+
+
solution.get_quadratic_activity_levels(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the activity levels for the quadratic +constraints with indices between begin and end, inclusive of +end. Equivalent to +solution.get_quadratic_activity_levels(range(begin, end + 1)).

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("qcp.lp")
+>>> c.solve()
+>>> xqxax = c.solution.get_quadratic_activity_levels()
+>>> abs(xqxax[0] - 2.015616) < 1e-6
+True
+
+
+
+ +
+
+get_quality_metrics()[source]
+

Returns an object containing measures of the solution quality.

+

See QualityMetrics.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> qm = c.solution.get_quality_metrics()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the incumbent solution to a file.

+

See CPXsolwrite in the Callable Library Reference +Manual and also InitialInterface.read_start().

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> c.solution.write("lpex.sol")
+
+
+
+ +
+ +
+
+class PresolveStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveStatus
+ + + +

Presolve status codes

+
+
+no_reductions = 0
+
+ +
+
+has_problem = 1
+
+ +
+
+empty_problem = 2
+
+ +
+ +
+
+class PresolveMethod[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveMethod
+ + + +

Presolve solution methods

+
+
+none = -1
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+ +
+
+class PresolveColStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveColStatus
+ + + +

Presolve variable status codes

+
+
+lower_bound = -1
+
+ +
+
+upper_bound = -2
+
+ +
+
+fixed = -3
+
+ +
+
+aggregated = -4
+
+ +
+
+other = -5
+
+ +
+ +
+
+class PresolveRowStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveRowStatus
+ + + +

Presolve linear constraint status codes

+
+
+reduced = -1
+
+ +
+
+aggregated = -2
+
+ +
+
+other = -3
+
+ +
+ +
+
+class PresolveInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.PresolveInterface
+ + + +

Methods for dealing with the presolved problem.

+
+
+status = <cplex._internal._subinterfaces.PresolveStatus object>
+

See PresolveStatus()

+
+ +
+
+method = <cplex._internal._subinterfaces.PresolveMethod object>
+

See PresolveMethod()

+
+ +
+
+col_status = <cplex._internal._subinterfaces.PresolveColStatus object>
+

See PresolveColStatus()

+
+ +
+
+row_status = <cplex._internal._subinterfaces.PresolveRowStatus object>
+

See PresolveRowStatus()

+
+ +
+
+crush_formula(formula)[source]
+

Crushes a linear formula down into the presolved space.

+

formula may either be an instance of the SparsePair class or a +sequence of length two, the first entry of which contains +variable names or indices, the second entry of which contains +the float values associated with those variables.

+

Returns a (crushed_formula, offset) pair, where +crushed_formula is a SparsePair object containing the crushed +formula in terms of the presolved variables and offset is the +value of the linear formula corresponding to variables that +have been removed in the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2))
+(SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0)
+
+
+
+ +
+
+crush_x(x)[source]
+

Projects a primal solution down to the presolved space.

+

x must be a list of floats with length equal to the number of +variables in the original problem. Returns a list of floats +with length equal to the number of variables in the presolved +problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_x([1.0] * 4)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+crush_pi(pi)[source]
+

Projects a dual solution down to the presolved space.

+

pi must be a list of floats with length equal to the number of +linear constraints in the original problem. Returns a list of +floats with length equal to the number of linear constraints +in the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.crush_pi([1.0] * 4)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+uncrush_formula(pre_formula)[source]
+

Uncrushes a linear formula up from the presolved space.

+

formula may either be an instance of the SparsePair class or a +sequence of length two, the first entry of which contains +variable names or indices, the second entry of which contains +the float values associated with those variables.

+

Returns a (formula, offset) pair, where formula is a +SparsePair object containing the formula in terms of variables +in the original problem and offset is the value of the linear +formula corresponding to variables that have been removed in +the presolved problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_formula(cplex.SparsePair(ind = [1, 2], val = [1.0] * 2))
+(SparsePair(ind = [1, 2], val = [1.0, 1.0]), 0.0)
+
+
+
+ +
+
+uncrush_x(pre_x)[source]
+

Projects a primal presolved solution up to the original space.

+

x must be a list of floats with length equal to the number of +variables in the presolved problem. Returns a list of floats +with length equal to the number of variables in the original +problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_x([1.0] * 3)
+[1.0, 1.0, 1.0, 0.0]
+
+
+
+ +
+
+uncrush_pi(pre_pi)[source]
+

Projects a dual presolved solution up to the presolved space.

+

pi must be a list of floats with length equal to the number of +linear constraints in the presolved problem. Returns a list +of floats with length equal to the number of linear +constraints in the original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.uncrush_pi([1.0] * 3)
+[1.0, 1.0, 1.0, 0.0]
+
+
+
+ +
+
+free()[source]
+

Frees the presolved problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.free()
+
+
+
+ +
+
+get_status()[source]
+

Returns the status of presolve.

+

Returns an attribute of Cplex.presolve.status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_status()
+1
+
+
+
+ +
+
+get_row_status()[source]
+

Returns the status of the original linear constraints.

+

Returns a list of integers with length equal to the number of +linear constraints in the original problem. Each entry of +this list is an attribute of Cplex.presolve.row_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_row_status()
+[-3, 1, 2, -3]
+
+
+
+ +
+
+get_col_status()[source]
+

Returns the status of the original variables.

+

Returns a list of integers with length equal to the number of +variables in the original problem. Each entry of this list +is an attribute of Cplex.presolve.col_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_col_status()
+[0, 1, 2, -5]
+
+
+
+ +
+
+get_presolved_row_status()[source]
+

Returns the status of the presolved linear constraints.

+

Returns a list of integers with length equal to the number of +linear constraints in the presolved problem. -1 indicates +that the presolved linear constraint corresponds to more than +one linear constraint in the original problem. Otherwise the +value is the index of the corresponding linear constraint in +the original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_presolved_row_status()
+[-1, 1, 2]
+
+
+
+ +
+
+get_presolved_col_status()[source]
+

Returns the status of the presolved variables.

+

Returns a list of integers with length equal to the number of +variables in the presolved problem. -1 indicates that the +presolved variable corresponds to a linear combination of more +than one variable in the original problem. Otherwise the +value is the index of the corresponding variable in the +original problem.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+>>> c.presolve.get_presolved_col_status()
+[0, 1, 2]
+
+
+
+ +
+
+add_rows(lin_expr=None, senses='', rhs=None, names=None)[source]
+

Adds linear constraints to the presolved problem.

+

presolve.add_rows accepts the keyword arguments lin_expr, +senses, rhs, and names.

+

If more than one argument is specified, all arguments must +have the same length.

+

lin_expr may be either a list of SparsePair instances or a +matrix in list-of-lists format.

+
+
Note

The entries of lin_expr must not contain duplicate indices. +If an entry of lin_expr references a variable more than +once, either by index, name, or a combination of index and +name, an exception will be raised.

+
+
+

senses must be either a list of single-character strings or a +string containing the types of the variables.

+

rhs is a list of floats, specifying the righthand side of +each linear constraint.

+

names is a list of strings.

+

The specified constraints are added to both the original +problem and the presolved problem.

+
+ +
+
+set_objective(objective)[source]
+

Sets the linear objective function of the presolved problem.

+

objective must be either a SparsePair instance or a list of +two lists, the first of which contains variable indices or +names, the second of which contains floats.

+

The objective function of both the original problem and the +presolved problem are changed.

+
+ +
+
+presolve(method)[source]
+

Solves the presolved problem.

+

method must be an attribute of Cplex.presolve.method.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.presolve.presolve(c.presolve.method.dual)
+
+
+
+ +
+
+write(filename)[source]
+

Writes the presolved problem to a file.

+
+ +
+ +
+
+class FeasoptConstraintType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.FeasoptConstraintType
+ + + +

Types of constraints

+
+
+lower_bound = 1
+
+ +
+
+upper_bound = 2
+
+ +
+
+linear = 3
+
+ +
+
+quadratic = 4
+
+ +
+
+indicator = 6
+
+ +
+ +
+
+class FeasoptInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.FeasoptInterface
+ + + +

Finds a minimal relaxation of the problem that is feasible.

+

This is a callable class. To find a feasible relaxation of a problem, +invoke the __call__ method of this class.

+
+
+constraint_type = <cplex._internal._subinterfaces.FeasoptConstraintType object>
+

See FeasoptConstraintType()

+
+ +
+
+all_constraints()[source]
+

Returns an object instructing feasopt to relax all constraints.

+

Calling Cplex.feasopt(Cplex.feasopt.all_constraints()) will +result in every constraint being relaxed independently with +equal weight.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.all_constraints()
+
+
+
+ +
+
+upper_bound_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all upper bounds.

+

If called with no arguments, every upper bound is assigned +weight 1.0.

+

If called with one or more arguments, every upper bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of upper bounds to be relaxed. If one variable index or name +is specified, it is the only upper bound that can be relaxed. +If two variable indices or names are specified, then upper +bounds of all variables between the first and the second, +inclusive, can be relaxed. If a sequence of variable names or +indices is passed in, all of their upper bounds can be +relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.upper_bound_constraints()
+
+
+
+ +
+
+lower_bound_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all lower bounds.

+

If called with no arguments, every lower bound is assigned +weight 1.0.

+

If called with one or more arguments, every lower bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of lower bounds to be relaxed. If one variable index or name +is specified, it is the only lower bound that can be relaxed. +If two variable indices or names are specified, then lower +bounds of all variables between the first and the second, +inclusive, can be relaxed. If a sequence of variable names or +indices is passed in, all of their lower bounds can be +relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.lower_bound_constraints()
+
+
+
+ +
+
+linear_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all linear constraints.

+

If called with no arguments, every linear constraint is +assigned weight 1.0.

+

If called with one or more arguments, every linear constraint +is assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of linear constraints to be relaxed. If one linear constraint +index or name is specified, it is the only linear constraint +that can be relaxed. If two linear constraint indices or +names are specified, then all linear constraints between the +first and the second, inclusive, can be relaxed. If a sequence +of linear constraint names or indices is passed in, all of their +linear constraints can be relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.linear_constraints()
+
+
+
+ +
+
+quadratic_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all quadratic constraints.

+

If called with no arguments, every quadratic constraint is +assigned weight 1.0.

+

If called with one or more arguments, every quadratic +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of quadratic constraints to be relaxed. If one quadratic +constraint index or name is specified, it is the only +quadratic constraint that can be relaxed. If two quadratic +constraint indices or names are specified, then all quadratic +constraints between the first and the second, inclusive, can be +relaxed. If a sequence of quadratic constraint names or indices +is passed in, all of their quadratic constraints can be relaxed.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.quadratic_constraints()
+
+
+
+ +
+
+indicator_constraints(*args)[source]
+

Returns an object instructing feasopt to relax all indicator constraints.

+

If called with no arguments, every indicator constraint is +assigned weight 1.0.

+

If called with one or more arguments, every indicator +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of indicator constraints to be relaxed. If one indicator +constraint index or name is specified, it is the only +indicator constraint that can be relaxed. If two indicator +constraint indices or names are specified, then all indicator +constraints between the first and the second, inclusive, can be +relaxed. If a sequence of indicator constraint names or indices +is passed in, all of their indicator constraints can be relaxed.

+

See also the __call__ method of this class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.feasopt.indicator_constraints()
+
+
+
+ +
+
+__call__(*args)[source]
+

Finds a minimal relaxation of the problem that is feasible.

+

This method can take arbitrarily many arguments. Either the +object returned by feasopt.all_constraints() or any combination +of constraint groups and objects returned by +upper_bound_constraints(), lower_bound_constraints(), +linear_constraints(), quadratic_constraints(), or +indicator_constraints() may be used to specify the constraints +to consider.

+

Constraint groups are sequences of length two, the first entry of +which is the preference for the group (a float), the second of +which is a sequence of pairs (type, id), where type is an +attribute of self.constraint_type and id is either an index or a +valid name for the type.

+

See CPXfeasoptext in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.feasopt(c.feasopt.all_constraints())
+>>> c.solution.get_objective_value()
+2.0
+>>> c.solution.get_values()
+[3.0, 2.0, 3.0, 2.0]
+
+
+
+ +
+ +
+
+class ConflictStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictStatus
+ + + +

Status codes returned by conflict.get

+
+
+excluded = -1
+
+ +
+
+possible_member = 0
+
+ +
+
+member = 3
+
+ +
+ +
+
+class ConflictConstraintType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictConstraintType
+ + + +

Types of constraints

+
+
+lower_bound = 1
+
+ +
+
+upper_bound = 2
+
+ +
+
+linear = 3
+
+ +
+
+quadratic = 4
+
+ +
+
+indicator = 6
+
+ +
+
+SOS = 5
+
+ +
+
+pwl = 7
+
+ +
+ +
+
+class ConflictInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.ConflictInterface
+ + + +

Methods for identifying conflicts among constraints.

+
+
+group_status = <cplex._internal._subinterfaces.ConflictStatus object>
+

See ConflictStatus()

+
+ +
+
+constraint_type = <cplex._internal._subinterfaces.ConflictConstraintType object>
+

See ConflictConstraintType()

+
+ +
+
+__init__(cplex)[source]
+

Creates a new ConflictInterface.

+

The conflict interface is exposed by the top-level Cplex class +as Cplex.conflict. This constructor is not meant to be used +externally.

+
+ +
+
+all_constraints()[source]
+

Returns an object instructing the conflict refiner to include +all constraints.

+

Calling +Cplex.conflict.refine(Cplex.conflict.all_constraints()) or +Cplex.conflict.refine_MIP_start(Cplex.conflict.all_constraints()) +will result in every constraint being included in the search +for conflicts with equal preference.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.all_constraints()
+
+
+
+ +
+
+upper_bound_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all upper bounds.

+

If called with no arguments, every upper bound is assigned +weight 1.0.

+

If called with one or more arguments, every upper bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of upper bounds to be included. If one variable index or name +is specified, it is the only upper bound that will be +included. If two variable indices or names are specified, then +upper bounds of all variables between the first and the +second, inclusive, will be included. If a sequence of +variable names or indices is passed in, all of their upper +bounds will be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.upper_bound_constraints()
+
+
+
+ +
+
+lower_bound_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all lower bounds.

+

If called with no arguments, every lower bound is assigned +weight 1.0.

+

If called with one or more arguments, every lower bound is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of lower bounds to be included. If one variable index or name +is specified, it is the only lower bound that will be +included. If two variable indices or names are specified, then +lower bounds of all variables between the first and the +second, inclusive, will be included. If a sequence of +variable names or indices is passed in, all of their lower +bounds will be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.lower_bound_constraints()
+
+
+
+ +
+
+linear_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all linear constraints.

+

If called with no arguments, every linear constraint is +assigned weight 1.0.

+

If called with one or more arguments, every linear constraint +is assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of linear constraints to be included. If one linear +constraint index or name is specified, it is the only linear +constraint that will be included. If two linear constraint +indices or names are specified, then all linear constraints +between the first and the second, inclusive, will be included. +If a sequence of linear constraint names or indices is passed +in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.linear_constraints()
+
+
+
+ +
+
+quadratic_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all quadratic constraints.

+

If called with no arguments, every quadratic constraint is +assigned weight 1.0.

+

If called with one or more arguments, every quadratic +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of quadratic constraints to be included. If one quadratic +constraint index or name is specified, it is the only +quadratic constraint that will be included. If two quadratic +constraint indices or names are specified, then all quadratic +constraints between the first and the second, inclusive, will +be included. If a sequence of quadratic constraint names or +indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.quadratic_constraints()
+
+
+
+ +
+
+indicator_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all indicator constraints.

+

If called with no arguments, every indicator constraint is +assigned weight 1.0.

+

If called with one or more arguments, every indicator +constraint is assigned a weight equal to the float passed in +as the first argument.

+

If additional arguments are specified, they determine a subset +of indicator constraints to be included. If one indicator +constraint index or name is specified, it is the only +indicator constraint that will be included. If two indicator +constraint indices or names are specified, the all indicator +constraints between the first and the second, inclusive, will +be included. If a sequence of indicator constraint names or +indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.indicator_constraints()
+
+
+
+ +
+
+pwl_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all PWL constraints.

+

If called with no arguments, every PWL constraint is assigned +weight 1.0.

+

If called with one or more arguments, every PWL constraint is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of PWL constraints to be included. If one PWL constraint index or +name is specified, it is the only PWL constraint that will be +included. If two PWL constraint indices or names are specified, +then all PWL constraints between the first and the second, +inclusive, will be included. If a sequence of PWL constraint +names or indices is passed in, they will all be included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.pwl_constraints()
+
+
+
+ +
+
+SOS_constraints(*args)[source]
+

Returns an object instructing the conflict refiner to include +all SOS constraints.

+

If called with no arguments, every SOS constraint is assigned +weight 1.0.

+

If called with one or more arguments, every SOS constraint is +assigned a weight equal to the float passed in as the first +argument.

+

If additional arguments are specified, they determine a subset +of SOS constraints to be included. If one SOS constraint +index or name is specified, it is the only SOS constraint that +will be included. If two SOS constraint indices or names are +specified, then all SOS constraints between the first and the +second, inclusive, will be included. If a sequence of SOS +constraint names or indices is passed in, they will all be +included.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> group = c.conflict.SOS_constraints()
+
+
+
+ +
+
+refine_MIP_start(MIP_start, *args)[source]
+

Identifies a minimal conflict among a set of constraints for a +given MIP start.

+

This method can take arbitrarily many arguments. The first +argument must be either a name or index of a MIP start. +Additional arguments are optional and can be the object returned +by all_constraints() or any combination of constraint groups +and objects returned by upper_bound_constraints(), +lower_bound_constraints(), linear_constraints(), +quadratic_constraints(), indicator_constraints(), +pwl_constraints(), or SOS_constraints() may be used to +specify the constraints to consider. If no additional arguments +are specified, then constraint groups are created automatically +as in the CPLEX interactive.

+

Constraint groups are sequences of length two, the first entry +of which is the preference for the group (a float), the second +of which is a sequence of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index +or a valid name for the type.

+

See CPXrefinemipstartconflictext and in the Callable +Library Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> indices = c.variables.add([1], [0], [0], c.variables.type.binary)
+>>> indices = c.variables.add([2], [0], [0], c.variables.type.binary)
+>>> c.solve()
+>>> indices = c.linear_constraints.add(
+...     lin_expr=[[[0, 1], [1.0, 1.0]]], senses="E", rhs=[2.0])
+>>> c.conflict.refine_MIP_start(0, c.conflict.all_constraints())
+>>> c.conflict.get()
+[-1, -1, -1, -1, 3]
+>>> c.conflict.group_status[3], c.conflict.group_status[-1]
+('member', 'excluded')
+>>> c.conflict.get_groups(0, 3)
+[(1.0, ((2, 0),)), (1.0, ((2, 1),)), (1.0, ((1, 0),)), (1.0, ((1, 1),))]
+
+
+
+ +
+
+refine(*args)[source]
+

Identifies a minimal conflict among a set of constraints.

+

This method can take arbitrarily many arguments. Either the +object returned by all_constraints() or any combination of +constraint groups and objects returned by +upper_bound_constraints(), lower_bound_constraints(), +linear_constraints(), quadratic_constraints(), +indicator_constraints(), pwl_constraints(), or +SOS_constraints() may be used to specify the constraints to +consider. Alternatively, if no arguments are specified, then +constraint groups are created automatically as in the CPLEX +interactive.

+

Constraint groups are sequences of length two, the first entry +of which is the preference for the group (a float), the second +of which is a sequence of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index or +a valid name for the type.

+

See CPXrefineconflictext in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.linear_constraints(),
+...                   c.conflict.lower_bound_constraints())
+>>> c.conflict.get()
+[3, -1, 3, -1, -1, -1]
+>>> c.conflict.group_status[3], c.conflict.group_status[-1]
+('member', 'excluded')
+>>> c.conflict.get_groups([0, 2])
+[(1.0, ((3, 0),)), (1.0, ((1, 0),))]
+
+
+
+ +
+
+get(*args)[source]
+

Returns the status of a set of groups of constraints.

+

Can be called by four forms.

+

If called with no arguments, returns a list containing the +status of all constraint groups.

+

If called with one integer argument, returns the status of +that constraint group.

+

If called with two integer arguments, returns the status of +all constraint groups between the first and second argument, +inclusive.

+

If called with a sequence of integers as its argument, returns +the status of all constraint groups in the sequence.

+

The status codes are attributes of +Cplex.conflict.group_status.

+

See CPXgetconflictext in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> confstatus = c.conflict.get()
+
+
+
+ +
+
+get_num_groups()[source]
+

Returns the number of constraint groups used in the last call +to refine() or refine_MIP_start().

+

See CPXgetconflictnumgroups in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> c.conflict.get_num_groups()
+10
+
+
+
+ +
+
+get_groups(*args)[source]
+

Returns the groups of constraints used in the last call to +refine() or refine_MIP_start().

+

Can be called by four forms.

+

If called with no arguments, returns a list containing all +constraint groups.

+

If called with one integer argument, returns that constraint +group.

+

If called with two integer arguments, returns all constraint +groups between the first and second argument, inclusive.

+

If called with a sequence of integers as its argument, returns +all constraint groups in the sequence.

+

Constraint groups are tuples of length two, the first entry of +which is the preference for the group (a float), the second of +which is a tuple of pairs (type, id), where type is an +attribute of conflict.constraint_type and id is either an index +or a valid name for the type.

+

See CPXgetconflictgroups in the Callable Library +Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> groups = c.conflict.get_groups()
+
+
+
+ +
+
+write(filename)[source]
+

Writes the conflict to a file.

+

See CPXclpwrite in the Callable Library Reference +Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> c.read("infeasible.lp")
+>>> c.conflict.refine(c.conflict.all_constraints())
+>>> c.conflict.write("conflict.clp")
+
+
+
+ +
+ +
+
+class PivotVarStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.PivotVarStatus
+ + + +

Use as input to pivoting methods.

+
+
+at_lower_bound = 0
+
+ +
+
+at_upper_bound = 2
+
+ +
+ +
+
+class AdvancedCplexInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.AdvancedCplexInterface
+ + + +

Advanced control of a Cplex object.

+
+
+no_variable = 2100000000
+

See _constants.CPX_NO_VARIABLE

+
+ +
+
+variable_status = <cplex._internal._subinterfaces.PivotVarStatus object>
+

See PivotVarStatus()

+
+ +
+
+delete_names()[source]
+

Deletes all names from the problem and its objects.

+
+ +
+
+basic_presolve()[source]
+

Performs bound strengthening and detects redundant rows.

+

Returns a tuple containing three lists: a list containing the +strengthened lower bounds, a list containing the strengthened +upper bounds, and a list containing the status of each row.

+

See CPXbasicpresolve in the Callable Library Reference +Manual.

+
+
Note

This method does not create a presolved problem.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> redlb, redub, rstat = c.advanced.basic_presolve()
+
+
+
+ +
+
+pivot(enter, leave, status)[source]
+

Pivots a variable into the basis.

+

enter is a name or index of a variable or linear constraint. +The index of a slack variable is specified by a negative +integer; -i - 1 refers to the slack associated with the ith +linear constraint. enter must not identify a basic variable.

+

leave is a name or index of a variable or linear constraint. +The index of a slack variable is specified by a negative +integer; -i - 1 refers to the slack associated with the ith +linear constraint. leave must identify either a basic +variable or a non-basic variable with both a lower and upper +bound to indicate that it is to move to its opposite bound. +leave may also be set to Cplex.advanced.no_variable to +instruct CPLEX to use a ratio test to determine the entering +variable.

+
+
Note

If a linear constraint has the same name as a column, it must +be specified by -index - 1, not by name.

+
+
+

status must be an attribute of Cplex.advanced.variable_status +specifying the nonbasic status to be assigned to the leaving +variable after the basis change.

+
+ +
+
+pivot_slacks_in(which)[source]
+

Forcibly pivots slack variables into the basis.

+

which may be either a single linear constraint index or name +or a sequence of linear constraint indices or names.

+
+ +
+
+pivot_fixed_variables_out(which)[source]
+

Forcibly pivots structural variables out of the basis.

+

which may be either a single variable index or name or a +sequence of variable indices or names.

+
+ +
+
+strong_branching(variables, it_limit)[source]
+

Performs strong branching.

+

variables is a sequence of names or indices of variables.

+

it_limit is an integer that specifies the number of iterations +allowed.

+

Returns a list of pairs (down_penalty, up_penalty) with the +same length as variables containing the penalties for +branching down or up, respectively, on each variable.

+

See CPXstrongbranch in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> itlim = c.parameters.simplex.limits.iterations.get()
+>>> c.read("example.mps")
+>>> c.solve()
+>>> vars = list(range(c.variables.get_num()))
+>>> result = c.advanced.strong_branching(vars, itlim)
+
+
+
+ +
+
+complete()[source]
+

See CPXcompletelp in the Callable Library Reference +Manual.

+
+ +
+ +
+
+class BranchDirection[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._subinterfaces.BranchDirection
+ + + +

Constants defining branch directions

+
+
+default = 0
+
+ +
+
+down = -1
+
+ +
+
+up = 1
+
+ +
+ +
+
+class OrderInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.OrderInterface
+ + + +

Methods for setting and querying a priority order for branching.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names = [str(i) for i in range(5)])
+>>> c.variables.set_types(zip(list(range(5)), ["C","I","I","I","I"]))
+>>> c.order.set([(1, 10, c.order.branch_direction.up), ('3', 5, c.order.branch_direction.down)])
+>>> c.order.get()
+[(1, 10, 1), (3, 5, -1)]
+>>> c.order.get_variables()
+[1, 3]
+
+
+
+
+branch_direction = <cplex._internal._subinterfaces.BranchDirection object>
+

See BranchDirection()

+
+ +
+
+get()[source]
+

Returns a list of triples (variable, priority, direction) +representing the priority order for branching.

+
+ +
+
+get_variables()[source]
+

Returns the variables for which an order has been set.

+
+ +
+
+set(order)[source]
+

Sets the priority order for branching.

+

order must be a list of triples (variable, priority, direction).

+

variable must be an index or name of a variable.

+

priority must be a nonnegative integer.

+

direction must be an attribute of order.branch_direction.

+
+ +
+
+read(filename)[source]
+

Reads a priority order from a file.

+
+ +
+
+write(filename)[source]
+

Writes the priority order to a file.

+
+ +
+ +
+
+class InitialInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._subinterfaces.InitialInterface
+ + + +

Methods to set starting information for an optimization algorithm +to solve continuous problems (LP, QP, QCP).

+
+
Note

Data passed to these methods cannot be queried immediately from +the methods in Cplex.solution. Those methods will return +data only after Cplex.solve() or Cplex.feasopt() has been called.

+
+
+
+
+status = <cplex._internal._subinterfaces.BasisVarStatus object>
+

See BasisVarStatus()

+
+ +
+
+set_start(col_status, row_status, col_primal, row_primal, col_dual, row_dual)[source]
+

Sets basis statuses, primal values, and dual values.

+

The arguments col_status, col_primal, and col_dual are lists +that either have length equal to the number of variables or +are empty. If col_status is empty, then row_status must also +be empty. If col_primal is empty, then row_primal must also +be empty.

+

The arguments row_status, row_primal, and row_dual are lists +that either have length equal to the number of linear +constraints or are empty. If row_status is empty, the +col_status must also be empty. If row_dual is empty, then +col_dual must also be empty.

+

Each entry of col_status and row_status must be an attribute of +Cplex.start.status.

+

Each entry of col_primal and row_primal must be a float +specifying the starting primal values for the columns and +rows, respectively.

+

Each entry of col_dual and row_dual must be a float +specifying the starting dual values for the columns and rows, +respectively.

+
+
Note

The starting information is ignored by the optimizers if the +parameter cplex.parameters.advance is set to +cplex.parameters.advance.values.none.

+
+
+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     names=["v{0}".format(i) for i in range(5)]
+... )
+>>> indices = c.linear_constraints.add(
+...     names=["r{0}".format(i) for i in range(3)]
+... )
+>>> s = c.start.status
+>>> c.start.set_start(
+...     [s.basic] * 3 + [s.at_lower_bound] * 2,
+...     [s.basic] + [s.at_upper_bound] * 2,
+...     [0.0] * 5,
+...     [1.0] * 3,
+...     [2.0] * 5,
+...     [3.0] * 3
+... )
+
+
+
+ +
+
+read_start(filename)[source]
+

Reads the starting information from a file.

+

See CPXreadcopystartinfo in the Callable Library +Reference Manual and also SolutionInterface.write().

+

Example usage:

+
>>> import cplex
+>>> c1 = cplex.Cplex()
+>>> out = c1.set_results_stream(None)
+>>> out = c1.set_log_stream(None)
+>>> c1.read("lpex.mps")
+>>> c1.solve()
+>>> c1.solution.write("lpex.sol")
+>>> c2 = cplex.Cplex()
+>>> out = c2.set_results_stream(None)
+>>> out = c2.set_log_stream(None)
+>>> c2.read("lpex.mps")
+>>> c2.start.read_start("lpex.sol")
+
+
+
+ +
+
+read_basis(filename)[source]
+

Reads the starting basis from a file.

+

See CPXreadcopybase in the Callable Library Reference +Manual and also BasisInterface.write().

+

Example:

+
>>> import cplex
+>>> c1 = cplex.Cplex()
+>>> out = c1.set_results_stream(None)
+>>> out = c1.set_log_stream(None)
+>>> c1.read("lpex.mps")
+>>> c1.solve()
+>>> c1.solution.basis.write("lpex.bas")
+>>> c2 = cplex.Cplex()
+>>> out = c2.set_results_stream(None)
+>>> out = c2.set_log_stream(None)
+>>> c2.read("lpex.mps")
+>>> c2.start.read_basis("lpex.bas")
+
+
+
+ +
+ +
+
+

cplex._internal._baseinterface module

+

Base-interface of the CPLEX API

+
+
+class BaseInterface[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._baseinterface.BaseInterface
+ + +

Common methods for sub-interfaces.

+
+
+__init__(cplex, advanced=False, getindexfunc=None)[source]
+

Creates a new BaseInterface.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+get_indices(name)[source]
+

Converts from names to indices.

+

If name is a string, get_indices returns the index of the +object with that name. If no such object exists, an +exception is raised.

+

If name is a sequence of strings, get_indices returns a list +of the indices corresponding to the strings in name. +Equivalent to map(self.get_indices, name).

+

If the subclass does not provide an index function (i.e., the +interface is not indexed), then a NotImplementedError is raised.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=["a", "b"])
+>>> c.variables.get_indices("a")
+0
+>>> c.variables.get_indices(["a", "b"])
+[0, 1]
+
+
+
+ +
+ +
+
+

cplex._internal._procedural module

+

Wrapper functions for the CPLEX C Callable Library

+
+
+getstatstring(env, statind)[source]
+
+ +
+
+geterrorstring(env, errcode)[source]
+
+ +
+
+cb_geterrorstring(env, status)[source]
+
+ +
+
+new_native_int()[source]
+
+ +
+
+delete_native_int(p)[source]
+
+ +
+
+set_native_int(p, v)[source]
+
+ +
+
+get_native_int(p)[source]
+
+ +
+
+setterminate(env, env_lp_ptr, p)[source]
+
+ +
+
+class SigIntHandler[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._procedural.SigIntHandler
+ + +

Handle Ctrl-C events during long running processes.

+

:undocumented

+
+
+__init__()[source]
+
+ +
+ +
+
+pack_env_lp_ptr(env, lp)[source]
+
+ +
+
+chbmatrix(lolmat, env_lp_ptr, r_c)[source]
+

See matrix_conversion.c:Pylolmat_to_CHBmat().

+
+ +
+
+Pylolmat_to_CHBmat(lolmat, env_lp_ptr, r_c)[source]
+
+ +
+
+free_CHBmat(lolmat)[source]
+
+ +
+
+class StatusChecker[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._procedural.StatusChecker
+ + +

A callable object used for checking status codes.

+

:undocumented

+
+
+__init__()[source]
+
+ +
+ +
+
+set_status_checker()[source]
+
+ +
+
+version(env)[source]
+
+ +
+
+versionnumber(env)[source]
+
+ +
+
+openCPLEX()[source]
+
+ +
+
+closeCPLEX(env)[source]
+
+ +
+
+getchannels(env)[source]
+
+ +
+
+addfuncdest(env, channel, fileobj)[source]
+
+ +
+
+delfuncdest(env, channel, fileobj)[source]
+
+ +
+
+setlpcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setnetcallbackfunc(env, cbhandle)[source]
+
+ +
+
+settuningcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setheuristiccallbackfunc(env, cbhandle)[source]
+
+ +
+
+setlazyconstraintcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setusercutcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setincumbentcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setnodecallbackfunc(env, cbhandle)[source]
+
+ +
+
+setbranchcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setbranchnosolncallbackfunc(env, cbhandle)[source]
+
+ +
+
+setsolvecallbackfunc(env, cbhandle)[source]
+
+ +
+
+setinfocallbackfunc(env, cbhandle)[source]
+
+ +
+
+setmipcallbackfunc(env, cbhandle)[source]
+
+ +
+
+setdefaults(env)[source]
+
+ +
+
+setintparam(env, whichparam, newvalue)[source]
+
+ +
+
+setlongparam(env, whichparam, newvalue)[source]
+
+ +
+
+setdblparam(env, whichparam, newvalue)[source]
+
+ +
+
+setstrparam(env, whichparam, newvalue)[source]
+
+ +
+
+getintparam(env, whichparam)[source]
+
+ +
+
+getlongparam(env, whichparam)[source]
+
+ +
+
+getdblparam(env, whichparam)[source]
+
+ +
+
+getstrparam(env, whichparam)[source]
+
+ +
+
+infointparam(env, whichparam)[source]
+
+ +
+
+infolongparam(env, whichparam)[source]
+
+ +
+
+infodblparam(env, whichparam)[source]
+
+ +
+
+infostrparam(env, whichparam)[source]
+
+ +
+
+getparamtype(env, param_name)[source]
+
+ +
+
+readcopyparam(env, filename)[source]
+
+ +
+
+writeparam(env, filename)[source]
+
+ +
+
+tuneparam(env, lp, int_param_values, dbl_param_values, str_param_values)[source]
+
+ +
+
+tuneparamprobset(env, filenames, filetypes, int_param_values, dbl_param_values, str_param_values)[source]
+
+ +
+
+fixparam(env, paramnum)[source]
+
+ +
+
+paramsetadd(env, ps, whichparam, newvalue, paramtype=None)[source]
+
+ +
+
+paramsetadddbl(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddint(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddlong(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetaddstr(env, ps, whichparam, newvalue)[source]
+
+ +
+
+paramsetapply(env, ps)[source]
+
+ +
+
+paramsetcopy(env, targetps, sourceps)[source]
+
+ +
+
+paramsetcreate(env)[source]
+
+ +
+
+paramsetdel(env, ps, whichparam)[source]
+
+ +
+
+paramsetfree(env, ps)[source]
+
+ +
+
+paramsetget(env, ps, whichparam, paramtype=None)[source]
+
+ +
+
+paramsetgetdbl(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetint(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetlong(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetstr(env, ps, whichparam)[source]
+
+ +
+
+paramsetgetids(env, ps)[source]
+
+ +
+
+paramsetreadcopy(env, ps, filename)[source]
+
+ +
+
+paramsetwrite(env, ps, filename)[source]
+
+ +
+
+paramsetgetnum(env, ps)[source]
+
+ +
+
+runseeds(env, lp, cnt)[source]
+
+ +
+
+createprob(env, probname)[source]
+
+ +
+
+readcopyprob(env, lp, filename, filetype='')[source]
+
+ +
+
+cloneprob(env, lp)[source]
+
+ +
+
+freeprob(env, lp)[source]
+
+ +
+
+mipopt(env, lp)[source]
+
+ +
+
+qpopt(env, lp)[source]
+
+ +
+
+baropt(env, lp)[source]
+
+ +
+
+hybbaropt(env, lp, method)[source]
+
+ +
+
+hybnetopt(env, lp, method)[source]
+
+ +
+
+lpopt(env, lp)[source]
+
+ +
+
+primopt(env, lp)[source]
+
+ +
+
+dualopt(env, lp)[source]
+
+ +
+
+siftopt(env, lp)[source]
+
+ +
+
+feasoptext(env, lp, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+delnames(env, lp)[source]
+
+ +
+
+writeprob(env, lp, filename, filetype='')[source]
+
+ +
+
+writeprobdev(env, lp, stream, filename, filetype)[source]
+
+ +
+
+embwrite(env, lp, filename)[source]
+
+ +
+
+dperwrite(env, lp, filename, epsilon)[source]
+
+ +
+
+pperwrite(env, lp, filename, epsilon)[source]
+
+ +
+
+preslvwrite(env, lp, filename)[source]
+
+ +
+
+dualwrite(env, lp, filename)[source]
+
+ +
+
+chgprobtype(env, lp, probtype)[source]
+
+ +
+
+chgprobtypesolnpool(env, lp, probtype, soln)[source]
+
+ +
+
+getprobtype(env, lp)[source]
+
+ +
+
+chgprobname(env, lp, probname)[source]
+
+ +
+
+getprobname(env, lp)[source]
+
+ +
+
+getnumcols(env, lp)[source]
+
+ +
+
+getnumint(env, lp)[source]
+
+ +
+
+getnumbin(env, lp)[source]
+
+ +
+
+getnumsemicont(env, lp)[source]
+
+ +
+
+getnumsemiint(env, lp)[source]
+
+ +
+
+getnumrows(env, lp)[source]
+
+ +
+
+populate(env, lp)[source]
+
+ +
+
+getnumqconstrs(env, lp)[source]
+
+ +
+
+getnumindconstrs(env, lp)[source]
+
+ +
+
+getnumsos(env, lp)[source]
+
+ +
+
+cleanup(env, lp, eps)[source]
+
+ +
+
+basicpresolve(env, lp)[source]
+
+ +
+
+pivotin(env, lp, rlist)[source]
+
+ +
+
+pivotout(env, lp, clist)[source]
+
+ +
+
+pivot(env, lp, jenter, jleave, leavestat)[source]
+
+ +
+
+strongbranch(env, lp, goodlist, itlim)[source]
+
+ +
+
+completelp(env, lp)[source]
+
+ +
+
+fast_getrows(env, lp)[source]
+
+ +
+
+fast_getcolname(env, lp, begin, end)[source]
+
+ +
+
+fast_getrowname(env, lp, begin, end)[source]
+
+ +
+
+fast_getsosname(env, lp, begin, end)[source]
+
+ +
+
+fast_getmipstartname(env, lp, begin, end)[source]
+
+ +
+
+fast_getobj(env, lp, begin, end)[source]
+
+ +
+
+fast_multiobjgetobj(env, lp, objidx, begin, end)[source]
+
+ +
+
+fast_multiobjgetoffset(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetweight(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetpriority(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetabstol(env, lp, objidx)[source]
+
+ +
+
+fast_multiobjgetreltol(env, lp, objidx)[source]
+
+ +
+
+fast_newcols(env, lp, nb, lb, ub, xctype)[source]
+
+ +
+
+has_name(env, lp, start, end)[source]
+
+ +
+
+has_non_default_lb(env, lp, start, end)[source]
+
+ +
+
+has_non_default_ub(env, lp, start, end)[source]
+
+ +
+
+newcols(env, lp, obj, lb, ub, xctype, colname)[source]
+
+ +
+
+addcols(env, lp, ccnt, nzcnt, obj, cmat, lb, ub, colname)[source]
+
+ +
+
+delcols(env, lp, begin, end)[source]
+
+ +
+
+chgbds(env, lp, indices, lu, bd)[source]
+
+ +
+
+chgcolname(env, lp, indices, newnames)[source]
+
+ +
+
+chgctype(env, lp, indices, xctype)[source]
+
+ +
+
+getcolindex(env, lp, colname)[source]
+
+ +
+
+getcolname(env, lp, begin, end)[source]
+
+ +
+
+getctype(env, lp, begin, end)[source]
+
+ +
+
+getlb(env, lp, begin, end)[source]
+
+ +
+
+getub(env, lp, begin, end)[source]
+
+ +
+
+getcols(env, lp, begin, end)[source]
+
+ +
+
+copyprotected(env, lp, indices)[source]
+
+ +
+
+getprotected(env, lp)[source]
+
+ +
+
+tightenbds(env, lp, indices, lu, bd)[source]
+
+ +
+
+newrows(env, lp, rhs, sense, rngval, rowname)[source]
+
+ +
+
+addrows(env, lp, ccnt, rcnt, nzcnt, rhs, sense, rmat, colname, rowname)[source]
+
+ +
+
+delrows(env, lp, begin, end)[source]
+
+ +
+
+chgrowname(env, lp, indices, newnames)[source]
+
+ +
+
+chgcoeflist(env, lp, rowlist, collist, vallist)[source]
+
+ +
+
+chgrhs(env, lp, indices, values)[source]
+
+ +
+
+chgrngval(env, lp, indices, values)[source]
+
+ +
+
+chgsense(env, lp, indices, senses)[source]
+
+ +
+
+getrhs(env, lp, begin, end)[source]
+
+ +
+
+getsense(env, lp, begin, end)[source]
+
+ +
+
+getrngval(env, lp, begin, end)[source]
+
+ +
+
+getrowname(env, lp, begin, end)[source]
+
+ +
+
+getcoef(env, lp, i, j)[source]
+
+ +
+
+getrowindex(env, lp, rowname)[source]
+
+ +
+
+getrows(env, lp, begin, end)[source]
+
+ +
+
+getnumnz(env, lp)[source]
+
+ +
+
+addlazyconstraints(env, lp, rhs, sense, lin_expr, names)[source]
+
+ +
+
+addusercuts(env, lp, rhs, sense, lin_expr, names)[source]
+
+ +
+
+freelazyconstraints(env, lp)[source]
+
+ +
+
+freeusercuts(env, lp)[source]
+
+ +
+
+copylpwnames(env, lp, numcols, numrows, objsense, obj, rhs, sense, matbeg, matcnt, matind, matval, lb, ub, rngval, colname, rowname)[source]
+
+ +
+
+addsos(env, lp, sostype, sosbeg, sosind, soswt, sosnames)[source]
+
+ +
+
+delsos(env, lp, begin, end)[source]
+
+ +
+
+getsos_info(env, lp, begin, end)[source]
+
+ +
+
+getsos(env, lp, begin, end)[source]
+
+ +
+
+getsosindex(env, lp, name)[source]
+
+ +
+
+getsosname(env, lp, begin, end)[source]
+
+ +
+
+addindconstr(env, lp, indcnt, indvar, complemented, rhs, sense, linmat, indtype, name, nzcnt)[source]
+
+ +
+
+getindconstr(env, lp, begin, end)[source]
+
+ +
+
+getindconstr_constant(env, lp, begin, end)[source]
+
+ +
+
+getindconstrindex(env, lp, name)[source]
+
+ +
+
+delindconstrs(env, lp, begin, end)[source]
+
+ +
+
+getindconstrslack(env, lp, begin, end)[source]
+
+ +
+
+getindconstrname(env, lp, which)[source]
+
+ +
+
+addqconstr(env, lp, rhs, sense, linind, linval, quadrow, quadcol, quadval, name)[source]
+
+ +
+
+getqconstr_info(env, lp, which)[source]
+
+ +
+
+getqconstr_lin(env, lp, which)[source]
+
+ +
+
+getqconstr_quad(env, lp, which)[source]
+
+ +
+
+delqconstrs(env, lp, begin, end)[source]
+
+ +
+
+getqconstrindex(env, lp, name)[source]
+
+ +
+
+getqconstrslack(env, lp, begin, end)[source]
+
+ +
+
+getqconstrname(env, lp, which)[source]
+
+ +
+
+newlonganno(env, lp, name, defval)[source]
+
+ +
+
+newdblanno(env, lp, name, defval)[source]
+
+ +
+
+dellonganno(env, lp, begin, end)[source]
+
+ +
+
+deldblanno(env, lp, begin, end)[source]
+
+ +
+
+getlongannoindex(env, lp, name)[source]
+
+ +
+
+getdblannoindex(env, lp, name)[source]
+
+ +
+
+getlongannoname(env, lp, idx)[source]
+
+ +
+
+getdblannoname(env, lp, idx)[source]
+
+ +
+
+getnumlonganno(env, lp)[source]
+
+ +
+
+getnumdblanno(env, lp)[source]
+
+ +
+
+getlongannodefval(env, lp, idx)[source]
+
+ +
+
+getdblannodefval(env, lp, idx)[source]
+
+ +
+
+setlonganno(env, lp, idx, objtype, ind, val)[source]
+
+ +
+
+setdblanno(env, lp, idx, objtype, ind, val)[source]
+
+ +
+
+getlonganno(env, lp, idx, objtype, begin, end)[source]
+
+ +
+
+getdblanno(env, lp, idx, objtype, begin, end)[source]
+
+ +
+
+readcopyanno(env, lp, filename)[source]
+
+ +
+
+writeanno(env, lp, filename)[source]
+
+ +
+
+writebendersanno(env, lp, filename)[source]
+
+ +
+
+addpwl(env, lp, vary, varx, preslope, postslope, nbreaks, breakx, breaky, name)[source]
+
+ +
+
+delpwl(env, lp, begin, end)[source]
+
+ +
+
+getnumpwl(env, lp)[source]
+
+ +
+
+getpwl(env, lp, idx)[source]
+
+ +
+
+getpwlindex(env, lp, name)[source]
+
+ +
+
+getpwlname(env, lp, idx)[source]
+
+ +
+
+copyobjname(env, lp, objname)[source]
+
+ +
+
+chgobj(env, lp, indices, values)[source]
+
+ +
+
+chgobjsen(env, lp, maxormin)[source]
+
+ +
+
+getobjsen(env, lp)[source]
+
+ +
+
+getobjoffset(env, lp)[source]
+
+ +
+
+chgobjoffset(env, lp, offset)[source]
+
+ +
+
+getobj(env, lp, begin, end)[source]
+
+ +
+
+getobjname(env, lp)[source]
+
+ +
+
+copyquad(env, lp, qmatbeg, qmatind, qmatval)[source]
+
+ +
+
+copyqpsep(env, lp, qsepvec)[source]
+
+ +
+
+chgqpcoef(env, lp, row, col, value)[source]
+
+ +
+
+getquad(env, lp, begin, end)[source]
+
+ +
+
+getqpcoef(env, lp, row, col)[source]
+
+ +
+
+getnumquad(env, lp)[source]
+
+ +
+
+getnumqpnz(env, lp)[source]
+
+ +
+
+getnumobjs(env, lp)[source]
+
+ +
+
+multiobjchgattribs(env, lp, objidx, offset=nan, weight=nan, priority=-1, abstol=nan, reltol=nan, name=None)[source]
+
+ +
+
+multiobjgetindex(env, lp, name)[source]
+
+ +
+
+multiobjgetname(env, lp, objidx)[source]
+
+ +
+
+multiobjgetobj(env, lp, objidx, begin, end)[source]
+
+ +
+
+multiobjsetobj(env, lp, objidx, objind, objval, offset=nan, weight=nan, priority=-1, abstol=nan, reltol=nan, objname=None)[source]
+
+ +
+
+setnumobjs(env, lp, n)[source]
+
+ +
+
+multiobjopt(env, lp, paramsets)[source]
+
+ +
+
+multiobjgetobjval(env, lp, objidx)[source]
+
+ +
+
+multiobjgetobjvalbypriority(env, lp, priority)[source]
+
+ +
+
+multiobjgetdblinfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetintinfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetlonginfo(env, lp, subprob, what)[source]
+
+ +
+
+multiobjgetnumsolves(env, lp)[source]
+
+ +
+
+getnumprios(env, lp)[source]
+
+ +
+
+ismultiobj(env, lp)[source]
+
+ +
+
+solninfo(env, lp)[source]
+
+ +
+
+getstat(env, lp)[source]
+
+ +
+
+getmethod(env, lp)[source]
+
+ +
+
+getobjval(env, lp)[source]
+
+ +
+
+getx(env, lp, begin, end)[source]
+
+ +
+
+getnumcores(env)[source]
+
+ +
+
+getax(env, lp, begin, end)[source]
+
+ +
+
+getxqxax(env, lp, begin, end)[source]
+
+ +
+
+getpi(env, lp, begin, end)[source]
+
+ +
+
+getslack(env, lp, begin, end)[source]
+
+ +
+
+getdj(env, lp, begin, end)[source]
+
+ +
+
+getqconstrdslack(env, lp, qind)[source]
+
+ +
+
+getrowinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getcolinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getqconstrinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getindconstrinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getsosinfeas(env, lp, x, begin, end)[source]
+
+ +
+
+getbase(env, lp)[source]
+
+ +
+
+getbhead(env, lp)[source]
+
+ +
+
+mbasewrite(env, lp, filename)[source]
+
+ +
+
+getijrow(env, lp, idx, is_row_index)[source]
+
+ +
+
+getpnorms(env, lp)[source]
+
+ +
+
+getdnorms(env, lp)[source]
+
+ +
+
+getbasednorms(env, lp)[source]
+
+ +
+
+getpsbcnt(env, lp)[source]
+
+ +
+
+getdsbcnt(env, lp)[source]
+
+ +
+
+getdblquality(env, lp, what)[source]
+
+ +
+
+getintquality(env, lp, what)[source]
+
+ +
+
+boundsa_lower(env, lp, begin, end)[source]
+
+ +
+
+boundsa_upper(env, lp, begin, end)[source]
+
+ +
+
+boundsa(env, lp, begin, end)[source]
+
+ +
+
+objsa(env, lp, begin, end)[source]
+
+ +
+
+rhssa(env, lp, begin, end)[source]
+
+ +
+
+refinemipstartconflictext(env, lp, mipstartindex, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+refineconflictext(env, lp, grppref, grpbeg, grpind, grptype)[source]
+
+ +
+
+getconflictext(env, lp, begin, end)[source]
+
+ +
+
+getconflictnumgroups(env, lp)[source]
+
+ +
+
+getconflictgroups(env, lp, begin, end)[source]
+
+ +
+
+getconflictnumpasses(env, lp)[source]
+
+ +
+
+clpwrite(env, lp, filename)[source]
+
+ +
+
+solwrite(env, lp, filename)[source]
+
+ +
+
+binvcol(env, lp, j)[source]
+
+ +
+
+binvrow(env, lp, i)[source]
+
+ +
+
+binvacol(env, lp, j)[source]
+
+ +
+
+binvarow(env, lp, i)[source]
+
+ +
+
+ftran(env, lp, x)[source]
+
+ +
+
+btran(env, lp, y)[source]
+
+ +
+
+getgrad(env, lp, j)[source]
+
+ +
+
+slackfromx(env, lp, x)[source]
+
+ +
+
+qconstrslackfromx(env, lp, x)[source]
+
+ +
+
+djfrompi(env, lp, pi)[source]
+
+ +
+
+qpdjfrompi(env, lp, pi, x)[source]
+
+ +
+
+mdleave(env, lp, goodlist)[source]
+
+ +
+
+qpindefcertificate(env, lp)[source]
+
+ +
+
+dualfarkas(env, lp)[source]
+
+ +
+
+getijdiv(env, lp)[source]
+
+ +
+
+getray(env, lp)[source]
+
+ +
+
+presolve(env, lp, method)[source]
+
+ +
+
+freepresolve(env, lp)[source]
+
+ +
+
+crushx(env, lp, x)[source]
+
+ +
+
+uncrushx(env, lp, prex)[source]
+
+ +
+
+crushpi(env, lp, pi)[source]
+
+ +
+
+uncrushpi(env, lp, prepi)[source]
+
+ +
+
+crushform(env, lp, ind, val)[source]
+
+ +
+
+uncrushform(env, lp, pind, pval)[source]
+
+ +
+
+getprestat_status(env, lp)[source]
+
+ +
+
+getprestat_r(env, lp)[source]
+
+ +
+
+getprestat_c(env, lp)[source]
+
+ +
+
+getprestat_or(env, lp)[source]
+
+ +
+
+getprestat_oc(env, lp)[source]
+
+ +
+
+prechgobj(env, lp, ind, val)[source]
+
+ +
+
+preaddrows(env, lp, rhs, sense, rmatbeg, rmatind, rmatval, names)[source]
+
+ +
+
+getnummipstarts(env, lp)[source]
+
+ +
+
+chgmipstarts(env, lp, mipstartindices, beg, varindices, values, effortlevel)[source]
+
+ +
+
+addmipstarts(env, lp, beg, varindices, values, effortlevel, mipstartname)[source]
+
+ +
+
+delmipstarts(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts_size(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts_effort(env, lp, begin, end)[source]
+
+ +
+
+getmipstarts(env, lp, begin, end)[source]
+
+ +
+
+getmipstartname(env, lp, begin, end)[source]
+
+ +
+
+getmipstartindex(env, lp, mipstartname)[source]
+
+ +
+
+readcopymipstarts(env, lp, filename)[source]
+
+ +
+
+writemipstarts(env, lp, filename, begin, end)[source]
+
+ +
+
+getitcnt(env, lp)[source]
+
+ +
+
+getphase1cnt(env, lp)[source]
+
+ +
+
+getsiftitcnt(env, lp)[source]
+
+ +
+
+getsiftphase1cnt(env, lp)[source]
+
+ +
+
+getbaritcnt(env, lp)[source]
+
+ +
+
+getcrossppushcnt(env, lp)[source]
+
+ +
+
+getcrosspexchcnt(env, lp)[source]
+
+ +
+
+getcrossdpushcnt(env, lp)[source]
+
+ +
+
+getcrossdexchcnt(env, lp)[source]
+
+ +
+
+getmipitcnt(env, lp)[source]
+
+ +
+
+getnodecnt(env, lp)[source]
+
+ +
+
+getnodeleftcnt(env, lp)[source]
+
+ +
+
+getbestobjval(env, lp)[source]
+
+ +
+
+getcutoff(env, lp)[source]
+
+ +
+
+getmiprelgap(env, lp)[source]
+
+ +
+
+getnumcuts(env, lp, cuttype)[source]
+
+ +
+
+getnodeint(env, lp)[source]
+
+ +
+
+getsubstat(env, lp)[source]
+
+ +
+
+get_wherefrom(cbstruct)[source]
+
+ +
+
+gettime(env)[source]
+
+ +
+
+getdettime(env)[source]
+
+ +
+
+getcallbackincumbent(cbstruct, begin, end)[source]
+
+ +
+
+getcallbackpseudocosts(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeintfeas(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodelb(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeub(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeobjval(cbstruct)[source]
+
+ +
+
+getcallbacknodex(cbstruct, begin, end)[source]
+
+ +
+
+getcallbacknodeinfo(cbstruct, node, which)[source]
+
+ +
+
+callbacksetuserhandle(cbstruct, userhandle)[source]
+
+ +
+
+callbacksetnodeuserhandle(cbstruct, nodeindex, userhandle)[source]
+
+ +
+
+getcallbackseqinfo(cbstruct, node, which)[source]
+
+ +
+
+getcallbacksosinfo(cbstruct, sosindex, member, which)[source]
+
+ +
+
+cutcallbackadd(cbstruct, rhs, sense, ind, val, purgeable)[source]
+
+ +
+
+cutcallbackaddlocal(cbstruct, rhs, sense, ind, val)[source]
+
+ +
+
+branchcallbackbranchgeneral(cbstruct, ind, lu, bd, rhs, sense, matbeg, matind, matval, nodeest, userhandle)[source]
+
+ +
+
+branchcallbackbranchasCPLEX(cbstruct, n, userhandle)[source]
+
+ +
+
+setpydel(env)[source]
+
+ +
+
+delpydel(env)[source]
+
+ +
+
+addsolnpooldivfilter(env, lp, lb, ub, ind, wts, ref, name)[source]
+
+ +
+
+addsolnpoolrngfilter(env, lp, lb, ub, ind, val, name)[source]
+
+ +
+
+getsolnpooldivfilter_constant(env, lp, which)[source]
+
+ +
+
+getsolnpooldivfilter(env, lp, which)[source]
+
+ +
+
+getsolnpoolrngfilter_constant(env, lp, which)[source]
+
+ +
+
+getsolnpoolrngfilter(env, lp, which)[source]
+
+ +
+
+delsolnpoolfilters(env, lp, begin, end)[source]
+
+ +
+
+getsolnpoolfiltername(env, lp, which)[source]
+
+ +
+
+getsolnpoolnumfilters(env, lp)[source]
+
+ +
+
+fltwrite(env, lp, filename)[source]
+
+ +
+
+readcopysolnpoolfilters(env, lp, filename)[source]
+
+ +
+
+getsolnpoolfilterindex(env, lp, colname)[source]
+
+ +
+
+getsolnpoolfiltertype(env, lp, index)[source]
+
+ +
+
+delsolnpoolsolns(env, lp, begin, end)[source]
+
+ +
+
+getsolnpoolnumsolns(env, lp)[source]
+
+ +
+
+getsolnpoolnumreplaced(env, lp)[source]
+
+ +
+
+getsolnpoolsolnindex(env, lp, colname)[source]
+
+ +
+
+getsolnpoolmeanobjval(env, lp)[source]
+
+ +
+
+getsolnpoolsolnname(env, lp, which)[source]
+
+ +
+
+solwritesolnpool(env, lp, soln, filename)[source]
+
+ +
+
+solwritesolnpoolall(env, lp, filename)[source]
+
+ +
+
+getsolnpoolobjval(env, lp, soln)[source]
+
+ +
+
+getsolnpoolx(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolslack(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolqconstrslack(env, lp, soln, begin, end)[source]
+
+ +
+
+getsolnpoolintquality(env, lp, soln, what)[source]
+
+ +
+
+getsolnpooldblquality(env, lp, soln, what)[source]
+
+ +
+
+copystart(env, lp, cstat, rstat, cprim, rprim, cdual, rdual)[source]
+
+ +
+
+readcopybase(env, lp, filename)[source]
+
+ +
+
+getorder(env, lp)[source]
+
+ +
+
+copyorder(env, lp, indices, priority, direction)[source]
+
+ +
+
+readcopyorder(env, lp, filename)[source]
+
+ +
+
+ordwrite(env, lp, filename)[source]
+
+ +
+
+readcopystartinfo(env, lp, filename)[source]
+
+ +
+
+initlock()[source]
+
+ +
+
+finitlock(lock)[source]
+
+ +
+
+getprobstats(env, lp)[source]
+
+ +
+
+gethist(env, lp, key)[source]
+
+ +
+
+getqualitymetrics(env, lp, soln)[source]
+
+ +
+
+showquality(env, lp, soln)[source]
+
+ +
+
+setgenericcallbackfunc(env, lp, contextmask, cbhandle)[source]
+
+ +
+
+callbackgetinfoint(contextptr, which)[source]
+
+ +
+
+callbackgetinfolong(contextptr, which)[source]
+
+ +
+
+callbackgetinfodbl(contextptr, which)[source]
+
+ +
+
+callbackabort(contextptr)[source]
+
+ +
+
+callbackcandidateispoint(contextptr)[source]
+
+ +
+
+callbackgetcandidatepoint(contextptr, begin, end)[source]
+
+ +
+
+callbackcandidateisray(contextptr)[source]
+
+ +
+
+callbackgetcandidateray(contextptr, begin, end)[source]
+
+ +
+
+callbackgetcandidateobj(contextptr)[source]
+
+ +
+
+callbackgetrelaxationpoint(contextptr, begin, end)[source]
+
+ +
+
+callbackgetrelaxationpointobj(contextptr)[source]
+
+ +
+
+callbackgetrelaxationstatus(contextptr, flags)[source]
+
+ +
+
+callbackmakebranch(contextptr, ind, lu, bd, rhs, sense, matbeg, matind, matval, nodeest)[source]
+
+ +
+
+callbackprunenode(contextptr)[source]
+
+ +
+
+callbackexitcutloop(contextptr)[source]
+
+ +
+
+callbackgetincumbent(contextptr, begin, end)[source]
+
+ +
+
+callbackgetincumbentobj(contextptr)[source]
+
+ +
+
+callbackgetlocallb(contextptr, begin, end)[source]
+
+ +
+
+callbackgetlocalub(contextptr, begin, end)[source]
+
+ +
+
+callbackgetgloballb(contextptr, begin, end)[source]
+
+ +
+
+callbackgetglobalub(contextptr, begin, end)[source]
+
+ +
+
+callbackpostheursoln(contextptr, cnt, ind, val, obj, strategy)[source]
+
+ +
+
+callbackaddusercuts(contextptr, rcnt, nzcnt, rhs, sense, rmat, cutmanagement, local)[source]
+
+ +
+
+callbackrejectcandidate(contextptr, rcnt, nzcnt, rhs, sense, rmat)[source]
+
+ +
+
+callbackrejectcandidatelocal(contextptr, rcnt, nzcnt, rhs, sense, rmat)[source]
+
+ +
+
+modelasstcallbacksetfunc(env, lp, cbhandle)[source]
+
+ +
+
+

cplex._internal._matrices module

+
+
undocumented:
+

_C_HB_Matrix, _HB_Matrix

+
+
+
+
+unpack_pair(item)[source]
+

Extracts the indices and values from an object.

+

The argument item can either be an instance of SparsePair or a +sequence of length two.

+

Example usage:

+
>>> sp = SparsePair()
+>>> ind, val = unpack_pair(sp)
+>>> lin_expr = [[], []]
+>>> ind, val = unpack_pair(lin_expr)
+
+
+
+ +
+
+unpack_triple(item)[source]
+

Extracts the indices and values from an object.

+

The argument item can either be an instance of SparseTriple or a +sequence of length three.

+

Example usage:

+
>>> st = SparseTriple()
+>>> ind1, ind2, val = unpack_triple(st)
+>>> quad_expr = [[], [], []]
+>>> ind1, ind2, val = unpack_triple(quad_expr)
+
+
+
+ +
+
+

cplex._internal._multiobj module

+

Multi-Objective API

+
+
+class MultiObjInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._multiobj.MultiObjInterface
+ + + +

Methods for adding, querying, and modifying multiple objectives.

+

The methods in this interface can be used to add, query, and modify +objectives in a specified problem. These objectives are used when +multi-objective optimization is initiated.

+

See also MultiObjSolnInterface where methods for accessing +solutions for multi-objective models can be found.

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+
+
+sense = <cplex._internal._subinterfaces.ObjSense object>
+

See ObjSense()

+
+ +
+
+__init__(cpx)[source]
+

Creates a new MultiObjInterface.

+

The Multi-Objective interface is exposed by the top-level Cplex +class as Cplex.multiobj. This constructor is not meant to be +used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of objectives in the problem.

+

See CPXgetnumobjs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.get_num()
+1
+>>> indices = c.multiobj.set_num(2)
+>>> c.multiobj.get_num()
+2
+
+
+
+ +
+
+set_num(numobj)[source]
+

Sets the number of objectives in the problem instance.

+

There is always at least one objective in the problem instance +(indexed 0) thus numobj must be at least 1. If before calling +this method there were more objectives in the instance than the +specified numobj then the objectives whose index is >= numobj are +removed from the instance. If before calling this method the +number of objectives was <= numobj then new objectives are +created, all with all-zero coefficients and default settings +(like priority, weight, etc).

+

See CPXsetnumobjs in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.get_num()
+2
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of objectives.

+

There are four forms by which multiobj.get_names may be called.

+
+
multiobj.get_names()

return the names of all objectives from the problem.

+
+
multiobj.get_names(i)

i must be an objective index. Returns the name of row i.

+
+
multiobj.get_names(s)

s must be a sequence of objective indices. Returns the names of +the objectives with indices the members of s. Equivalent to +[multiobj.get_names(i) for i in s]

+
+
multiobj.get_names(begin, end)

begin and end must be objective indices. Returns the names of +the objectives with indices between begin and end, inclusive of +end. Equivalent to multiobj.get_names(range(begin, end + 1)).

+
+
+

See CPXmultiobjgetname in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_definition(0, name='mo1')
+>>> c.multiobj.get_names(0)
+'mo1'
+
+
+
+ +
+
+set_name(objidx, name)[source]
+

Sets the name of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.set_num(3)
+>>> for i in range(3):
+...     c.multiobj.set_name(i, str(i))
+>>> c.multiobj.get_names()
+['0', '1', '2']
+
+
+
+ +
+
+get_definition(objidx, begin=None, end=None)[source]
+

Returns the definition of an objective.

+

Returns an objective definitions, where the definition is a list +containing the following components: obj (a list containing the +linear objective coefficients), offset, weight, priority, abstol, +reltol (see set_definition).

+

objidx is the name or index of the objective to be accessed.

+

The optional begin and end arguments must be variable indices +or names. Together, begin and end specify the range of objective +function coefficients to be returned. By default, the linear +objective coefficients of all variables from the problem will be +returned (i.e., begin will default to the first variable index +and end will default to the last variable index).

+

See CPXmultiobjgetobj in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> varind = list(c.variables.add(obj=[1.0, 2.0]))
+>>> c.multiobj.get_definition(0)
+[[1.0, 2.0], 0.0, 1.0, 0, 0.0, 0.0]
+
+
+
+ +
+
+set_definition(objidx, obj=None, offset=0.0, weight=1.0, priority=0, abstol=None, reltol=None, name=None)[source]
+

Sets the definition of an objective.

+

multiobj.set_definition accepts the keyword arguments objidx, +obj, offset, weight, priority, abstol, reltol, and name.

+

objidx is the name or index of the objective to be set. The +objective index must be in the interval +[0, Cplex.multiobj.get_num() - 1].

+

obj can be either a SparsePair or a list of two lists specifying +the linear component of the objective. If not specified, the +coefficients of every variable are set to 0.0.

+
+
Note

obj must not contain duplicate indices. If obj references a +variable more than once, either by index, name, or a +combination of index and name, an exception will be raised.

+
+
+

offset is the offset of the objective to be set. If not +specififed, the offset is set to 0.0.

+

weight is the weight of the objective to be set. For the +definition of the weight see the description of blended objective +in the multi-objective optimization section of the CPLEX User’s +Manual. If not specified, the weight is set to 1.0.

+

priority is the priority of the objective to be set. It must be a +nonnegative integer. For the definition of the priority see the +description of lexicographic objective in the multi-objective +optimization section of the CPLEX User’s Manual. If not +specified, the priority is set to 0.

+

abstol is the absolute tolerance of the objective to be set. If +not specified, the absolute tolerance is set to 0.0.

+

reltol is the relative tolerance of the objective to be set. If +not specified, the relative tolerance is set to 0.0.

+

name is a string representing the name of the objective to be +set. If not specified, the objective name will default to None.

+

See CPXmultiobjsetobj in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> varind = list(c.variables.add(names=['x1', 'x2']))
+>>> c.multiobj.set_definition(
+...     objidx=0,
+...     obj=cplex.SparsePair(ind=varind, val=[1.0, 2.0]),
+...     offset=0.0,
+...     weight=1.0,
+...     priority=0,
+...     abstol=1e-06,
+...     reltol=1e-04,
+...     name='obj1')
+>>> c.multiobj.get_definition('obj1')
+[[1.0, 2.0], 0.0, 1.0, 0, 1e-06, 0.0001]
+>>> c.multiobj.get_names(0)
+'obj1'
+
+
+
+ +
+
+get_linear(objidx, *args)[source]
+

Returns the linear coefficients of a set of variables.

+

Can be called by four forms each of which requires an objidx +argument. objidx must be an objective name or index.

+
+
multiobj.get_linear(objidx)

return the linear objective coefficients of all variables +from the problem.

+
+
multiobj.get_linear(objidx, i)

i must be a variable name or index. Returns the linear +objective coefficient of the variable whose index or name is i.

+
+
multiobj.get_linear(objidx, s)

s must be a sequence of variable names or indices. Returns the +linear objective coefficient of the variables with indices the +members of s. Equivalent to +[multiobj.get_linear(objidx, i) for i in s]

+
+
multiobj.get_linear(objidx, begin, end)

begin and end must be variable indices or variable names. +Returns the linear objective coefficient of the variables with +indices between begin and end, inclusive of end. Equivalent to +multiobj.get_linear(objidx, range(begin, end + 1)).

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(
+...     obj=[1.5 * i for i in range(10)],
+...     names=[str(i) for i in range(10)])
+>>> c.variables.get_num()
+10
+>>> c.multiobj.get_linear(0, 8)
+12.0
+>>> c.multiobj.get_linear(0, '1', 3)
+[1.5, 3.0, 4.5]
+>>> c.multiobj.get_linear(0, [2, '0', 5])
+[3.0, 0.0, 7.5]
+>>> c.multiobj.get_linear(0)
+[0.0, 1.5, 3.0, 4.5, 6.0, 7.5, 9.0, 10.5, 12.0, 13.5]
+
+
+
+ +
+
+set_linear(objidx, *args)[source]
+

Changes the linear part of an objective function.

+

Can be called by two forms each of which requires an objidx +argument. objidx must be an objective name or index.

+
+
multiobj.set_linear(objidx, var, value)

var must be a variable index or name and value must be a float. +Changes the coefficient of the variable identified by var to +value.

+
+
multiobj.set_linear(objidx, sequence)

sequence is a sequence of pairs (var, value) as described +above. Changes the coefficients for the specified variables to +the given values.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=[str(i) for i in range(4)])
+>>> c.multiobj.get_linear(0)
+[0.0, 0.0, 0.0, 0.0]
+>>> c.multiobj.set_linear(0, 0, 1.0)
+>>> c.multiobj.get_linear(0)
+[1.0, 0.0, 0.0, 0.0]
+>>> c.multiobj.set_linear(0, '3', -1.0)
+>>> c.multiobj.get_linear(0)
+[1.0, 0.0, 0.0, -1.0]
+>>> c.multiobj.set_linear(0, [('2', 2.0), (1, 0.5)])
+>>> c.multiobj.get_linear(0)
+[1.0, 0.5, 2.0, -1.0]
+
+
+
+ +
+
+get_sense()[source]
+

Returns the sense of all objective functions.

+

See ObjSense.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+>>> c.multiobj.set_sense(c.multiobj.sense.maximize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'maximize'
+>>> c.multiobj.set_sense(c.multiobj.sense.minimize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+
+
+
+ +
+
+set_sense(sense)[source]
+

Sets the sense of all objective functions.

+
+
Note

All objective functions share the same sense. To model an +objective with a different sense use a negative value for the +weight attribute. See set_weight.

+
+
+

The argument to this method must be either ObjSense.minimize +or ObjSense.maximize.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+>>> c.multiobj.set_sense(c.multiobj.sense.maximize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'maximize'
+>>> c.multiobj.set_sense(c.multiobj.sense.minimize)
+>>> c.multiobj.sense[c.multiobj.get_sense()]
+'minimize'
+
+
+
+ +
+
+get_offset(objidx)[source]
+

Returns the constant offset of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_offset(0)
+0.0
+
+
+
+ +
+
+set_offset(objidx, offset)[source]
+

Sets the constant offset of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.objective.set_offset(3.14)
+>>> c.objective.get_offset()
+3.14
+
+
+
+ +
+
+get_weight(objidx)[source]
+

Returns the weight of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_weight(0)
+1.0
+
+
+
+ +
+
+set_weight(objidx, weight)[source]
+

Sets the weight of an objective function.

+

objidx must be an objective name or index.

+
+
Note

All objective functions share the same sense. To model an +objective with a different sense use a negative value for the +weight attribute. See set_sense.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_weight(0, -2.0)
+>>> c.multiobj.get_weight(0)
+-2.0
+
+
+
+ +
+
+get_priority(objidx)[source]
+

Returns the priority of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_priority(0)
+0
+
+
+
+ +
+
+set_priority(objidx, priority)[source]
+

Sets the priority of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_priority(0, 2)
+>>> c.multiobj.get_priority(0)
+2
+
+
+
+ +
+
+get_abstol(objidx)[source]
+

Returns the absolute tolerance of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_abstol(0)
+0.0
+
+
+
+ +
+
+set_abstol(objidx, abstol)[source]
+

Sets the absolute tolerance of an objective function.

+

objidx must be an objective name or index.

+

abstol should be a float. When specifying a new value, the same +limits apply as with the +Cplex.parameters.mip.tolerances.absmipgap parameter. See the +section on Specifying multiple objective problems in the CPLEX +User’s Manual for the details on the meaning of this tolerance.

+

See CPXmultiobjchgattribs in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_abstol(0, 1e-6)
+>>> c.multiobj.get_abstol(0)
+1e-06
+
+
+
+ +
+
+get_reltol(objidx)[source]
+

Returns the relative tolerance of an objective function.

+

objidx must be an objective name or index.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.get_reltol(0)
+0.0
+
+
+
+ +
+
+set_reltol(objidx, reltol)[source]
+

Sets the relative tolerance of an objective function.

+

objidx must be an objective name or index.

+

reltol should be a float. When specifying a new value, the same +limits apply as with the Cplex.parameters.mip.tolerances.mipgap +parameter. Note that a nondefault setting of this parameter only +applies to MIP multiobjective problems. See the section on +Specifying multiple objective problems in the CPLEX User’s Manual +for the details on the meaning of this tolerance.

+

See CPXmultiobjchgattribs in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0 for i in range(3)])
+>>> c.multiobj.set_reltol(0, 1e-4)
+>>> c.multiobj.get_reltol(0)
+0.0001
+
+
+
+ +
+ +
+
+

cplex._internal._multiobjsoln module

+

Multi-Objective Solution API

+
+
+class MultiObjFloatInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjFloatInfo
+ + + +

Types of floating point information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+time = 2
+

See CPX_MULTIOBJ_TIME in the C API.

+
+ +
+
+dettime = 3
+

See CPX_MULTIOBJ_DETTIME in the C API.

+
+ +
+
+objective = 14
+

See CPX_MULTIOBJ_OBJVAL in the C API.

+
+ +
+
+best_objective = 15
+

See CPX_MULTIOBJ_BESTOBJVAL in the C API.

+
+ +
+ +
+
+class MultiObjIntInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjIntInfo
+ + + +

Types of integer information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+error = 0
+

See CPX_MULTIOBJ_ERROR in the C API.

+
+ +
+
+status = 1
+

See CPX_MULTIOBJ_STATUS in the C API.

+
+ +
+
+method = 18
+

See CPX_MULTIOBJ_METHOD in the C API.

+
+ +
+
+priority = 17
+

See CPX_MULTIOBJ_PRIORITY in the C API.

+
+ +
+
+blend = 20
+

See CPX_MULTIOBJ_BLEND in the C API.

+
+ +
+
+pfeas = 21
+

See CPX_MULTIOBJ_PFEAS in the C API.

+
+ +
+
+dfeas = 22
+

See CPX_MULTIOBJ_DFEAS in the C API.

+
+ +
+ +
+
+class MultiObjLongInfo[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjLongInfo
+ + + +

Types of long integer information that can be queried for +multi-objective optimization.

+

This class contains the types of solution information of type float +that can be retreived from the solution of a sub-problem solved +during multi-objective optimization.

+

This information can be querried for each priority level with method +MultiObjSolnInterface.get_info.

+
+
+num_barrier_iterations = 4
+

See CPX_MULTIOBJ_BARITCNT in the C API.

+
+ +
+
+num_sifting_iterations = 5
+

See CPX_MULTIOBJ_SIFTITCNT in the C API.

+
+ +
+
+num_sifting_phase1_iterations = 6
+

See CPX_MULTIOBJ_SIFTPHASE1CNT in the C API.

+
+ +
+
+num_degenerate_iterations = 7
+

See CPX_MULTIOBJ_DEGCNT in the C API.

+
+ +
+
+num_iterations = 8
+

See CPX_MULTIOBJ_ITCNT in the C API.

+
+ +
+
+num_phase1_iterations = 9
+

See CPX_MULTIOBJ_PHASE1CNT in the C API.

+
+ +
+
+num_primal_pushes = 10
+

See CPX_MULTIOBJ_PPUSH in the C API.

+
+ +
+
+num_primal_exchanges = 11
+

See CPX_MULTIOBJ_PEXCH in the C API.

+
+ +
+
+num_dual_pushes = 12
+

See CPX_MULTIOBJ_DPUSH in the C API.

+
+ +
+
+num_dual_exchanges = 13
+

See CPX_MULTIOBJ_DEXCH in the C API.

+
+ +
+
+num_nodes = 16
+

See CPX_MULTIOBJ_NODECNT in the C API.

+
+ +
+
+num_nodes_left = 19
+

See CPX_MULTIOBJ_NODELEFTCNT in the C API.

+
+ +
+ +
+
+class MultiObjSolnInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._multiobjsoln.MultiObjSolnInterface
+ + + +

Methods for accessing solutions for multi-objective models.

+

The methods in this interface can be used to query solutions for +multi-objective models.

+

See also MultiObjInterface where methods for adding, querying, and +modifying multiple objectives can be found.

+
+
+float_info = <cplex._internal._multiobjsoln.MultiObjFloatInfo object>
+

See MultiObjFloatInfo()

+
+ +
+
+int_info = <cplex._internal._multiobjsoln.MultiObjIntInfo object>
+

See MultiObjIntInfo()

+
+ +
+
+long_info = <cplex._internal._multiobjsoln.MultiObjLongInfo object>
+

See MultiObjLongInfo()

+
+ +
+
+__init__(parent)[source]
+

Creates a new MIPSolutionInterface.

+

The multi-objective solution interface is exposed by the +top-level Cplex class as Cplex.solution.multiobj. This +constructor is not meant to be used externally.

+
+ +
+
+get_objective_value(objidx)[source]
+

Returns the value of an objective function.

+

objidx is the name or index of the objective to be accessed.

+

See CPXmultiobjgetobjval in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.solve()
+>>> c.solution.multiobj.get_objective_value(0)
+-202.5
+>>> c.solution.multiobj.get_objective_value(1)
+-202.5
+
+
+
+ +
+
+get_objval_by_priority(priority)[source]
+

Returns the value of an objective function by priority.

+

After multi-objective optimization, returns the blended objective +value for the specified priority.

+

See CPXmultiobjgetobjvalbypriority in the Callable +Library Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> c.solution.multiobj.get_objval_by_priority(1)
+-202.5
+>>> c.solution.multiobj.get_objval_by_priority(2)
+-202.5
+
+
+
+ +
+
+get_num_solves()[source]
+

Returns the number of sub-problems that where successfully +solved during the last optimization of a multi-objective problem.

+

See CPXmultiobjgetnumsolves in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> c.solution.multiobj.get_num_solves()
+2
+
+
+
+ +
+
+get_info(subprob, what)[source]
+

Returns the solution information of a sub-problem of a +multi-objective optimization.

+

subprob is the sub-problem of a multi-objective optimization.

+

what is an attribute from Cplex.solution.multiobj.float_info +(see MultiObjFloatInfo), Cplex.solution.multiobj.int_info +(see MultiObjIntInfo), or Cplex.solution.multiobj.long_info +(see MultiObjLongInfo).

+

See CPXmultiobjgetdblinfo, +CPXmultiobjgetintinfo, +CPXmultiobjgetlonginfo, etc. in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("example.mps")
+>>> c.multiobj.set_num(2)
+>>> c.multiobj.set_linear(
+...     1,
+...     [(i, o) for i, o in enumerate(c.multiobj.get_linear(0))]
+... )
+>>> c.multiobj.set_priority(0, 1)
+>>> c.multiobj.set_priority(1, 2)
+>>> c.solve()
+>>> num = c.solution.multiobj.get_num_solves()
+>>> for i in range(num):
+...     priority = c.solution.multiobj.get_info(
+...         i,
+...         c.solution.multiobj.int_info.priority
+...     )
+
+
+
+ +
+ +
+
+

cplex._internal._pwl module

+

Piecewise Linear API

+
+
+class PWLConstraintInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._pwl.PWLConstraintInterface
+ + + +

Methods for adding, querying, and modifying PWL constraints.

+

A PWL constraint describes a piecewise linear relationship between +two variables: vary=pwl(varx). The PWL constraint is described by +specifying the index of the vary and varx variables involved and by +providing the breakpoints of the PWL function (specified by the +(breakx[i],breaky[i]) coordinate pairs). Before the first segment of +the PWL function there may be a half-line; its slope is specified by +preslope. After the last segment of the the PWL function there may +be a half-line; its slope is specified by postslope. Two consecutive +breakpoints may have the same x coordinate, in such cases there is a +discontinuity in the PWL function. Three consecutive breakpoints +may not have the same x coordinate.

+
+
+__init__(cpx)[source]
+

Creates a new PWLConstraintInterface.

+

The PWL constraint interface is exposed by the top-level Cplex +class as Cplex.pwl_constraints. This constructor is not meant +to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of PWL constraints in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.pwl_constraints.get_num()
+0
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+
+
+
+ +
+
+add(vary, varx, preslope, postslope, breakx, breaky, name='')[source]
+

Adds a PWL constraint to the problem.

+

vary: the index of the ‘y’ variable in the vary=pwl(varx) +function.

+

varx: the index of the ‘x’ variable in the vary=pwl(varx) +function.

+

preslope: before the first segment of the PWL function there is +a half-line; its slope is specified by preslope.

+

postslope: after the last segment of the the PWL function there +is a half-line; its slope is specified by postslope.

+

breakx: A list containing the indices of the ‘x’ variables +involved.

+

breaky: A list containing the indices of the ‘y’ variables +involved.

+

name: the name of the PWL constraint; defaults to the empty +string.

+

Returns the index of the PWL constraint.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes PWL constraints from the problem.

+

There are four forms by which pwl_constraints.delete may be +called.

+
+
pwl_constraints.delete()

deletes all PWL constraints from the problem.

+
+
pwl_constraints.delete(i)

i must be a PWL constraint name or index. Deletes the PWL +constraint whose index or name is i.

+
+
pwl_constraints.delete(seq)

seq must be a sequence of PWL constraint names or indices. +Deletes the PWL constraints with names or indices contained +within s. Equivalent to [pwl_constraints.delete(i) for i in s].

+
+
pwl_constraints.delete(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Deletes the PWL constraints with indices between begin +and end, inclusive of end. Equivalent to +pwl_constraints.delete(range(begin, end + 1)). This will give +the best performance when deleting batches of PWL constraints.

+
+
+

See CPXdelpwl in the Callable Library Reference Manual for more +detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_num()
+1
+>>> c.pwl_constraints.delete(idx)
+>>> c.pwl_constraints.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of PWL constraints.

+

May be called by four forms.

+
+
pwl_constraints.get_names()

return the names of all PWL constraints in the problem.

+
+
pwl_constraints.get_names(i)

i must be a PWL constraint name or index. Returns the name of +PWL constraint i.

+
+
pwl_constraints.get_names(seq)

seq must be a sequence of PWL constraint names or indices. +Returns the names of PWL constraints with names or indices in +s. Equivalent to +[pwl_constraints.get_names(i) for i in s]

+
+
pwl_constraints.get_names(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Returns the names of PWL constraints with indices +between begin and end, inclusive of end. Equivalent to +pwl_constraints.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_names(idx)
+'pwl1'
+
+
+
+ +
+
+get_definitions(*args)[source]
+

Returns the definitions of a set of PWL constraints.

+

Returns a list of PWL definitions, where each definition is a +list containing the following components: vary, varx, preslope, +postslope, breakx, breaky (see add).

+

May be called by four forms.

+
+
pwl_constraints.get_definitions()

return the definitions of all PWL constraints in the +problem.

+
+
pwl_constraints.get_definitions(i)

i must be a PWL constraint name or index. Returns the +definition of PWL constraint i.

+
+
pwl_constraints.get_definitions(seq)

seq must be a sequence of PWL constraint names or indices. +Returns the definitions of PWL constraints with names or +indices in s. Equivalent to +[pwl_constraints.get_definitions(i) for i in s]

+
+
pwl_constraints.get_definitions(begin, end)

begin and end must be PWL constraint indices or PWL constraint +names. Returns the definitions of PWL constraints with indices +between begin and end, inclusive of end. Equivalent to +pwl_constraints.get_definitions(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['y', 'x'])
+>>> idx = c.pwl_constraints.add(vary='y', varx='x',
+...                             preslope=0.5, postslope=2.0,
+...                             breakx=[0.0, 1.0, 2.0],
+...                             breaky=[0.0, 1.0, 4.0],
+...                             name='pwl1')
+>>> c.pwl_constraints.get_definitions(idx)
+[0, 1, 0.5, 2.0, [0.0, 1.0, 2.0], [0.0, 1.0, 4.0]]
+
+
+
+ +
+ +
+
+

cplex._internal._anno module

+

Annotation API

+
+
+class AnnotationObjectType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._anno.AnnotationObjectType
+ + + +

Constants defining annotation object types.

+
+
+objective = 0
+
+ +
+
+variable = 1
+
+ +
+
+row = 2
+
+ +
+
+sos_constraint = 3
+
+ +
+
+indicator_constraint = 4
+
+ +
+
+quadratic_constraint = 5
+
+ +
+ +
+
+class AnnotationInterface[source]
+

Bases: BaseInterface

+
Inheritance diagram of cplex._internal._anno.AnnotationInterface
+ + + +

Methods for adding, querying, and modifying annotations.

+
+
+object_type = <cplex._internal._anno.AnnotationObjectType object>
+

See AnnotationObjectType()

+
+ +
+ +
+
+class LongAnnotationInterface[source]
+

Bases: AnnotationInterface

+
Inheritance diagram of cplex._internal._anno.LongAnnotationInterface
+ + + + +

Methods for adding, querying, and modifying long annotations.

+
+
+benders_annotation = 'cpxBendersPartition'
+

String constant for the name of the Benders annotation.

+
+ +
+
+benders_mastervalue = 0
+

Default value for the Benders master partition.

+
+ +
+
+__init__(cpx)[source]
+

Creates a new LongAnnotationInterface.

+

The long annotation interface is exposed by the top-level Cplex +class as Cplex.long_annotations. This constructor is not meant +to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of long annotations in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.long_annotations.get_num()
+0
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> c.long_annotations.get_num()
+1
+
+
+
+ +
+
+add(name, defval)[source]
+

Adds an annotation to the problem.

+

name: the name of the annotation.

+

defval: the default value for annotation objects.

+

Returns the index of the added annotation.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add(name='ann1', defval=0)
+>>> c.long_annotations.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes long annotations from the problem.

+

There are four forms by which long_annotations.delete may be +called.

+
+
long_annotations.delete()

deletes all long annotations from the problem.

+
+
long_annotations.delete(i)

i must be an annotation name or index. Deletes the long +annotation whose index or name is i.

+
+
long_annotations.delete(seq)

seq must be a sequence of annotation names or indices. +Deletes the long annotations with names or indices contained +within s. Equivalent to [long_annotations.delete(i) for i in s].

+
+
long_annotations.delete(begin, end)

begin and end must be annotation indices or annotation names. +Deletes the long annotations with indices between begin and +end, inclusive of end. Equivalent to +long_annotations.delete(range(begin, end + 1)). This will give +the best performance when deleting batches of long annotations.

+
+
+

See CPXdellongannotations in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> c.long_annotations.get_num()
+1
+>>> c.long_annotations.delete(idx)
+>>> c.long_annotations.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of long annotations.

+

May be called by four forms.

+
+
long_annotations.get_names()

return the names of all long annotations in the problem.

+
+
long_annotations.get_names(i)

i must be an annotation name or index. Returns the name of +long annotation i.

+
+
long_annotations.get_names(seq)

seq must be a sequence of annotation names or indices. +Returns the names of long annotations with names or indices in +s. Equivalent to +[long_annotations.get_names(i) for i in s]

+
+
long_annotations.get_names(begin, end)

begin and end must be annotation indices or annotation names. +Returns the names of long annotations with indices between +begin and end, inclusive of end. Equivalent to +long_annotations.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.long_annotations.add('ann{0}'.format(i), i)
+...  for i in range(1, 6)]
+[0, 1, 2, 3, 4]
+>>> c.long_annotations.get_names()
+['ann1', 'ann2', 'ann3', 'ann4', 'ann5']
+>>> c.long_annotations.get_names(0)
+'ann1'
+>>> c.long_annotations.get_names([0, 2, 4])
+['ann1', 'ann3', 'ann5']
+>>> c.long_annotations.get_names(1, 3)
+['ann2', 'ann3', 'ann4']
+
+
+
+ +
+
+get_default_values(*args)[source]
+

Returns the default value of a set of long annotations.

+

May be called by four forms.

+
+
long_annotations.get_default_values()

return the default values of all long annotations in the +problem.

+
+
long_annotations.get_default_values(i)

i must be an annotation name or index. Returns the default +value of long annotation i.

+
+
long_annotations.get_default_values(seq)

seq must be a sequence of annotation names or indices. +Returns the default values of long annotations with names or +indices in s. Equivalent to +[long_annotations.get_default_values(i) for i in s]

+
+
long_annotations.get_default_values(begin, end)

begin and end must be annotation indices or annotation names. +Returns the default values of long annotations with indices +between begin and end, inclusive of end. Equivalent to +long_annotations.get_default_values(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx1 = c.long_annotations.add(name='ann1', defval=0)
+>>> idx2 = c.long_annotations.add(name='ann2', defval=1)
+>>> c.long_annotations.get_default_values()
+[0, 1]
+
+
+
+ +
+
+set_values(idx, objtype, *args)[source]
+

Sets the values for objects in the specified long annotation.

+

idx: the long annotation index or name.

+

objtype: the annotation object type.

+

Can be called by two forms:

+
+
long_annotations.set_values(idx, objtype, i, val)

i must be a name or index. Changes the long annotation value +of the object identified by i.

+
+
long_annotations.set_values(idx, objtype, seq)

seq is a sequence of pairs (i, val) as described above. +Changes the long annotation values for the specified objects.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.objective
+>>> c.long_annotations.set_values(idx, objtype, 0, 1)
+>>> c.long_annotations.get_values(idx, objtype, 0)
+1
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.long_annotations.object_type.variable
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.long_annotations.get_values(idx, objtype)
+[1, 1, 1]
+
+
+
+ +
+
+get_values(idx, objtype, *args)[source]
+

Returns the long annotation values for the specified objects.

+

idx: the long annotation index or name.

+

objtype: the annotation object type.

+

Can be called by four forms:

+
+
long_annotations.get_values(idx, objtype)

return the values of all objects for a given annotation.

+
+
long_annotations.get_values(idx, objtype, i)

i must be a name or index. Returns the long annotation value +of the object identified by i.

+
+
long_annotations.get_values(idx, objtype, seq)

seq is a sequence of object names or indices. Returns the +long annotation values for the specified objects. Equivalent +to +[long_annotations.get_values(idx, objtype, i) for i in seq]

+
+
long_annotations.get_values(idx, objtype, begin, end)

begin and end must be object indices or object names. Returns +the long annotation values of objects with indices between +begin and end, inclusive of end. Equivalent to +long_annotations.get_values(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.objective
+>>> c.long_annotations.set_values(idx, objtype, 0, 1)
+>>> c.long_annotations.get_values(idx, objtype, 0)
+1
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.long_annotations.object_type.variable
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.long_annotations.get_values(idx, objtype, list(indices))
+[1, 1, 1]
+
+
+
+ +
+ +
+
+class DoubleAnnotationInterface[source]
+

Bases: AnnotationInterface

+
Inheritance diagram of cplex._internal._anno.DoubleAnnotationInterface
+ + + + +

Methods for adding, querying, and modifying double annotations.

+
+
+__init__(cpx)[source]
+

Creates a new DoubleAnnotationInterface.

+

The double annotation interface is exposed by the top-level +Cplex class as Cplex.double_annotations. This constructor is +not meant to be used externally.

+
+ +
+
+get_num()[source]
+

Returns the number of double annotations in the problem.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.double_annotations.get_num()
+0
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+add(name, defval)[source]
+

Adds an annotation to the problem.

+

name: the name of the annotation.

+

defval: the default value for annotation objects.

+

Returns the index of the added annotation.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add(name='ann1', defval=0.0)
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+delete(*args)[source]
+

Deletes double annotations from the problem.

+

There are four forms by which double_annotations.delete may be +called.

+
+
double_annotations.delete()

deletes all double annotations from the problem.

+
+
double_annotations.delete(i)

i must be an annotation name or index. Deletes the double +annotation whose index or name is i.

+
+
double_annotations.delete(seq)

seq must be a sequence of annotation names or indices. +Deletes the double annotations with names or indices contained +within s. Equivalent to +[double_annotations.delete(i) for i in s].

+
+
double_annotations.delete(begin, end)

begin and end must be annotation indices or annotation names. +Deletes the double annotations with indices between begin and +end, inclusive of end. Equivalent to +double_annotations.delete(range(begin, end + 1)). This will +give the best performance when deleting batches of double +annotations.

+
+
+

See CPXdeldblannotations in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> c.double_annotations.get_num()
+1
+>>> c.double_annotations.delete(idx)
+>>> c.double_annotations.get_num()
+0
+
+
+
+ +
+
+get_names(*args)[source]
+

Returns the names of a set of double annotations.

+

May be called by four forms.

+
+
double_annotations.get_names()

return the names of all double annotations in the problem.

+
+
double_annotations.get_names(i)

i must be an annotation name or index. Returns the name of +double annotation i.

+
+
double_annotations.get_names(seq)

seq must be a sequence of annotation names or indices. +Returns the names of double annotations with names or indices +in s. Equivalent to +[double_annotations.get_names(i) for i in s]

+
+
double_annotations.get_names(begin, end)

begin and end must be annotation indices or annotation names. +Returns the names of double annotations with indices between +begin and end, inclusive of end. Equivalent to +double_annotations.get_names(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> [c.double_annotations.add('ann{0}'.format(i), i)
+...  for i in range(1, 6)]
+[0, 1, 2, 3, 4]
+>>> c.double_annotations.get_names()
+['ann1', 'ann2', 'ann3', 'ann4', 'ann5']
+>>> c.double_annotations.get_names(0)
+'ann1'
+>>> c.double_annotations.get_names([0, 2, 4])
+['ann1', 'ann3', 'ann5']
+>>> c.double_annotations.get_names(1, 3)
+['ann2', 'ann3', 'ann4']
+
+
+
+ +
+
+get_default_values(*args)[source]
+

Returns the default value of a set of double annotations.

+

May be called by four forms.

+
+
double_annotations.get_default_values()

return the default values of all double annotations in the +problem.

+
+
double_annotations.get_default_values(i)

i must be an annotation name or index. Returns the default +value of double annotation i.

+
+
double_annotations.get_default_values(seq)

seq must be a sequence of annotation names or indices. +Returns the default values of double annotations with names or +indices in s. Equivalent to +[double_annotations.get_default_values(i) for i in s]

+
+
double_annotations.get_default_values(begin, end)

begin and end must be annotation indices or annotation names. +Returns the default values of double annotations with indices +between begin and end, inclusive of end. Equivalent to +double_annotations.get_default_values(list(range(begin, end + 1)))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx1 = c.double_annotations.add(name='ann1', defval=0.0)
+>>> idx2 = c.double_annotations.add(name='ann2', defval=1.0)
+>>> c.double_annotations.get_default_values()
+[0.0, 1.0]
+
+
+
+ +
+
+set_values(idx, objtype, *args)[source]
+

Sets the values for objects in the specified double annotation.

+

idx: the double annotation index or name.

+

objtype: the annotation object type.

+

Can be called by two forms:

+
+
double_annotations.set_values(idx, objtype, i, val)

i must be a name or index. Changes the double annotation +value of the object identified by i.

+
+
double_annotations.set_values(idx, objtype, seq)

seq is a sequence of pairs (i, val) as described above. +Changes the double annotation values for the specified +objects.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> objtype = c.double_annotations.object_type.objective
+>>> c.double_annotations.set_values(idx, objtype, 0, 1.0)
+>>> c.double_annotations.get_values(idx, objtype, 0)
+1.0
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.double_annotations.object_type.variable
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1.0) for i in indices])
+>>> c.double_annotations.get_values(idx, objtype)
+[1.0, 1.0, 1.0]
+
+
+
+ +
+
+get_values(idx, objtype, *args)[source]
+

Returns the double annotation values for the specified objects.

+

idx: the double annotation index or name.

+

objtype: the annotation object type.

+

Can be called by four forms:

+
+
double_annotations.get_values(idx, objtype)

return the values of all objects for a given annotation.

+
+
double_annotations.get_values(idx, objtype, i)

i must be a name or index. Returns the double annotation +value of the object identified by i.

+
+
double_annotations.get_values(idx, objtype, seq)

seq is a sequence of object names or indices. Returns the +double annotation values for the specified objects. +Equivalent to +[double_annotations.get_values(idx, objtype, i) for i in seq]

+
+
double_annotations.get_values(idx, objtype, begin, end)

begin and end must be object indices or object names. Returns +the double annotation values of objects with indices between +begin and end, inclusive of end. Equivalent to +double_annotations.get_values(range(begin, end + 1))

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.double_annotations.add('ann1', 0.0)
+>>> objtype = c.double_annotations.object_type.objective
+>>> c.double_annotations.set_values(idx, objtype, 0, 1.0)
+>>> c.double_annotations.get_values(idx, objtype, 0)
+1.0
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> objtype = c.double_annotations.object_type.variable
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1.0) for i in indices])
+>>> c.double_annotations.get_values(idx, objtype, list(indices))
+[1.0, 1.0, 1.0]
+
+
+
+ +
+ +
+
+

cplex._internal._constants module

+

Constants from the CPLEX C Callable Library

+
+
+

cplex._internal._constantsenum module

+

Enum constants from the CPLEX C Callable Library

+
+
+

cplex._internal._aux_functions module

+

Internal auxiliary functions.

+
+
+class deprecated[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._aux_functions.deprecated
+ + +

A decorator that marks methods/functions as deprecated.

+
+
+__init__(version)[source]
+
+ +
+ +
+
+deprecated_class(name, version, stacklevel=3)[source]
+

Emits a warning for a deprecated class.

+

This should be called in __init__.

+

name - the name of the class (e.g., PresolveCallback).

+
+
version - the version at which the class was deprecated (e.g.,

“V12.7.1”).

+
+
+

stacklevel - indicates how many levels up the stack is the caller.

+
+ +
+
+max_arg_length(arg_list)[source]
+

Returns the max length of the arguments in arg_list.

+
+ +
+
+validate_arg_lengths(arg_list, allow_empty=True, extra_msg='')[source]
+

Checks for equivalent argument lengths.

+

If allow_empty is True (the default), then empty arguments are not +checked against the max length of non-empty arguments. Some functions +allow NULL arguments in the Callable Library, for example.

+
+ +
+
+make_ranges(indices)[source]
+

non-public

+
+ +
+
+identity(x)[source]
+

Simple identity function.

+
+ +
+
+apply_freeform_two_args(fn, conv, args, unpack_single=True)[source]
+

non-public

+
+ +
+
+apply_freeform_one_arg(fn, conv, maxval, args)[source]
+

non-public

+
+ +
+
+apply_pairs(fn, conv, *args)[source]
+

non-public

+
+ +
+
+delete_set_by_range(fn, conv, max_num, *args)[source]
+

non-public

+
+ +
+
+make_group(conv, max_num, c_type, *args)[source]
+

Returns a _group object

+

input: +conv - a function that will convert names to indices +max_num - number of existing constraints of a given type +c_type - constraint type +args - arbitrarily many arguments (see description below)

+

If args is empty, every constraint/bound is assigned weight 1.0.

+

If args is of length one or more, every constraint/bound is assigned +a weight equal to the float passed in as the first item.

+

If args contains additional items, they determine a subset of +constraints/bounds to be included. If one index or name is +specified, it is the only one that will be included. If two indices +or names are specified, all constraints between the first and the +second, inclusive, will be included. If a sequence of names or +indices is passed in, all of their constraints/bounds will be +included.

+

See example usage in _subinterfaces.ConflictInterface.

+
+ +
+
+init_list_args(*args)[source]
+

Initialize default arguments with empty lists if necessary.

+
+ +
+
+listify(x)[source]
+

Returns [x] if x isn’t already a list.

+

This is used to wrap arguments for functions that require lists.

+
+ +
+
+convert_sequence(seq, getindexfunc, cache=None)[source]
+

Converts a sequence of names to indices as necessary.

+

If you are calling convert (see below) in a tight loop, but you +know that you are always working with a sequence, then it can be +more efficient to call this method directly (there is no overhead +checking if it is a sequence).

+
+ +
+
+convert(name, getindexfunc, cache=None)[source]
+

Converts from names to indices as necessary.

+

If name is a string, an index is returned.

+

If name is a sequence, a sequence of indices is returned.

+

If name is neither (i.e., it’s an integer), then that is returned +as is.

+

getindexfunc is a function that takes a name and returns an index.

+

The optional cache argument allows for further localized +caching (e.g., within a loop).

+
+ +
+
+unzip(iterable=None)[source]
+

Inverse of the zip function.

+

Example usage:

+
>>> z = list(zip([1, 2, 3], [4, 5, 6]))
+>>> unzip(z)
+[(1, 2, 3), (4, 5, 6)]
+
+
+
+ +
+
+

cplex._internal._parameter_classes module

+

Parameters for the CPLEX Python API.

+

This module defines classes for parameters, groups of parameters, and +parameter constants used in the CPLEX Python API. For more detail, see also +the corresponding commands of the Interactive Optimizer documented in the +CPLEX Parameters Reference Manual.

+
+
+class Parameter[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._parameter_classes.Parameter
+ + +

Base class for Cplex parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env, about, parent, name, constants=None)[source]
+

non-public

+
+ +
+
+__repr__()[source]
+

Returns the name of the parameter within the hierarchy.

+
+ +
+
+set(value)[source]
+

Sets the parameter to value.

+
+ +
+
+get()[source]
+

Returns the current value of the parameter.

+
+ +
+
+reset()[source]
+

Sets the parameter to its default value.

+
+ +
+
+default()[source]
+

Returns the default value of the parameter.

+
+ +
+
+type()[source]
+

Returns the type of the parameter.

+

Allowed types are float, int, and str.

+
+ +
+
+help()[source]
+

Returns the documentation for the parameter.

+
+ +
+ +
+
+class NumParameter[source]
+

Bases: Parameter

+
Inheritance diagram of cplex._internal._parameter_classes.NumParameter
+ + + +

Class for integer and float parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+min()[source]
+

Returns the minimum value for the parameter.

+
+ +
+
+max()[source]
+

Returns the maximum value for the parameter.

+
+ +
+ +
+
+class StrParameter[source]
+

Bases: Parameter

+
Inheritance diagram of cplex._internal._parameter_classes.StrParameter
+ + + +

Class for string parameters.

+
+
Undocumented:
+

__init__

+
+
+
+ +
+
+class ParameterGroup[source]
+

Bases: object

+
Inheritance diagram of cplex._internal._parameter_classes.ParameterGroup
+ + +

Class containing a group of Cplex parameters.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env, members, parent)[source]
+

non-public

+
+ +
+
+__repr__()[source]
+

Returns the name of the parameter group within the hierarchy.

+
+ +
+
+reset()[source]
+

Sets the parameters in the group to their default values.

+
+ +
+
+get_changed()[source]
+

Returns a list of the changed parameters in the group.

+

Returns a list of (parameter, value) pairs. Each parameter is +an instance of the Parameter class, and thus the parameter +value can be changed via its set method, or this object can be +passed to the tuning functions.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.read.datacheck.set(
+...     c.parameters.read.datacheck.values.assist)
+>>> for parameter, value in c.parameters.get_changed():
+...     pass  # do something
+
+
+
+ +
+
+get_all()[source]
+

Returns a list of all the parameters in the group.

+

Returns a list of (parameter, value) pairs. Each parameter is +an instance of the Parameter class, and thus the parameter +value can be changed via its set method, or this object can be +passed to the tuning functions.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> for parameter, value in c.parameters.get_all():
+...     pass  # do something
+
+
+
+ +
+ +
+
+class TuningConstants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.TuningConstants
+ + + +

Status codes returned by tuning methods.

+

For an explanation of tuning, see that topic in +the CPLEX User’s Manual.

+
+
+completed = 0
+
+ +
+
+abort = 1
+
+ +
+
+time_limit = 2
+
+ +
+
+dettime_limit = 3
+
+ +
+ +
+
+class RootParameterGroup[source]
+

Bases: ParameterGroup

+
Inheritance diagram of cplex._internal._parameter_classes.RootParameterGroup
+ + + +

Class containing all the Cplex parameters.

+
+
Undocumented:
+

__init__, _set, _get, _get_info

+
+
+
+
+tuning_status = <cplex._internal._parameter_classes.TuningConstants object>
+

See TuningConstants()

+
+ +
+
+__init__(env, members)[source]
+

non-public

+
+ +
+
+reset()[source]
+

Sets the parameters in the group to their default values.

+
+ +
+
+__repr__()[source]
+

Return ‘parameters’.

+
+ +
+
+tune_problem_set(filenames, filetypes=None, fixed_parameters_and_values=None)[source]
+

Tunes parameters for a set of problems.

+

filenames must be a sequence of strings specifying a set of +problems to tune.

+

If filetypes is given, it must be a sequence of the same +length as filenames also consisting of strings that specify +the types of the corresponding files.

+

If fixed_parameters_and_values is given, it may be either a +ParameterSet instance or a sequence of sequences of length 2 +containing instances of the Parameter class that are to be fixed +during the tuning process and the values at which they are to be +fixed.

+

tune_problem_set returns the status of the tuning procedure, +which is an attribute of parameters.tuning_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.lpmethod,
+...        c.parameters.lpmethod.values.auto)
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"],
+...     fixed_parameters_and_values=ps)
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"],
+...     fixed_parameters_and_values=[
+...         (c.parameters.lpmethod,
+...          c.parameters.lpmethod.values.auto)])
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem_set(
+...     filenames=["lpex.mps", "example.mps"])
+>>> c.parameters.tuning_status[status]
+'completed'
+
+
+
+ +
+
+tune_problem(fixed_parameters_and_values=None)[source]
+

Tunes parameters for a Cplex problem.

+

If fixed_parameters_and_values is given, it may be either a +ParameterSet instance or a sequence of sequences of length 2 +containing instances of the Parameter class that are to be fixed +during the tuning process and the values at which they are to be +fixed.

+

tune_problem returns the status of the tuning procedure, which +is an attribute of parameters.tuning_status.

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.lpmethod,
+...        c.parameters.lpmethod.values.auto)
+>>> status = c.parameters.tune_problem(ps)
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem([
+...     (c.parameters.lpmethod,
+...      c.parameters.lpmethod.values.auto)])
+>>> c.parameters.tuning_status[status]
+'completed'
+>>> status = c.parameters.tune_problem()
+>>> c.parameters.tuning_status[status]
+'completed'
+
+
+
+ +
+
+read_file(filename)[source]
+

Reads a set of parameters from the file filename.

+
+ +
+
+write_file(filename)[source]
+

Writes a set of parameters to the file filename.

+
+ +
+ +
+
+class off_on_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.off_on_constants
+ + + +
+
+off = 0
+
+ +
+
+on = 1
+
+ +
+ +
+
+class auto_off_on_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.auto_off_on_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+on = 1
+
+ +
+ +
+
+class writelevel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.writelevel_constants
+ + + +
+
+auto = 0
+
+ +
+
+all_variables = 1
+
+ +
+
+discrete_variables = 2
+
+ +
+
+nonzero_variables = 3
+
+ +
+
+nonzero_discrete_variables = 4
+
+ +
+ +
+
+class scale_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.scale_constants
+ + + +
+
+none = -1
+
+ +
+
+equilibration = 0
+
+ +
+
+aggressive = 1
+
+ +
+ +
+
+class mip_emph_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.mip_emph_constants
+ + + +
+
+balanced = 0
+
+ +
+
+optimality = 2
+
+ +
+
+feasibility = 1
+
+ +
+
+best_bound = 3
+
+ +
+
+hidden_feasibility = 4
+
+ +
+
+heuristic = 5
+
+ +
+ +
+
+class brdir_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.brdir_constants
+ + + +
+
+down = -1
+
+ +
+
+auto = 0
+
+ +
+
+up = 1
+
+ +
+ +
+
+class search_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.search_constants
+ + + +
+
+auto = 0
+
+ +
+
+traditional = 1
+
+ +
+
+dynamic = 2
+
+ +
+ +
+
+class subalg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.subalg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+network = 3
+
+ +
+
+barrier = 4
+
+ +
+
+sifting = 5
+
+ +
+ +
+
+class nodesel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.nodesel_constants
+ + + +
+
+depth_first = 0
+
+ +
+
+best_bound = 1
+
+ +
+
+best_estimate = 2
+
+ +
+
+best_estimate_alt = 3
+
+ +
+ +
+
+class alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+sifting = 5
+
+ +
+
+network = 3
+
+ +
+
+concurrent = 6
+
+ +
+ +
+
+class varsel_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.varsel_constants
+ + + +
+
+min_infeasibility = -1
+
+ +
+
+default = 0
+
+ +
+
+max_infeasibility = 1
+
+ +
+
+pseudo_costs = 2
+
+ +
+
+strong_branching = 3
+
+ +
+
+pseudo_reduced_costs = 4
+
+ +
+ +
+
+class dive_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dive_constants
+ + + +
+
+auto = 0
+
+ +
+
+traditional = 1
+
+ +
+
+probing = 2
+
+ +
+
+guided = 3
+
+ +
+ +
+
+class file_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.file_constants
+ + + +
+
+auto = 0
+
+ +
+
+memory = 1
+
+ +
+
+disk = 2
+
+ +
+
+disk_compressed = 3
+
+ +
+ +
+
+class fpheur_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.fpheur_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+feas = 1
+
+ +
+
+obj_and_feas = 2
+
+ +
+ +
+
+class cardls_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.cardls_constants
+ + + +
+
+disabled = -1
+
+ +
+
+auto = 0
+
+ +
+
+at_root = 1
+
+ +
+
+at_all_nodes = 2
+
+ +
+ +
+
+class miqcp_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.miqcp_constants
+ + + +
+
+auto = 0
+
+ +
+
+QCP_at_node = 1
+
+ +
+
+LP_at_node = 2
+
+ +
+ +
+
+class presolve_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.presolve_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+force = 1
+
+ +
+
+probe = 2
+
+ +
+ +
+
+class v_agg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.v_agg_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+moderate = 1
+
+ +
+
+aggressive = 2
+
+ +
+
+very_aggressive = 3
+
+ +
+ +
+
+class kappastats_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.kappastats_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+sample = 1
+
+ +
+
+full = 2
+
+ +
+ +
+
+class agg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.agg_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+moderate = 1
+
+ +
+
+aggressive = 2
+
+ +
+ +
+
+class replace_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.replace_constants
+ + + +
+
+firstin_firstout = 0
+
+ +
+
+worst_objective = 1
+
+ +
+
+diversity = 2
+
+ +
+ +
+
+class ordertype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.ordertype_constants
+ + + +
+
+default = 0
+
+ +
+
+cost = 1
+
+ +
+
+bounds = 2
+
+ +
+
+scaled_cost = 3
+
+ +
+ +
+
+class mip_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.mip_display_constants
+ + + +
+
+none = 0
+
+ +
+
+integer_feasible = 1
+
+ +
+
+mip_interval_nodes = 2
+
+ +
+
+node_cuts = 3
+
+ +
+
+LP_root = 4
+
+ +
+
+LP_all = 5
+
+ +
+ +
+
+class conflict_algorithm_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.conflict_algorithm_constants
+ + + +
+
+auto = 0
+
+ +
+
+fast = 1
+
+ +
+
+propagate = 2
+
+ +
+
+presolve = 3
+
+ +
+
+iis = 4
+
+ +
+
+limitedsolve = 5
+
+ +
+
+solve = 6
+
+ +
+ +
+
+class dual_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dual_pricing_constants
+ + + +
+
+auto = 0
+
+ +
+
+full = 1
+
+ +
+
+steep = 2
+
+ +
+
+full_steep = 3
+
+ +
+
+steep_Q_start = 4
+
+ +
+
+devex = 5
+
+ +
+ +
+
+class primal_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.primal_pricing_constants
+ + + +
+
+partial = -1
+
+ +
+
+auto = 0
+
+ +
+
+devex = 1
+
+ +
+
+steep = 2
+
+ +
+
+steep_Q_start = 3
+
+ +
+
+full = 4
+
+ +
+ +
+
+class display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.display_constants
+ + + +
+
+none = 0
+
+ +
+
+normal = 1
+
+ +
+
+detailed = 2
+
+ +
+ +
+
+class prered_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.prered_constants
+ + + +
+
+none = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+primal_and_dual = 3
+
+ +
+ +
+
+class prereform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.prereform_constants
+ + + +
+
+none = 0
+
+ +
+
+interfere_crush = 1
+
+ +
+
+interfere_uncrush = 2
+
+ +
+
+all = 3
+
+ +
+ +
+
+class sos1reform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sos1reform_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+logarithmic = 1
+
+ +
+ +
+
+class sos2reform_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sos2reform_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+logarithmic = 1
+
+ +
+ +
+
+class coeffreduce_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.coeffreduce_constants
+ + + +
+
+none = 0
+
+ +
+
+integral = 1
+
+ +
+
+any = 2
+
+ +
+ +
+
+class dependency_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dependency_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+begin = 1
+
+ +
+
+end = 2
+
+ +
+
+begin_and_end = 3
+
+ +
+ +
+
+class dual_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.dual_constants
+ + + +
+
+no = -1
+
+ +
+
+auto = 0
+
+ +
+
+yes = 1
+
+ +
+ +
+
+class linear_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.linear_constants
+ + + +
+
+only_linear = 0
+
+ +
+
+full = 1
+
+ +
+ +
+
+class repeatpre_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.repeatpre_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+without_cuts = 1
+
+ +
+
+with_cuts = 2
+
+ +
+
+new_root_cuts = 3
+
+ +
+ +
+
+class sym_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sym_constants
+ + + +
+
+auto = -1
+
+ +
+
+off = 0
+
+ +
+
+mild = 1
+
+ +
+
+moderate = 2
+
+ +
+
+aggressive = 3
+
+ +
+
+more_aggressive = 4
+
+ +
+
+very_aggressive = 5
+
+ +
+ +
+
+class qcpduals_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.qcpduals_constants
+ + + +
+
+no = 0
+
+ +
+
+if_possible = 1
+
+ +
+
+force = 2
+
+ +
+ +
+
+class sift_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.sift_alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+network = 3
+
+ +
+ +
+
+class feasopt_mode_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.feasopt_mode_constants
+ + + +
+
+min_sum = 0
+
+ +
+
+opt_sum = 1
+
+ +
+
+min_inf = 2
+
+ +
+
+opt_inf = 3
+
+ +
+
+min_quad = 4
+
+ +
+
+opt_quad = 5
+
+ +
+ +
+
+class measure_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.measure_constants
+ + + +
+
+average = 1
+
+ +
+
+minmax = 2
+
+ +
+ +
+
+class tune_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.tune_display_constants
+ + + +
+
+none = 0
+
+ +
+
+minimal = 1
+
+ +
+
+settings = 2
+
+ +
+
+settings_and_logs = 3
+
+ +
+ +
+
+class bar_order_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_order_constants
+ + + +
+
+approx_min_degree = 1
+
+ +
+
+approx_min_fill = 2
+
+ +
+
+nested_dissection = 3
+
+ +
+ +
+
+class crossover_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.crossover_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+ +
+
+class bar_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_alg_constants
+ + + +
+
+default = 0
+
+ +
+
+infeas_estimate = 1
+
+ +
+
+infeas_constant = 2
+
+ +
+
+standard = 3
+
+ +
+ +
+
+class bar_start_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.bar_start_alg_constants
+ + + +
+
+zero_dual = 1
+
+ +
+
+estimated_dual = 2
+
+ +
+
+average_primal_zero_dual = 3
+
+ +
+
+average_primal_estimated_dual = 4
+
+ +
+ +
+
+class par_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.par_constants
+ + + +
+
+opportunistic = -1
+
+ +
+
+auto = 0
+
+ +
+
+deterministic = 1
+
+ +
+ +
+
+class qp_alg_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.qp_alg_constants
+ + + +
+
+auto = 0
+
+ +
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+network = 3
+
+ +
+
+barrier = 4
+
+ +
+ +
+
+class advance_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.advance_constants
+ + + +
+
+none = 0
+
+ +
+
+standard = 1
+
+ +
+
+alternate = 2
+
+ +
+ +
+
+class clocktype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.clocktype_constants
+ + + +
+
+auto = 0
+
+ +
+
+CPU = 1
+
+ +
+
+wall = 2
+
+ +
+ +
+
+class solutiontype_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.solutiontype_constants
+ + + +
+
+auto = 0
+
+ +
+
+basic = 1
+
+ +
+
+non_basic = 2
+
+ +
+ +
+
+class optimalitytarget_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.optimalitytarget_constants
+ + + +
+
+auto = 0
+
+ +
+
+optimal_convex = 1
+
+ +
+
+first_order = 2
+
+ +
+
+optimal_global = 3
+
+ +
+ +
+
+class datacheck_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.datacheck_constants
+ + + +
+
+off = 0
+
+ +
+
+warn = 1
+
+ +
+
+assist = 2
+
+ +
+ +
+
+class benders_strategy_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.benders_strategy_constants
+ + + +
+
+none = -1
+
+ +
+
+auto = 0
+
+ +
+
+user = 1
+
+ +
+
+workers = 2
+
+ +
+
+full = 3
+
+ +
+ +
+
+class network_display_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_display_constants
+ + + +
+
+none = 0
+
+ +
+
+true_objective_values = 1
+
+ +
+
+penalized_objective_values = 2
+
+ +
+ +
+
+class network_netfind_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_netfind_constants
+ + + +
+
+pure = 1
+
+ +
+
+reflection_scaling = 2
+
+ +
+
+general_scaling = 3
+
+ +
+ +
+
+class network_pricing_constants[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._parameter_classes.network_pricing_constants
+ + + +
+
+auto = 0
+
+ +
+
+partial = 1
+
+ +
+
+multiple_partial = 2
+
+ +
+
+multiple_partial_with_sorting = 3
+
+ +
+ +
+
+

cplex._internal._solutionstrategyenum module

+

A module for the SolutionStrategy class.

+
+
+class SolutionStrategy[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex._internal._solutionstrategyenum.SolutionStrategy
+ + + +

The different types of solutions that can submitted to +cplex.callbacks.Context.post_heuristic_solution().

+

For further details about these values, see the reference manual of +the CPLEX Callable Library (C API) particularly, the enumeration +CPXCALLBACKSOLUTIONSTRATEGY.

+
+
+no_check = -1
+

See CPXCALLBACKSOLUTION_NOCHECK in the C API.

+
+ +
+
+check_feasible = 0
+

See CPXCALLBACKSOLUTION_CHECKFEAS in the C API.

+
+ +
+
+propagate = 1
+

See CPXCALLBACKSOLUTION_PROPAGATE in the C API.

+
+ +
+
+solve = 2
+

See CPXCALLBACKSOLUTION_SOLVE in the C API.

+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/cplex.html b/docs/cplex.html new file mode 100644 index 0000000..19ab9ad --- /dev/null +++ b/docs/cplex.html @@ -0,0 +1,6249 @@ + + + + + + + + cplex package — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex package

+

The CPLEX Python API.

+

This package contains classes for accessing CPLEX from the Python +programming language. The most important class defined by this package +is the Cplex class, which provides methods for creating, modifying, +querying, or solving an optimization problem, and for querying aspects of +a solution.

+

The exceptions module defines the exception classes that are raised +during abnormal operation by the CPLEX Python API.

+

The callbacks module defines callback classes that can be used to alter +the behavior of the algorithms used by CPLEX.

+

The constant infinity, defined in the cplex package, should be used to +set infinite upper and lower bounds.

+

The classes SparsePair and SparseTriple are used as input and output +classes for sparse vector and sparse matrix output, respectively. See +the documentation for individual methods for details about the usage +of these classes.

+
+
+class Cplex[source]
+

Bases: object

+
Inheritance diagram of cplex.Cplex
+ + +

A class encapsulating a CPLEX Problem.

+

An instance of the Cplex class provides methods for creating, +modifying, and querying an optimization problem, solving it, and +querying aspects of the solution.

+

Most of the methods are provided within subinterfaces: for example, +methods for adding, modifying, and querying data associated with +variables are within the Cplex.variables interface, and methods for +querying the solution are within the Cplex.solution category.

+
+
Undocumented:
+

__del__

+
+
+
+
+problem_type = <cplex._internal.ProblemType object>
+

See ProblemType

+
+ +
+
+__init__(*args)[source]
+

Constructor of the Cplex class.

+

The Cplex constructor accepts four types of argument lists.

+
>>> cpx = cplex.Cplex()
+
+
+

cpx is a new problem with no data

+
>>> cpx = cplex.Cplex("filename")
+
+
+

cpx is a new problem containing the data in filename. If filename +does not exist, an exception is raised.

+
>>> cpx = cplex.Cplex("filename", "filetype")
+
+
+

same as form 2, but cplex reads the file filename as a file of +type filetype, rather than inferring the file type from its +extension.

+
>>> cpx = cplex.Cplex(old_cpx)
+
+
+

cpx contains the same problem data as old_cpx, but is a different +object and contains no solution data. Future changes to one do +not affect the other.

+

The Cplex object is a context manager and can be used, like so:

+
>>> import cplex
+>>> with cplex.Cplex() as cpx:
+...     # do stuff
+...     pass
+
+
+

When the with-block is finished, the end() method will be +called automatically.

+
+ +
+
+parameters
+

See RootParameterGroup

+
+ +
+
+variables
+

See VariablesInterface

+
+ +
+
+linear_constraints
+

See LinearConstraintInterface

+
+ +
+
+quadratic_constraints
+

See QuadraticConstraintInterface

+
+ +
+
+indicator_constraints
+

See IndicatorConstraintInterface

+
+ +
+
+SOS
+

See SOSInterface

+
+ +
+
+objective
+

See ObjectiveInterface

+
+ +
+
+multiobj
+

See MultiObjInterface

+
+ +
+
+MIP_starts
+

See MIPStartsInterface

+
+ +
+
+solution
+

See SolutionInterface

+
+ +
+
+presolve
+

See PresolveInterface

+
+ +
+
+order
+

See OrderInterface

+
+ +
+
+conflict
+

See ConflictInterface

+
+ +
+
+advanced
+

See AdvancedCplexInterface

+
+ +
+
+start
+

See InitialInterface

+
+ +
+
+feasopt
+

See FeasoptInterface

+
+ +
+
+long_annotations
+

See LongAnnotationInterface

+
+ +
+
+double_annotations
+

See DoubleAnnotationInterface

+
+ +
+
+pwl_constraints
+

See PWLConstraintInterface

+
+ +
+
+end()[source]
+

Releases the Cplex object.

+

Frees all data structures associated with CPLEX. After a call of +the method end(), the invoking Cplex object and all objects that +have been created with it (such as variables and constraints) can +no longer be used. Attempts to use them subsequently raise a +ValueError.

+
+
Note

The Cplex object is a context manager. Thus, rather than +calling this method explicitly, the best practice should be to +use a Cplex object in a “with” statement (see __enter__ and +__exit__).

+
+
+

Example usage:

+
>>> import cplex
+>>> cpx = cplex.Cplex()
+>>> cpx.end()
+
+
+
+ +
+
+__del__()[source]
+

non-public

+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The “with” statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Cplex objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as cpx:
+...     # do stuff
+...     pass
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with-block, the end() method is called +automatically.

+
+ +
+
+read(filename, filetype='')[source]
+

Reads a problem from file.

+

The first argument is a string specifying the filename from which +the problem will be read.

+

If the method is called with two arguments, the second argument +is a string specifying the file type. If this argument is +omitted, filetype is taken to be the extension of the filename.

+

See CPXreadcopyprob in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+
+
+
+ +
+
+write(filename, filetype='')[source]
+

Writes a problem to a file.

+

The first argument is a string specifying the filename to which +the problem will be written.

+

If the filename ends with .bz2 (for BZip2) or .gz (for GNU Zip), +a compressed file is written.

+

If the method is called with two arguments, the second argument +is a string specifying the file type. If this argument is +omitted, filetype is taken to be the extension of the filename.

+

If filetype is any of “sav”, “mps”, “lp”, the problem is written +in the corresponding format. If filetype is either “rew” or “rlp” +the problem is written with generic names in mps or lp format, +respectively. If filetype is “alp” the problem is written with +generic names in lp format, where the variable names are +annotated to indicate the type and bounds of each variable.

+

If filetype is “dua”, the dual problem is written to a file. If +filetype is “emb”, an embedded network problem is written to a +file. If filetype is “ppe”, the perturbed problem is written to a +file. If filetype is “dpe”, the perturbed dual problem is written +to a file.

+

For documentation of the file types, see the CPLEX File Format +Reference Manual.

+

See CPXwriteprob, CPXdualwrite, +CPXembwrite, CPXdperwrite, and +CPXpperwrite in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> c.write("example.lp")
+
+
+
+ +
+
+write_to_stream(stream, filetype='LP', comptype='')[source]
+

Writes a problem to a file-like object in the given file format.

+

The filetype argument can be any of “sav” (a binary format), “lp” +(the default), “mps”, “rew”, “rlp”, or “alp” (see Cplex.write +for an explanation of these).

+

If comptype is “bz2” (for BZip2) or “gz” (for GNU Zip), a +compressed file is written.

+

See CPXwriteprob in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> class NoOpStream():
+...     def __init__(self):
+...         self.was_called = False
+...     def write(self, bytes):
+...         self.was_called = True
+...         pass
+...     def flush(self):
+...         pass
+>>> stream = NoOpStream()
+>>> c.write_to_stream(stream)
+>>> stream.was_called
+True
+
+
+
+ +
+
+write_as_string(filetype='LP', comptype='')[source]
+

Writes a problem as a string in the given file format.

+

For an explanation of the filetype and comptype arguments, see +Cplex.write_to_stream.

+
+
Note

When SAV format is specified for filetype or a compressed file +format is specified for comptype, the return value will be a +byte string.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(names=['x1', 'x2', 'x3'])
+>>> lp_str = c.write_as_string("lp")
+>>> len(lp_str) > 0
+True
+
+
+
+ +
+
+read_annotations(filename)[source]
+

Reads annotations from a file.

+

See CPXreadcopyannotations in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> idx = c.double_annotations.add('ann1', 0)
+>>> objtype = c.double_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.double_annotations.set_values(idx, objtype,
+...                                 [(i, 1) for i in indices])
+>>> c.write_annotations('example.ann')
+>>> c.long_annotations.delete()
+>>> c.double_annotations.delete()
+>>> c.long_annotations.get_num()
+0
+>>> c.double_annotations.get_num()
+0
+>>> c.read_annotations('example.ann')
+>>> c.long_annotations.get_num()
+1
+>>> c.double_annotations.get_num()
+1
+
+
+
+ +
+
+write_annotations(filename)[source]
+

Writes the annotations to a file.

+

See CPXwriteannotations in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> idx = c.long_annotations.add('ann1', 0)
+>>> objtype = c.long_annotations.object_type.variable
+>>> indices = c.variables.add(names=['v1', 'v2', 'v3'])
+>>> c.long_annotations.set_values(idx, objtype,
+...                               [(i, 1) for i in indices])
+>>> c.write_annotations('example.ann')
+
+
+
+ +
+
+write_benders_annotation(filename)[source]
+

Writes the annotation of the auto-generated decomposition.

+

Writes the annotation of the decompostion CPLEX automatically +generates for the model of the CPLEX problem object to the +specified file.

+

See CPXwritebendersannotation in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read('UFL_25_35_1.mps')
+>>> c.write_benders_annotation('UFL_25_35_1.ann')
+
+
+
+ +
+
+get_problem_type()[source]
+

Returns the problem type.

+

See CPXgetprobtype in the Callable Library Reference +Manual for more detail.

+

The return value is an attribute of problem_type.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.get_problem_type()
+0
+>>> c.problem_type[c.get_problem_type()]
+'LP'
+
+
+
+ +
+
+set_problem_type(type, soln=None)[source]
+

Changes the problem type.

+

If only one argument is given, that argument specifies the new +problem type (see problem_type). It must be one of the +following:

+
    +
  • Cplex.problem_type.LP

  • +
  • Cplex.problem_type.MILP

  • +
  • Cplex.problem_type.fixed_MILP

  • +
  • Cplex.problem_type.QP

  • +
  • Cplex.problem_type.MIQP

  • +
  • Cplex.problem_type.fixed_MIQP

  • +
  • Cplex.problem_type.QCP

  • +
  • Cplex.problem_type.MIQCP

  • +
+

If an optional second argument is given, it is taken to be an +identifier of a member of the solution pool. In this case, the +first argument must be one of the following:

+
    +
  • Cplex.problem_type.fixed_MILP

  • +
  • Cplex.problem_type.fixed_MIQP

  • +
+

See CPXchgprobtype and CPXchgprobtypesolnpool +in the Callable Library Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_type(c.problem_type.LP)
+
+
+
+ +
+
+solve(paramsets=None)[source]
+

Solves the problem.

+

The optional paramsets argument can only be specified when +multiple objectives are present (otherwise, a ValueError is +raised). paramsets must be a sequence containing ParameterSet +objects (see Cplex.create_parameter_set) or None. See +CPXmultiobjopt in the Callable Library Reference Manual +for more detail.

+
+
Note

The solve method returning normally (i.e., without raising an +exception) does not necessarily mean that an optimal or +feasible solution has been found. Use +SolutionInterface.get_status() to query the status of the +current solution.

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> c.solve()
+>>> status = c.solution.get_status()
+
+
+
+ +
+
+runseeds(cnt=30)[source]
+

Evaluates the variability of the problem.

+

Solves the same problem instance multiple times using different +random seeds allowing the user to evaluate the variability of the +problem class the instance belongs to.

+

The optional cnt argument specifies the number of times +optimization should be performed (the default is 30).

+

A problem must be an MILP, MIQP, or MIQCP and must exist in +memory.

+
+ +
+
+populate_solution_pool()[source]
+

Generates a variety of solutions to a discrete problem (MIP, MIQP, MIQCP).

+

The algorithm that populates the solution pool works in two +phases.

+

In the first phase, it solves the problem to optimality (or +some stopping criterion set by the user) while it sets up a +branch and cut tree for the second phase.

+

In the second phase, it generates multiple solutions by using +the information computed and stored in the first phase and by +continuing to explore the tree.

+

For more information, see the function CPXpopulate in the +Callable Library Reference Manual and the topic solution pool +in the CPLEX User’s Manual.

+
+ +
+
+get_problem_name()[source]
+

Returns the problem name.

+

See CPXgetprobname in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_name("prob1")
+>>> c.get_problem_name()
+'prob1'
+
+
+
+ +
+
+set_problem_name(name)[source]
+

Sets the problem name.

+

See CPXchgprobname in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.set_problem_name("prob1")
+>>> c.get_problem_name()
+'prob1'
+
+
+
+ +
+
+cleanup(epsilon)[source]
+

Deletes values from the problem data with absolute value +smaller than epsilon.

+

See CPXcleanup in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> indices = c.variables.add(obj=[1.0, 1e-10, 1.0])
+>>> c.objective.get_linear()
+[1.0, 1e-10, 1.0]
+>>> c.cleanup(epsilon=1e-6)
+>>> c.objective.get_linear()
+[1.0, 0.0, 1.0]
+
+
+
+ +
+
+register_callback(callback_class)[source]
+

Registers a callback class for use during optimization.

+

callback_class must be a proper subclass of one of the callback +classes defined in the module callbacks. To implement custom +logic, override the __call__ method with a method that has +signature __call__(self) -> None. If callback_class is a subclass +of more than one callback class, it will only be called when its +first superclass is called. register_callback returns the +instance of callback_class registered for use. Any previously +registered callback of the same class will no longer be +registered.

+

Returns an instance of callback_class.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback):
+...     pass
+>>> cb = c.register_callback(MyMIPInfoCallback)
+
+
+
+ +
+
+unregister_callback(callback_class)[source]
+

Stops a callback class from being used.

+

callback_class must be one of the callback classes defined in the +module callbacks or a subclass of one of them. This method +unregisters any previously registered callback of the same class. +If callback_class is a subclass of more than one callback class, +this method will unregister only the callback of the same type as +its first superclass.

+

Returns the instance of callback_class just unregistered.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class MyMIPInfoCallback(cplex.callbacks.MIPInfoCallback):
+...     pass
+>>> cb = c.register_callback(MyMIPInfoCallback)
+>>> cb = c.unregister_callback(MyMIPInfoCallback)
+
+
+
+ +
+
+set_results_stream(results_file, fn=None)[source]
+

Specifies where results will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which results will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_results_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_warning_stream(warning_file, fn=None)[source]
+

Specifies where warnings will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which warnings will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_warning_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_error_stream(error_file, fn=None)[source]
+

Specifies where errors will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which errors will be written. To write to +this stream, use this object’s write() method.

+

Example usage:

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_error_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+set_log_stream(log_file, fn=None)[source]
+

Specifies where the log will be printed.

+

The first argument must be a file-like object (i.e., an object +with a write method and a flush method). Use None as the first +argument to suppress output.

+

The second optional argument is a function that takes a string as +input and returns a string. If specified, strings sent to this +stream will be processed by this function before being written.

+

Returns the stream to which the log will be written. To write to +this stream, use this object’s write() method.

+
>>> import cplex
+>>> with cplex.Cplex() as c, open("output.txt", "w") as f:
+...     output = c.set_log_stream(f)
+...     output.write("this is an example")
+
+
+
+ +
+
+get_version()[source]
+

Returns a string specifying the version of CPLEX.

+

See CPXversion in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> version = c.get_version()
+
+
+
+ +
+
+get_versionnumber()[source]
+

Returns an integer specifying the version of CPLEX.

+

The version of CPLEX is in the format vvrrmmff, where vv is the +version, rr is the release, mm is the modification, and ff is the +fixpack number. For example, for CPLEX version 12.5.0.1 the +returned value is 12050001.

+

See CPXversionnumber in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> versionnumber = c.get_versionnumber()
+
+
+
+ +
+
+get_num_cores()[source]
+

Returns the number of cores on this machine.

+

See CPXgetnumcores in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> num_cores = c.get_num_cores()
+
+
+
+ +
+
+get_stats()[source]
+

Returns a Stats object containing problem statistics.

+
+
Note

Printing the Stats object will give a nice summary of the +problem statistics in human readable form (e.g. as with the +“display problem statistics” command in the CPLEX interactive).

+
+
+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> stats = c.get_stats()
+>>> stats.num_variables
+32
+>>> stats.num_linear_constraints
+27
+
+
+
+ +
+
+get_time()[source]
+

Returns a time stamp in seconds.

+

To measure time spent between a starting point and ending point +of an operation, take the result of this method at the starting +point; take the result of this method at the end point; subtract +the starting time stamp from the ending time stamp; the +subtraction yields elapsed time in seconds.

+

The interpretation of this value as wall clock time or CPU time +is controlled by the parameter clocktype.

+

The absolute value of the time stamp is not meaningful.

+

See CPXgettime in the Callable Library Reference Manual +for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> start = c.get_time()
+>>> c.solve()
+>>> solve_time = c.get_time() - start
+
+
+
+ +
+
+get_dettime()[source]
+

Returns a deterministic time stamp in ticks.

+

To measure elapsed deterministic time in ticks between a starting +point and ending point of an operation, take the deterministic +time stamp at the starting point; take the deterministic time +stamp at the ending point; subtract the starting deterministic +time stamp from the ending deterministic time stamp.

+

The absolute value of the deterministic time stamp is not +meaningful.

+

See CPXgetdettime in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> out = c.set_results_stream(None)
+>>> out = c.set_log_stream(None)
+>>> c.read("lpex.mps")
+>>> start = c.get_dettime()
+>>> c.solve()
+>>> solve_dettime = c.get_dettime() - start
+
+
+
+ +
+
+use_aborter(aborter)[source]
+

Use an Aborter to control termination of solve methods.

+

Instructs the invoking object to use the aborter to control +termination of its solving and tuning methods.

+

If another aborter is already being used by the invoking object, +then this method overrides the previously used aborter.

+

Returns the aborter installed in the invoking object or None.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+
+
+
+ +
+
+remove_aborter()[source]
+

Removes the Aborter being used by the invoking object.

+

Returns the aborter that was removed or None.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+>>> aborter = c.remove_aborter()
+
+
+
+ +
+
+get_aborter()[source]
+

Returns the Aborter being used by the invoking object.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> aborter = c.use_aborter(cplex.Aborter())
+>>> aborter = c.get_aborter()
+
+
+
+ +
+
+set_callback(functor=None, contextmask=0)[source]
+

Set callback function to use during optimization.

+

Sets the callback that CPLEX invokes during optimization. If +functor is None then contextmask will be treated as 0 and the +callback is effectively cleared from CPLEX.

+

In all other cases functor must be a reference to an object that +has a callable member called ‘invoke’ (if that does not exist, or +is not a callable, an exception will occur the first time CPLEX +attempts to invoke the callback). Whenever CPLEX needs to invoke +the callback it calls this member with exactly one argument: an +instance of cplex.callbacks.Context.

+

Note that in the ‘invoke’ function you must not invoke any +functions of the Cplex instance that is performing the current +solve. All functions that can be invoked from a callback are +members of the cplex.callbacks.Context class.

+

contextmask must be the bitwise OR of values from +cplex.callbacks.Context.id and specifies in which contexts +CPLEX shall invoke the callback: the callback is invoked in all +contexts for which the corresponding bit is set in contextmask.

+

Note about cplex.callbacks.Context.id.thread_down: This is +considered a “destructor” function and should not raise any +exception. Any exception raised from the callback in this context +will just be ignored.

+

See cplex.callbacks.Context.

+

See CPXcallbacksetfunc in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> class GenericCB():
+...     def invoke(self, context):
+...         pass  # Do something here.
+>>> cb = GenericCB()
+>>> c.set_callback(cb)  # Register callback.
+>>> c.set_callback(None)  # Clear callback.
+
+
+
+ +
+
+set_modeling_assistance_callback(functor=None)[source]
+

Set callback function to use for modeling assistance warnings.

+

Sets the callback that CPLEX invokes before and after +optimization (once for every modeling issue detected). If functor +is None then the callback is effectively cleared from CPLEX. The +callback function will only be invoked if the CPLEX parameter +Cplex.parameters.read.datacheck is set to +Cplex.parameters.read.datacheck.values.assist (2). In addition, +the parameter Cplex.parameters.read.warninglimit controls the +number of times each type of modeling assistance warning will be +reported (the rest will be ignored). See CPX_PARAM_DATACHECK and +CPX_PARAM_WARNLIM in the Parameters of CPLEX Reference Manual.

+

In all other cases functor must be a reference to an object that +has a callable attribute named ‘invoke’ (if that does not exist, +or is not a callable, an exception will occur the first time CPLEX +attempts to invoke the callback). Whenever CPLEX needs to invoke +the callback it calls this member with two argument: the modeling +issue ID and the associated warning message.

+

See model_info.

+

See CPXmodelasstcallbacksetfunc in the Callable Library +Reference Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.read.datacheck.set(
+...     c.parameters.read.datacheck.values.assist)
+>>> class ModelAsstCB():
+...     def invoke(self, issueid, message):
+...         pass  # Do something here.
+>>> cb = ModelAsstCB()
+>>> c.set_modeling_assistance_callback(cb)  # Register callback.
+>>> c.set_modeling_assistance_callback(None)  # Clear callback.
+
+
+
+ +
+
+create_parameter_set()[source]
+

Returns a new CPLEX parameter set object that is associated +with this CPLEX problem object.

+
+
Note

When this CPLEX problem object is destroyed, the parameter set +object returned by this function will also be destoyed.

+
+
+

See ParameterSet.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+ +
+
+copy_parameter_set(source)[source]
+

Returns a deep copy of a parameter set.

+

In a sense, this a convenience function; it is equivalent to +querying what parameters are in the source parameter set, +querying their values, and then adding those parameters to the +target parameter set.

+
+
Note

The source parameter set must have been created by this CPLEX +problem object. Mixing parameter sets from different CPLEX +problem objects is not supported.

+
+
Note

When this CPLEX problem object is destroyed, the parameter set +object returned by this function will also be destoyed.

+
+
+

See ParameterSet.

+

See CPXparamsetcopy in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> source = c.create_parameter_set()
+>>> source.add(c.parameters.advance,
+...            c.parameters.advance.values.none)
+>>> len(source)
+1
+>>> target = c.copy_parameter_set(source)
+>>> len(target)
+1
+
+
+
+ +
+
+get_parameter_set()[source]
+

Returns a parameter set containing parameters that have been +changed from their default values in the environment.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> ps = c.get_parameter_set()
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+set_parameter_set(source)[source]
+

Applies the parameter values in the paramset to the +environment.

+
+
Note

The source parameter set must have been created by this CPLEX +problem object. Mixing parameter sets from different CPLEX +problem objects is not supported.

+
+
+

See CPXparamsetapply in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> c.set_parameter_set(ps)
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+copylp(numcols, numrows, objsense=1, obj=None, rhs=None, senses='', matbeg=None, matcnt=None, matind=None, matval=None, lb=None, ub=None, range_values=None, colnames=None, rownames=None)[source]
+

Copies LP data into a CPLEX problem object.

+

The arguments define an objective function, constraint matrix, +variable bounds, righthand side, constraint senses, range values, +names of constraints, and names of variables.

+
+
Note

This method can give better performance when building a model, +but it may not be as user friendly as using other methods. To +compare different techniques, see the lpex1.py example.

+
+
Note

Calling this method destroys any existing data associated with +the problem object.

+
+
+

numcols : the number of columns in the constraint matrix, or +equivalently, the number of variables in the problem object.

+

numrows : the number of rows in the constraint matrix, not +including the objective function or bounds on the variables.

+

objsense : sets the sense of the objective function. Must be +either Cplex.objective.sense.minimize or +Cplex.objective.sense.maximize.

+

obj : a list of floats of length at least numcols containing +the objective function coefficients. Required if numcols > 0.

+

rhs : a list of floats of length at least numrows containing +the righthand side value for each constraint in the constraint +matrix. Required if numrows > 0.

+

senses : A list of single-character strings or a string +containing the sense of each constraint in the constraint matrix. +Must be of length at least numrows. Each entry must be one of +‘G’, ‘L’, ‘E’, and ‘R’, indicating greater-than-or-equal-to (>=), +less-than-or-equal-to (<=), equality (=), and ranged constraints, +respectively. Required if numrows > 0.

+

With respect to the arguments matbeg (beginning of the matrix), +matcnt (count of the matrix), matind (indices of the matrix), +and matval (values of the matrix), CPLEX needs to know only the +nonzero coefficients. These arguments are required if +numcols > 0 and numrows > 0.

+

These arrays are accessed as follows. Suppose that CPLEX wants to +access the entries in some column j. These are assumed to be +given by the entries: +matval[matbeg[j]],.., matval[matbeg[j]+matcnt[j]-1]

+

The corresponding row indices are: +matind[matbeg[j]],.., matind[matbeg[j]+matcnt[j]-1]

+

lb : a list of length at least numcols containing the lower +bound on each of the variables. Required if numcols > 0.

+

ub : a list of length at least numcols containing the upper +bound on each of the variables. Required if numcols > 0.

+

range_values : a list of floats, specifying the difference +between lefthand side and righthand side of each linear +constraint. If range_values[i] > 0 (zero) then the constraint i +is defined as rhs[i] <= rhs[i] + range_values[i]. If +range_values[i] < 0 (zero) then constraint i is defined as +rhs[i] + range_value[i] <= a*x <= rhs[i].

+

colnames : a list of strings of length at least numcols +containing the names of the matrix columns or, equivalently, the +constraint names.

+

rownames : a list of strings of length at least numrows +containing the names of the matrix rows or, equivalently, the +constraint names.

+

See CPXcopylpwnames in the Callable Library Reference +Manual for more detail.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.copylp(numcols=3,
+...          numrows=2,
+...          objsense=c.objective.sense.maximize,
+...          obj=[1.0, 2.0, 3.0],
+...          rhs=[20.0, 30.0],
+...          senses="LL",
+...          matbeg=[0, 2, 4],
+...          matcnt=[2, 2, 2],
+...          matind=[0, 1, 0, 1, 0, 1],
+...          matval=[-1.0, 1.0, 1.0, -3.0, 1.0, 1.0],
+...          lb=[0.0, 0.0, 0.0],
+...          ub=[40.0, cplex.infinity, cplex.infinity],
+...          range_values=[0.0, 0.0],
+...          colnames=["x1", "x2", "x3"],
+...          rownames=["c1", "c2"])
+
+
+
+ +
+ +
+
+class Stats[source]
+

Bases: object

+
Inheritance diagram of cplex.Stats
+ + +

A class whose data members reflect statistics about a CPLEX +problem.

+

An instance of this class is returned by the Cplex.get_stats() +method.

+

The __str__ method of this class returns a string containing a +summary of the problem statistics in human readable form.

+

An instance of this class always has the following integer members:

+
    +
  • num_objectives

  • +
  • num_variables

  • +
  • num_nonnegative

  • +
  • num_fixed

  • +
  • num_boxed

  • +
  • num_free

  • +
  • num_other

  • +
  • num_binary

  • +
  • num_integer

  • +
  • num_semicontinuous

  • +
  • num_semiinteger

  • +
  • num_quadratic_variables

  • +
  • num_linear_objective_nz

  • +
  • num_quadratic_objective_nz

  • +
  • num_linear_constraints

  • +
  • num_linear_less

  • +
  • num_linear_equal

  • +
  • num_linear_greater

  • +
  • num_linear_range

  • +
  • num_linear_nz

  • +
  • num_linear_rhs_nz

  • +
  • num_indicator_constraints

  • +
  • num_indicator_less

  • +
  • num_indicator_equal

  • +
  • num_indicator_greater

  • +
  • num_indicator_complemented

  • +
  • num_indicator_nz

  • +
  • num_indicator_rhs_nz

  • +
  • num_quadratic_constraints

  • +
  • num_quadratic_less

  • +
  • num_quadratic_greater

  • +
  • num_quadratic_linear_nz

  • +
  • num_quadratic_nz

  • +
  • num_quadratic_rhs_nz

  • +
  • num_SOS_constraints

  • +
  • num_SOS1

  • +
  • num_SOS1_members

  • +
  • type_SOS1

  • +
  • num_SOS2

  • +
  • num_SOS2_members

  • +
  • type_SOS2

  • +
  • num_lazy_constraints

  • +
  • num_lazy_nnz

  • +
  • num_lazy_lt

  • +
  • num_lazy_eq

  • +
  • num_lazy_gt

  • +
  • num_lazy_rhs_nnz

  • +
  • num_user_cuts

  • +
  • num_user_cuts_nnz

  • +
  • num_user_cuts_lt

  • +
  • num_user_cuts_eq

  • +
  • num_user_cuts_gt

  • +
  • num_user_cuts_rhs_nnz

  • +
  • num_pwl_constraints

  • +
  • num_pwl_breaks

  • +
+

An instance of this class always has the following float members:

+
    +
  • min_lower_bound

  • +
  • max_upper_bound

  • +
  • min_linear_objective

  • +
  • max_linear_objective

  • +
  • min_linear_constraints

  • +
  • max_linear_constraints

  • +
  • min_linear_constraints_rhs

  • +
  • max_linear_constraints_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with a quadratic objective also has the following float +members:

+
    +
  • min_quadratic_objective

  • +
  • max_quadratic_objective

  • +
+

An instance of this class returned by an instance of the Cplex +class with ranged constraints also has the following float +members:

+
    +
  • min_linear_range

  • +
  • max_linear_range

  • +
+

An instance of this class returned by an instance of the Cplex +class with quadratic constraints also has the following float +members:

+
    +
  • min_quadratic_linear

  • +
  • max_quadratic_linear

  • +
  • min_quadratic

  • +
  • max_quadratic

  • +
  • min_quadratic_rhs

  • +
  • max_quadratic_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with indicator constraints also has the following float +members:

+
    +
  • min_indicator

  • +
  • max_indicator

  • +
  • min_indicator_rhs

  • +
  • max_indicator_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with lazy constraints also has the following float members:

+
    +
  • min_lazy_constraint

  • +
  • max_lazy_constraint

  • +
  • min_lazy_constraint_rhs

  • +
  • max_lazy_constraint_rhs

  • +
+

An instance of this class returned by an instance of the Cplex +class with user cuts also has the following float members:

+
    +
  • min_user_cut

  • +
  • max_user_cut

  • +
  • min_user_cut_rhs

  • +
  • max_user_cut_rhs

  • +
+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(c)[source]
+
+ +
+
+__str__()[source]
+

Returns a string containing a summary of the problem +statistics in human readable form.

+
+ +
+ +
+
+class Aborter[source]
+

Bases: object

+
Inheritance diagram of cplex.Aborter
+ + +

Gracefully terminates the solve and tuning methods of CPLEX.

+

You can pass an instance of this class to one or more Cplex objects.

+

Calling the method abort() will then terminate the solve or tuning +method of the Cplex object.

+
+
+__init__()[source]
+

Constructor of the Aborter class.

+

The Aborter object is a context manager and can be used, like so:

+
+
with Aborter() as aborter:

# do stuff

+
+
+

When the with block is finished, the end() method will be called +automatically.

+
+ +
+
+abort()[source]
+

Aborts the solving and tuning methods.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.abort()
+
+
+
+ +
+
+clear()[source]
+

Clears the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.clear()
+
+
+
+ +
+
+is_aborted()[source]
+

Returns True if the method to abort has been called.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.is_aborted()
+False
+
+
+
+ +
+
+end()[source]
+

Ends the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.end()
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Aborter objects return themselves.

+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+ +
+
+infinity = 1e+20
+

See CPX_INFBOUND in the C API.

+
+ +
+
+class ParameterSet[source]
+

Bases: object

+
Inheritance diagram of cplex.ParameterSet
+ + +

A parameter set object for use with multi-objective optimization.

+

A parameter set consists of key-value pairs where the key is a CPLEX +parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated +parameter value.

+

When adding, getting, or deleting items from a parameter set the +param argument can be either a Parameter object (e.g, +Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND +(1001)).

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+

See Cplex.create_parameter_set and Cplex.copy_parameter_set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance, c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+
+__init__(env)[source]
+

Constructor of the ParameterSet class.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+end()[source]
+

Releases the ParameterSet object.

+

Frees all data structures associated with a ParameterSet. After +a call of the method end(), the invoking object can no longer be +used. Attempts to use them subsequently raise a ValueError.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.end()
+
+
+
+ +
+
+__del__()[source]
+

Destructor of the ParameterSet class.

+

When a ParameterSet object is destoyed, the end() method is +called.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> del ps
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

ParameterSet objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> with c.create_parameter_set():
+...     pass  # do something here
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+
+add(param, value)[source]
+

Add a parameter ID and value to a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+
+
+
+ +
+
+get(param)[source]
+

Gets a parameter value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+get_ids()[source]
+

Gets the parameter IDs contained in a parameter set.

+

Returns an iterator containing the parameter IDs in a parameter +set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> list(ps.get_ids())
+[1001]
+
+
+
+ +
+
+delete(param)[source]
+

Deletes a parameter from a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+>>> ps.delete(c.parameters.advance)
+>>> len(ps)
+0
+
+
+
+ +
+
+clear()[source]
+

Clears all items from the parameter set.

+

Example Usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.clear()
+>>> len(ps)
+0
+
+
+
+ +
+
+__len__()[source]
+

Return the number of items in the parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> len(ps)
+0
+
+
+
+ +
+
+read(filename)[source]
+

Reads parameter names and settings from the file specified by +filename and copies them into the parameter set.

+

Note that the content of the parameter set is not cleared out +before the parameters in the file are copied into the parameter +set. The parameters are read from the file one by one and are +added to the parameter set, or, if the parameter was already +present in the set, then its value is updated.

+

This routine reads and copies files in the PRM format, as created +by Cplex.parameters.write. The PRM format is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> c.parameters.write_file('example.prm')
+>>> ps = c.create_parameter_set()
+>>> ps.read('example.prm')
+>>> value = ps.get(c.parameters.advance)
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+write(filename)[source]
+

Writes a parameter file that contains the parameters in the +parameter set.

+

This routine writes a file in a format suitable for reading by +ParameterSet.read or by Cplex.parameters.read.

+

The file is written in the PRM format which is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.write('example.prm')
+>>> c.parameters.read_file('example.prm')
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+ +
+
+class SparsePair
+

Bases: object

+
Inheritance diagram of cplex.SparsePair
+ + +

A class for storing sparse vector data.

+

An instance of this class has two attributes, ind and val. ind +specifies the indices and val specifies the values. ind and val +must be sequences of the same length. In general, ind may contain +any identifier; for example, when a SparsePair object is passed to +Cplex.linear_constraints.add, its ind attribute may be a list +containing both variable names and variable indices.

+
+
+__init__(ind=None, val=None)[source]
+

Constructor for SparsePair.

+

Takes two arguments, ind and val; ind specifies the indices that +the SparsePair refers to, and val specifies the float values +associated with those indices; ind and val must have the same +length. If ind or val is omitted, they will default to an empty +list.

+
>>> spair = SparsePair(ind=[0], val=[1.0])
+
+
+
+ +
+
+__repr__()[source]
+

Representation method of SparsePair.

+

Example usage:

+
>>> SparsePair(ind=[0], val=[1.0])
+SparsePair(ind = [0], val = [1.0])
+
+
+
+ +
+
+isvalid()[source]
+

Tests that ind and val have the same length.

+

Example usage:

+
>>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0])
+>>> spair.isvalid()
+True
+
+
+
+ +
+
+unpack()[source]
+

Extracts the indices and values sequences as a tuple.

+

Returns ind and val as given in __init__.

+
>>> spair = SparsePair(ind=[0, 1, 2], val=[1.0, 1.0, 1.0])
+>>> ind, val = spair.unpack()
+
+
+
+ +
+ +
+
+class SparseTriple
+

Bases: object

+
Inheritance diagram of cplex.SparseTriple
+ + +

A class for storing sparse matrix data.

+

An instance of this class has three attributes, ind1, ind2, and val. +ind1 and ind2 specify the indices and val specifies the values. +ind1, ind2, and val must be sequences of the same length. In +general, ind1 and ind2 may contain any identifier; for example, when +a SparseTriple object is passed to Cplex.quadratic_constraints.add, +its ind1 attribute may be a list containing both variable names and +variable indices.

+
+
+__init__(ind1=None, ind2=None, val=None)[source]
+

Constructor for SparseTriple.

+

Takes three arguments, ind1, ind2 and val, specifying the +indices that the SparseTriple refers to and the float values +associated with those indices, respectively. ind1, ind2, and +val must all have the same length. If ind1, ind2, or val is +omitted, they will default to an empty list.

+
>>> striple = SparseTriple(ind1=[0], ind2=[0], val=[1.0])
+
+
+
+ +
+
+__repr__()[source]
+

Representation method of SparseTriple.

+

Example usage:

+
>>> SparseTriple(ind1=[0], ind2=[0], val=[1.0])
+SparseTriple(ind1 = [0], ind2 = [0], val = [1.0])
+
+
+
+ +
+
+isvalid()[source]
+

Tests that ind1, ind2, and val have the same length.

+

Example usage:

+
>>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1],
+...                        val=[1.0, 1.0])
+>>> striple.isvalid()
+True
+
+
+
+ +
+
+unpack()[source]
+

Extracts the indices and values sequences as a tuple.

+

Returns ind1, ind2, and val as given in __init__.

+
>>> striple = SparseTriple(ind1=[0, 1], ind2=[0, 1],
+...                        val=[1.0, 1.0])
+>>> ind1, ind2, val = striple.unpack()
+
+
+
+ +
+ +
+

Subpackages

+
+ +
+
+
+

Submodules

+
+

cplex.aborter module

+

Aborter API

+
+
+class Aborter[source]
+

Bases: object

+
Inheritance diagram of cplex.aborter.Aborter
+ + +

Gracefully terminates the solve and tuning methods of CPLEX.

+

You can pass an instance of this class to one or more Cplex objects.

+

Calling the method abort() will then terminate the solve or tuning +method of the Cplex object.

+
+
+__init__()[source]
+

Constructor of the Aborter class.

+

The Aborter object is a context manager and can be used, like so:

+
+
with Aborter() as aborter:

# do stuff

+
+
+

When the with block is finished, the end() method will be called +automatically.

+
+ +
+
+abort()[source]
+

Aborts the solving and tuning methods.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.abort()
+
+
+
+ +
+
+clear()[source]
+

Clears the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.clear()
+
+
+
+ +
+
+is_aborted()[source]
+

Returns True if the method to abort has been called.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.is_aborted()
+False
+
+
+
+ +
+
+end()[source]
+

Ends the invoking aborter.

+

Example usage:

+
>>> aborter = cplex.Aborter()
+>>> aborter.end()
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

Aborter objects return themselves.

+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+ +
+
+

cplex.callbacks module

+

Callback classes for the CPLEX Python API.

+

This module defines the Context class which provides methods to query +information and perform all actions that can be performed from a generic +callback. See Cplex.set_callback().

+

See the following examples for more information on generic callbacks:

+
+
    +
  • admipex8.py

  • +
  • admipex9.py

  • +
  • bendersatsp2.py

  • +
+
+

This module also defines a hierarchy of classes for legacy callbacks, +many of which can be subclassed to define alternative behavior for the +algorithms in CPLEX. The methods provided by the classes allow you to +query information about the optimization in progress and to control the +optimization algorithm.

+

To use a subclassable legacy callback class, define a subclass of it that +defines a __call__ method. Then pass that class name to the +Cplex.register_callback method. The Cplex class will instantiate the +legacy callback class and return the instance of the class that was +created. If you wish to associate additional data with your callback +class, you may do so after it has been registered with the Cplex object.

+

See the following examples for more information on legacy callbacks:

+
+
    +
  • admipex1.py

  • +
  • admipex2.py

  • +
  • admipex3.py

  • +
  • admipex5.py

  • +
  • admipex6.py

  • +
  • bendersatsp.py

  • +
  • lpex4.py

  • +
  • mipex4.py

  • +
+
+
+
Note

If you operate the CPLEX Python API in parallel mode with callbacks +registered, there will be a single instance of each of your callback +classes shared among all threads.

+
+
+
+
+class Callback[source]
+

Bases: object

+
Inheritance diagram of cplex.callbacks.Callback
+ + +

Base class for Cplex callback classes.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+__call__()[source]
+

Method to be overridden by user-defined callback class.

+

See the Cplex.register_callback method.

+
+ +
+
+abort()[source]
+

Terminates optimization.

+
+
Note

A call to abort should be followed immediately by a return +statement. Calling other callback methods may override the +effect of the abort statement.

+
+
+
+ +
+
+get_end_time()[source]
+

Returns a time stamp for computing the time limit.

+

Subtracting the return value of Callback.get_time() from the +return value of this method yields the time remaining in +seconds.

+

The interpretation of this value as wall clock time or CPU +time is controlled by the parameter clocktype.

+
+ +
+
+get_end_dettime()[source]
+

Returns a deterministic time stamp in ticks.

+

Subtracting the return value of Callback.get_dettime() from the +return value of this method yields the time remaining in +deterministic ticks.

+
+ +
+
+get_start_time()[source]
+

Returns a time stamp specifying when the solving process started.

+

To compute elapsed time in seconds, subtract the result of +Callback.get_time() from the result of this method. This computation +yields either wallclock time (also known as real time) or CPU time, +depending on the clock set by the clocktype parameter.

+
+ +
+
+get_start_dettime()[source]
+

Returns a deterministic time stamp specifying when the solving process started.

+

To compute elapsed deterministic time in ticks, subtract the result of +Callback.get_dettime() from the result of this method.

+
+ +
+
+get_time()[source]
+

Returns a time stamp for the current time.

+

Subtracting the return value of this method from the return +value of Callback.get_end_time() yields the time remaining in +seconds.

+

The interpretation of this value as wall clock time or CPU +time is controlled by the parameter clocktype.

+
+ +
+
+get_dettime()[source]
+

Returns a deterministic time stamp for the current time.

+

Subtracting the return value of this method from the return +value of Callback.get_end_dettime() yields the time remaining in +deterministic ticks.

+
+ +
+ +
+
+class OptimizationCallback[source]
+

Bases: Callback

+
Inheritance diagram of cplex.callbacks.OptimizationCallback
+ + + +

Base class for Cplex optimization callback classes.

+
+
+get_num_quadratic_constraints()[source]
+

Returns the number of quadratic constraints in the problem.

+
+ +
+
+get_num_cols()[source]
+

Returns the number of variables in the problem.

+
+ +
+
+get_num_rows()[source]
+

Returns the number of linear constraints in the problem.

+
+ +
+ +
+
+class ContinuousCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.ContinuousCallback
+ + + + +

Subclassable class for Cplex continuous callbacks.

+

When Cplex is solving a problem by a simplex or barrier method, +this callback will be called after the simplex or barrier +callback, if any such callbacks are registered.

+

During concurrent optimization, CPLEX calls the user-written +callback only in the main thread, not in other concurrent threads.

+
+
Undocumented:
+

__init__, _wherefrom

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_dual_infeasibility()[source]
+

Returns a measure of the dual infeasibility of the problem.

+
+ +
+
+get_primal_infeasibility()[source]
+

Returns a measure of the primal infeasibility of the problem.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations completed.

+
+ +
+
+get_objective_value()[source]
+

Returns the current value of the objective function.

+
+ +
+
+is_dual_feasible()[source]
+

Returns whether or not the current solution is dual feasible.

+
+ +
+
+is_primal_feasible()[source]
+

Returns whether or not the current solution is primal feasible.

+
+ +
+ +
+
+class SimplexCallback[source]
+

Bases: ContinuousCallback

+
Inheritance diagram of cplex.callbacks.SimplexCallback
+ + + + + +

Subclassable class for Cplex simplex callback classes.

+

This callback will be used during execution of the primal simplex, +dual simplex, or quadratic simplex algorithms.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+ +
+
+class BarrierCallback[source]
+

Bases: ContinuousCallback

+
Inheritance diagram of cplex.callbacks.BarrierCallback
+ + + + + +

Subclassable class for Cplex barrier callback classes.

+

This callback will be used during execution of the barrier or +quadratic barrier algorithms.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_dual_objective_value()[source]
+

Returns the current dual value of the objective function.

+
+ +
+ +
+
+class CrossoverCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.CrossoverCallback
+ + + + +

Subclassable class for Cplex crossover callback classes.

+

This callback will be used during execution of a crossover +algorithm.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_num_dual_exchanges()[source]
+

Returns the number of dual exchanges performed so far.

+
+ +
+
+get_num_dual_pushes()[source]
+

Returns the number of dual pushes performed so far.

+
+ +
+
+get_num_primal_exchanges()[source]
+

Returns the number of primal exchanges performed so far.

+
+ +
+
+get_num_primal_pushes()[source]
+

Returns the number of primal pushes performed so far.

+
+ +
+
+get_num_superbasics()[source]
+

Returns the number of superbasic variables in the basis.

+
+ +
+ +
+
+class QualityMetric[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.QualityMetric
+ + + +

Constants defining metrics for the quality of the MIP solve.

+
+
+kappa_stable = 127
+
+ +
+
+kappa_suspicious = 128
+
+ +
+
+kappa_unstable = 129
+
+ +
+
+kappa_illposed = 130
+
+ +
+
+kappa_max = 131
+
+ +
+
+kappa_attention = 132
+
+ +
+ +
+
+class CutType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.CutType
+ + + +

Arguments to MIPInfoCallback.get_num_cuts().

+
+
+cover = 108
+
+ +
+
+GUB_cover = 111
+
+ +
+
+flow_cover = 110
+
+ +
+
+clique = 107
+
+ +
+
+fractional = 115
+
+ +
+
+MIR = 120
+
+ +
+
+flow_path = 119
+
+ +
+
+disjunctive = 117
+
+ +
+
+implied_bound = 112
+
+ +
+
+zero_half = 122
+
+ +
+
+multi_commodity_flow = 126
+
+ +
+
+lift_and_project = 133
+
+ +
+
+user = 134
+
+ +
+
+table = 135
+
+ +
+
+solution_pool = 136
+
+ +
+
+benders = 137
+
+ +
+ +
+
+class MIPInfoCallback[source]
+

Bases: OptimizationCallback

+
Inheritance diagram of cplex.callbacks.MIPInfoCallback
+ + + + +

Subclassable class for MIP informational callback classes.

+

This callback will be used when CPLEX is solving a MIP problem.

+
+
Undocumented:
+

__init__

+
+
+
+
+quality_metric = <cplex.callbacks.QualityMetric object>
+

See QualityMetric()

+
+ +
+
+cut_type = <cplex.callbacks.CutType object>
+

See CutType()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_num_cols()[source]
+

Returns the number of variables in the problem.

+
+ +
+
+get_num_rows()[source]
+

Returns the number of linear constraints in the problem.

+
+ +
+
+get_num_quadratic_constraints()[source]
+

Returns the number of quadratic constraints in the problem.

+
+ +
+
+get_num_cuts(cut_type)[source]
+

Returns the number of cuts of type cut_type added so far.

+
+ +
+
+get_best_objective_value()[source]
+

Returns the best objective value among unexplored nodes.

+
+ +
+
+get_cutoff()[source]
+

Returns the current cutoff value.

+
+ +
+
+get_incumbent_objective_value()[source]
+

Returns the objective value of the incumbent solution.

+
+ +
+
+get_incumbent_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the incumbent solution.

+

Can be called by four forms.

+
+
self.get_incumbent_linear_slacks()

return all linear slack values from the incumbent solution.

+
+
self.get_incumbent_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_incumbent_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_incumbent_linear_slacks(i) for i in s]

+
+
self.get_incumbent_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_incumbent_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_incumbent_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks for the incumbent solution.

+

Can be called by four forms.

+
+
self.get_incumbent_quadratic_slacks()
+
return all quadratic slack values from the incumbent

solution.

+
+
+
+
self.get_incumbent_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_incumbent_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to +[self.get_incumbent_quadratic_slacks(i) for i in s]

+
+
self.get_incumbent_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_incumbent_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_incumbent_values(*args)[source]
+

Returns the variable values of the incumbent solution.

+

There are four forms by which get_incumbent_values may be +called.

+
+
self.get_incumbent_values()

returns the entire incumbent solution

+
+
self.get_incumbent_values(i)

i must be a variable index or name. Returns the value +of the variable with index i in the incumbent solution.

+
+
self.get_incumbent_values(s)

s must be a sequence of variables indices or names. +Returns a list of the values of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_incumbent_values(i) for i in s]

+
+
self.get_incumbent_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the values of the variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_incumbent_values(range(begin, end + 1))

+
+
+
+ +
+
+get_MIP_relative_gap()[source]
+

Returns the current relative MIP gap.

+

Accesses the current relative gap, like the routine +CPXgetmiprelgap in the Callable Library. See CPXgetcallbackinfo +and CPXgetmiprelgap in the Callable Library Reference Manual for +more detail.

+
+ +
+
+get_num_iterations()[source]
+

Returns the number of iterations performed so far.

+
+ +
+
+get_num_nodes()[source]
+

Returns the number of nodes processed so far.

+
+ +
+
+get_num_remaining_nodes()[source]
+

Returns the number of unexplored nodes remaining.

+
+ +
+
+has_incumbent()[source]
+

Returns whether or not an incumbent solution has been found.

+
+ +
+
+get_float_quality(which)[source]
+

Returns a measure of the quality of the MIP solution as a floating point value.

+

The measure of the quality of a solution must be an attribute +of self.quality_metric corresponding to a floating point +quality metric. Such metrics include:

+

self.quality_metric.kappa_stable +self.quality_metric.kappa_suspicious +self.quality_metric.kappa_unstable +self.quality_metric.kappa_illposed +self.quality_metric.kappa_max +self.quality_metric.kappa_attention

+
+ +
+
+get_thread_num()[source]
+

Returns the identifier for the thread from which the callback +was invoked.

+

See CPX_CALLBACK_INFO_MY_THREAD_NUM in the Callable Library +Reference Manual for more detail.

+
+ +
+ +
+
+class MIPCallback[source]
+

Bases: MIPInfoCallback

+
Inheritance diagram of cplex.callbacks.MIPCallback
+ + + + + +

Subclassable class for MIP callback classes.

+

This callback will be used when CPLEX is solving a MIP problem.

+
+
Undocumented:
+

__init__, _get_node_info, _get_seq_info

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_objective_coefficients(*args)[source]
+

Returns the coefficients of the linear objective function.

+

There are four forms by which get_objective_coefficients may +be called.

+
+
self.get_objective_coefficients()

returns the entire objective function.

+
+
self.get_objective_coefficients(i)

i must be a variable index or name. Returns the objective +coefficient of the variable with index i.

+
+
self.get_objective_coefficients(s)

s must be a sequence of variable indices or names. Returns +a list of the objective coefficients of the variables with +indices the members of s, in the same order as they appear +in s. Equivalent to [self.get_objective_coefficients(i) +for i in s]

+
+
self.get_objective_coefficients(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the objective coefficients of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_objective_coefficients(range(begin, end + 1))

+
+
+
+ +
+
+get_current_node_depth()[source]
+

Returns the depth of the current node in the search tree.

+

The root node has depth 0 (zero). The depth of other nodes is defined +recursively as the depth of their parent node plus one. In other +words, the depth of a node is its distance in terms of the number of +branches from the root.

+
+ +
+ +
+
+class FeasibilityStatus[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.FeasibilityStatus
+ + + +

Feasibility status codes.

+
+
+feasible = 0
+
+ +
+
+implied_feasible = 2
+
+ +
+
+infeasible = 1
+
+ +
+ +
+
+class ControlCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.ControlCallback
+ + + + + + +

Base class for Cplex MIP control callback classes.

+
+
Undocumented:
+

__init__

+
+
+
+
+feasibility_status = <cplex.callbacks.FeasibilityStatus object>
+

See FeasibilityStatus()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_pseudo_costs(*args)[source]
+

Returns the current pseudo costs.

+

There are four forms by which get_pseudo_costs may be +called.

+
+
self.get_pseudo_costs()
+
returns a list of pairs with the pseudo costs for all the

variables.

+
+
+
+
self.get_pseudo_costs(i)

i must be a variable index or name. Returns a pair (up, +down), where up is the up pseudo cost and down is the down +pseudo cost of branching on the variable i.

+
+
self.get_pseudo_costs(s)

s must be a sequence of variable indices or names. Returns +a list of pairs (up, down) of pseudo costs of branching on +the variables with indices the members of s, in the same +order as they appear in s. Equivalent to +[self.get_pseudo_costs(i) for i in s]

+
+
self.get_pseudo_costs(begin, end)

begin and end must be variable indices or variable names. +Returns a list of pairs (up, down) of pseudo costs of branching +on the variables with indices between begin and end, inclusive +of end. Equivalent to +self.get_pseudo_costs(range(begin, end + 1))

+
+
+
+ +
+
+get_feasibilities(*args)[source]
+

Returns the current integer feasibility status.

+

There are four forms by which get_feasibilities may be +called.

+

The return values are attributes of self.feasibility_status.

+
+
self.get_feasibilities()

returns a list with the feasibility status for all the +variables.

+
+
self.get_feasibilities(i)

i must be a variable index or name. Returns the +feasibility status of the variable with index i.

+
+
self.get_feasibilities(s)

s must be a sequence of variable indices or names. Returns +a list of the feasibility statuses of the variables with +indices the members of s, in the same order as they appear +in s. Equivalent to [self.get_feasibilities(i) for i in s]

+
+
self.get_feasibilities(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the feasibility statuses of the variables +with indices between begin and end, inclusive of end. +Equivalent to self.get_feasibilities(range(begin, end + 1))

+
+
Note

Before you call this method from a solve callback, a +solution must exist. That is, you must first create the +solution by calling a CPLEX optimization method, and then +you must verify that this optimization method generated a +solution by checking its return value before you call the +method get_feasibilities.

+
+
+
+ +
+
+get_lower_bounds(*args)[source]
+

Returns the lower bounds at the current node.

+

There are four forms by which get_lower_bounds may be +called.

+
+
self.get_lower_bounds()

returns a list with the lower bounds for all the variables.

+
+
self.get_lower_bounds(i)

i must be a variable index or name. Returns the lower +bound of the variable with index i.

+
+
self.get_lower_bounds(s)

s must be a sequence of variable indices or names. Returns +a list of the lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_lower_bounds(i) for i in s]

+
+
self.get_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the lower bounds of the variables with +indices between begin and end, inclusive of end. Equivalent +to self.get_lower_bounds(range(begin, end + 1))

+
+
+
+ +
+
+get_upper_bounds(*args)[source]
+

Returns the upper bounds at the current node.

+

There are four forms by which get_upper_bounds may be +called.

+
+
self.get_upper_bounds()

returns a list with the upper bounds for all the variables.

+
+
self.get_upper_bounds(i)

i must be a variable index or name. Returns the upper +bound of the variable with index i.

+
+
self.get_upper_bounds(s)

s must be a sequence of variable indices or names. Returns +a list of the upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_upper_bounds(i) for i in s]

+
+
self.get_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the upper bounds of the variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_upper_bounds(range(begin, end + 1))

+
+
+
+ +
+
+get_node_data()[source]
+

Returns the user handle for the current node.

+

Returns None if no handle is set for the node.

+
+ +
+
+set_node_data(data)[source]
+

Set the user handle for the current node.

+

Returns the user handle previously set for this node (or None +if no handle was set).

+
+ +
+
+get_node_ID()[source]
+

Return the sequence number of this node.

+
+ +
+
+get_objective_value()[source]
+

Returns the value of the objective function at the current node.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_linear_slacks()

return all linear slack values from the problem at the +current node.

+
+
self.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_linear_slacks(i) for i in s]

+
+
self.get_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Returns a set of quadratic slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_quadratic_slacks()

return all quadratic slack values from the problem at the +current node.

+
+
self.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [self.get_quadratic_slacks(i) for i in s]

+
+
self.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or quadratic +constraint names. Returns the slack values associated with the +quadratic constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_values(*args)[source]
+

Returns the solution values at the current node.

+

In the case that the node LP is unbounded, this method returns +a vector that corresponds to an unbounded direction, scaled so +that at least one of its elements has magnitude +cplex.infinity. Thus, often the vector can be used directly, +for example to separate a lazy constraint. However, due to +the presence of large values in the vector care must be taken +to avoid potential numerical errors. If in doubt, +rescale the vector, and use it as an unbounded ray +rather than a primal vector.

+

There are four forms by which get_values may be called.

+
+
self.get_values()

returns the entire primal solution vector.

+
+
self.get_values(i)

i must be a variable index or name. Returns the solution +value of the variable with index i.

+
+
self.get_values(s)

s must be a sequence of variable indices or names. Returns +a list of the solution values of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_values(i) for i in s]

+
+
self.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_values(range(begin, end + 1))

+
+
+
+ +
+
+get_SOS_feasibilities(*args)[source]
+

Returns the current special ordered set feasibility status.

+

There are four forms by which get_SOS_feasibilities may be +called.

+

Returns 1 if the SOS is feasible and 0 if it is not.

+
+
self.get_SOS_feasibilties()

Returns the feasibility statuses of all the special ordered +sets.

+
+
self.get_SOS_feasibilities(i)

i must be a SOS index or name. Returns the feasibility +status of the special ordered set with index i.

+
+
self.get_SOS_feasibilities(s)

s must be a sequence of SOS indices or names. Returns a +list of the feasibility statuses of the special ordered +sets with indices the members of s, in the same order as +they appear in s. Equivalent to +[self.get_SOS_feasibilities(i) for i in s]

+
+
self.get_SOS_feasibilities(begin, end)

begin and end must be SOS indices or SOS names. Returns a list +of the feasibility statuses of the special ordered sets with +indices between begin and end, inclusive of end. Equivalent to +self.get_SOS_feasibilities(range(begin, end + 1))

+
+
Note

Before you call this method from a solve callback, a +solution must exist. That is, you must first create the +solution by calling a CPLEX optimization method, and then +you must verify that this optimization method generated a +solution by checking its return value before you call the +method get_SOS_feasibilities.

+
+
+
+ +
+ +
+
+class BranchType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.BranchType
+ + + +

Constants defining types of branches.

+
+
+any = 'A'
+
+ +
+
+SOS1 = '1'
+
+ +
+
+SOS2 = '2'
+
+ +
+
+variable = '0'
+
+ +
+ +
+
+class BranchCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.BranchCallback
+ + + + + + + +

Subclassable class for branch callback classes.

+

The user must be careful when using this class. Pruning a valid node +can prune the optimal solution. Also, choosing a different branching +variable can result in placing an invalid bound on a variable, in case +the variable was already restricted to other bounds before.

+

In particular, the user must not branch on variables that are implied +feasible. ImpliedFeasible specifies that the variable has been +presolved out. It will be feasible when all other integer variables +are integer feasible. Branching on such variables can cut off +feasible solutions.

+

If the user intends to branch on continuous variables, the user must +disable dual presolve reductions. To disable dual presolve +reductions, set the parameter to control primal and dual reduction +type, parameters.preprocessing.reduce, either to the value 1 (one) +(that is, CPX_PREREDUCE_PRIMALONLY) or to the value 0 (zero) (that +is, CPX_PREREDUCE_NOPRIMALORDUAL).

+

Also, if the user intends to branch on continuous variables, the user +must turn off reductions that may interfere with crushing or uncrushing. +This is parameters.preprocessing.reformulations.

+

By design, the CPLEX branch callback calculates and provides the +branching decisions that CPLEX would make in case the user does not +create any branches in the callback. Depending on variable selection +and other features of your model, the computation of these candidate +branches can be time-consuming. Consequently, if you know that you +will never use the branching candidates suggested by CPLEX, then you +can save time by disabling such features as strong branching. This +callback will be used prior to branching at a node in the branch and +cut tree.

+
+
Undocumented:
+

__init__

+
+
+
+
+branch_type = <cplex.callbacks.BranchType object>
+

See BranchType()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_branch(which_branch)[source]
+

Returns one of the candidate branches at the current node.

+

which_branch must be an integer such that 0 <= which_branch < +self.get_num_branches().

+

The return value of get_branch is a tuple t with two entries. +The first entry is the node estimate for the specified branch. +The second entry is a list of (var, dir, bnd) triples, where +var is the index of a variable whose bound will change, bnd is +the new bound, and dir is one of “L”, “U”, and “B”, indicating +that the branch will change the lower bound, the upper bound, +or both, respectively.

+
+ +
+
+get_branch_type()[source]
+

Returns the type of the branch.

+

One of the following: +self.branch_type.any +self.branch_type.SOS1 +self.branch_type.SOS2 +self.branch_type.variable

+
+ +
+
+get_num_branches()[source]
+

Return the number of nodes Cplex will create from this branch.

+
+ +
+
+is_integer_feasible()[source]
+

Return whether or not the current node is integer feasible.

+
+ +
+
+make_branch(objective_estimate, variables=None, constraints=None, node_data=None)[source]
+

Makes a new branch with the specified data.

+

objective_estimate is a float representing the estimated +objective value resulting from the specified branch.

+

variables is a sequence of (var, dir, bnd) triples specifying +the variables on which to branch. var must be an index of a +variable, dir must be one of “L” and “U”, indicating that the +bound is a lower or upper bound, respectively, and bnd is an +integer specifying the new bound for the variable.

+

constraints is a sequence of (vec, sense, rhs) triples +specifying the constraints with which to branch. vec must be +either an instance of SparsePair or a sequence with two +entries, the first of which specifies the indices and the +second of which specifies the values of the constraint. rhs +must be a float determining the righthand side of the +constraint. sense must be one of “L”, “G”, or “E”, specifying +whether the constraint is a less-than-or-equal-to (<=), +greater-than-or-equal-to (>=), or equality constraint.

+

node_data may be any object to be associated with the created +node. It can be queried by the get_node_data methods of the +IncumbentCallback class and the NodeCallback class.

+
+ +
+
+make_cplex_branch(which_branch, node_data=None)[source]
+

Replicates a CPLEX branch.

+

This method replicates the n-th branch that CPLEX would create +at the current node. The purpose of this method is to branch +exactly like CPLEX, but at the same time attach a user object to +the newly created node.

+

which_branch must be an integer such that 0 <= which_branch < +self.get_num_branches().

+

node_data may be any object to be associated with the created +node. It can be queried by the get_node_data methods of various +callback classes.

+

This method returns the sequence number of the newly created +node.

+
+ +
+
+prune()[source]
+

Removes the current node from the search tree.

+
+
Note

Prune must not be called in combination with make_branch. +Prune is not compatible with the populate_solution_pool +method of the Cplex class because +that method retains fathomed nodes for subsequent use.

+
+
+
+ +
+ +
+
+class CutCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.CutCallback
+ + + + + + + +

Base class for user cut and lazy constraint callback classes.

+
+
Undocumented:
+

add, add_local

+
+
+
+ +
+
+class UseConstraint[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.UseConstraint
+ + + +

Constants to specify when to use the added constraint

+
+
+force = 0
+
+ +
+
+purge = 1
+
+ +
+ +
+
+class LazyConstraintCallback[source]
+

Bases: CutCallback

+
Inheritance diagram of cplex.callbacks.LazyConstraintCallback
+ + + + + + + + +

Subclassable class for lazy constraint callback classes.

+

This callback will be used when CPLEX finds a new integer +feasible solution and when CPLEX finds that the LP relaxation +at the current node is unbounded.

+
+

Note

+

The lazy constraint callback may be invoked during MIP start +processing. In that case get_solution_source returns +mip_start_solution. When this value is returned some special +considerations apply:

+
+
    +
  • MIP start processing occurs very early in the solution process. +At this point no search tree is setup yet and there are no +search tree nodes yet. Consequently, a lot of the callback +methods that require a node context will fail in this +situation.

  • +
  • Lazy constraints separated when processing a MIP start will be +discarded after that MIP start has been processed. This means +that the callback may have to separate the same constraint +again for the next MIP start or for a solution that is found +later in the solution process.

  • +
+
+
+
+
Undocumented:
+

__init__

+
+
+
+
+use_constraint = <cplex.callbacks.UseConstraint object>
+

See UseConstraint()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+add(constraint, sense, rhs, use=0)[source]
+

Adds a linear constraint to the current subproblem.

+

constraint must be either a SparsePair instance or a list of +two lists, the first of which specifies variables, the second +of which specifies the values of the constraint.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the constraint.

+

use indicates under what circumstances the constraint should +be used. It can take the following values:

+

self.use_constraint.force (default) : force CPLEX to use the constraint +self.use_constraint.purge : allow CPLEX to purge the constraint

+

When you add a lazy constraint with the nondefault value purge, +you authorize CPLEX to purge (that is, to eliminate) the lazy +constraint under certain circumstances, for example, if the +lazy constraint becomes slack. Consequently, in view of such +purging, you must not assume that any previously added constraints +are still in current relaxation. In other words, the purged +lazy constraint may be violated in subsequent relaxations.

+
+ +
+
+add_local(constraint, sense, rhs)[source]
+

Adds a linear local constraint to the current subproblem.

+

A local constraint is a constraint that will only be added to +the problem at the current node and the subtree rooted by the +current node. It will not be added to the constraint matrix of +the original model.

+

constraint must be either a SparsePair instance or a list of +two lists, the first of which specifies variables, the second +of which specifies the values of the constraint.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the constraint.

+
+ +
+
+is_unbounded_node()[source]
+

Returns True if the current LP relaxation is unbounded, False otherwise.

+
+ +
+
+get_solution_source()[source]
+

Returns the source of the solution for which the lazy constraint callback was invoked.

+

The possible return values are:

+

IncumbentCallback.solution_source.node_solution: The integral solution is +the solution to the LP relaxation of a node in the MIP search +tree.

+

IncumbentCallback.solution_source.heuristic_solution: The integral solution +has been found by a CPLEX internal heuristic.

+

IncumbentCallback.solution_source.mipstart_solution: The integral solution has been +found during MIP start processing.

+
+ +
+ +
+
+class UseCut[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.UseCut
+ + + +

Constants to specify when to use the added cut.

+
+
+force = 0
+
+ +
+
+purge = 1
+
+ +
+
+filter = 2
+
+ +
+ +
+
+class UserCutCallback[source]
+

Bases: CutCallback

+
Inheritance diagram of cplex.callbacks.UserCutCallback
+ + + + + + + + +

Subclassable class for lazy constraint callback classes.

+

This callback will be used within the cut loop that CPLEX calls at +each node of the branch and cut algorithm. It will be called once +after CPLEX has ended its own cut generation loop so that the user +can specify additional cuts to be added to the cut pool.

+
+
Undocumented:
+

__init__

+
+
+
+
+use_cut = <cplex.callbacks.UseCut object>
+

See UseCut()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+add(cut, sense, rhs, use=0)[source]
+

Adds a linear cut to to the current subproblem.

+

cut must be either a SparsePair instance or a list of two +lists, the first of which specifies variables, the second of +which specifies the values of the cut.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the cut.

+

use indicates under what circumstances the cut should be used. +It can take the following values

+

self.use_cut.force (default) : force CPLEX to use the cut +self.use_cut.purge : allow CPLEX to purge the cut +self.use_cut.filter : treat as cuts CPLEX creates

+
+ +
+
+add_local(cut, sense, rhs)[source]
+

Adds a linear local cut to the current subproblem.

+

A local cut is a cut that is only valid at the current +node and the subtree rooted by the current node. It does +not need to be globally valid.

+

cut must be either a SparsePair instance or a list of two +lists, the first of which specifies variables, the second of +which specifies the values of the cut.

+

sense must be a single-character string; (“L”, “G”, “E”)

+

rhs is a float, specifying the righthand side of the cut.

+
+ +
+
+is_after_cut_loop()[source]
+

Returns True if called after the cut loop, False otherwise.

+
+ +
+
+abort_cut_loop()[source]
+

Terminate the cut loop and proceed with branching.

+
+ +
+ +
+
+class MethodType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.MethodType
+ + + +

Constants defining methods for solving the node LP.

+
+
+primal = 1
+
+ +
+
+dual = 2
+
+ +
+
+barrier = 4
+
+ +
+
+network = 3
+
+ +
+ +
+
+class HSCallback[source]
+

Bases: ControlCallback

+
Inheritance diagram of cplex.callbacks.HSCallback
+ + + + + + + +

Base class for heuristic and solve callback classes.

+
+
+status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See _internal._subinterfaces.SolutionStatus()

+
+ +
+
+method = <cplex.callbacks.MethodType object>
+

See MethodType()

+
+ +
+
+get_cplex_status()[source]
+

Returns the solution status of the current subproblem.

+

Returns an attribute of self.status.

+
+ +
+
+is_dual_feasible()[source]
+

Returns whether the solution of the current subproblem is dual feasible.

+
+ +
+
+is_primal_feasible()[source]
+

Returns whether the solution of the current subproblem is primal feasible.

+
+ +
+
+solve(alg=2)[source]
+

Solves the current subproblem.

+

The value of alg, if specified, determines the algorithm to +use to solve the current subproblem.

+

self.method.primal : primal simplex

+

self.method.dual : dual simplex

+

self.method.barrier : barrier

+

self.method.network : network

+

If this method generates a feasible solution it returns True, +otherwise it returns False.

+
+ +
+ +
+
+class HeuristicCallback[source]
+

Bases: HSCallback

+
Inheritance diagram of cplex.callbacks.HeuristicCallback
+ + + + + + + + +

Subclassable class for heuristic callback classes.

+

This callback will be used after solving each subproblem and at +the root node before each round of cuts is added to the problem +and resolved.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+set_bounds(*args)[source]
+

Sets the bounds for a set of variables.

+

Can be called by two forms.

+
+
self.set_bounds(i, lb, ub)

i must be a variable name or index and lb and ub must be +real numbers. Sets the lower bound and upper bound of the +variable whose index or name is i to lb and ub, +respectively.

+
+
self.set_lower_bounds(seq_of_triples)

seq_of_triples must be a list or tuple of tuples (i, lb, ub), +each of which consists of a variable name or index and +two real numbers. Sets the bounds of the specified +variables to the corresponding values. Equivalent to +[self.set_lower_bounds(triple[0], triple[1], triple[2]) for +triple in seq_of_triples].

+
+
Note

The variables specified must not have been removed by +presolve.

+
+
Note

These bound changes affect only the problem at the current +node.

+
+
+
+ +
+
+set_solution(solution, objective_value=None)[source]
+

Sets a solution to be used as the incumbent.

+

solution is either an instance of SparsePair or a sequence of +length two. If it is a sequence, the first entry is a +sequence of variable indices or names whose values are to be +changed and the second entry is a sequence of floats with the +corresponding new solution values. Variables whose indices +are not specified remain unchanged.

+

If objective_value is specified, it is taken as the objective +value of the new solution. Otherwise, the objective value is +computed.

+

Do not call this method multiple times. +Calling it again will overwrite any previously specified solution.

+
+ +
+ +
+
+class SolveCallback[source]
+

Bases: HSCallback

+
Inheritance diagram of cplex.callbacks.SolveCallback
+ + + + + + + + +

Subclassable class for solve callback classes.

+

This callback can be used to solve node relaxations during branch +and cut search.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+set_start(primal=None, dual=None)[source]
+

Sets the starting vectors for the next solve.

+

The arguments primal and dual must either be instances of +SparsePair or sequences of length two. If they are sequences, +the first entry is a sequence of indices or names specifying +the columns or rows whose values are to be set, and the second +entry is a sequence of floats with the corresponding new +values.

+

If primal is specified but dual is not, no dual values will be +stored. If dual is specified but primal is not, no primal +values will be stored.

+

Variables whose indices are not specified will be set to 0.0.

+
+
Note

If presolve is enabled, attempting to set dual values in +this method will raise an exception.

+
+
+
+ +
+
+use_solution()[source]
+

Tell CPLEX to use the resident solution after calling solve.

+
+ +
+ +
+
+class SolutionSource[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.SolutionSource
+ + + +

Attributes defining possible solution sources.

+
+
+node_solution = 111
+
+ +
+
+heuristic_solution = 117
+
+ +
+
+user_solution = 118
+
+ +
+
+mipstart_solution = 119
+
+ +
+ +
+
+class IncumbentCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.IncumbentCallback
+ + + + + + +

Subclassable class for incumbent callback classes.

+

This callback will be used after each new potential incumbent is found. +If the callback is used to reject incumbents, the user must set +the parameter +c.parameters.preprocessing.reduce either to the value +1 (one) to restrict presolve to primal reductions only or to 0 (zero) +to disable all presolve reductions. This setting of the parameter is +not necessary if the incumbent callback is used for other purposes.

+
+
Note

The incumbent callback may be invoked during MIP start processing. +In that case get_solution_source will return mip_start_solution. +In this situation the following special consideration applies:

+
    +
  • MIP start processing occurs very early in the solution process. +At this point no search tree is setup yet and there are no search +tree nodes yet. Consequently, a lot of the callback methods +that require a node context will fail in this situation.

  • +
+
+
+
+
Undocumented:
+

__init__

+
+
+
+
+solution_source = <cplex.callbacks.SolutionSource object>
+

See SolutionSource()

+
+ +
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_node_data()[source]
+

Returns the user handle for the current node.

+

Returns None if no handle is set for the node.

+
+ +
+
+set_node_data(data)[source]
+

Set the user handle for the current node.

+

Returns the user handle previously set for this node (or None +if no handle was set).

+
+ +
+
+get_node_ID()[source]
+

Returns the sequence number of the current node.

+
+ +
+
+get_objective_value()[source]
+

Returns the objective value of the potential incumbent.

+
+ +
+
+get_linear_slacks(*args)[source]
+

Returns a set of linear slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_linear_slacks()

return all linear slack values from the problem at the +current node.

+
+
self.get_linear_slacks(i)

i must be a linear constraint name or index. Returns the +slack values associated with the linear constraint whose +index or name is i.

+
+
self.get_linear_slacks(s)

s must be a sequence of linear constraint names or indices. +Returns the slack values associated with the linear +constraints with indices the members of s. Equivalent to +[self.get_linear_slacks(i) for i in s]

+
+
self.get_linear_slacks(begin, end)

begin and end must be linear constraint indices with begin +<= end or linear constraint names whose indices respect +this order. Returns the slack values associated with the +linear constraints with indices between begin and end, +inclusive of end. Equivalent to +self.get_linear_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_quadratic_slacks(*args)[source]
+

Return a set of quadratic slacks for the solution at the current node.

+

Can be called by four forms.

+
+
self.get_quadratic_slacks()

return all quadratic slack values from the problem at the +current node.

+
+
self.get_quadratic_slacks(i)

i must be a quadratic constraint name or index. Returns +the slack values associated with the quadratic constraint +whose index or name is i.

+
+
self.get_quadratic_slacks(s)

s must be a sequence of quadratic constraint names or +indices. Returns the slack values associated with the +quadratic constraints with indices the members of s. +Equivalent to [self.get_quadratic_slacks(i) for i in s]

+
+
self.get_quadratic_slacks(begin, end)

begin and end must be quadratic constraint indices or +quadratic constraint names. Returns the slack values associated +with the quadratic constraints with indices between begin and +end, inclusive of end. Equivalent to +self.get_quadratic_slacks(range(begin, end + 1)).

+
+
+
+ +
+
+get_values(*args)[source]
+

Return the potential incumbent solution values.

+

There are four forms by which get_values may be called.

+
+
self.get_values()

returns the entire potential incumbent.

+
+
self.get_values(i)

i must be a variable index or name. Returns the potential +incumbent value of the variable with index i.

+
+
self.get_values(s)

s must be a sequence of variable indices or names. Returns +a list of the potential incumbent values of the variables +with indices the members of s, in the same order as they +appear in s. Equivalent to [self.get_values(i) for i in s]

+
+
self.get_values(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the potential incumbent values of variables +with indices between begin and end, inclusive of end. +Equivalent to self.get_values(range(begin, end + 1))

+
+
+
+ +
+
+get_solution_source()[source]
+

Returns the source of the solution for which the incumbent callback was invoked.

+

The possible return values are:

+

self.solution_source.node_solution: The integral solution is +the solution to the LP relaxation of a node in the MIP search +tree.

+

self.solution_source.heuristic_solution: The integral solution +has been found by a CPLEX internal heuristic.

+

self.solution_source.user_solution: The integral solution has been +found by the user in the heuristic callback.

+

self.solution_source.mipstart_solution: The integral solution has been +found during MIP start processing.

+
+ +
+
+reject()[source]
+

Tells Cplex not to use the potential incumbent.

+
+ +
+ +
+
+class NodeCallback[source]
+

Bases: MIPCallback

+
Inheritance diagram of cplex.callbacks.NodeCallback
+ + + + + + +

Subclassable class for node callback classes.

+

This callback will be used before CPLEX enters a node, and can select +a different node to be entered instead.

+
+
Undocumented:
+

__init__, __conditionally_convert

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_branch_variable(which_node)[source]
+

Returns the index of the variable used to branch at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_depth(which_node)[source]
+

Returns the depth in the search tree of node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_current_node_depth()[source]
+

Returns the depth of the current node in the search tree.

+

This method always raises an exception since the node callback is not +invoked in the context of any node.

+
+ +
+
+get_estimated_objective_value(which_node)[source]
+

Returns the estimated objective function value at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_infeasibility_sum(which_node)[source]
+

Returns the sum of infeasibilities at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_num_infeasibilities(which_node)[source]
+

Returns the number of infeasibilities at node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+get_node_data(which_node)[source]
+

Returns the handle set by the user for node which_node.

+

Returns None if no handle was set when the node was created.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+set_node_data(which_node, data)[source]
+

Set the user handle for the specified node.

+

Returns the user handle previously set for that node (or None +if no handle was set).

+
+ +
+
+get_node_ID(which_node)[source]
+

Returns a one-tuple containing the sequence number of node which_node.

+

which_node must be an integer specifying the index +number of the desired node.

+
+ +
+
+get_node_number(which_node)[source]
+

Returns the index number of node which_node.

+

which_node must be a 1-tuple whose entry is an integer +specifying the sequence number of the desired node.

+
+ +
+
+get_objective_value(which_node)[source]
+

Returns the objective function value for node which_node.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+
+select_node(which_node)[source]
+

Tells Cplex to enter node which_node next.

+

which_node may either be an integer specifying the index +number of the desired node, or a 1-tuple whose entry is an +integer specifying the sequence number of the desired node.

+
+ +
+ +
+
+class TuningCallback[source]
+

Bases: Callback

+
Inheritance diagram of cplex.callbacks.TuningCallback
+ + + +

Subclassable class for tuning callback classes.

+

This callback will be used during tuning.

+

For general information about tuning callbacks, see that topic +in the CPLEX User’s Manual.

+
+
Undocumented:
+

__init__

+
+
+
+
+__init__(env)[source]
+

non-public

+
+ +
+
+get_progress()[source]
+

Returns the fraction of the tuning process that is done.

+
+ +
+ +
+
+class ContextType[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.ContextType
+ + + +

The different contexts in which a generic callback can be invoked.

+

The values defined here serve two purposes:

+
+

They are returned from Context.get_id() to indicate in which +context a particular callback invocation happened.

+

The bit-wise OR of these values specifies to +Cplex.set_callback() in which contexts CPLEX invokes the +callback.

+
+

See the reference manual of the CPLEX Callable Library (C API) +for a more detailed description of the various contexts.

+
+
+thread_up = 2
+

See CPX_CALLBACKCONTEXT_THREAD_UP in the C API.

+
+ +
+
+thread_down = 4
+

See CPX_CALLBACKCONTEXT_THREAD_DOWN in the C API.

+
+ +
+
+local_progress = 8
+

See CPX_CALLBACKCONTEXT_LOCAL_PROGRESS in the C API.

+
+ +
+
+global_progress = 16
+

See CPX_CALLBACKCONTEXT_GLOBAL_PROGRESS in the C API.

+
+ +
+
+candidate = 32
+

See CPX_CALLBACKCONTEXT_CANDIDATE in the C API.

+
+ +
+
+relaxation = 64
+

See CPX_CALLBACKCONTEXT_RELAXATION in the C API.

+
+ +
+
+branching = 128
+

See CPX_CALLBACKCONTEXT_BRANCHING in the C API.

+
+ +
+ +
+
+class RelaxationFlags[source]
+

Bases: ConstantClass

+
Inheritance diagram of cplex.callbacks.RelaxationFlags
+ + + +

The flags that can be passed to Context.get_relaxation_status().

+

See the reference manual of the CPLEX Callable Library (C API) +for a more detailed description of the various contexts.

+
+
+no_solve = 1
+

See CPX_RELAXATION_FLAG_NOSOLVE in the C API.

+
+ +
+ +
+
+class Context[source]
+

Bases: object

+
Inheritance diagram of cplex.callbacks.Context
+ + +

Context for the generic callback.

+

An instance of this class defines the context in which a generic +callback was invoked. It provides methods to query information and +perform all actions that can be performed from a generic callback.

+

Note that an instance of this class is only valid during the +execution of the callback into which it was passed. Don’t store a +reference to the context across callback invocations.

+

See Cplex.set_callback().

+
+
Undocumented:
+

__init__

+
+
+
+
+info = <cplex._internal._callbackinfoenum.CallbackInfo object>
+

See CallbackInfo

+
+ +
+
+solution_strategy = <cplex._internal._solutionstrategyenum.SolutionStrategy object>
+

See SolutionStrategy

+
+ +
+
+id = <cplex.callbacks.ContextType object>
+

See ContextType

+
+ +
+
+relaxation_flags = <cplex.callbacks.RelaxationFlags object>
+

See RelaxationFlags

+
+ +
+
+solution_status = <cplex._internal._subinterfaces.SolutionStatus object>
+

See SolutionStatus

+
+ +
+
+__init__(cpx, contextptr, contextid)[source]
+

non-public

+
+ +
+
+get_id()[source]
+

Returns the context in which the current callback was invoked.

+

The return value will be one of the constants in ContextType.

+
+ +
+
+in_thread_up()[source]
+

Returns True if the callback was invoked in context +ContextType.thread_up.

+

It is a shortcut for checking whether get_id() returns +ContextType.thread_up or not.

+
+ +
+
+in_thread_down()[source]
+

Returns True if the callback was invoked in context +ContextType.thread_down.

+

It is a shortcut for checking whether get_id() returns +ContextType.thread_down or not.

+
+ +
+
+in_local_progress()[source]
+

Returns True if the callback was invoked in context +ContextType.local_progress.

+

It is a shortcut for checking whether get_id() returns +ContextType.local_progress or not.

+
+ +
+
+in_global_progress()[source]
+

Returns True if the callback was invoked in context +ContextType.global_progress.

+

It is a shortcut for checking whether get_id() returns +ContextType.global_progress or not.

+
+ +
+
+in_candidate()[source]
+

Returns True if the callback was invoked in context +ContextType.candidate.

+

It is a shortcut for checking whether get_id() returns +ContextType.candidate or not.

+
+ +
+
+in_relaxation()[source]
+

Returns True if the callback was invoked in context +ContextType.relaxation.

+

It is a shortcut for checking whether get_id() returns +ContextType.relaxation or not.

+
+ +
+
+in_branching()[source]
+

Returns True if the callback was invoked in context +ContextType.branching.

+

It is a shortcut for checking whether get_id() returns +ContextType.branching or not.

+
+ +
+
+get_int_info(what)[source]
+

Returns a 32bit signed information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_long_info(what)[source]
+

Returns a 64bit signed information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfolong in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_double_info(what)[source]
+

Returns a float information value.

+

Potential values are listed in Context.info. Note that in all +contexts but ContextType.global_progress the information +returned by the method is thread-local.

+

See CPXcallbackgetinfodbl in the Callable Library +Reference Manual for more detail.

+
+ +
+
+abort()[source]
+

Aborts the optimization.

+

If you call this method then CPLEX will abort optimization at +the next opportunity.

+

See CPXcallbackabort in the Callable Library Reference +Manual for more detail.

+
+ +
+
+get_relaxation_point(*args)[source]
+

Returns the solution to the current relaxation.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

This method returns the values in the solution for the current +relaxation for the variables specified by the arguments.

+

There are four forms by which get_relaxation_point may be called.

+
+
self.get_relaxation_point()

returns the full solution vector.

+
+
self.get_relaxation_point(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the solution to the current +relaxation.

+
+
self.get_relaxation_point(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_relaxation_point(i) for i in s]

+
+
self.get_relaxation_point(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_relaxation_point(range(begin, end + 1)).

+
+
+

See CPXcallbackgetrelaxationpoint in the Callable +Library Reference Manual for more detail.

+
+ +
+
+get_relaxation_objective()[source]
+

Returns the objective value of current relaxation.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

See CPXcallbackgetrelaxationpoint in the Callable +Library Reference Manual for more detail.

+
+ +
+
+get_relaxation_status(flags=0)[source]
+

Returns the solution status of the relaxation LP.

+

Returns the solution status of the LP relaxation at the current +node.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

See CPXcallbackgetrelaxationstatus in the Callable +Library Reference Manual for more detail.

+
+ +
+
+make_branch(objective_estimate, variables=None, constraints=None)[source]
+

Makes a new branch with the specified data.

+

This method can only be invoked if get_id() returns +ContextType.branching. If invoked in a different context it +will raise an exception.

+

objective_estimate is a float representing the estimated +objective value resulting from the specified branch.

+

variables is a sequence of (var, dir, bnd) tuples specifying +the variables on which to branch. var must be an index of a +variable, dir must be one of “L” and “U”, indicating that the +bound is a lower or upper bound, respectively, and bnd is an +integer specifying the new bound for the variable.

+

constraints is a sequence of (vec, sense, rhs) tuples specifying +the constraints with which to branch. vec must be either an +instance of SparsePair or a sequence with two entries, the +first of which specifies the indices and the second of which +specifies the values of the constraint. rhs must be a float +determining the righthand side of the constraint. sense must be +one of “L”, “G”, or “E”, specifying whether the constraint is a +less-than-or-equal-to (<=), greater-than-or-equal-to (>=), or +equality constraint (=).

+

The method returns an integer that uniquely identifies the newly +created child node in the search tree.

+

Note that the children will be dropped if you call +prune_current_node() at the same node.

+

See CPXcallbackmakebranch in the Callable Library +Reference Manual for more detail.

+
+ +
+
+prune_current_node()[source]
+

Ask CPLEX to prune the current node from the search tree.

+

This method can only be invoked if get_id() returns +ContextType.relaxation or ContextType.branching. If invoked +in a different context it will raise an exception.

+

The node is marked for pruning. As soon as the callback returns, +CPLEX stops processing the node. In particular, no child nodes +will be created from that node, even if you called +make_branch() to explicitly create new nodes.

+

See CPXcallbackprunenode in the Callable Library +Reference Manual for more detail.

+
+ +
+
+exit_cut_loop()[source]
+

Ask CPLEX to stop cutting plane separatation at the current +node.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

See CPXcallbackexitcutloop in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_incumbent(*args)[source]
+

Returns the current incumbent solution.

+

The method returns the values in the current incumbent solution +for the variables specified by the arguments.

+

There are four forms by which get_incumbent may be called.

+
+
self.get_incumbent()

returns the full incumbent vector.

+
+
self.get_incumbent(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the current incumbent +solution.

+
+
self.get_incumbent(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_incumbent(i) for i in s]

+
+
self.get_incumbent(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_incumbent(range(begin, end + 1)).

+
+
+

See CPXcallbackgetincumbent in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_incumbent_objective()[source]
+

Returns the objective value of the current incumbent.

+

The returned value may be a huge value (such as 1e75) to indicate +that no incumbent was found yet. Consider using get_int_info() +with CallbackInfo.feasible first to check whether there is an +incumbent.

+

See CPXcallbackgetincumbent in the Callable Library +Reference Manual for more detail.

+
+ +
+
+is_candidate_point()[source]
+

Test if the callback was invoked for a candidate feasible +point.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method returns true if the callback was invoked for a +candidate feasible point. In that case the candidate feasible +point can be examined using get_candidate_point() and +get_candidate_objective().

+

See CPXcallbackcandidateispoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_source()[source]
+

Get the source from which the current candidate solution originated.

+

The value returned is from IncumbentCallback.solution_source.

+
+ +
+
+get_candidate_point(*args)[source]
+

Returns the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_point() returns true. +If invoked in a different context it will raise an exception.

+

This method returns the values in the current candidate solution +for the variables specified by the arguments.

+

There are four forms by which get_candidate_point may be called.

+
+
self.get_candidate_point()

returns the full solution vector.

+
+
self.get_candidate_point(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the current candidate +solution.

+
+
self.get_candidate_point(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_candidate_point(i) for i in s]

+
+
self.get_candidate_point(begin, end)

begin and end must be variable indices or variable names. +Returns a list of solution values of variables with indices +between begin and end, inclusive of end. Equivalent to +self.get_candidate_point(range(begin, end + 1))

+
+
+

See CPXcallbackgetcandidatepoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_objective()[source]
+

Returns the objective value of current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_point() returns true. +It will raise an exception if invoked in a different context.

+

See CPXcallbackgetcandidatepoint in the Callable Library +Reference Manual for more detail.

+
+ +
+
+is_candidate_ray()[source]
+

Test if the callback was invoked for an unbounded ray.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method returns true if the callback was invoked for an +unbounded relaxation. In that case the unbounded ray can be +obtained using get_candidate_ray() and.

+

See CPXcallbackcandidateisray in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_candidate_ray(*args)[source]
+

Returns the current unbounded ray.

+

This method can only be invoked if get_id() returns +ContextType.candidate and is_candidate_ray() returns true. If +invoked in a different context it will raise an exception.

+

The method returns the values for in the unbounded ray for the +variables specified by the arguments.

+

There are four forms by which get_candidate_ray may be called.

+
+
self.get_candidate_ray()

returns the full ray vector.

+
+
self.get_candidate_ray(i)

i must be a variable index or name. Returns the value of the +variable with index or name i in the unbounded ray.

+
+
self.get_candidate_ray(s)

s must be a sequence of variable indices or names. Returns a +list of the values of the variables with indices the members of +s, in the same order as they appear in s. Equivalent to +[self.get_candidate_ray(i) for i in s]

+
+
self.get_candidate_ray(begin, end)

begin and end must be variable indices or variable names. +Returns a list of unbounded reay values of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_candidate_ray(range(begin, end + 1)).

+
+
+

See CPXcallbackgetcandidateray in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_local_lower_bounds(*args)[source]
+

Returns the current local lower bounds.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

There are four forms by which get_local_lower_bounds may be +called.

+
+
self.get_local_lower_bounds()

returns local lower bounds for all variables.

+
+
self.get_local_lower_bounds(i)

i must be a variable index or name. Returns the local lower +bound of the variable with index or name i.

+
+
self.get_local_lower_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the local lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_local_lower_bounds(i) for i in s]

+
+
self.get_local_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the local lower bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_local_lower_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetlocallb in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_local_upper_bounds(*args)[source]
+

Returns the current local upper bounds.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

There are four forms by which get_local_upper_bounds may be +called.

+
+
self.get_local_upper_bounds()

returns local upper bounds for all variables.

+
+
self.get_local_upper_bounds(i)

i must be a variable index or name. Returns the local upper +bound of the variable with index or name i.

+
+
self.get_local_upper_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the local upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_local_upper_bounds(i) for i in s]

+
+
self.get_local_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the local upper bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_local_upper_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetlocalub in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_global_lower_bounds(*args)[source]
+

Returns the current globally valid lower bounds.

+

This method cannot be invoked if get_id() returns +ContextType.thread_up or ContextType.thread_down.

+

There are four forms by which get_global_lower_bounds may be +called.

+
+
self.get_global_lower_bounds()

returns global lower bounds for all variables.

+
+
self.get_global_lower_bounds(i)

i must be a variable index or name. Returns the global lower +bound of the variable with index or name i.

+
+
self.get_global_lower_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the global lower bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_global_lower_bounds(i) for i in s]

+
+
self.get_global_lower_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the global lower bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_global_lower_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetgloballb in the Callable Library +Reference Manual for more detail.

+
+ +
+
+get_global_upper_bounds(*args)[source]
+

Returns the current globally valid upper bounds.

+

This method cannot be invoked if get_id() returns +ContextType.thread_up or ContextType.thread_down.

+

There are four forms by which get_global_upper_bounds may be +called.

+
+
self.get_global_upper_bounds()

returns global upper bounds for all variables.

+
+
self.get_global_upper_bounds(i)

i must be a variable index or name. Returns the global upper +bound of the variable with index or name i.

+
+
self.get_global_upper_bounds(s)

s must be a sequence of variable indices or names. Returns a +list of the global upper bounds of the variables with indices +the members of s, in the same order as they appear in s. +Equivalent to [self.get_global_upper_bounds(i) for i in s]

+
+
self.get_global_upper_bounds(begin, end)

begin and end must be variable indices or variable names. +Returns a list of the global upper bounds of variables with +indices between begin and end, inclusive of end. Equivalent to +self.get_global_upper_bounds(range(begin, end + 1)).

+
+
+

See CPXcallbackgetglobalub in the Callable Library +Reference Manual for more detail.

+
+ +
+
+post_heuristic_solution(x, obj, strategy)[source]
+

Posts a feasible solution vector to CPLEX.

+

This method posts a (possibly partial) feasible solution to +CPLEX. CPLEX may use this vector to find a new incumbent +solution.

+

x is either a SparsePair instance or a list of two lists, the +first of which specifies the variables (by index or name) and the +second of which specifies the values.

+

obj is an estimate for the objective function value of the +solution provided by x.

+

strategy specifies how CPLEX should complete partial solutions. +See SolutionStrategy for further details.

+

See CPXcallbackpostheursoln in the Callable Library +Reference Manual for more detail.

+
+ +
+
+add_user_cuts(cuts, senses, rhs, cutmanagement, local)[source]
+

Adds user cuts.

+

This method can only be invoked if get_id() returns +ContextType.relaxation. If invoked in a different context it +will raise an exception.

+

This method submits the specified user cuts to CPLEX.

+

cuts, senses, rhs, cutmanagement, local must all be lists of +compatible dimensions. The first three specify the cuts to be +added.

+

cuts must be either a list of SparsePair instances or a list of +lists of two lists, the first of which specifies variables, the +second of which specifies the values of the constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

cutmanagement must be a list of integer values specifying how +CPLEX should treat each cut (see UseCut constants for further +details).

+

local must be a list of boolean values and specifies for each cut +whether it is only locally valid (True) or globally valid +(False).

+

See CPXcallbackaddusercuts in the Callable Library +Reference Manual for more detail.

+
+ +
+
+add_user_cut(cut, sense, rhs, cutmanagement, local)[source]
+

Convenience wrapper for add_user_cuts() that only adds a +single cut.

+
+ +
+
+reject_candidate(constraints=None, senses=None, rhs=None)[source]
+

Rejects the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate. If invoked in a different context it +will raise an exception.

+

This method marks the current candidate solution as infeasible, +potentially specifying additional constraints that cut it off.

+

If constraints, senses, and rhs are all None then the current +candidate solution is just rejected. If any of the three is not +None then all must be not None and all must have compatible +dimensions. In that case the three arguments specify a set of +constraints that cut off the current candidate solution. CPLEX +may use this information to tighten the problem formulation and +to avoid finding the same solution again. There is however no +guarantee that CPLEX will actually use those additional +constraints.

+

constraints must be either a list of SparsePair instances or a +list of lists of two lists, the first of which specifies +variables, the second of which specifies the values of the +constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

See CPXcallbackrejectcandidate in the Callable Library +Reference Manual for more detail.

+
+ +
+
+reject_candidate_local(constraints=None, senses=None, rhs=None)[source]
+

Rejects the current candidate solution.

+

This method can only be invoked if get_id() returns +ContextType.candidate and if the candidate was invoked for an +integral node. If invoked in a different context it will raise an +exception.

+

This method marks the current candidate solution as infeasible, +potentially specifying additional constraints that cut it off. +The specified constraints are not required to be globally valid. +They are only required to be valid in the subtree in which the +callback was invoked.

+

If constraints, senses, and rhs are all None then the current +candidate solution is just rejected. If any of the three is not +None then all must be not None and all must have compatible +dimensions. In that case the three arguments specify a set of +constraints that cut off the current candidate solution. CPLEX +may use this information to tighten the problem formulation and +to avoid finding the same solution again. There is however no +guarantee that CPLEX will actually use those additional +constraints.

+

constraints must be either a list of SparsePair instances or a +list of lists of two lists, the first of which specifies +variables, the second of which specifies the values of the +constraint.

+

senses must be list of single-character strings; (“L”, “G”, “E”) +It may also be one single string (the concatenation of the single +character strings).

+

rhs is a list of floats, specifying the righthand side of the +constraints.

+

See CPXcallbackrejectcandidatelocal in the Callable Library +Reference Manual for more detail.

+
+ +
+ +
+
+

cplex.constant_class module

+

A base class for classes that contain groups of constants.

+
+
+class ConstantClass[source]
+

Bases: object

+
Inheritance diagram of cplex.constant_class.ConstantClass
+ + +

A base class for classes that contain groups of constants.

+
+
+__init__()[source]
+

Creates a new ConstantClass.

+

This constructor is not meant to be used externally.

+
+ +
+
+__getitem__(item)[source]
+

Converts a constant to a string.

+
+ +
+
+__iter__()[source]
+

Iterate over the constants in this class.

+
+ +
+ +
+
+

cplex.exceptions module

+

Error codes and Exceptions raised by the CPLEX Python API.

+

For documentation of CPLEX error codes, see the group +optim.cplex.errorcodes in the reference manual of the CPLEX Callable +Library, and the topic Interpreting Error Codes in the Overview of the +APIs.

+
+
+exception CplexError[source]
+

Bases: Exception

+

Class for exceptions raised by the CPLEX Python API.

+
+ +
+
+exception CplexSolverError[source]
+

Bases: CplexError

+

Class for errors returned by the Callable Library functions.

+

self.args[0] : A string describing the error.

+

self.args[1] : The address of the environment that raised the error.

+

self.args[2] : The integer status code of the error.

+
+ +
+
+exception WrongNumberOfArgumentsError[source]
+

Bases: CplexError, TypeError

+

Class for errors involving the wrong number of arguments.

+

This exception is generally raised by methods that can accept a +dynamic number of arguments, but also enforce certain rules (e.g., to +be grouped in pairs, requires at least one argument, etc.).

+
+ +
+
+exception ErrorChannelMessage[source]
+

Bases: CplexError

+

Class for storing the last message on the error channel.

+

For internal use only.

+
+ +
+
+

cplex.model_info module

+

Modeling information IDs returned by the Callable Library.

+

This module defines symbolic names for the integer modeling information +IDs returned by the Callable Library. The names to which the modeling +information IDs are assigned are the same names used in the Callable +Library, all of which begin with CPXMI. The modeling information IDs are +accessible through the modeling assistance callback. These symbolic names +can be used to test if a particular modeling issue has been detected.

+

See Cplex.set_modeling_assistance_callback.

+
+
+CPXMI_BIGM_COEF = 1040
+

See CPXMI_BIGM_COEF in the C API.

+
+ +
+
+CPXMI_BIGM_TO_IND = 1041
+

See CPXMI_BIGM_TO_IND in the C API.

+
+ +
+
+CPXMI_BIGM_VARBOUND = 1042
+

See CPXMI_BIGM_VARBOUND in the C API.

+
+ +
+
+CPXMI_CANCEL_TOL = 1045
+

See CPXMI_CANCEL_TOL in the C API.

+
+ +
+
+CPXMI_EPGAP_LARGE = 1038
+

See CPXMI_EPGAP_LARGE in the C API.

+
+ +
+
+CPXMI_EPGAP_OBJOFFSET = 1037
+

See CPXMI_EPGAP_OBJOFFSET in the C API.

+
+ +
+
+CPXMI_FEAS_TOL = 1043
+

See CPXMI_FEAS_TOL in the C API.

+
+ +
+
+CPXMI_FRACTION_SCALING = 1047
+

See CPXMI_FRACTION_SCALING in the C API.

+
+ +
+
+CPXMI_IND_NZ_LARGE_NUM = 1019
+

See CPXMI_IND_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_IND_NZ_SMALL_NUM = 1020
+

See CPXMI_IND_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_IND_RHS_LARGE_NUM = 1021
+

See CPXMI_IND_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_IND_RHS_SMALL_NUM = 1022
+

See CPXMI_IND_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_KAPPA_ILLPOSED = 1035
+

See CPXMI_KAPPA_ILLPOSED in the C API.

+
+ +
+
+CPXMI_KAPPA_SUSPICIOUS = 1033
+

See CPXMI_KAPPA_SUSPICIOUS in the C API.

+
+ +
+
+CPXMI_KAPPA_UNSTABLE = 1034
+

See CPXMI_KAPPA_UNSTABLE in the C API.

+
+ +
+
+CPXMI_LB_LARGE_NUM = 1003
+

See CPXMI_LB_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LB_SMALL_NUM = 1004
+

See CPXMI_LB_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_LC_NZ_LARGE_NUM = 1023
+

See CPXMI_LC_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LC_NZ_SMALL_NUM = 1024
+

See CPXMI_LC_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_LC_RHS_LARGE_NUM = 1025
+

See CPXMI_LC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_LC_RHS_SMALL_NUM = 1026
+

See CPXMI_LC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_COEFFS = 1062
+

See CPXMI_MULTIOBJ_COEFFS in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_LARGE_NUM = 1058
+

See CPXMI_MULTIOBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_MIX = 1063
+

See CPXMI_MULTIOBJ_MIX in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_OPT_TOL = 1060
+

See CPXMI_MULTIOBJ_OPT_TOL in the C API.

+
+ +
+
+CPXMI_MULTIOBJ_SMALL_NUM = 1059
+

See CPXMI_MULTIOBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_NZ_LARGE_NUM = 1009
+

See CPXMI_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_NZ_SMALL_NUM = 1010
+

See CPXMI_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_OBJ_LARGE_NUM = 1001
+

See CPXMI_OBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_OBJ_SMALL_NUM = 1002
+

See CPXMI_OBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_OPT_TOL = 1044
+

See CPXMI_OPT_TOL in the C API.

+
+ +
+
+CPXMI_PWL_SLOPE_LARGE_NUM = 1064
+

See CPXMI_PWL_SLOPE_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_PWL_SLOPE_SMALL_NUM = 1065
+

See CPXMI_PWL_SLOPE_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_LINNZ_LARGE_NUM = 1015
+

See CPXMI_QC_LINNZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_LINNZ_SMALL_NUM = 1016
+

See CPXMI_QC_LINNZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_QNZ_LARGE_NUM = 1017
+

See CPXMI_QC_QNZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_QNZ_SMALL_NUM = 1018
+

See CPXMI_QC_QNZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QC_RHS_LARGE_NUM = 1013
+

See CPXMI_QC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QC_RHS_SMALL_NUM = 1014
+

See CPXMI_QC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QOBJ_LARGE_NUM = 1011
+

See CPXMI_QOBJ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_QOBJ_SMALL_NUM = 1012
+

See CPXMI_QOBJ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_QOPT_TOL = 1046
+

See CPXMI_QOPT_TOL in the C API.

+
+ +
+
+CPXMI_RHS_LARGE_NUM = 1007
+

See CPXMI_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_RHS_SMALL_NUM = 1008
+

See CPXMI_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_COL = 1050
+

See CPXMI_SAMECOEFF_COL in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_IND = 1051
+

See CPXMI_SAMECOEFF_IND in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_LAZY = 1054
+

See CPXMI_SAMECOEFF_LAZY in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_MULTIOBJ = 1061
+

See CPXMI_SAMECOEFF_MULTIOBJ in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_OBJ = 1057
+

See CPXMI_SAMECOEFF_OBJ in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_QLIN = 1052
+

See CPXMI_SAMECOEFF_QLIN in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_QUAD = 1053
+

See CPXMI_SAMECOEFF_QUAD in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_RHS = 1056
+

See CPXMI_SAMECOEFF_RHS in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_ROW = 1049
+

See CPXMI_SAMECOEFF_ROW in the C API.

+
+ +
+
+CPXMI_SAMECOEFF_UCUT = 1055
+

See CPXMI_SAMECOEFF_UCUT in the C API.

+
+ +
+
+CPXMI_SINGLE_PRECISION = 1036
+

See CPXMI_SINGLE_PRECISION in the C API.

+
+ +
+
+CPXMI_SYMMETRY_BREAKING_INEQ = 1039
+

See CPXMI_SYMMETRY_BREAKING_INEQ in the C API.

+
+ +
+
+CPXMI_UB_LARGE_NUM = 1005
+

See CPXMI_UB_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UB_SMALL_NUM = 1006
+

See CPXMI_UB_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_UC_NZ_LARGE_NUM = 1027
+

See CPXMI_UC_NZ_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UC_NZ_SMALL_NUM = 1028
+

See CPXMI_UC_NZ_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_UC_RHS_LARGE_NUM = 1029
+

See CPXMI_UC_RHS_LARGE_NUM in the C API.

+
+ +
+
+CPXMI_UC_RHS_SMALL_NUM = 1030
+

See CPXMI_UC_RHS_SMALL_NUM in the C API.

+
+ +
+
+CPXMI_WIDE_COEFF_RANGE = 1048
+

See CPXMI_WIDE_COEFF_RANGE in the C API.

+
+ +
+
+

cplex.paramset module

+

ParameterSet API

+
+
+class ParameterSet[source]
+

Bases: object

+
Inheritance diagram of cplex.paramset.ParameterSet
+ + +

A parameter set object for use with multi-objective optimization.

+

A parameter set consists of key-value pairs where the key is a CPLEX +parameter ID (e.g., CPX_PARAM_ADVIND) and the value is the associated +parameter value.

+

When adding, getting, or deleting items from a parameter set the +param argument can be either a Parameter object (e.g, +Cplex.parameters.advance) or an integer ID (e.g., CPX_PARAM_ADVIND +(1001)).

+

For more details see the section on multi-objective optimization in +the CPLEX User’s Manual.

+

See Cplex.create_parameter_set and Cplex.copy_parameter_set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance, c.parameters.advance.values.none)
+>>> len(ps)
+1
+
+
+
+
+__init__(env)[source]
+

Constructor of the ParameterSet class.

+

This class is not meant to be instantiated directly nor used +externally.

+
+ +
+
+end()[source]
+

Releases the ParameterSet object.

+

Frees all data structures associated with a ParameterSet. After +a call of the method end(), the invoking object can no longer be +used. Attempts to use them subsequently raise a ValueError.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.end()
+
+
+
+ +
+
+__del__()[source]
+

Destructor of the ParameterSet class.

+

When a ParameterSet object is destoyed, the end() method is +called.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> del ps
+
+
+
+ +
+
+__enter__()[source]
+

Enter the runtime context related to this object.

+

The with statement will bind this method’s return value to the +target specified in the as clause of the statement, if any.

+

ParameterSet objects return themselves.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> with c.create_parameter_set():
+...     pass  # do something here
+
+
+
+ +
+
+__exit__(exc_type, exc_value, traceback)[source]
+

Exit the runtime context.

+

When we exit the with block, the end() method is called.

+
+ +
+
+add(param, value)[source]
+

Add a parameter ID and value to a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+
+
+
+ +
+
+get(param)[source]
+

Gets a parameter value.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> val = ps.get(c.parameters.advance)
+>>> val == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+get_ids()[source]
+

Gets the parameter IDs contained in a parameter set.

+

Returns an iterator containing the parameter IDs in a parameter +set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> list(ps.get_ids())
+[1001]
+
+
+
+ +
+
+delete(param)[source]
+

Deletes a parameter from a parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> len(ps)
+1
+>>> ps.delete(c.parameters.advance)
+>>> len(ps)
+0
+
+
+
+ +
+
+clear()[source]
+

Clears all items from the parameter set.

+

Example Usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.clear()
+>>> len(ps)
+0
+
+
+
+ +
+
+__len__()[source]
+

Return the number of items in the parameter set.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> len(ps)
+0
+
+
+
+ +
+
+read(filename)[source]
+

Reads parameter names and settings from the file specified by +filename and copies them into the parameter set.

+

Note that the content of the parameter set is not cleared out +before the parameters in the file are copied into the parameter +set. The parameters are read from the file one by one and are +added to the parameter set, or, if the parameter was already +present in the set, then its value is updated.

+

This routine reads and copies files in the PRM format, as created +by Cplex.parameters.write. The PRM format is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> c.parameters.advance.set(c.parameters.advance.values.none)
+>>> c.parameters.write_file('example.prm')
+>>> ps = c.create_parameter_set()
+>>> ps.read('example.prm')
+>>> value = ps.get(c.parameters.advance)
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+
+write(filename)[source]
+

Writes a parameter file that contains the parameters in the +parameter set.

+

This routine writes a file in a format suitable for reading by +ParameterSet.read or by Cplex.parameters.read.

+

The file is written in the PRM format which is documented in the +CPLEX File Formats Reference Manual.

+

Example usage:

+
>>> import cplex
+>>> c = cplex.Cplex()
+>>> ps = c.create_parameter_set()
+>>> ps.add(c.parameters.advance,
+...        c.parameters.advance.values.none)
+>>> ps.write('example.prm')
+>>> c.parameters.read_file('example.prm')
+>>> value = c.parameters.advance.get()
+>>> value == c.parameters.advance.values.none
+True
+
+
+
+ +
+ +
+
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/genindex.html b/docs/genindex.html new file mode 100644 index 0000000..f586491 --- /dev/null +++ b/docs/genindex.html @@ -0,0 +1,4600 @@ + + + + + + + Index — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Index

+ +
+ _ + | A + | B + | C + | D + | E + | F + | G + | H + | I + | K + | L + | M + | N + | O + | P + | Q + | R + | S + | T + | U + | V + | W + | Y + | Z + +
+

_

+ + + +
+ +

A

+ + + +
+ +

B

+ + + +
+ +

C

+ + + +
+ +

D

+ + + +
+ +

E

+ + + +
+ +

F

+ + + +
+ +

G

+ + + +
+ +

H

+ + + +
+ +

I

+ + + +
+ +

K

+ + + +
+ +

L

+ + + +
+ +

M

+ + + +
+ +

N

+ + + +
+ +

O

+ + + +
+ +

P

+ + + +
+ +

Q

+ + + +
+ +

R

+ + + +
+ +

S

+ + + +
+ +

T

+ + + +
+ +

U

+ + + +
+ +

V

+ + + +
+ +

W

+ + + +
+ +

Y

+ + +
+ +

Z

+ + + +
+ + + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..90d8ee7 --- /dev/null +++ b/docs/index.html @@ -0,0 +1,172 @@ + + + + + + + + CPLEX Python API Reference Manual — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

CPLEX Python API Reference Manual

+
+

Contents:

+ +
+
+
+

IBM CPLEX Python API Reference Manual

+

The CPLEX Python API is a Python package named cplex that allows the CPLEX Callable Library to be accessed from the Python programming language. It is equally suitable for interactive use through the Python interpreter or for writing scripts or full-fledged applications.

+

For users of Python, CPLEX offers both a Python application programming interface (API) documented in this reference manual, as well as IBM Decision Optimization CPLEX Modeling for Python, also known as DOcplex. DOcplex is a library composed of two modules:

+
    +
  • Mathematical Programming Modeling for Python using docplex.mp (DOcplex.MP)

  • +
  • Constraint Programming Modeling for Python using docplex.cp (DOcplex.CP)

  • +
+

For more about DOcplex, see the DOcplex landing page.

+

The CPLEX Python API can be installed directly from PyPI or from Anaconda, using the commands pip and conda.

+

If you are using the conda command to install, then you should make sure the correct channel will be searched.

+

You can add the right channel in the active environment with a command like:

+
conda config --add channels ibmdecisionoptimization
+
+
+

The following commands install the Community Edition CPLEX and CP Optimizer run-times as well as the low-level Python interface to CPLEX.

+

PyPI:

+
pip install cplex
+
+
+

Anaconda:

+
conda install cplex
+
+
+

The following commands install the higher-level “docplex” Python package which includes CPLEX and CP Optimizer modeling and solving support. The Community Edition run-times which come as standard are limited in the size of the optimization problems that they can solve. To upgrade the Community Edition runtimes and remove size limitations, use the command “docplex” which was installed when you installed the “docplex” module with pip and conda.

+

PyPI:

+
pip install docplex
+
+
+

Anaconda:

+
conda install docplex
+
+
+

Running:

+
docplex config --upgrade Full_Path_To_This_CPLEX_Studio_Installation
+
+
+

will upgrade the CPLEX and CP Optimizer Python run-times from the Community Edition version to a size-unlimited version.

+
+
+

What you need to know

+

This manual assumes that you are familiar with the Python programming language.

+

This manual also assumes that you are familiar with the operating system on which you are using CPLEX and have the appropriate version of Python installed on your system. For information about supported platforms, see Detailed System Requirements (DSR) on your IBM customer support site.

+

For interactive use, the tab completion functionality provided by the Python module rlcompleter is extremely useful as you browse the CPLEX Python API. GNU/Linux systems typically include this package by default. Mac users are advised to install the package readline for their system. Windows users are advised either to use IDLE, the Python IDE distributed with Python, or to install the package readline for their system.

+
+
+

Structure of the package cplex

+

The CPLEX Python API is an object-oriented API providing most of its functionality through the class Cplex defined in the top level of the package cplex. This class has a number of methods, such as Cplex.read and Cplex.solve for operating on optimization problems, but most of its functionality is provided through methods of data attributes such as Cplex.linear_constraints, Cplex.objective, and Cplex.solution. These objects provide methods for modifying and querying data associated with the corresponding parts of an optimization problem. These objects are instances of classes defined within the subpackage cplex._internal. As its name suggests, classes and other data defined in the package cplex._internal are not to be instantiated or otherwise accessed directly by the user, but rather should only be accessed as attributes of an instance of the object Cplex.

+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/modules.html b/docs/modules.html new file mode 100644 index 0000000..4e233d4 --- /dev/null +++ b/docs/modules.html @@ -0,0 +1,377 @@ + + + + + + + + cplex — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+

cplex

+
+ +
+
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/objects.inv b/docs/objects.inv new file mode 100644 index 0000000..ece9d2d Binary files /dev/null and b/docs/objects.inv differ diff --git a/docs/py-modindex.html b/docs/py-modindex.html new file mode 100644 index 0000000..a874eba --- /dev/null +++ b/docs/py-modindex.html @@ -0,0 +1,212 @@ + + + + + + + Python Module Index — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + +

Python Module Index

+ +
+ c +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 
+ c
+ cplex +
    + cplex._internal +
    + cplex._internal._anno +
    + cplex._internal._aux_functions +
    + cplex._internal._baseinterface +
    + cplex._internal._constants +
    + cplex._internal._constantsenum +
    + cplex._internal._matrices +
    + cplex._internal._multiobj +
    + cplex._internal._multiobjsoln +
    + cplex._internal._parameter_classes +
    + cplex._internal._procedural +
    + cplex._internal._pwl +
    + cplex._internal._solutionstrategyenum +
    + cplex._internal._subinterfaces +
    + cplex.aborter +
    + cplex.callbacks +
    + cplex.constant_class +
    + cplex.exceptions +
    + cplex.model_info +
    + cplex.paramset +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/search.html b/docs/search.html new file mode 100644 index 0000000..582e2ba --- /dev/null +++ b/docs/search.html @@ -0,0 +1,114 @@ + + + + + + + Search — CPLEX Python API Reference Manual 22.1.2 documentation + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +

Search

+ + + + +

+ Searching for multiple words only shows matches that contain + all words. +

+ + +
+ + + +
+ + +
+ + +
+
+
+
+ +
+
+ + + + \ No newline at end of file diff --git a/docs/searchindex.js b/docs/searchindex.js new file mode 100644 index 0000000..160f58b --- /dev/null +++ b/docs/searchindex.js @@ -0,0 +1 @@ +Search.setIndex({"alltitles":{"CPLEX Python API Reference Manual":[[2,null]],"Contents:":[[2,null]],"IBM CPLEX Python API Reference Manual":[[2,"ibm-cplex-python-api-reference-manual"]],"Structure of the package cplex":[[2,"structure-of-the-package-cplex"]],"Submodules":[[0,"submodules"],[1,"submodules"]],"Subpackages":[[0,"subpackages"]],"What you need to know":[[2,"what-you-need-to-know"]],"cplex":[[3,null]],"cplex package":[[0,null]],"cplex._internal package":[[1,null]],"cplex._internal._anno module":[[1,"module-cplex._internal._anno"]],"cplex._internal._aux_functions module":[[1,"module-cplex._internal._aux_functions"]],"cplex._internal._baseinterface module":[[1,"module-cplex._internal._baseinterface"]],"cplex._internal._constants module":[[1,"module-cplex._internal._constants"]],"cplex._internal._constantsenum module":[[1,"module-cplex._internal._constantsenum"]],"cplex._internal._matrices module":[[1,"module-cplex._internal._matrices"]],"cplex._internal._multiobj module":[[1,"module-cplex._internal._multiobj"]],"cplex._internal._multiobjsoln module":[[1,"module-cplex._internal._multiobjsoln"]],"cplex._internal._parameter_classes module":[[1,"module-cplex._internal._parameter_classes"]],"cplex._internal._procedural module":[[1,"module-cplex._internal._procedural"]],"cplex._internal._pwl module":[[1,"module-cplex._internal._pwl"]],"cplex._internal._solutionstrategyenum module":[[1,"cplex-internal-solutionstrategyenum-module"]],"cplex._internal._subinterfaces module":[[1,"module-cplex._internal._subinterfaces"]],"cplex.aborter module":[[0,"module-cplex.aborter"]],"cplex.callbacks module":[[0,"module-cplex.callbacks"]],"cplex.constant_class module":[[0,"module-cplex.constant_class"]],"cplex.exceptions module":[[0,"module-cplex.exceptions"]],"cplex.model_info module":[[0,"module-cplex.model_info"]],"cplex.paramset module":[[0,"module-cplex.paramset"]]},"docnames":["cplex","cplex._internal","index","modules"],"envversion":{"sphinx":66,"sphinx.domains.c":3,"sphinx.domains.changeset":1,"sphinx.domains.citation":1,"sphinx.domains.cpp":9,"sphinx.domains.index":1,"sphinx.domains.javascript":3,"sphinx.domains.math":2,"sphinx.domains.python":4,"sphinx.domains.rst":2,"sphinx.domains.std":2,"sphinx.ext.intersphinx":1,"sphinx.ext.viewcode":1},"filenames":["cplex.rst","cplex._internal.rst","index.rst","modules.rst"],"indexentries":{"__call__() (callback method)":[[0,"cplex.callbacks.Callback.__call__",false]],"__call__() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.__call__",false]],"__del__() (cplex method)":[[0,"cplex.Cplex.__del__",false]],"__del__() (environment method)":[[1,"cplex._internal.Environment.__del__",false]],"__del__() (parameterset method)":[[0,"cplex.ParameterSet.__del__",false],[0,"cplex.paramset.ParameterSet.__del__",false]],"__enter__() (aborter method)":[[0,"cplex.Aborter.__enter__",false],[0,"cplex.aborter.Aborter.__enter__",false]],"__enter__() (cplex method)":[[0,"cplex.Cplex.__enter__",false]],"__enter__() (parameterset method)":[[0,"cplex.ParameterSet.__enter__",false],[0,"cplex.paramset.ParameterSet.__enter__",false]],"__exit__() (aborter method)":[[0,"cplex.Aborter.__exit__",false],[0,"cplex.aborter.Aborter.__exit__",false]],"__exit__() (cplex method)":[[0,"cplex.Cplex.__exit__",false]],"__exit__() (parameterset method)":[[0,"cplex.ParameterSet.__exit__",false],[0,"cplex.paramset.ParameterSet.__exit__",false]],"__getitem__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__getitem__",false]],"__getitem__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__getitem__",false]],"__init__() (aborter method)":[[0,"cplex.Aborter.__init__",false],[0,"cplex.aborter.Aborter.__init__",false]],"__init__() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.__init__",false]],"__init__() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.__init__",false]],"__init__() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.__init__",false]],"__init__() (barriercallback method)":[[0,"cplex.callbacks.BarrierCallback.__init__",false]],"__init__() (baseinterface method)":[[1,"cplex._internal._baseinterface.BaseInterface.__init__",false]],"__init__() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.__init__",false]],"__init__() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.__init__",false]],"__init__() (callback method)":[[0,"cplex.callbacks.Callback.__init__",false]],"__init__() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.__init__",false]],"__init__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__init__",false]],"__init__() (context method)":[[0,"cplex.callbacks.Context.__init__",false]],"__init__() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.__init__",false]],"__init__() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.__init__",false]],"__init__() (cplex method)":[[0,"cplex.Cplex.__init__",false]],"__init__() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.__init__",false]],"__init__() (deprecated method)":[[1,"cplex._internal._aux_functions.deprecated.__init__",false]],"__init__() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.__init__",false]],"__init__() (environment method)":[[1,"cplex._internal.Environment.__init__",false]],"__init__() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.__init__",false]],"__init__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__init__",false]],"__init__() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.__init__",false]],"__init__() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.__init__",false]],"__init__() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.__init__",false]],"__init__() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.__init__",false]],"__init__() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.__init__",false]],"__init__() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.__init__",false]],"__init__() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.__init__",false]],"__init__() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.__init__",false]],"__init__() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.__init__",false]],"__init__() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.__init__",false]],"__init__() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.__init__",false]],"__init__() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.__init__",false]],"__init__() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.__init__",false]],"__init__() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.__init__",false]],"__init__() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.__init__",false]],"__init__() (parameterset method)":[[0,"cplex.ParameterSet.__init__",false],[0,"cplex.paramset.ParameterSet.__init__",false]],"__init__() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.__init__",false]],"__init__() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.__init__",false]],"__init__() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.__init__",false]],"__init__() (qualitymetrics method)":[[1,"cplex._internal._subinterfaces.QualityMetrics.__init__",false]],"__init__() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.__init__",false]],"__init__() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.__init__",false]],"__init__() (siginthandler method)":[[1,"cplex._internal._procedural.SigIntHandler.__init__",false]],"__init__() (simplexcallback method)":[[0,"cplex.callbacks.SimplexCallback.__init__",false]],"__init__() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.__init__",false]],"__init__() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.__init__",false]],"__init__() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.__init__",false]],"__init__() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.__init__",false]],"__init__() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.__init__",false]],"__init__() (sparsepair method)":[[0,"cplex.SparsePair.__init__",false]],"__init__() (sparsetriple method)":[[0,"cplex.SparseTriple.__init__",false]],"__init__() (stats method)":[[0,"cplex.Stats.__init__",false]],"__init__() (statuschecker method)":[[1,"cplex._internal._procedural.StatusChecker.__init__",false]],"__init__() (tuningcallback method)":[[0,"cplex.callbacks.TuningCallback.__init__",false]],"__init__() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.__init__",false]],"__init__() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.__init__",false]],"__iter__() (constantclass method)":[[0,"cplex.constant_class.ConstantClass.__iter__",false]],"__len__() (parameterset method)":[[0,"cplex.ParameterSet.__len__",false],[0,"cplex.paramset.ParameterSet.__len__",false]],"__repr__() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.__repr__",false]],"__repr__() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.__repr__",false]],"__repr__() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.__repr__",false]],"__repr__() (sparsepair method)":[[0,"cplex.SparsePair.__repr__",false]],"__repr__() (sparsetriple method)":[[0,"cplex.SparseTriple.__repr__",false]],"__str__() (histogram method)":[[1,"cplex._internal._subinterfaces.Histogram.__str__",false]],"__str__() (qualitymetrics method)":[[1,"cplex._internal._subinterfaces.QualityMetrics.__str__",false]],"__str__() (stats method)":[[0,"cplex.Stats.__str__",false]],"abort (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.abort",false]],"abort() (aborter method)":[[0,"cplex.Aborter.abort",false],[0,"cplex.aborter.Aborter.abort",false]],"abort() (callback method)":[[0,"cplex.callbacks.Callback.abort",false]],"abort() (context method)":[[0,"cplex.callbacks.Context.abort",false]],"abort_cut_loop() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.abort_cut_loop",false]],"abort_dettime_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_dettime_limit",false]],"abort_dual_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_dual_obj_limit",false]],"abort_iteration_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_iteration_limit",false]],"abort_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_obj_limit",false]],"abort_primal_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_primal_obj_limit",false]],"abort_relaxed (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_relaxed",false]],"abort_time_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_time_limit",false]],"abort_user (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.abort_user",false]],"aborter (class in cplex)":[[0,"cplex.Aborter",false]],"aborter (class in cplex.aborter)":[[0,"cplex.aborter.Aborter",false]],"add() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.add",false]],"add() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.add",false]],"add() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.add",false]],"add() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.add",false]],"add() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.add",false]],"add() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.add",false]],"add() (parameterset method)":[[0,"cplex.ParameterSet.add",false],[0,"cplex.paramset.ParameterSet.add",false]],"add() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.add",false]],"add() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.add",false]],"add() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.add",false]],"add() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.add",false]],"add() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.add",false]],"add_batch() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.add_batch",false]],"add_diversity_filter() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.add_diversity_filter",false]],"add_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.add_lazy_constraints",false]],"add_local() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.add_local",false]],"add_local() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.add_local",false]],"add_range_filter() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.add_range_filter",false]],"add_rows() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.add_rows",false]],"add_user_cut() (context method)":[[0,"cplex.callbacks.Context.add_user_cut",false]],"add_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.add_user_cuts",false]],"add_user_cuts() (context method)":[[0,"cplex.callbacks.Context.add_user_cuts",false]],"addcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addcols",false]],"addfuncdest() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addfuncdest",false]],"addindconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addindconstr",false]],"addlazyconstraints() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addlazyconstraints",false]],"addmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addmipstarts",false]],"addpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addpwl",false]],"addqconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addqconstr",false]],"addrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addrows",false]],"addsolnpooldivfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsolnpooldivfilter",false]],"addsolnpoolrngfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsolnpoolrngfilter",false]],"addsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addsos",false]],"addusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.addusercuts",false]],"advance_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.advance_constants",false]],"advanced (cplex attribute)":[[0,"cplex.Cplex.advanced",false]],"advanced (linearconstraintinterface attribute)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.advanced",false]],"advanced (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.advanced",false]],"advanced (variablesinterface attribute)":[[1,"cplex._internal._subinterfaces.VariablesInterface.advanced",false]],"advancedcplexinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface",false]],"advancedlinearconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface",false]],"advancedsolutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface",false]],"advancedvariablesinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface",false]],"agg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.agg_constants",false]],"aggregated (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.aggregated",false]],"aggregated (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.aggregated",false]],"aggressive (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.aggressive",false]],"aggressive (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.aggressive",false]],"aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.aggressive",false]],"aggressive (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.aggressive",false]],"alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.alg_constants",false]],"all (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.all",false]],"all_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.all_constraints",false]],"all_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.all_constraints",false]],"all_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.all_variables",false]],"alternate (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.alternate",false]],"annotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.AnnotationInterface",false]],"annotationobjecttype (class in cplex._internal._anno)":[[1,"cplex._internal._anno.AnnotationObjectType",false]],"any (branchtype attribute)":[[0,"cplex.callbacks.BranchType.any",false]],"any (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.any",false]],"apply_freeform_one_arg() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_freeform_one_arg",false]],"apply_freeform_two_args() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_freeform_two_args",false]],"apply_pairs() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.apply_pairs",false]],"approx_min_degree (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.approx_min_degree",false]],"approx_min_fill (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.approx_min_fill",false]],"assist (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.assist",false]],"at_all_nodes (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.at_all_nodes",false]],"at_lower_bound (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.at_lower_bound",false]],"at_lower_bound (pivotvarstatus attribute)":[[1,"cplex._internal._subinterfaces.PivotVarStatus.at_lower_bound",false]],"at_root (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.at_root",false]],"at_upper_bound (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.at_upper_bound",false]],"at_upper_bound (pivotvarstatus attribute)":[[1,"cplex._internal._subinterfaces.PivotVarStatus.at_upper_bound",false]],"auto (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.auto",false]],"auto (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.auto",false]],"auto (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.auto",false]],"auto (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.auto",false]],"auto (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.auto",false]],"auto (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.auto",false]],"auto (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.auto",false]],"auto (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.auto",false]],"auto (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.auto",false]],"auto (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.auto",false]],"auto (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.auto",false]],"auto (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.auto",false]],"auto (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.auto",false]],"auto (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.auto",false]],"auto (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.auto",false]],"auto (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.auto",false]],"auto (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.auto",false]],"auto (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.auto",false]],"auto (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.auto",false]],"auto (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.auto",false]],"auto (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.auto",false]],"auto (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.auto",false]],"auto (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.auto",false]],"auto (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.auto",false]],"auto (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.auto",false]],"auto (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.auto",false]],"auto (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.auto",false]],"auto (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.auto",false]],"auto (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.auto",false]],"auto (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.auto",false]],"auto (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.auto",false]],"auto (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.auto",false]],"auto (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.auto",false]],"auto (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.auto",false]],"auto_off_on_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants",false]],"average (measure_constants attribute)":[[1,"cplex._internal._parameter_classes.measure_constants.average",false]],"average_primal_estimated_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.average_primal_estimated_dual",false]],"average_primal_zero_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.average_primal_zero_dual",false]],"balanced (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.balanced",false]],"bar_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_alg_constants",false]],"bar_order_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_order_constants",false]],"bar_start_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants",false]],"baropt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.baropt",false]],"barrier (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.barrier",false]],"barrier (methodtype attribute)":[[0,"cplex.callbacks.MethodType.barrier",false]],"barrier (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.barrier",false]],"barrier (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.barrier",false]],"barrier (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.barrier",false]],"barrier (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.barrier",false]],"barrier (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.barrier",false]],"barriercallback (class in cplex.callbacks)":[[0,"cplex.callbacks.BarrierCallback",false]],"baseinterface (class in cplex._internal._baseinterface)":[[1,"cplex._internal._baseinterface.BaseInterface",false]],"basic (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.basic",false]],"basic (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.basic",false]],"basic (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.basic",false]],"basic_presolve() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.basic_presolve",false]],"basicpresolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.basicpresolve",false]],"basis (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.basis",false]],"basisinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BasisInterface",false]],"basisvarstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BasisVarStatus",false]],"begin (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.begin",false]],"begin_and_end (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.begin_and_end",false]],"benders (cuttype attribute)":[[0,"cplex.callbacks.CutType.benders",false],[1,"cplex._internal._subinterfaces.CutType.benders",false]],"benders_annotation (longannotationinterface attribute)":[[1,"cplex._internal._anno.LongAnnotationInterface.benders_annotation",false]],"benders_mastervalue (longannotationinterface attribute)":[[1,"cplex._internal._anno.LongAnnotationInterface.benders_mastervalue",false]],"benders_num_best (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.benders_num_best",false]],"benders_strategy_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants",false]],"best_bound (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.best_bound",false]],"best_bound (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_bound",false]],"best_estimate (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_estimate",false]],"best_estimate_alt (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.best_estimate_alt",false]],"best_objective (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.best_objective",false]],"binary (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.binary",false]],"binvacol() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvacol",false]],"binvacol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvacol",false]],"binvarow() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvarow",false]],"binvarow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvarow",false]],"binvcol() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvcol",false]],"binvcol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvcol",false]],"binvrow() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.binvrow",false]],"binvrow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.binvrow",false]],"blend (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.blend",false]],"bound_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.bound_constraints",false]],"bounds (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.bounds",false]],"bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.bounds",false]],"boundsa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa",false]],"boundsa_lower() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa_lower",false]],"boundsa_upper() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.boundsa_upper",false]],"bqp (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.BQP",false]],"branch_direction (orderinterface attribute)":[[1,"cplex._internal._subinterfaces.OrderInterface.branch_direction",false]],"branch_type (branchcallback attribute)":[[0,"cplex.callbacks.BranchCallback.branch_type",false]],"branchcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.BranchCallback",false]],"branchcallbackbranchascplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.branchcallbackbranchasCPLEX",false]],"branchcallbackbranchgeneral() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.branchcallbackbranchgeneral",false]],"branchdirection (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.BranchDirection",false]],"branching (contexttype attribute)":[[0,"cplex.callbacks.ContextType.branching",false]],"branchtype (class in cplex.callbacks)":[[0,"cplex.callbacks.BranchType",false]],"brdir_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.brdir_constants",false]],"btran() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.btran",false]],"btran() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.btran",false]],"callback (class in cplex.callbacks)":[[0,"cplex.callbacks.Callback",false]],"callbackabort() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackabort",false]],"callbackaddusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackaddusercuts",false]],"callbackcandidateispoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackcandidateispoint",false]],"callbackcandidateisray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackcandidateisray",false]],"callbackexitcutloop() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackexitcutloop",false]],"callbackgetcandidateobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidateobj",false]],"callbackgetcandidatepoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidatepoint",false]],"callbackgetcandidateray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetcandidateray",false]],"callbackgetgloballb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetgloballb",false]],"callbackgetglobalub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetglobalub",false]],"callbackgetincumbent() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetincumbent",false]],"callbackgetincumbentobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetincumbentobj",false]],"callbackgetinfodbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfodbl",false]],"callbackgetinfoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfoint",false]],"callbackgetinfolong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetinfolong",false]],"callbackgetlocallb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetlocallb",false]],"callbackgetlocalub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetlocalub",false]],"callbackgetrelaxationpoint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationpoint",false]],"callbackgetrelaxationpointobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationpointobj",false]],"callbackgetrelaxationstatus() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackgetrelaxationstatus",false]],"callbackmakebranch() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackmakebranch",false]],"callbackpostheursoln() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackpostheursoln",false]],"callbackprunenode() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackprunenode",false]],"callbackrejectcandidate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackrejectcandidate",false]],"callbackrejectcandidatelocal() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbackrejectcandidatelocal",false]],"callbacksetnodeuserhandle() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbacksetnodeuserhandle",false]],"callbacksetuserhandle() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.callbacksetuserhandle",false]],"candidate (contexttype attribute)":[[0,"cplex.callbacks.ContextType.candidate",false]],"cardls_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.cardls_constants",false]],"cb_geterrorstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cb_geterrorstring",false]],"change() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.change",false]],"chbmatrix() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chbmatrix",false]],"check_feasibility (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.check_feasibility",false]],"check_feasible (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.check_feasible",false]],"chgbds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgbds",false]],"chgcoeflist() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgcoeflist",false]],"chgcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgcolname",false]],"chgctype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgctype",false]],"chgmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgmipstarts",false]],"chgobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobj",false]],"chgobjoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobjoffset",false]],"chgobjsen() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgobjsen",false]],"chgprobname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobname",false]],"chgprobtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobtype",false]],"chgprobtypesolnpool() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgprobtypesolnpool",false]],"chgqpcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgqpcoef",false]],"chgrhs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrhs",false]],"chgrngval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrngval",false]],"chgrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgrowname",false]],"chgsense() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.chgsense",false]],"cleanup() (cplex method)":[[0,"cplex.Cplex.cleanup",false]],"cleanup() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cleanup",false]],"clear() (aborter method)":[[0,"cplex.Aborter.clear",false],[0,"cplex.aborter.Aborter.clear",false]],"clear() (parameterset method)":[[0,"cplex.ParameterSet.clear",false],[0,"cplex.paramset.ParameterSet.clear",false]],"clique (cuttype attribute)":[[0,"cplex.callbacks.CutType.clique",false],[1,"cplex._internal._subinterfaces.CutType.clique",false]],"clocktype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.clocktype_constants",false]],"cloneprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cloneprob",false]],"closecplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.closeCPLEX",false]],"clpwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.clpwrite",false]],"coeffreduce_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants",false]],"col_status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.col_status",false]],"complete() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.complete",false]],"completed (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.completed",false]],"completelp() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.completelp",false]],"concurrent (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.concurrent",false]],"conflict (cplex attribute)":[[0,"cplex.Cplex.conflict",false]],"conflict_abort_contradiction (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_contradiction",false]],"conflict_abort_dettime_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_dettime_limit",false]],"conflict_abort_iteration_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_iteration_limit",false]],"conflict_abort_memory_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_memory_limit",false]],"conflict_abort_node_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_node_limit",false]],"conflict_abort_obj_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_obj_limit",false]],"conflict_abort_time_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_time_limit",false]],"conflict_abort_user (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_abort_user",false]],"conflict_algorithm_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants",false]],"conflict_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_feasible",false]],"conflict_minimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.conflict_minimal",false]],"conflictconstrainttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType",false]],"conflictinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictInterface",false]],"conflictstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ConflictStatus",false]],"constantclass (class in cplex.constant_class)":[[0,"cplex.constant_class.ConstantClass",false]],"constraint_type (conflictinterface attribute)":[[1,"cplex._internal._subinterfaces.ConflictInterface.constraint_type",false]],"constraint_type (feasoptinterface attribute)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.constraint_type",false]],"context (class in cplex.callbacks)":[[0,"cplex.callbacks.Context",false]],"contexttype (class in cplex.callbacks)":[[0,"cplex.callbacks.ContextType",false]],"continuous (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.continuous",false]],"continuouscallback (class in cplex.callbacks)":[[0,"cplex.callbacks.ContinuousCallback",false]],"controlcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.ControlCallback",false]],"convert() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.convert",false]],"convert_sequence() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.convert_sequence",false]],"copy_parameter_set() (cplex method)":[[0,"cplex.Cplex.copy_parameter_set",false]],"copylp() (cplex method)":[[0,"cplex.Cplex.copylp",false]],"copylpwnames() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copylpwnames",false]],"copyobjname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyobjname",false]],"copyorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyorder",false]],"copyprotected() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyprotected",false]],"copyqpsep() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyqpsep",false]],"copyquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copyquad",false]],"copystart() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.copystart",false]],"cost (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.cost",false]],"cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.cover",false],[1,"cplex._internal._subinterfaces.CutType.cover",false]],"cplex":[[0,"module-cplex",false]],"cplex (class in cplex)":[[0,"cplex.Cplex",false]],"cplex._internal":[[1,"module-cplex._internal",false]],"cplex._internal._anno":[[1,"module-cplex._internal._anno",false]],"cplex._internal._aux_functions":[[1,"module-cplex._internal._aux_functions",false]],"cplex._internal._baseinterface":[[1,"module-cplex._internal._baseinterface",false]],"cplex._internal._constants":[[1,"module-cplex._internal._constants",false]],"cplex._internal._constantsenum":[[1,"module-cplex._internal._constantsenum",false]],"cplex._internal._matrices":[[1,"module-cplex._internal._matrices",false]],"cplex._internal._multiobj":[[1,"module-cplex._internal._multiobj",false]],"cplex._internal._multiobjsoln":[[1,"module-cplex._internal._multiobjsoln",false]],"cplex._internal._parameter_classes":[[1,"module-cplex._internal._parameter_classes",false]],"cplex._internal._procedural":[[1,"module-cplex._internal._procedural",false]],"cplex._internal._pwl":[[1,"module-cplex._internal._pwl",false]],"cplex._internal._solutionstrategyenum":[[1,"module-cplex._internal._solutionstrategyenum",false]],"cplex._internal._subinterfaces":[[1,"module-cplex._internal._subinterfaces",false]],"cplex.aborter":[[0,"module-cplex.aborter",false]],"cplex.callbacks":[[0,"module-cplex.callbacks",false]],"cplex.constant_class":[[0,"module-cplex.constant_class",false]],"cplex.exceptions":[[0,"module-cplex.exceptions",false]],"cplex.model_info":[[0,"module-cplex.model_info",false]],"cplex.paramset":[[0,"module-cplex.paramset",false]],"cplexerror":[[0,"cplex.exceptions.CplexError",false]],"cplexsolvererror":[[0,"cplex.exceptions.CplexSolverError",false]],"cpu (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.CPU",false]],"cpxmi_bigm_coef (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_COEF",false]],"cpxmi_bigm_to_ind (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_TO_IND",false]],"cpxmi_bigm_varbound (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_BIGM_VARBOUND",false]],"cpxmi_cancel_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_CANCEL_TOL",false]],"cpxmi_epgap_large (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_EPGAP_LARGE",false]],"cpxmi_epgap_objoffset (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_EPGAP_OBJOFFSET",false]],"cpxmi_feas_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_FEAS_TOL",false]],"cpxmi_fraction_scaling (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_FRACTION_SCALING",false]],"cpxmi_ind_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_NZ_LARGE_NUM",false]],"cpxmi_ind_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_NZ_SMALL_NUM",false]],"cpxmi_ind_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_RHS_LARGE_NUM",false]],"cpxmi_ind_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_IND_RHS_SMALL_NUM",false]],"cpxmi_kappa_illposed (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_ILLPOSED",false]],"cpxmi_kappa_suspicious (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_SUSPICIOUS",false]],"cpxmi_kappa_unstable (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_KAPPA_UNSTABLE",false]],"cpxmi_lb_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LB_LARGE_NUM",false]],"cpxmi_lb_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LB_SMALL_NUM",false]],"cpxmi_lc_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_NZ_LARGE_NUM",false]],"cpxmi_lc_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_NZ_SMALL_NUM",false]],"cpxmi_lc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_RHS_LARGE_NUM",false]],"cpxmi_lc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_LC_RHS_SMALL_NUM",false]],"cpxmi_multiobj_coeffs (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_COEFFS",false]],"cpxmi_multiobj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_LARGE_NUM",false]],"cpxmi_multiobj_mix (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_MIX",false]],"cpxmi_multiobj_opt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_OPT_TOL",false]],"cpxmi_multiobj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_MULTIOBJ_SMALL_NUM",false]],"cpxmi_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_NZ_LARGE_NUM",false]],"cpxmi_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_NZ_SMALL_NUM",false]],"cpxmi_obj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OBJ_LARGE_NUM",false]],"cpxmi_obj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OBJ_SMALL_NUM",false]],"cpxmi_opt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_OPT_TOL",false]],"cpxmi_pwl_slope_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_PWL_SLOPE_LARGE_NUM",false]],"cpxmi_pwl_slope_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_PWL_SLOPE_SMALL_NUM",false]],"cpxmi_qc_linnz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_LINNZ_LARGE_NUM",false]],"cpxmi_qc_linnz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_LINNZ_SMALL_NUM",false]],"cpxmi_qc_qnz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_QNZ_LARGE_NUM",false]],"cpxmi_qc_qnz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_QNZ_SMALL_NUM",false]],"cpxmi_qc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_RHS_LARGE_NUM",false]],"cpxmi_qc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QC_RHS_SMALL_NUM",false]],"cpxmi_qobj_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOBJ_LARGE_NUM",false]],"cpxmi_qobj_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOBJ_SMALL_NUM",false]],"cpxmi_qopt_tol (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_QOPT_TOL",false]],"cpxmi_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_RHS_LARGE_NUM",false]],"cpxmi_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_RHS_SMALL_NUM",false]],"cpxmi_samecoeff_col (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_COL",false]],"cpxmi_samecoeff_ind (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_IND",false]],"cpxmi_samecoeff_lazy (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_LAZY",false]],"cpxmi_samecoeff_multiobj (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_MULTIOBJ",false]],"cpxmi_samecoeff_obj (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_OBJ",false]],"cpxmi_samecoeff_qlin (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_QLIN",false]],"cpxmi_samecoeff_quad (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_QUAD",false]],"cpxmi_samecoeff_rhs (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_RHS",false]],"cpxmi_samecoeff_row (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_ROW",false]],"cpxmi_samecoeff_ucut (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SAMECOEFF_UCUT",false]],"cpxmi_single_precision (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SINGLE_PRECISION",false]],"cpxmi_symmetry_breaking_ineq (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_SYMMETRY_BREAKING_INEQ",false]],"cpxmi_ub_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UB_LARGE_NUM",false]],"cpxmi_ub_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UB_SMALL_NUM",false]],"cpxmi_uc_nz_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_NZ_LARGE_NUM",false]],"cpxmi_uc_nz_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_NZ_SMALL_NUM",false]],"cpxmi_uc_rhs_large_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_RHS_LARGE_NUM",false]],"cpxmi_uc_rhs_small_num (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_UC_RHS_SMALL_NUM",false]],"cpxmi_wide_coeff_range (in module cplex.model_info)":[[0,"cplex.model_info.CPXMI_WIDE_COEFF_RANGE",false]],"create_parameter_set() (cplex method)":[[0,"cplex.Cplex.create_parameter_set",false]],"createprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.createprob",false]],"crossover_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.crossover_constants",false]],"crossovercallback (class in cplex.callbacks)":[[0,"cplex.callbacks.CrossoverCallback",false]],"crush_formula() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_formula",false]],"crush_pi() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_pi",false]],"crush_x() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.crush_x",false]],"crushform() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushform",false]],"crushpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushpi",false]],"crushx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.crushx",false]],"cut_type (mipinfocallback attribute)":[[0,"cplex.callbacks.MIPInfoCallback.cut_type",false]],"cut_type (mipsolutioninterface attribute)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.cut_type",false]],"cutcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.CutCallback",false]],"cutcallbackadd() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cutcallbackadd",false]],"cutcallbackaddlocal() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.cutcallbackaddlocal",false]],"cuttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.CutType",false]],"cuttype (class in cplex.callbacks)":[[0,"cplex.callbacks.CutType",false]],"datacheck_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.datacheck_constants",false]],"default (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.default",false]],"default (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.default",false]],"default (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.default",false]],"default (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.default",false]],"default() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.default",false]],"delcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delcols",false]],"deldblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.deldblanno",false]],"delete() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.delete",false]],"delete() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.delete",false]],"delete() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.delete",false]],"delete() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.delete",false]],"delete() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.delete",false]],"delete() (parameterset method)":[[0,"cplex.ParameterSet.delete",false],[0,"cplex.paramset.ParameterSet.delete",false]],"delete() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.delete",false]],"delete() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.delete",false]],"delete() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.delete",false]],"delete() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.delete",false]],"delete() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.delete",false]],"delete() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.delete",false]],"delete_names() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.delete_names",false]],"delete_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delete_native_int",false]],"delete_set_by_range() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.delete_set_by_range",false]],"delfuncdest() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delfuncdest",false]],"delindconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delindconstrs",false]],"dellonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dellonganno",false]],"delmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delmipstarts",false]],"delnames() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delnames",false]],"delpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delpwl",false]],"delpydel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delpydel",false]],"delqconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delqconstrs",false]],"delrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delrows",false]],"delsolnpoolfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsolnpoolfilters",false]],"delsolnpoolsolns() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsolnpoolsolns",false]],"delsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.delsos",false]],"dependency_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dependency_constants",false]],"deprecated (class in cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.deprecated",false]],"deprecated_class() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.deprecated_class",false]],"depth_first (nodesel_constants attribute)":[[1,"cplex._internal._parameter_classes.nodesel_constants.depth_first",false]],"detailed (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.detailed",false]],"deterministic (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.deterministic",false]],"dettime (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.dettime",false]],"dettime_limit (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.dettime_limit",false]],"devex (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.devex",false]],"devex (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.devex",false]],"dfeas (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.dfeas",false]],"disabled (cardls_constants attribute)":[[1,"cplex._internal._parameter_classes.cardls_constants.disabled",false]],"discrete_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.discrete_variables",false]],"disjunctive (cuttype attribute)":[[0,"cplex.callbacks.CutType.disjunctive",false],[1,"cplex._internal._subinterfaces.CutType.disjunctive",false]],"disk (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.disk",false]],"disk_compressed (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.disk_compressed",false]],"display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.display_constants",false]],"dive_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dive_constants",false]],"diversity (filtertype attribute)":[[1,"cplex._internal._subinterfaces.FilterType.diversity",false]],"diversity (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.diversity",false]],"djfrompi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.djfrompi",false]],"double_annotations (cplex attribute)":[[0,"cplex.Cplex.double_annotations",false]],"doubleannotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.DoubleAnnotationInterface",false]],"down (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.down",false]],"down (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.down",false]],"dperwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dperwrite",false]],"dual (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.dual",false]],"dual (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.dual",false]],"dual (methodtype attribute)":[[0,"cplex.callbacks.MethodType.dual",false]],"dual (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.dual",false]],"dual (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.dual",false]],"dual (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.dual",false]],"dual (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.dual",false]],"dual (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.dual",false]],"dual (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.dual",false]],"dual_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dual_constants",false]],"dual_farkas() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.dual_farkas",false]],"dual_objective (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.dual_objective",false]],"dual_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants",false]],"dualfarkas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualfarkas",false]],"dualopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualopt",false]],"dualwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.dualwrite",false]],"dynamic (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.dynamic",false]],"effort_level (mipstartsinterface attribute)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.effort_level",false]],"effortlevel (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.EffortLevel",false]],"embwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.embwrite",false]],"empty_problem (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.empty_problem",false]],"end (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.end",false]],"end() (aborter method)":[[0,"cplex.Aborter.end",false],[0,"cplex.aborter.Aborter.end",false]],"end() (cplex method)":[[0,"cplex.Cplex.end",false]],"end() (parameterset method)":[[0,"cplex.ParameterSet.end",false],[0,"cplex.paramset.ParameterSet.end",false]],"environment (class in cplex._internal)":[[1,"cplex._internal.Environment",false]],"equilibration (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.equilibration",false]],"error (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.error",false]],"error_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.ERROR_CHNL_IDX",false]],"errorchannelmessage":[[0,"cplex.exceptions.ErrorChannelMessage",false]],"estimated_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.estimated_dual",false]],"exact_kappa (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.exact_kappa",false]],"excluded (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.excluded",false]],"exit_cut_loop() (context method)":[[0,"cplex.callbacks.Context.exit_cut_loop",false]],"fail_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_feasible",false]],"fail_feasible_no_tree (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_feasible_no_tree",false]],"fail_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_infeasible",false]],"fail_infeasible_no_tree (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.fail_infeasible_no_tree",false]],"fast (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.fast",false]],"fast_getcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getcolname",false]],"fast_getmipstartname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getmipstartname",false]],"fast_getobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getobj",false]],"fast_getrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getrowname",false]],"fast_getrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getrows",false]],"fast_getsosname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_getsosname",false]],"fast_multiobjgetabstol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetabstol",false]],"fast_multiobjgetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetobj",false]],"fast_multiobjgetoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetoffset",false]],"fast_multiobjgetpriority() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetpriority",false]],"fast_multiobjgetreltol() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetreltol",false]],"fast_multiobjgetweight() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_multiobjgetweight",false]],"fast_newcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fast_newcols",false]],"feas (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.feas",false]],"feasibility (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.feasibility",false]],"feasibility_status (controlcallback attribute)":[[0,"cplex.callbacks.ControlCallback.feasibility_status",false]],"feasibilitystatus (class in cplex.callbacks)":[[0,"cplex.callbacks.FeasibilityStatus",false]],"feasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.feasible",false]],"feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible",false]],"feasible_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_inf",false]],"feasible_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_quad",false]],"feasible_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.feasible_relaxed_sum",false]],"feasopt (cplex attribute)":[[0,"cplex.Cplex.feasopt",false]],"feasopt (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.feasopt",false]],"feasopt_mode_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants",false]],"feasoptconstrainttype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType",false]],"feasoptext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.feasoptext",false]],"feasoptinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FeasoptInterface",false]],"file_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.file_constants",false]],"filter (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.filter",false]],"filter (usecut attribute)":[[0,"cplex.callbacks.UseCut.filter",false]],"filtertype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.FilterType",false]],"finitlock() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.finitlock",false]],"first_order (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.first_order",false]],"first_order (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.first_order",false]],"firstin_firstout (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.firstin_firstout",false]],"fixed (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.fixed",false]],"fixed_milp (problemtype attribute)":[[1,"cplex._internal.ProblemType.fixed_MILP",false]],"fixed_miqp (problemtype attribute)":[[1,"cplex._internal.ProblemType.fixed_MIQP",false]],"fixparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fixparam",false]],"float_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.float_info",false]],"flow_cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.flow_cover",false],[1,"cplex._internal._subinterfaces.CutType.flow_cover",false]],"flow_path (cuttype attribute)":[[0,"cplex.callbacks.CutType.flow_path",false],[1,"cplex._internal._subinterfaces.CutType.flow_path",false]],"fltwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.fltwrite",false]],"force (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.force",false]],"force (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.force",false]],"force (useconstraint attribute)":[[0,"cplex.callbacks.UseConstraint.force",false]],"force (usecut attribute)":[[0,"cplex.callbacks.UseCut.force",false]],"fpheur_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.fpheur_constants",false]],"fractional (cuttype attribute)":[[0,"cplex.callbacks.CutType.fractional",false],[1,"cplex._internal._subinterfaces.CutType.fractional",false]],"free() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.free",false]],"free_chbmat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.free_CHBmat",false]],"free_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.free_lazy_constraints",false]],"free_nonbasic (basisvarstatus attribute)":[[1,"cplex._internal._subinterfaces.BasisVarStatus.free_nonbasic",false]],"free_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.free_user_cuts",false]],"freelazyconstraints() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freelazyconstraints",false]],"freepresolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freepresolve",false]],"freeprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freeprob",false]],"freeusercuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.freeusercuts",false]],"ftran() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.ftran",false]],"ftran() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ftran",false]],"full (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.full",false]],"full (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.full",false]],"full (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.full",false]],"full (linear_constants attribute)":[[1,"cplex._internal._parameter_classes.linear_constants.full",false]],"full (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.full",false]],"full_steep (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.full_steep",false]],"general_scaling (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.general_scaling",false]],"get() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get",false]],"get() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.get",false]],"get() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.get",false]],"get() (parameterset method)":[[0,"cplex.ParameterSet.get",false],[0,"cplex.paramset.ParameterSet.get",false]],"get_aborter() (cplex method)":[[0,"cplex.Cplex.get_aborter",false]],"get_abstol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_abstol",false]],"get_activity_levels() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_activity_levels",false]],"get_all() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.get_all",false]],"get_basic_col_index() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basic_col_index",false]],"get_basic_row_index() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basic_row_index",false]],"get_basis() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basis",false]],"get_basis_dual_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_basis_dual_norms",false]],"get_best_objective() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_best_objective",false]],"get_best_objective_value() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_best_objective_value",false]],"get_bounds() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_bounds",false]],"get_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_branch",false]],"get_branch_type() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_branch_type",false]],"get_branch_variable() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_branch_variable",false]],"get_candidate_objective() (context method)":[[0,"cplex.callbacks.Context.get_candidate_objective",false]],"get_candidate_point() (context method)":[[0,"cplex.callbacks.Context.get_candidate_point",false]],"get_candidate_ray() (context method)":[[0,"cplex.callbacks.Context.get_candidate_ray",false]],"get_candidate_source() (context method)":[[0,"cplex.callbacks.Context.get_candidate_source",false]],"get_changed() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.get_changed",false]],"get_coefficients() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_coefficients",false]],"get_col_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_col_status",false]],"get_cols() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_cols",false]],"get_complemented() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_complemented",false]],"get_cplex_status() (hscallback method)":[[0,"cplex.callbacks.HSCallback.get_cplex_status",false]],"get_current_node_depth() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.get_current_node_depth",false]],"get_current_node_depth() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_current_node_depth",false]],"get_cutoff() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_cutoff",false]],"get_cutoff() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_cutoff",false]],"get_default_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_default_values",false]],"get_default_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_default_values",false]],"get_definition() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_definition",false]],"get_definitions() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_definitions",false]],"get_depth() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_depth",false]],"get_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_dettime",false]],"get_dettime() (cplex method)":[[0,"cplex.Cplex.get_dettime",false]],"get_dettime() (environment method)":[[1,"cplex._internal.Environment.get_dettime",false]],"get_diverging_index() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_diverging_index",false]],"get_diversity_filters() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_diversity_filters",false]],"get_double_info() (context method)":[[0,"cplex.callbacks.Context.get_double_info",false]],"get_driebeek_penalties() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_Driebeek_penalties",false]],"get_dual_infeasibility() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_dual_infeasibility",false]],"get_dual_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_dual_norms",false]],"get_dual_objective_value() (barriercallback method)":[[0,"cplex.callbacks.BarrierCallback.get_dual_objective_value",false]],"get_dual_values() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_dual_values",false]],"get_effort_levels() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_effort_levels",false]],"get_end_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_end_dettime",false]],"get_end_time() (callback method)":[[0,"cplex.callbacks.Callback.get_end_time",false]],"get_estimated_objective_value() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_estimated_objective_value",false]],"get_feasibilities() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_feasibilities",false]],"get_float_quality() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_float_quality",false]],"get_float_quality() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_float_quality",false]],"get_float_quality() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_float_quality",false]],"get_global_lower_bounds() (context method)":[[0,"cplex.callbacks.Context.get_global_lower_bounds",false]],"get_global_upper_bounds() (context method)":[[0,"cplex.callbacks.Context.get_global_upper_bounds",false]],"get_gradients() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_gradients",false]],"get_groups() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get_groups",false]],"get_header() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_header",false]],"get_histogram() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_histogram",false]],"get_histogram() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_histogram",false]],"get_id() (context method)":[[0,"cplex.callbacks.Context.get_id",false]],"get_ids() (parameterset method)":[[0,"cplex.ParameterSet.get_ids",false],[0,"cplex.paramset.ParameterSet.get_ids",false]],"get_incumbent() (context method)":[[0,"cplex.callbacks.Context.get_incumbent",false]],"get_incumbent_linear_slacks() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_linear_slacks",false]],"get_incumbent_node() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_incumbent_node",false]],"get_incumbent_objective() (context method)":[[0,"cplex.callbacks.Context.get_incumbent_objective",false]],"get_incumbent_objective_value() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_objective_value",false]],"get_incumbent_quadratic_slacks() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_quadratic_slacks",false]],"get_incumbent_values() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_incumbent_values",false]],"get_indicator_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_indicator_slacks",false]],"get_indicator_variables() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_indicator_variables",false]],"get_indices() (baseinterface method)":[[1,"cplex._internal._baseinterface.BaseInterface.get_indices",false]],"get_infeasibility_sum() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_infeasibility_sum",false]],"get_info() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_info",false]],"get_int_info() (context method)":[[0,"cplex.callbacks.Context.get_int_info",false]],"get_integer_quality() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_integer_quality",false]],"get_integer_quality() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_integer_quality",false]],"get_linear() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_linear",false]],"get_linear() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_linear",false]],"get_linear_components() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_linear_components",false]],"get_linear_components() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_linear_components",false]],"get_linear_num_nonzeros() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_linear_num_nonzeros",false]],"get_linear_reduced_costs_from_pi() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_linear_reduced_costs_from_pi",false]],"get_linear_slacks() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_linear_slacks",false]],"get_linear_slacks() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_linear_slacks",false]],"get_linear_slacks() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_linear_slacks",false]],"get_linear_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_linear_slacks",false]],"get_linear_slacks_from_x() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_linear_slacks_from_x",false]],"get_local_lower_bounds() (context method)":[[0,"cplex.callbacks.Context.get_local_lower_bounds",false]],"get_local_upper_bounds() (context method)":[[0,"cplex.callbacks.Context.get_local_upper_bounds",false]],"get_long_info() (context method)":[[0,"cplex.callbacks.Context.get_long_info",false]],"get_lower_bounds() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_lower_bounds",false]],"get_lower_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_lower_bounds",false]],"get_mean_objective_value() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_mean_objective_value",false]],"get_method() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_method",false]],"get_mip_relative_gap() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_MIP_relative_gap",false]],"get_mip_relative_gap() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_mip_relative_gap",false]],"get_name() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_name",false]],"get_names() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_names",false]],"get_names() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_names",false]],"get_names() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_names",false]],"get_names() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_names",false]],"get_names() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_names",false]],"get_names() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_names",false]],"get_names() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_names",false]],"get_names() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_names",false]],"get_names() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_names",false]],"get_names() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_names",false]],"get_names() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_names",false]],"get_names() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_names",false]],"get_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.get_native_int",false]],"get_node_data() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_node_data",false]],"get_node_data() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_node_data",false]],"get_node_data() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_data",false]],"get_node_id() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_node_ID",false]],"get_node_id() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_node_ID",false]],"get_node_id() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_ID",false]],"get_node_number() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_node_number",false]],"get_num() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_num",false]],"get_num() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_num",false]],"get_num() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_num",false]],"get_num() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_num",false]],"get_num() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_num",false]],"get_num() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_num",false]],"get_num() (pwlconstraintinterface method)":[[1,"cplex._internal._pwl.PWLConstraintInterface.get_num",false]],"get_num() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_num",false]],"get_num() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_num",false]],"get_num() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_num",false]],"get_num() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_num",false]],"get_num() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num",false]],"get_num_barrier_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_barrier_iterations",false]],"get_num_binary() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_binary",false]],"get_num_branches() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.get_num_branches",false]],"get_num_cols() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_cols",false]],"get_num_cols() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_cols",false]],"get_num_conflict_passes() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_conflict_passes",false]],"get_num_cores() (cplex method)":[[0,"cplex.Cplex.get_num_cores",false]],"get_num_cores() (environment method)":[[1,"cplex._internal.Environment.get_num_cores",false]],"get_num_cuts() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_cuts",false]],"get_num_cuts() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_num_cuts",false]],"get_num_dual_exchange() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_dual_exchange",false]],"get_num_dual_exchanges() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_dual_exchanges",false]],"get_num_dual_push() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_dual_push",false]],"get_num_dual_pushes() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_dual_pushes",false]],"get_num_dual_superbasic() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_num_dual_superbasic",false]],"get_num_entries() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_num_entries",false]],"get_num_groups() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.get_num_groups",false]],"get_num_infeasibilities() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_num_infeasibilities",false]],"get_num_integer() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_integer",false]],"get_num_iterations() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_num_iterations",false]],"get_num_iterations() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_iterations",false]],"get_num_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_iterations",false]],"get_num_lazy_constraints() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.get_num_lazy_constraints",false]],"get_num_members() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_num_members",false]],"get_num_nodes() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_nodes",false]],"get_num_nodes_processed() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_nodes_processed",false]],"get_num_nodes_remaining() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_nodes_remaining",false]],"get_num_nonzeros() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_num_nonzeros",false]],"get_num_nonzeros() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_num_nonzeros",false]],"get_num_nonzeros() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_num_nonzeros",false]],"get_num_phase_one_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_phase_one_iterations",false]],"get_num_primal_exchange() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_primal_exchange",false]],"get_num_primal_exchanges() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_primal_exchanges",false]],"get_num_primal_push() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_primal_push",false]],"get_num_primal_pushes() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_primal_pushes",false]],"get_num_primal_superbasic() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_num_primal_superbasic",false]],"get_num_quadratic_constraints() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_quadratic_constraints",false]],"get_num_quadratic_constraints() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_quadratic_constraints",false]],"get_num_quadratic_nonzeros() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_num_quadratic_nonzeros",false]],"get_num_quadratic_variables() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_num_quadratic_variables",false]],"get_num_remaining_nodes() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_remaining_nodes",false]],"get_num_replaced() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_num_replaced",false]],"get_num_rows() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_num_rows",false]],"get_num_rows() (optimizationcallback method)":[[0,"cplex.callbacks.OptimizationCallback.get_num_rows",false]],"get_num_semicontinuous() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_semicontinuous",false]],"get_num_semiinteger() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_num_semiinteger",false]],"get_num_sifting_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_sifting_iterations",false]],"get_num_sifting_phase_one_iterations() (progressinterface method)":[[1,"cplex._internal._subinterfaces.ProgressInterface.get_num_sifting_phase_one_iterations",false]],"get_num_solves() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_num_solves",false]],"get_num_superbasics() (crossovercallback method)":[[0,"cplex.callbacks.CrossoverCallback.get_num_superbasics",false]],"get_num_user_cuts() (advancedlinearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface.get_num_user_cuts",false]],"get_objective_coefficients() (mipcallback method)":[[0,"cplex.callbacks.MIPCallback.get_objective_coefficients",false]],"get_objective_value() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_objective_value",false]],"get_objective_value() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_objective_value",false]],"get_objective_value() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_objective_value",false]],"get_objective_value() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_objective_value",false]],"get_objective_value() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.get_objective_value",false]],"get_objective_value() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_objective_value",false]],"get_objective_value() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_objective_value",false]],"get_objval_by_priority() (multiobjsolninterface method)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.get_objval_by_priority",false]],"get_offset() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_offset",false]],"get_offset() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_offset",false]],"get_parameter_set() (cplex method)":[[0,"cplex.Cplex.get_parameter_set",false]],"get_presolved_col_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_presolved_col_status",false]],"get_presolved_row_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_presolved_row_status",false]],"get_primal_infeasibility() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.get_primal_infeasibility",false]],"get_primal_norms() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.get_primal_norms",false]],"get_priority() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_priority",false]],"get_problem_name() (cplex method)":[[0,"cplex.Cplex.get_problem_name",false]],"get_problem_type() (cplex method)":[[0,"cplex.Cplex.get_problem_type",false]],"get_progress() (tuningcallback method)":[[0,"cplex.callbacks.TuningCallback.get_progress",false]],"get_protected() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.get_protected",false]],"get_pseudo_costs() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_pseudo_costs",false]],"get_quad_num_nonzeros() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_quad_num_nonzeros",false]],"get_quadratic() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_quadratic",false]],"get_quadratic_activity_levels() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_activity_levels",false]],"get_quadratic_coefficients() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_quadratic_coefficients",false]],"get_quadratic_components() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_quadratic_components",false]],"get_quadratic_dualslack() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_dualslack",false]],"get_quadratic_indefinite_certificate() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_indefinite_certificate",false]],"get_quadratic_reduced_costs_from_pi() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_reduced_costs_from_pi",false]],"get_quadratic_slacks() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_quadratic_slacks",false]],"get_quadratic_slacks() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_quadratic_slacks",false]],"get_quadratic_slacks() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_quadratic_slacks",false]],"get_quadratic_slacks() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quadratic_slacks",false]],"get_quadratic_slacks_from_x() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_quadratic_slacks_from_x",false]],"get_quality_metrics() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_quality_metrics",false]],"get_quality_metrics() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_quality_metrics",false]],"get_range_filters() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_range_filters",false]],"get_range_values() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_range_values",false]],"get_ray() (advancedsolutioninterface method)":[[1,"cplex._internal._subinterfaces.AdvancedSolutionInterface.get_ray",false]],"get_reduced_costs() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_reduced_costs",false]],"get_relaxation_objective() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_objective",false]],"get_relaxation_point() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_point",false]],"get_relaxation_status() (context method)":[[0,"cplex.callbacks.Context.get_relaxation_status",false]],"get_reltol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_reltol",false]],"get_rhs() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_rhs",false]],"get_rhs() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_rhs",false]],"get_rhs() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_rhs",false]],"get_row_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_row_status",false]],"get_rows() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_rows",false]],"get_sense() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_sense",false]],"get_sense() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.get_sense",false]],"get_senses() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_senses",false]],"get_senses() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.get_senses",false]],"get_senses() (quadraticconstraintinterface method)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface.get_senses",false]],"get_sets() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_sets",false]],"get_solution_source() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_solution_source",false]],"get_solution_source() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.get_solution_source",false]],"get_solution_type() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_solution_type",false]],"get_sos_feasibilities() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_SOS_feasibilities",false]],"get_start_dettime() (callback method)":[[0,"cplex.callbacks.Callback.get_start_dettime",false]],"get_start_time() (callback method)":[[0,"cplex.callbacks.Callback.get_start_time",false]],"get_starts() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.get_starts",false]],"get_stats() (cplex method)":[[0,"cplex.Cplex.get_stats",false]],"get_status() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.get_status",false]],"get_status() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_status",false]],"get_status_string() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_status_string",false]],"get_subproblem_status() (mipsolutioninterface method)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface.get_subproblem_status",false]],"get_thread_num() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.get_thread_num",false]],"get_time() (callback method)":[[0,"cplex.callbacks.Callback.get_time",false]],"get_time() (cplex method)":[[0,"cplex.Cplex.get_time",false]],"get_time() (environment method)":[[1,"cplex._internal.Environment.get_time",false]],"get_types() (indicatorconstraintinterface method)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.get_types",false]],"get_types() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.get_types",false]],"get_types() (sosinterface method)":[[1,"cplex._internal._subinterfaces.SOSInterface.get_types",false]],"get_types() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_types",false]],"get_upper_bounds() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_upper_bounds",false]],"get_upper_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.get_upper_bounds",false]],"get_values() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.get_values",false]],"get_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.get_values",false]],"get_values() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.get_values",false]],"get_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.get_values",false]],"get_values() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.get_values",false]],"get_values() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.get_values",false]],"get_variables() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.get_variables",false]],"get_version() (cplex method)":[[0,"cplex.Cplex.get_version",false]],"get_version() (environment method)":[[1,"cplex._internal.Environment.get_version",false]],"get_versionnumber() (cplex method)":[[0,"cplex.Cplex.get_versionnumber",false]],"get_versionnumber() (environment method)":[[1,"cplex._internal.Environment.get_versionnumber",false]],"get_weight() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.get_weight",false]],"get_wherefrom() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.get_wherefrom",false]],"getax() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getax",false]],"getbaritcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbaritcnt",false]],"getbase() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbase",false]],"getbasednorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbasednorms",false]],"getbestobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbestobjval",false]],"getbhead() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getbhead",false]],"getcallbackincumbent() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackincumbent",false]],"getcallbacknodeinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeinfo",false]],"getcallbacknodeintfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeintfeas",false]],"getcallbacknodelb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodelb",false]],"getcallbacknodeobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeobjval",false]],"getcallbacknodeub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodeub",false]],"getcallbacknodex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacknodex",false]],"getcallbackpseudocosts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackpseudocosts",false]],"getcallbackseqinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbackseqinfo",false]],"getcallbacksosinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcallbacksosinfo",false]],"getchannels() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getchannels",false]],"getcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcoef",false]],"getcolindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolindex",false]],"getcolinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolinfeas",false]],"getcolname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcolname",false]],"getcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcols",false]],"getconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictext",false]],"getconflictgroups() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictgroups",false]],"getconflictnumgroups() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictnumgroups",false]],"getconflictnumpasses() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getconflictnumpasses",false]],"getcrossdexchcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossdexchcnt",false]],"getcrossdpushcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossdpushcnt",false]],"getcrosspexchcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrosspexchcnt",false]],"getcrossppushcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcrossppushcnt",false]],"getctype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getctype",false]],"getcutoff() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getcutoff",false]],"getdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblanno",false]],"getdblannodefval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannodefval",false]],"getdblannoindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannoindex",false]],"getdblannoname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblannoname",false]],"getdblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblparam",false]],"getdblquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdblquality",false]],"getdettime() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdettime",false]],"getdj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdj",false]],"getdnorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdnorms",false]],"getdsbcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getdsbcnt",false]],"geterrorstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.geterrorstring",false]],"getgrad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getgrad",false]],"gethist() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.gethist",false]],"getijdiv() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getijdiv",false]],"getijrow() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getijrow",false]],"getindconstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstr",false]],"getindconstr_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstr_constant",false]],"getindconstrindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrindex",false]],"getindconstrinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrinfeas",false]],"getindconstrname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrname",false]],"getindconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getindconstrslack",false]],"getintparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getintparam",false]],"getintquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getintquality",false]],"getitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getitcnt",false]],"getlb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlb",false]],"getlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlonganno",false]],"getlongannodefval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannodefval",false]],"getlongannoindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannoindex",false]],"getlongannoname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongannoname",false]],"getlongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getlongparam",false]],"getmethod() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmethod",false]],"getmipitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipitcnt",false]],"getmiprelgap() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmiprelgap",false]],"getmipstartindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstartindex",false]],"getmipstartname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstartname",false]],"getmipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts",false]],"getmipstarts_effort() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts_effort",false]],"getmipstarts_size() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getmipstarts_size",false]],"getnodecnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodecnt",false]],"getnodeint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodeint",false]],"getnodeleftcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnodeleftcnt",false]],"getnumbin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumbin",false]],"getnumcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcols",false]],"getnumcores() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcores",false]],"getnumcuts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumcuts",false]],"getnumdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumdblanno",false]],"getnumindconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumindconstrs",false]],"getnumint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumint",false]],"getnumlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumlonganno",false]],"getnummipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnummipstarts",false]],"getnumnz() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumnz",false]],"getnumobjs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumobjs",false]],"getnumprios() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumprios",false]],"getnumpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumpwl",false]],"getnumqconstrs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumqconstrs",false]],"getnumqpnz() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumqpnz",false]],"getnumquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumquad",false]],"getnumrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumrows",false]],"getnumsemicont() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsemicont",false]],"getnumsemiint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsemiint",false]],"getnumsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getnumsos",false]],"getobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobj",false]],"getobjname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjname",false]],"getobjoffset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjoffset",false]],"getobjsen() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjsen",false]],"getobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getobjval",false]],"getorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getorder",false]],"getparamtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getparamtype",false]],"getphase1cnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getphase1cnt",false]],"getpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpi",false]],"getpnorms() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpnorms",false]],"getprestat_c() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_c",false]],"getprestat_oc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_oc",false]],"getprestat_or() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_or",false]],"getprestat_r() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_r",false]],"getprestat_status() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprestat_status",false]],"getprobname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobname",false]],"getprobstats() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobstats",false]],"getprobtype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprobtype",false]],"getprotected() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getprotected",false]],"getpsbcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpsbcnt",false]],"getpwl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwl",false]],"getpwlindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwlindex",false]],"getpwlname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getpwlname",false]],"getqconstr_info() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_info",false]],"getqconstr_lin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_lin",false]],"getqconstr_quad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstr_quad",false]],"getqconstrdslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrdslack",false]],"getqconstrindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrindex",false]],"getqconstrinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrinfeas",false]],"getqconstrname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrname",false]],"getqconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqconstrslack",false]],"getqpcoef() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqpcoef",false]],"getquad() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getquad",false]],"getqualitymetrics() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getqualitymetrics",false]],"getray() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getray",false]],"getrhs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrhs",false]],"getrngval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrngval",false]],"getrowindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowindex",false]],"getrowinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowinfeas",false]],"getrowname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrowname",false]],"getrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getrows",false]],"getsense() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsense",false]],"getsiftitcnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsiftitcnt",false]],"getsiftphase1cnt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsiftphase1cnt",false]],"getslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getslack",false]],"getsolnpooldblquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldblquality",false]],"getsolnpooldivfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldivfilter",false]],"getsolnpooldivfilter_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpooldivfilter_constant",false]],"getsolnpoolfilterindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfilterindex",false]],"getsolnpoolfiltername() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfiltername",false]],"getsolnpoolfiltertype() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolfiltertype",false]],"getsolnpoolintquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolintquality",false]],"getsolnpoolmeanobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolmeanobjval",false]],"getsolnpoolnumfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumfilters",false]],"getsolnpoolnumreplaced() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumreplaced",false]],"getsolnpoolnumsolns() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolnumsolns",false]],"getsolnpoolobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolobjval",false]],"getsolnpoolqconstrslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolqconstrslack",false]],"getsolnpoolrngfilter() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolrngfilter",false]],"getsolnpoolrngfilter_constant() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolrngfilter_constant",false]],"getsolnpoolslack() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolslack",false]],"getsolnpoolsolnindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolsolnindex",false]],"getsolnpoolsolnname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolsolnname",false]],"getsolnpoolx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsolnpoolx",false]],"getsos() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsos",false]],"getsos_info() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsos_info",false]],"getsosindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosindex",false]],"getsosinfeas() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosinfeas",false]],"getsosname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsosname",false]],"getstat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstat",false]],"getstatstring() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstatstring",false]],"getstrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getstrparam",false]],"getsubstat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getsubstat",false]],"gettime() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.gettime",false]],"getub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getub",false]],"getx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getx",false]],"getxqxax() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.getxqxax",false]],"global_progress (contexttype attribute)":[[0,"cplex.callbacks.ContextType.global_progress",false]],"group_status (conflictinterface attribute)":[[1,"cplex._internal._subinterfaces.ConflictInterface.group_status",false]],"gub_cover (cuttype attribute)":[[0,"cplex.callbacks.CutType.GUB_cover",false],[1,"cplex._internal._subinterfaces.CutType.GUB_cover",false]],"guided (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.guided",false]],"has_incumbent() (mipinfocallback method)":[[0,"cplex.callbacks.MIPInfoCallback.has_incumbent",false]],"has_name() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_name",false]],"has_non_default_lb() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_non_default_lb",false]],"has_non_default_ub() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.has_non_default_ub",false]],"has_problem (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.has_problem",false]],"help() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.help",false]],"heuristic (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.heuristic",false]],"heuristic_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.heuristic_solution",false]],"heuristiccallback (class in cplex.callbacks)":[[0,"cplex.callbacks.HeuristicCallback",false]],"hidden_feasibility (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.hidden_feasibility",false]],"histogram (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.Histogram",false]],"hscallback (class in cplex.callbacks)":[[0,"cplex.callbacks.HSCallback",false]],"hybbaropt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.hybbaropt",false]],"hybnetopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.hybnetopt",false]],"id (context attribute)":[[0,"cplex.callbacks.Context.id",false]],"identity() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.identity",false]],"if_ (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.if_",false]],"if_possible (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.if_possible",false]],"iff (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.iff",false]],"iis (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.iis",false]],"implied_bound (cuttype attribute)":[[0,"cplex.callbacks.CutType.implied_bound",false],[1,"cplex._internal._subinterfaces.CutType.implied_bound",false]],"implied_feasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.implied_feasible",false]],"in_branching() (context method)":[[0,"cplex.callbacks.Context.in_branching",false]],"in_candidate() (context method)":[[0,"cplex.callbacks.Context.in_candidate",false]],"in_global_progress() (context method)":[[0,"cplex.callbacks.Context.in_global_progress",false]],"in_local_progress() (context method)":[[0,"cplex.callbacks.Context.in_local_progress",false]],"in_relaxation() (context method)":[[0,"cplex.callbacks.Context.in_relaxation",false]],"in_thread_down() (context method)":[[0,"cplex.callbacks.Context.in_thread_down",false]],"in_thread_up() (context method)":[[0,"cplex.callbacks.Context.in_thread_up",false]],"incumbent (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.incumbent",false]],"incumbentcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.IncumbentCallback",false]],"indicator (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.indicator",false]],"indicator (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.indicator",false]],"indicator_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.indicator_constraint",false]],"indicator_constraints (cplex attribute)":[[0,"cplex.Cplex.indicator_constraints",false]],"indicator_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.indicator_constraints",false]],"indicator_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.indicator_constraints",false]],"indicator_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.indicator_constraints",false]],"indicatorconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface",false]],"indicatortype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.IndicatorType",false]],"infeas_constant (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.infeas_constant",false]],"infeas_estimate (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.infeas_estimate",false]],"infeasibility (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.infeasibility",false]],"infeasibilityinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface",false]],"infeasible (feasibilitystatus attribute)":[[0,"cplex.callbacks.FeasibilityStatus.infeasible",false]],"infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.infeasible",false]],"infeasible_or_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.infeasible_or_unbounded",false]],"infinity (in module cplex)":[[0,"cplex.infinity",false]],"info (context attribute)":[[0,"cplex.callbacks.Context.info",false]],"infodblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infodblparam",false]],"infointparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infointparam",false]],"infolongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infolongparam",false]],"infostrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.infostrparam",false]],"init_list_args() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.init_list_args",false]],"initialinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.InitialInterface",false]],"initlock() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.initlock",false]],"int_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.int_info",false]],"integer (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.integer",false]],"integer_feasible (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.integer_feasible",false]],"integral (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.integral",false]],"interfere_crush (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.interfere_crush",false]],"interfere_uncrush (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.interfere_uncrush",false]],"is_aborted() (aborter method)":[[0,"cplex.Aborter.is_aborted",false],[0,"cplex.aborter.Aborter.is_aborted",false]],"is_after_cut_loop() (usercutcallback method)":[[0,"cplex.callbacks.UserCutCallback.is_after_cut_loop",false]],"is_candidate_point() (context method)":[[0,"cplex.callbacks.Context.is_candidate_point",false]],"is_candidate_ray() (context method)":[[0,"cplex.callbacks.Context.is_candidate_ray",false]],"is_dual_feasible() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.is_dual_feasible",false]],"is_dual_feasible() (hscallback method)":[[0,"cplex.callbacks.HSCallback.is_dual_feasible",false]],"is_dual_feasible() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.is_dual_feasible",false]],"is_integer_feasible() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.is_integer_feasible",false]],"is_primal_feasible() (continuouscallback method)":[[0,"cplex.callbacks.ContinuousCallback.is_primal_feasible",false]],"is_primal_feasible() (hscallback method)":[[0,"cplex.callbacks.HSCallback.is_primal_feasible",false]],"is_primal_feasible() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.is_primal_feasible",false]],"is_unbounded_node() (lazyconstraintcallback method)":[[0,"cplex.callbacks.LazyConstraintCallback.is_unbounded_node",false]],"ismultiobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ismultiobj",false]],"isvalid() (sparsepair method)":[[0,"cplex.SparsePair.isvalid",false]],"isvalid() (sparsetriple method)":[[0,"cplex.SparseTriple.isvalid",false]],"kappa (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.kappa",false]],"kappa_attention (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_attention",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_attention",false]],"kappa_illposed (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_illposed",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_illposed",false]],"kappa_max (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_max",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_max",false]],"kappa_stable (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_stable",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_stable",false]],"kappa_suspicious (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_suspicious",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_suspicious",false]],"kappa_unstable (qualitymetric attribute)":[[0,"cplex.callbacks.QualityMetric.kappa_unstable",false],[1,"cplex._internal._subinterfaces.QualityMetric.kappa_unstable",false]],"kappastats_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.kappastats_constants",false]],"lazyconstraintcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.LazyConstraintCallback",false]],"lift_and_project (cuttype attribute)":[[0,"cplex.callbacks.CutType.lift_and_project",false],[1,"cplex._internal._subinterfaces.CutType.lift_and_project",false]],"limitedsolve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.limitedsolve",false]],"linear (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.linear",false]],"linear (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.linear",false]],"linear_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.linear_constants",false]],"linear_constraints (cplex attribute)":[[0,"cplex.Cplex.linear_constraints",false]],"linear_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.linear_constraints",false]],"linear_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.linear_constraints",false]],"linear_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.linear_constraints",false]],"linearconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface",false]],"listify() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.listify",false]],"local_implied_bound (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.local_implied_bound",false]],"local_progress (contexttype attribute)":[[0,"cplex.callbacks.ContextType.local_progress",false]],"log_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.LOG_CHNL_IDX",false]],"logarithmic (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.logarithmic",false]],"logarithmic (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.logarithmic",false]],"long_annotations (cplex attribute)":[[0,"cplex.Cplex.long_annotations",false]],"long_info (multiobjsolninterface attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface.long_info",false]],"longannotationinterface (class in cplex._internal._anno)":[[1,"cplex._internal._anno.LongAnnotationInterface",false]],"lower_bound (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.lower_bound",false]],"lower_bound (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.lower_bound",false]],"lower_bound (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.lower_bound",false]],"lower_bound_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.lower_bound_constraints",false]],"lower_bound_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.lower_bound_constraints",false]],"lower_bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.lower_bounds",false]],"lp (problemtype attribute)":[[1,"cplex._internal.ProblemType.LP",false]],"lp_all (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.LP_all",false]],"lp_at_node (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.LP_at_node",false]],"lp_root (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.LP_root",false]],"lpopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.lpopt",false]],"make_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.make_branch",false]],"make_branch() (context method)":[[0,"cplex.callbacks.Context.make_branch",false]],"make_cplex_branch() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.make_cplex_branch",false]],"make_group() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.make_group",false]],"make_ranges() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.make_ranges",false]],"max() (numparameter method)":[[1,"cplex._internal._parameter_classes.NumParameter.max",false]],"max_arg_length() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.max_arg_length",false]],"max_comp_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_comp_slack",false]],"max_dual_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_dual_infeasibility",false]],"max_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_dual_residual",false]],"max_indicator_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_indicator_slack_infeasibility",false]],"max_infeasibility (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.max_infeasibility",false]],"max_int_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_int_infeasibility",false]],"max_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_pi",false]],"max_primal_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_primal_infeasibility",false]],"max_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_primal_residual",false]],"max_pwl_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_pwl_slack_infeasibility",false]],"max_quadratic_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_primal_residual",false]],"max_quadratic_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_slack",false]],"max_quadratic_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_quadratic_slack_infeasibility",false]],"max_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_reduced_cost",false]],"max_scaled_dual_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_dual_infeasibility",false]],"max_scaled_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_dual_residual",false]],"max_scaled_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_pi",false]],"max_scaled_primal_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_primal_infeasibility",false]],"max_scaled_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_primal_residual",false]],"max_scaled_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_reduced_cost",false]],"max_scaled_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_slack",false]],"max_scaled_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_scaled_x",false]],"max_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_slack",false]],"max_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.max_x",false]],"maximize (objsense attribute)":[[1,"cplex._internal._subinterfaces.ObjSense.maximize",false]],"mbasewrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mbasewrite",false]],"mdleave() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mdleave",false]],"measure_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.measure_constants",false]],"mem_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.mem_limit_feasible",false]],"mem_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.mem_limit_infeasible",false]],"member (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.member",false]],"memory (file_constants attribute)":[[1,"cplex._internal._parameter_classes.file_constants.memory",false]],"method (hscallback attribute)":[[0,"cplex.callbacks.HSCallback.method",false]],"method (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.method",false]],"method (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.method",false]],"method (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.method",false]],"methodtype (class in cplex.callbacks)":[[0,"cplex.callbacks.MethodType",false]],"mild (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.mild",false]],"milp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MILP",false]],"min() (numparameter method)":[[1,"cplex._internal._parameter_classes.NumParameter.min",false]],"min_inf (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_inf",false]],"min_infeasibility (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.min_infeasibility",false]],"min_quad (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_quad",false]],"min_sum (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.min_sum",false]],"minimal (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.minimal",false]],"minimize (objsense attribute)":[[1,"cplex._internal._subinterfaces.ObjSense.minimize",false]],"minmax (measure_constants attribute)":[[1,"cplex._internal._parameter_classes.measure_constants.minmax",false]],"mip (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.MIP",false]],"mip (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.MIP",false]],"mip_abort_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_abort_feasible",false]],"mip_abort_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_abort_infeasible",false]],"mip_dettime_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_dettime_limit_feasible",false]],"mip_dettime_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_dettime_limit_infeasible",false]],"mip_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.mip_display_constants",false]],"mip_emph_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.mip_emph_constants",false]],"mip_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible",false]],"mip_feasible_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_inf",false]],"mip_feasible_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_quad",false]],"mip_feasible_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_feasible_relaxed_sum",false]],"mip_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_infeasible",false]],"mip_infeasible_or_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_infeasible_or_unbounded",false]],"mip_interval_nodes (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.mip_interval_nodes",false]],"mip_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal",false]],"mip_optimal_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_infeasible",false]],"mip_optimal_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_inf",false]],"mip_optimal_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_quad",false]],"mip_optimal_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_optimal_relaxed_sum",false]],"mip_starts (cplex attribute)":[[0,"cplex.Cplex.MIP_starts",false]],"mip_time_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_time_limit_feasible",false]],"mip_time_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_time_limit_infeasible",false]],"mip_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.MIP_unbounded",false]],"mipcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.MIPCallback",false]],"mipinfocallback (class in cplex.callbacks)":[[0,"cplex.callbacks.MIPInfoCallback",false]],"mipopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.mipopt",false]],"mipsolutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.MIPSolutionInterface",false]],"mipstart_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.mipstart_solution",false]],"mipstartsinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface",false]],"miqcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MIQCP",false]],"miqcp_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.miqcp_constants",false]],"miqp (problemtype attribute)":[[1,"cplex._internal.ProblemType.MIQP",false]],"mir (cuttype attribute)":[[0,"cplex.callbacks.CutType.MIR",false],[1,"cplex._internal._subinterfaces.CutType.MIR",false]],"modelasstcallbacksetfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.modelasstcallbacksetfunc",false]],"moderate (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.moderate",false]],"moderate (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.moderate",false]],"moderate (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.moderate",false]],"module":[[0,"module-cplex",false],[0,"module-cplex.aborter",false],[0,"module-cplex.callbacks",false],[0,"module-cplex.constant_class",false],[0,"module-cplex.exceptions",false],[0,"module-cplex.model_info",false],[0,"module-cplex.paramset",false],[1,"module-cplex._internal",false],[1,"module-cplex._internal._anno",false],[1,"module-cplex._internal._aux_functions",false],[1,"module-cplex._internal._baseinterface",false],[1,"module-cplex._internal._constants",false],[1,"module-cplex._internal._constantsenum",false],[1,"module-cplex._internal._matrices",false],[1,"module-cplex._internal._multiobj",false],[1,"module-cplex._internal._multiobjsoln",false],[1,"module-cplex._internal._parameter_classes",false],[1,"module-cplex._internal._procedural",false],[1,"module-cplex._internal._pwl",false],[1,"module-cplex._internal._solutionstrategyenum",false],[1,"module-cplex._internal._subinterfaces",false]],"more_aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.more_aggressive",false]],"multi_commodity_flow (cuttype attribute)":[[0,"cplex.callbacks.CutType.multi_commodity_flow",false],[1,"cplex._internal._subinterfaces.CutType.multi_commodity_flow",false]],"multiobj (cplex attribute)":[[0,"cplex.Cplex.multiobj",false]],"multiobj (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.multiobj",false]],"multiobj_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_infeasible",false]],"multiobj_inforunbd (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_inforunbd",false]],"multiobj_non_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_non_optimal",false]],"multiobj_optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_optimal",false]],"multiobj_stopped (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_stopped",false]],"multiobj_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.multiobj_unbounded",false]],"multiobjchgattribs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjchgattribs",false]],"multiobjfloatinfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo",false]],"multiobjgetdblinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetdblinfo",false]],"multiobjgetindex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetindex",false]],"multiobjgetintinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetintinfo",false]],"multiobjgetlonginfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetlonginfo",false]],"multiobjgetname() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetname",false]],"multiobjgetnumsolves() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetnumsolves",false]],"multiobjgetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobj",false]],"multiobjgetobjval() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobjval",false]],"multiobjgetobjvalbypriority() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjgetobjvalbypriority",false]],"multiobjinterface (class in cplex._internal._multiobj)":[[1,"cplex._internal._multiobj.MultiObjInterface",false]],"multiobjintinfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo",false]],"multiobjlonginfo (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo",false]],"multiobjopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjopt",false]],"multiobjsetobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.multiobjsetobj",false]],"multiobjsolninterface (class in cplex._internal._multiobjsoln)":[[1,"cplex._internal._multiobjsoln.MultiObjSolnInterface",false]],"multiple_partial (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.multiple_partial",false]],"multiple_partial_with_sorting (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.multiple_partial_with_sorting",false]],"nested_dissection (bar_order_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_order_constants.nested_dissection",false]],"network (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.network",false]],"network (methodtype attribute)":[[0,"cplex.callbacks.MethodType.network",false]],"network (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.network",false]],"network (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.network",false]],"network (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.network",false]],"network_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_display_constants",false]],"network_netfind_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_netfind_constants",false]],"network_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.network_pricing_constants",false]],"new_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.new_native_int",false]],"new_root_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.new_root_cuts",false]],"newcols() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newcols",false]],"newdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newdblanno",false]],"newlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newlonganno",false]],"newrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.newrows",false]],"no (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.no",false]],"no (qcpduals_constants attribute)":[[1,"cplex._internal._parameter_classes.qcpduals_constants.no",false]],"no_check (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.no_check",false]],"no_check (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.no_check",false]],"no_reductions (presolvestatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveStatus.no_reductions",false]],"no_solve (relaxationflags attribute)":[[0,"cplex.callbacks.RelaxationFlags.no_solve",false]],"no_variable (advancedcplexinterface attribute)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.no_variable",false]],"node_cuts (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.node_cuts",false]],"node_limit_feasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.node_limit_feasible",false]],"node_limit_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.node_limit_infeasible",false]],"node_lp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_LP",false]],"node_qcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_QCP",false]],"node_qp (problemtype attribute)":[[1,"cplex._internal.ProblemType.node_QP",false]],"node_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.node_solution",false]],"nodecallback (class in cplex.callbacks)":[[0,"cplex.callbacks.NodeCallback",false]],"nodesel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.nodesel_constants",false]],"non_basic (solutiontype_constants attribute)":[[1,"cplex._internal._parameter_classes.solutiontype_constants.non_basic",false]],"nonbasic (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.nonbasic",false]],"none (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.none",false]],"none (agg_constants attribute)":[[1,"cplex._internal._parameter_classes.agg_constants.none",false]],"none (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.none",false]],"none (coeffreduce_constants attribute)":[[1,"cplex._internal._parameter_classes.coeffreduce_constants.none",false]],"none (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.none",false]],"none (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.none",false]],"none (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.none",false]],"none (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.none",false]],"none (mip_display_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_display_constants.none",false]],"none (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.none",false]],"none (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.none",false]],"none (prereform_constants attribute)":[[1,"cplex._internal._parameter_classes.prereform_constants.none",false]],"none (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.none",false]],"none (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.none",false]],"none (scale_constants attribute)":[[1,"cplex._internal._parameter_classes.scale_constants.none",false]],"none (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.none",false]],"none (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.none",false]],"none (sos1reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos1reform_constants.none",false]],"none (sos2reform_constants attribute)":[[1,"cplex._internal._parameter_classes.sos2reform_constants.none",false]],"none (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.none",false]],"none (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.none",false]],"nonzero_discrete_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.nonzero_discrete_variables",false]],"nonzero_variables (writelevel_constants attribute)":[[1,"cplex._internal._parameter_classes.writelevel_constants.nonzero_variables",false]],"normal (display_constants attribute)":[[1,"cplex._internal._parameter_classes.display_constants.normal",false]],"num_barrier_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_barrier_iterations",false]],"num_best (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.num_best",false]],"num_degenerate_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_degenerate_iterations",false]],"num_dual_exchanges (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_dual_exchanges",false]],"num_dual_pushes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_dual_pushes",false]],"num_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_iterations",false]],"num_nodes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_nodes",false]],"num_nodes_left (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_nodes_left",false]],"num_phase1_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_phase1_iterations",false]],"num_primal_exchanges (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_primal_exchanges",false]],"num_primal_pushes (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_primal_pushes",false]],"num_sifting_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_sifting_iterations",false]],"num_sifting_phase1_iterations (multiobjlonginfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjLongInfo.num_sifting_phase1_iterations",false]],"numparameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.NumParameter",false]],"obj_and_feas (fpheur_constants attribute)":[[1,"cplex._internal._parameter_classes.fpheur_constants.obj_and_feas",false]],"object_type (annotationinterface attribute)":[[1,"cplex._internal._anno.AnnotationInterface.object_type",false]],"objective (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.objective",false]],"objective (cplex attribute)":[[0,"cplex.Cplex.objective",false]],"objective (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.objective",false]],"objective() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.objective",false]],"objective_gap (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.objective_gap",false]],"objectiveinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface",false]],"objsa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.objsa",false]],"objsense (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ObjSense",false]],"off (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.off",false]],"off (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.off",false]],"off (dependency_constants attribute)":[[1,"cplex._internal._parameter_classes.dependency_constants.off",false]],"off (off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.off_on_constants.off",false]],"off (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.off",false]],"off (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.off",false]],"off_on_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.off_on_constants",false]],"on (auto_off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.auto_off_on_constants.on",false]],"on (off_on_constants attribute)":[[1,"cplex._internal._parameter_classes.off_on_constants.on",false]],"only_linear (linear_constants attribute)":[[1,"cplex._internal._parameter_classes.linear_constants.only_linear",false]],"onlyif (indicatortype attribute)":[[1,"cplex._internal._subinterfaces.IndicatorType.onlyif",false]],"opencplex() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.openCPLEX",false]],"opportunistic (par_constants attribute)":[[1,"cplex._internal._parameter_classes.par_constants.opportunistic",false]],"opt_inf (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_inf",false]],"opt_quad (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_quad",false]],"opt_sum (feasopt_mode_constants attribute)":[[1,"cplex._internal._parameter_classes.feasopt_mode_constants.opt_sum",false]],"optimal (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal",false]],"optimal_convex (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.optimal_convex",false]],"optimal_face_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_face_unbounded",false]],"optimal_global (optimalitytarget_constants attribute)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants.optimal_global",false]],"optimal_infeasible (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_infeasible",false]],"optimal_populated (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_populated",false]],"optimal_populated_tolerance (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_populated_tolerance",false]],"optimal_relaxed_inf (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_inf",false]],"optimal_relaxed_quad (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_quad",false]],"optimal_relaxed_sum (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_relaxed_sum",false]],"optimal_tolerance (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.optimal_tolerance",false]],"optimality (mip_emph_constants attribute)":[[1,"cplex._internal._parameter_classes.mip_emph_constants.optimality",false]],"optimalitytarget_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.optimalitytarget_constants",false]],"optimizationcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.OptimizationCallback",false]],"order (cplex attribute)":[[0,"cplex.Cplex.order",false]],"orderinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.OrderInterface",false]],"ordertype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.ordertype_constants",false]],"ordwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.ordwrite",false]],"other (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.other",false]],"other (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.other",false]],"pack_env_lp_ptr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pack_env_lp_ptr",false]],"par_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.par_constants",false]],"parameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.Parameter",false]],"parametergroup (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.ParameterGroup",false]],"parameters (cplex attribute)":[[0,"cplex.Cplex.parameters",false]],"parameterset (class in cplex)":[[0,"cplex.ParameterSet",false]],"parameterset (class in cplex.paramset)":[[0,"cplex.paramset.ParameterSet",false]],"paramsetadd() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetadd",false]],"paramsetadddbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetadddbl",false]],"paramsetaddint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddint",false]],"paramsetaddlong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddlong",false]],"paramsetaddstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetaddstr",false]],"paramsetapply() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetapply",false]],"paramsetcopy() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetcopy",false]],"paramsetcreate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetcreate",false]],"paramsetdel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetdel",false]],"paramsetfree() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetfree",false]],"paramsetget() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetget",false]],"paramsetgetdbl() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetdbl",false]],"paramsetgetids() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetids",false]],"paramsetgetint() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetint",false]],"paramsetgetlong() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetlong",false]],"paramsetgetnum() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetnum",false]],"paramsetgetstr() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetgetstr",false]],"paramsetreadcopy() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetreadcopy",false]],"paramsetwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.paramsetwrite",false]],"partial (network_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.network_pricing_constants.partial",false]],"partial (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.partial",false]],"penalized_objective_values (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.penalized_objective_values",false]],"pfeas (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.pfeas",false]],"pivot (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot",false]],"pivot() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot",false]],"pivot() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivot",false]],"pivot_fixed_variables_out() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot_fixed_variables_out",false]],"pivot_in (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot_in",false]],"pivot_out (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.pivot_out",false]],"pivot_slacks_in() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.pivot_slacks_in",false]],"pivotin() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivotin",false]],"pivotout() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pivotout",false]],"pivotvarstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PivotVarStatus",false]],"pool (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.pool",false]],"populate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.populate",false]],"populate_solution_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.populate_solution_limit",false]],"populate_solution_pool() (cplex method)":[[0,"cplex.Cplex.populate_solution_pool",false]],"possible_member (conflictstatus attribute)":[[1,"cplex._internal._subinterfaces.ConflictStatus.possible_member",false]],"post_heuristic_solution() (context method)":[[0,"cplex.callbacks.Context.post_heuristic_solution",false]],"pperwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.pperwrite",false]],"preaddrows() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.preaddrows",false]],"prechgobj() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.prechgobj",false]],"prered_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.prered_constants",false]],"prereform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.prereform_constants",false]],"preslvwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.preslvwrite",false]],"presolve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.presolve",false]],"presolve (cplex attribute)":[[0,"cplex.Cplex.presolve",false]],"presolve() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.presolve",false]],"presolve() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.presolve",false]],"presolve_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.presolve_constants",false]],"presolvecolstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveColStatus",false]],"presolveinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveInterface",false]],"presolvemethod (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveMethod",false]],"presolverowstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus",false]],"presolvestatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.PresolveStatus",false]],"primal (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.primal",false]],"primal (crossover_constants attribute)":[[1,"cplex._internal._parameter_classes.crossover_constants.primal",false]],"primal (methodtype attribute)":[[0,"cplex.callbacks.MethodType.primal",false]],"primal (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.primal",false]],"primal (presolvemethod attribute)":[[1,"cplex._internal._subinterfaces.PresolveMethod.primal",false]],"primal (qp_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.qp_alg_constants.primal",false]],"primal (sift_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.sift_alg_constants.primal",false]],"primal (solutionmethod attribute)":[[1,"cplex._internal._subinterfaces.SolutionMethod.primal",false]],"primal (solutiontype attribute)":[[1,"cplex._internal._subinterfaces.SolutionType.primal",false]],"primal (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.primal",false]],"primal_and_dual (prered_constants attribute)":[[1,"cplex._internal._parameter_classes.prered_constants.primal_and_dual",false]],"primal_objective (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.primal_objective",false]],"primal_pricing_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants",false]],"primopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.primopt",false]],"priority (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.priority",false]],"probe (presolve_constants attribute)":[[1,"cplex._internal._parameter_classes.presolve_constants.probe",false]],"probing (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.probing",false]],"problem_type (cplex attribute)":[[0,"cplex.Cplex.problem_type",false]],"problemtype (class in cplex._internal)":[[1,"cplex._internal.ProblemType",false]],"progress (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.progress",false]],"progressinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.ProgressInterface",false]],"propagate (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.propagate",false]],"propagate (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.propagate",false]],"protect() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.protect",false]],"prune() (branchcallback method)":[[0,"cplex.callbacks.BranchCallback.prune",false]],"prune_current_node() (context method)":[[0,"cplex.callbacks.Context.prune_current_node",false]],"pseudo_costs (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.pseudo_costs",false]],"pseudo_reduced_costs (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.pseudo_reduced_costs",false]],"pure (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.pure",false]],"purge (useconstraint attribute)":[[0,"cplex.callbacks.UseConstraint.purge",false]],"purge (usecut attribute)":[[0,"cplex.callbacks.UseCut.purge",false]],"pwl (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.pwl",false]],"pwl_constraints (cplex attribute)":[[0,"cplex.Cplex.pwl_constraints",false]],"pwl_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.pwl_constraints",false]],"pwlconstraintinterface (class in cplex._internal._pwl)":[[1,"cplex._internal._pwl.PWLConstraintInterface",false]],"pylolmat_to_chbmat() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.Pylolmat_to_CHBmat",false]],"qconstrslackfromx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qconstrslackfromx",false]],"qcp (problemtype attribute)":[[1,"cplex._internal.ProblemType.QCP",false]],"qcp_at_node (miqcp_constants attribute)":[[1,"cplex._internal._parameter_classes.miqcp_constants.QCP_at_node",false]],"qcpduals_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.qcpduals_constants",false]],"qp (problemtype attribute)":[[1,"cplex._internal.ProblemType.QP",false]],"qp_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.qp_alg_constants",false]],"qpdjfrompi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpdjfrompi",false]],"qpindefcertificate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpindefcertificate",false]],"qpopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.qpopt",false]],"quadratic (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.quadratic",false]],"quadratic (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.quadratic",false]],"quadratic_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.quadratic_constraint",false]],"quadratic_constraints (cplex attribute)":[[0,"cplex.Cplex.quadratic_constraints",false]],"quadratic_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.quadratic_constraints",false]],"quadratic_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.quadratic_constraints",false]],"quadratic_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.quadratic_constraints",false]],"quadraticconstraintinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QuadraticConstraintInterface",false]],"quality_metric (mipinfocallback attribute)":[[0,"cplex.callbacks.MIPInfoCallback.quality_metric",false]],"quality_metric (solnpoolinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.quality_metric",false]],"quality_metric (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.quality_metric",false]],"qualitymetric (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QualityMetric",false]],"qualitymetric (class in cplex.callbacks)":[[0,"cplex.callbacks.QualityMetric",false]],"qualitymetrics (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.QualityMetrics",false]],"range (filtertype attribute)":[[1,"cplex._internal._subinterfaces.FilterType.range",false]],"read() (cplex method)":[[0,"cplex.Cplex.read",false]],"read() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.read",false]],"read() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.read",false]],"read() (parameterset method)":[[0,"cplex.ParameterSet.read",false],[0,"cplex.paramset.ParameterSet.read",false]],"read() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.read",false]],"read_annotations() (cplex method)":[[0,"cplex.Cplex.read_annotations",false]],"read_basis() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.read_basis",false]],"read_file() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.read_file",false]],"read_start() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.read_start",false]],"readcopyanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyanno",false]],"readcopybase() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopybase",false]],"readcopymipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopymipstarts",false]],"readcopyorder() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyorder",false]],"readcopyparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyparam",false]],"readcopyprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopyprob",false]],"readcopysolnpoolfilters() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopysolnpoolfilters",false]],"readcopystartinfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.readcopystartinfo",false]],"reduced (presolverowstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveRowStatus.reduced",false]],"refine() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.refine",false]],"refine_mip_start() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.refine_MIP_start",false]],"refineconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.refineconflictext",false]],"refinemipstartconflictext() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.refinemipstartconflictext",false]],"reflection_scaling (network_netfind_constants attribute)":[[1,"cplex._internal._parameter_classes.network_netfind_constants.reflection_scaling",false]],"register_callback() (cplex method)":[[0,"cplex.Cplex.register_callback",false]],"register_callback() (environment method)":[[1,"cplex._internal.Environment.register_callback",false]],"reject() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.reject",false]],"reject_candidate() (context method)":[[0,"cplex.callbacks.Context.reject_candidate",false]],"reject_candidate_local() (context method)":[[0,"cplex.callbacks.Context.reject_candidate_local",false]],"relaxation (contexttype attribute)":[[0,"cplex.callbacks.ContextType.relaxation",false]],"relaxation_flags (context attribute)":[[0,"cplex.callbacks.Context.relaxation_flags",false]],"relaxation_unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.relaxation_unbounded",false]],"relaxationflags (class in cplex.callbacks)":[[0,"cplex.callbacks.RelaxationFlags",false]],"remove_aborter() (cplex method)":[[0,"cplex.Cplex.remove_aborter",false]],"repair (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.repair",false]],"repeatpre_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.repeatpre_constants",false]],"replace_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.replace_constants",false]],"reset() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.reset",false]],"reset() (parametergroup method)":[[1,"cplex._internal._parameter_classes.ParameterGroup.reset",false]],"reset() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.reset",false]],"results_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.RESULTS_CHNL_IDX",false]],"rhs() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.rhs",false]],"rhssa() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.rhssa",false]],"rlt (cuttype attribute)":[[1,"cplex._internal._subinterfaces.CutType.RLT",false]],"rootparametergroup (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.RootParameterGroup",false]],"row (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.row",false]],"row_status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.row_status",false]],"runseeds() (cplex method)":[[0,"cplex.Cplex.runseeds",false]],"runseeds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.runseeds",false]],"sample (kappastats_constants attribute)":[[1,"cplex._internal._parameter_classes.kappastats_constants.sample",false]],"scale_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.scale_constants",false]],"scaled_cost (ordertype_constants attribute)":[[1,"cplex._internal._parameter_classes.ordertype_constants.scaled_cost",false]],"search_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.search_constants",false]],"select_node() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.select_node",false]],"semi_continuous (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.semi_continuous",false]],"semi_integer (vartypes attribute)":[[1,"cplex._internal._subinterfaces.VarTypes.semi_integer",false]],"sense (multiobjinterface attribute)":[[1,"cplex._internal._multiobj.MultiObjInterface.sense",false]],"sense (objectiveinterface attribute)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.sense",false]],"sensitivity (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.sensitivity",false]],"sensitivityinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SensitivityInterface",false]],"set() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.set",false]],"set() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.set",false]],"set_abstol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_abstol",false]],"set_bounds() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.set_bounds",false]],"set_callback() (cplex method)":[[0,"cplex.Cplex.set_callback",false]],"set_coefficients() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_coefficients",false]],"set_definition() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_definition",false]],"set_error_stream() (cplex method)":[[0,"cplex.Cplex.set_error_stream",false]],"set_error_stream() (environment method)":[[1,"cplex._internal.Environment.set_error_stream",false]],"set_linear() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_linear",false]],"set_linear() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_linear",false]],"set_linear_components() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_linear_components",false]],"set_log_stream() (cplex method)":[[0,"cplex.Cplex.set_log_stream",false]],"set_log_stream() (environment method)":[[1,"cplex._internal.Environment.set_log_stream",false]],"set_lower_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_lower_bounds",false]],"set_modeling_assistance_callback() (cplex method)":[[0,"cplex.Cplex.set_modeling_assistance_callback",false]],"set_name() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_name",false]],"set_name() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_name",false]],"set_names() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_names",false]],"set_names() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_names",false]],"set_native_int() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.set_native_int",false]],"set_node_data() (controlcallback method)":[[0,"cplex.callbacks.ControlCallback.set_node_data",false]],"set_node_data() (incumbentcallback method)":[[0,"cplex.callbacks.IncumbentCallback.set_node_data",false]],"set_node_data() (nodecallback method)":[[0,"cplex.callbacks.NodeCallback.set_node_data",false]],"set_num() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_num",false]],"set_objective() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.set_objective",false]],"set_offset() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_offset",false]],"set_offset() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_offset",false]],"set_parameter_set() (cplex method)":[[0,"cplex.Cplex.set_parameter_set",false]],"set_priority() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_priority",false]],"set_problem_name() (cplex method)":[[0,"cplex.Cplex.set_problem_name",false]],"set_problem_type() (cplex method)":[[0,"cplex.Cplex.set_problem_type",false]],"set_quadratic() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_quadratic",false]],"set_quadratic_coefficients() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_quadratic_coefficients",false]],"set_range_values() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_range_values",false]],"set_reltol() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_reltol",false]],"set_results_stream() (cplex method)":[[0,"cplex.Cplex.set_results_stream",false]],"set_results_stream() (environment method)":[[1,"cplex._internal.Environment.set_results_stream",false]],"set_rhs() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_rhs",false]],"set_sense() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_sense",false]],"set_sense() (objectiveinterface method)":[[1,"cplex._internal._subinterfaces.ObjectiveInterface.set_sense",false]],"set_senses() (linearconstraintinterface method)":[[1,"cplex._internal._subinterfaces.LinearConstraintInterface.set_senses",false]],"set_solution() (heuristiccallback method)":[[0,"cplex.callbacks.HeuristicCallback.set_solution",false]],"set_start() (initialinterface method)":[[1,"cplex._internal._subinterfaces.InitialInterface.set_start",false]],"set_start() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.set_start",false]],"set_status_checker() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.set_status_checker",false]],"set_types() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_types",false]],"set_upper_bounds() (variablesinterface method)":[[1,"cplex._internal._subinterfaces.VariablesInterface.set_upper_bounds",false]],"set_values() (doubleannotationinterface method)":[[1,"cplex._internal._anno.DoubleAnnotationInterface.set_values",false]],"set_values() (longannotationinterface method)":[[1,"cplex._internal._anno.LongAnnotationInterface.set_values",false]],"set_warning_stream() (cplex method)":[[0,"cplex.Cplex.set_warning_stream",false]],"set_warning_stream() (environment method)":[[1,"cplex._internal.Environment.set_warning_stream",false]],"set_weight() (multiobjinterface method)":[[1,"cplex._internal._multiobj.MultiObjInterface.set_weight",false]],"setbranchcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setbranchcallbackfunc",false]],"setbranchnosolncallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setbranchnosolncallbackfunc",false]],"setdblanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdblanno",false]],"setdblparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdblparam",false]],"setdefaults() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setdefaults",false]],"setgenericcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setgenericcallbackfunc",false]],"setheuristiccallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setheuristiccallbackfunc",false]],"setincumbentcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setincumbentcallbackfunc",false]],"setinfocallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setinfocallbackfunc",false]],"setintparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setintparam",false]],"setlazyconstraintcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlazyconstraintcallbackfunc",false]],"setlonganno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlonganno",false]],"setlongparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlongparam",false]],"setlpcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setlpcallbackfunc",false]],"setmipcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setmipcallbackfunc",false]],"setnetcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnetcallbackfunc",false]],"setnodecallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnodecallbackfunc",false]],"setnumobjs() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setnumobjs",false]],"setpydel() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setpydel",false]],"setsolvecallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setsolvecallbackfunc",false]],"setstrparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setstrparam",false]],"setterminate() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setterminate",false]],"settings (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.settings",false]],"settings_and_logs (tune_display_constants attribute)":[[1,"cplex._internal._parameter_classes.tune_display_constants.settings_and_logs",false]],"settuningcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.settuningcallbackfunc",false]],"setusercutcallbackfunc() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.setusercutcallbackfunc",false]],"showquality() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.showquality",false]],"sift_alg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sift_alg_constants",false]],"sifting (alg_constants attribute)":[[1,"cplex._internal._parameter_classes.alg_constants.sifting",false]],"sifting (subalg_constants attribute)":[[1,"cplex._internal._parameter_classes.subalg_constants.sifting",false]],"siftopt() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.siftopt",false]],"siginthandler (class in cplex._internal._procedural)":[[1,"cplex._internal._procedural.SigIntHandler",false]],"simplexcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.SimplexCallback",false]],"slackfromx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.slackfromx",false]],"solninfo() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solninfo",false]],"solnpoolfilterinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface",false]],"solnpoolinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface",false]],"solution (cplex attribute)":[[0,"cplex.Cplex.solution",false]],"solution_limit (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.solution_limit",false]],"solution_pool (cuttype attribute)":[[0,"cplex.callbacks.CutType.solution_pool",false],[1,"cplex._internal._subinterfaces.CutType.solution_pool",false]],"solution_source (incumbentcallback attribute)":[[0,"cplex.callbacks.IncumbentCallback.solution_source",false]],"solution_status (context attribute)":[[0,"cplex.callbacks.Context.solution_status",false]],"solution_strategy (context attribute)":[[0,"cplex.callbacks.Context.solution_strategy",false]],"solutioninterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionInterface",false]],"solutionmethod (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionMethod",false]],"solutionsource (class in cplex.callbacks)":[[0,"cplex.callbacks.SolutionSource",false]],"solutionstatus (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionStatus",false]],"solutionstrategy (class in cplex._internal._solutionstrategyenum)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy",false]],"solutiontype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SolutionType",false]],"solutiontype_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.solutiontype_constants",false]],"solve (conflict_algorithm_constants attribute)":[[1,"cplex._internal._parameter_classes.conflict_algorithm_constants.solve",false]],"solve (solutionstrategy attribute)":[[1,"cplex._internal._solutionstrategyenum.SolutionStrategy.solve",false]],"solve() (cplex method)":[[0,"cplex.Cplex.solve",false]],"solve() (hscallback method)":[[0,"cplex.callbacks.HSCallback.solve",false]],"solve_fixed (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.solve_fixed",false]],"solve_mip (effortlevel attribute)":[[1,"cplex._internal._subinterfaces.EffortLevel.solve_MIP",false]],"solvecallback (class in cplex.callbacks)":[[0,"cplex.callbacks.SolveCallback",false]],"solwrite() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwrite",false]],"solwritesolnpool() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwritesolnpool",false]],"solwritesolnpoolall() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.solwritesolnpoolall",false]],"sos (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.SOS",false]],"sos (cplex attribute)":[[0,"cplex.Cplex.SOS",false]],"sos1 (branchtype attribute)":[[0,"cplex.callbacks.BranchType.SOS1",false]],"sos1 (sostype attribute)":[[1,"cplex._internal._subinterfaces.SOSType.SOS1",false]],"sos1reform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sos1reform_constants",false]],"sos2 (branchtype attribute)":[[0,"cplex.callbacks.BranchType.SOS2",false]],"sos2 (sostype attribute)":[[1,"cplex._internal._subinterfaces.SOSType.SOS2",false]],"sos2reform_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sos2reform_constants",false]],"sos_constraint (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.sos_constraint",false]],"sos_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.SOS_constraints",false]],"sos_constraints() (infeasibilityinterface method)":[[1,"cplex._internal._subinterfaces.InfeasibilityInterface.SOS_constraints",false]],"sosinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SOSInterface",false]],"sostype (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.SOSType",false]],"sparsepair (class in cplex)":[[0,"cplex.SparsePair",false]],"sparsetriple (class in cplex)":[[0,"cplex.SparseTriple",false]],"standard (advance_constants attribute)":[[1,"cplex._internal._parameter_classes.advance_constants.standard",false]],"standard (bar_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_alg_constants.standard",false]],"start (cplex attribute)":[[0,"cplex.Cplex.start",false]],"stats (class in cplex)":[[0,"cplex.Stats",false]],"status (basisinterface attribute)":[[1,"cplex._internal._subinterfaces.BasisInterface.status",false]],"status (hscallback attribute)":[[0,"cplex.callbacks.HSCallback.status",false]],"status (initialinterface attribute)":[[1,"cplex._internal._subinterfaces.InitialInterface.status",false]],"status (multiobjintinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjIntInfo.status",false]],"status (presolveinterface attribute)":[[1,"cplex._internal._subinterfaces.PresolveInterface.status",false]],"status (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.status",false]],"statuschecker (class in cplex._internal._procedural)":[[1,"cplex._internal._procedural.StatusChecker",false]],"steep (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.steep",false]],"steep (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.steep",false]],"steep_q_start (dual_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_pricing_constants.steep_Q_start",false]],"steep_q_start (primal_pricing_constants attribute)":[[1,"cplex._internal._parameter_classes.primal_pricing_constants.steep_Q_start",false]],"strong_branching (varsel_constants attribute)":[[1,"cplex._internal._parameter_classes.varsel_constants.strong_branching",false]],"strong_branching() (advancedcplexinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.strong_branching",false]],"strongbranch() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.strongbranch",false]],"strparameter (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.StrParameter",false]],"subalg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.subalg_constants",false]],"sum_comp_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_comp_slack",false]],"sum_dual_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_dual_infeasibilities",false]],"sum_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_dual_residual",false]],"sum_indicator_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_indicator_slack_infeasibility",false]],"sum_integer_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_integer_infeasibilities",false]],"sum_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_pi",false]],"sum_primal_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_primal_infeasibilities",false]],"sum_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_primal_residual",false]],"sum_pwl_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_pwl_slack_infeasibility",false]],"sum_quadratic_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_primal_residual",false]],"sum_quadratic_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_slack",false]],"sum_quadratic_slack_infeasibility (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_quadratic_slack_infeasibility",false]],"sum_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_reduced_cost",false]],"sum_scaled_dual_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_dual_infeasibilities",false]],"sum_scaled_dual_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_dual_residual",false]],"sum_scaled_pi (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_pi",false]],"sum_scaled_primal_infeasibilities (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_primal_infeasibilities",false]],"sum_scaled_primal_residual (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_primal_residual",false]],"sum_scaled_reduced_cost (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_reduced_cost",false]],"sum_scaled_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_slack",false]],"sum_scaled_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_scaled_x",false]],"sum_slack (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_slack",false]],"sum_x (qualitymetric attribute)":[[1,"cplex._internal._subinterfaces.QualityMetric.sum_x",false]],"sym_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.sym_constants",false]],"table (cuttype attribute)":[[0,"cplex.callbacks.CutType.table",false],[1,"cplex._internal._subinterfaces.CutType.table",false]],"thread_down (contexttype attribute)":[[0,"cplex.callbacks.ContextType.thread_down",false]],"thread_up (contexttype attribute)":[[0,"cplex.callbacks.ContextType.thread_up",false]],"tighten_lower_bounds() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.tighten_lower_bounds",false]],"tighten_upper_bounds() (advancedvariablesinterface method)":[[1,"cplex._internal._subinterfaces.AdvancedVariablesInterface.tighten_upper_bounds",false]],"tightenbds() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tightenbds",false]],"time (multiobjfloatinfo attribute)":[[1,"cplex._internal._multiobjsoln.MultiObjFloatInfo.time",false]],"time_limit (tuningconstants attribute)":[[1,"cplex._internal._parameter_classes.TuningConstants.time_limit",false]],"traditional (dive_constants attribute)":[[1,"cplex._internal._parameter_classes.dive_constants.traditional",false]],"traditional (search_constants attribute)":[[1,"cplex._internal._parameter_classes.search_constants.traditional",false]],"true_objective_values (network_display_constants attribute)":[[1,"cplex._internal._parameter_classes.network_display_constants.true_objective_values",false]],"tune_display_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.tune_display_constants",false]],"tune_problem() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tune_problem",false]],"tune_problem_set() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tune_problem_set",false]],"tuneparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tuneparam",false]],"tuneparamprobset() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.tuneparamprobset",false]],"tuning_status (rootparametergroup attribute)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.tuning_status",false]],"tuningcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.TuningCallback",false]],"tuningconstants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.TuningConstants",false]],"type (solnpoolfilterinterface attribute)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.type",false]],"type (solutioninterface attribute)":[[1,"cplex._internal._subinterfaces.SolutionInterface.type",false]],"type (sosinterface attribute)":[[1,"cplex._internal._subinterfaces.SOSInterface.type",false]],"type (variablesinterface attribute)":[[1,"cplex._internal._subinterfaces.VariablesInterface.type",false]],"type() (parameter method)":[[1,"cplex._internal._parameter_classes.Parameter.type",false]],"type_ (indicatorconstraintinterface attribute)":[[1,"cplex._internal._subinterfaces.IndicatorConstraintInterface.type_",false]],"unbounded (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.unbounded",false]],"uncrush_formula() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_formula",false]],"uncrush_pi() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_pi",false]],"uncrush_x() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.uncrush_x",false]],"uncrushform() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushform",false]],"uncrushpi() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushpi",false]],"uncrushx() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.uncrushx",false]],"unknown (solutionstatus attribute)":[[1,"cplex._internal._subinterfaces.SolutionStatus.unknown",false]],"unpack() (sparsepair method)":[[0,"cplex.SparsePair.unpack",false]],"unpack() (sparsetriple method)":[[0,"cplex.SparseTriple.unpack",false]],"unpack_pair() (in module cplex._internal._matrices)":[[1,"cplex._internal._matrices.unpack_pair",false]],"unpack_triple() (in module cplex._internal._matrices)":[[1,"cplex._internal._matrices.unpack_triple",false]],"unregister_callback() (cplex method)":[[0,"cplex.Cplex.unregister_callback",false]],"unregister_callback() (environment method)":[[1,"cplex._internal.Environment.unregister_callback",false]],"unzip() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.unzip",false]],"up (branchdirection attribute)":[[1,"cplex._internal._subinterfaces.BranchDirection.up",false]],"up (brdir_constants attribute)":[[1,"cplex._internal._parameter_classes.brdir_constants.up",false]],"upper_bound (conflictconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.ConflictConstraintType.upper_bound",false]],"upper_bound (feasoptconstrainttype attribute)":[[1,"cplex._internal._subinterfaces.FeasoptConstraintType.upper_bound",false]],"upper_bound (presolvecolstatus attribute)":[[1,"cplex._internal._subinterfaces.PresolveColStatus.upper_bound",false]],"upper_bound_constraints() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.upper_bound_constraints",false]],"upper_bound_constraints() (feasoptinterface method)":[[1,"cplex._internal._subinterfaces.FeasoptInterface.upper_bound_constraints",false]],"upper_bounds() (sensitivityinterface method)":[[1,"cplex._internal._subinterfaces.SensitivityInterface.upper_bounds",false]],"use_aborter() (cplex method)":[[0,"cplex.Cplex.use_aborter",false]],"use_constraint (lazyconstraintcallback attribute)":[[0,"cplex.callbacks.LazyConstraintCallback.use_constraint",false]],"use_cut (usercutcallback attribute)":[[0,"cplex.callbacks.UserCutCallback.use_cut",false]],"use_solution() (solvecallback method)":[[0,"cplex.callbacks.SolveCallback.use_solution",false]],"useconstraint (class in cplex.callbacks)":[[0,"cplex.callbacks.UseConstraint",false]],"usecut (class in cplex.callbacks)":[[0,"cplex.callbacks.UseCut",false]],"user (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.user",false]],"user (cuttype attribute)":[[0,"cplex.callbacks.CutType.user",false],[1,"cplex._internal._subinterfaces.CutType.user",false]],"user_solution (solutionsource attribute)":[[0,"cplex.callbacks.SolutionSource.user_solution",false]],"usercutcallback (class in cplex.callbacks)":[[0,"cplex.callbacks.UserCutCallback",false]],"v_agg_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.v_agg_constants",false]],"validate_arg_lengths() (in module cplex._internal._aux_functions)":[[1,"cplex._internal._aux_functions.validate_arg_lengths",false]],"variable (annotationobjecttype attribute)":[[1,"cplex._internal._anno.AnnotationObjectType.variable",false]],"variable (branchtype attribute)":[[0,"cplex.callbacks.BranchType.variable",false]],"variable_status (advancedcplexinterface attribute)":[[1,"cplex._internal._subinterfaces.AdvancedCplexInterface.variable_status",false]],"variables (cplex attribute)":[[0,"cplex.Cplex.variables",false]],"variablesinterface (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.VariablesInterface",false]],"varsel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.varsel_constants",false]],"vartypes (class in cplex._internal._subinterfaces)":[[1,"cplex._internal._subinterfaces.VarTypes",false]],"version() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.version",false]],"versionnumber() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.versionnumber",false]],"very_aggressive (sym_constants attribute)":[[1,"cplex._internal._parameter_classes.sym_constants.very_aggressive",false]],"very_aggressive (v_agg_constants attribute)":[[1,"cplex._internal._parameter_classes.v_agg_constants.very_aggressive",false]],"wall (clocktype_constants attribute)":[[1,"cplex._internal._parameter_classes.clocktype_constants.wall",false]],"warn (datacheck_constants attribute)":[[1,"cplex._internal._parameter_classes.datacheck_constants.warn",false]],"warning_chnl_idx (environment attribute)":[[1,"cplex._internal.Environment.WARNING_CHNL_IDX",false]],"with_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.with_cuts",false]],"without_cuts (repeatpre_constants attribute)":[[1,"cplex._internal._parameter_classes.repeatpre_constants.without_cuts",false]],"workers (benders_strategy_constants attribute)":[[1,"cplex._internal._parameter_classes.benders_strategy_constants.workers",false]],"worst_objective (replace_constants attribute)":[[1,"cplex._internal._parameter_classes.replace_constants.worst_objective",false]],"write() (basisinterface method)":[[1,"cplex._internal._subinterfaces.BasisInterface.write",false]],"write() (conflictinterface method)":[[1,"cplex._internal._subinterfaces.ConflictInterface.write",false]],"write() (cplex method)":[[0,"cplex.Cplex.write",false]],"write() (mipstartsinterface method)":[[1,"cplex._internal._subinterfaces.MIPStartsInterface.write",false]],"write() (orderinterface method)":[[1,"cplex._internal._subinterfaces.OrderInterface.write",false]],"write() (parameterset method)":[[0,"cplex.ParameterSet.write",false],[0,"cplex.paramset.ParameterSet.write",false]],"write() (presolveinterface method)":[[1,"cplex._internal._subinterfaces.PresolveInterface.write",false]],"write() (solnpoolfilterinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolFilterInterface.write",false]],"write() (solnpoolinterface method)":[[1,"cplex._internal._subinterfaces.SolnPoolInterface.write",false]],"write() (solutioninterface method)":[[1,"cplex._internal._subinterfaces.SolutionInterface.write",false]],"write_annotations() (cplex method)":[[0,"cplex.Cplex.write_annotations",false]],"write_as_string() (cplex method)":[[0,"cplex.Cplex.write_as_string",false]],"write_benders_annotation() (cplex method)":[[0,"cplex.Cplex.write_benders_annotation",false]],"write_file() (rootparametergroup method)":[[1,"cplex._internal._parameter_classes.RootParameterGroup.write_file",false]],"write_to_stream() (cplex method)":[[0,"cplex.Cplex.write_to_stream",false]],"writeanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeanno",false]],"writebendersanno() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writebendersanno",false]],"writelevel_constants (class in cplex._internal._parameter_classes)":[[1,"cplex._internal._parameter_classes.writelevel_constants",false]],"writemipstarts() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writemipstarts",false]],"writeparam() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeparam",false]],"writeprob() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeprob",false]],"writeprobdev() (in module cplex._internal._procedural)":[[1,"cplex._internal._procedural.writeprobdev",false]],"wrongnumberofargumentserror":[[0,"cplex.exceptions.WrongNumberOfArgumentsError",false]],"yes (dual_constants attribute)":[[1,"cplex._internal._parameter_classes.dual_constants.yes",false]],"zero_dual (bar_start_alg_constants attribute)":[[1,"cplex._internal._parameter_classes.bar_start_alg_constants.zero_dual",false]],"zero_half (cuttype attribute)":[[0,"cplex.callbacks.CutType.zero_half",false],[1,"cplex._internal._subinterfaces.CutType.zero_half",false]]},"objects":{"":[[0,0,0,"-","cplex"]],"cplex":[[0,1,1,"","Aborter"],[0,1,1,"","Cplex"],[0,1,1,"","ParameterSet"],[0,1,1,"","SparsePair"],[0,1,1,"","SparseTriple"],[0,1,1,"","Stats"],[1,0,0,"-","_internal"],[0,0,0,"-","aborter"],[0,0,0,"-","callbacks"],[0,0,0,"-","constant_class"],[0,0,0,"-","exceptions"],[0,6,1,"","infinity"],[0,0,0,"-","model_info"],[0,0,0,"-","paramset"]],"cplex.Aborter":[[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","clear"],[0,2,1,"","end"],[0,2,1,"","is_aborted"]],"cplex.Cplex":[[0,3,1,"","MIP_starts"],[0,3,1,"","SOS"],[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,3,1,"","advanced"],[0,2,1,"","cleanup"],[0,3,1,"","conflict"],[0,2,1,"","copy_parameter_set"],[0,2,1,"","copylp"],[0,2,1,"","create_parameter_set"],[0,3,1,"","double_annotations"],[0,2,1,"","end"],[0,3,1,"","feasopt"],[0,2,1,"","get_aborter"],[0,2,1,"","get_dettime"],[0,2,1,"","get_num_cores"],[0,2,1,"","get_parameter_set"],[0,2,1,"","get_problem_name"],[0,2,1,"","get_problem_type"],[0,2,1,"","get_stats"],[0,2,1,"","get_time"],[0,2,1,"","get_version"],[0,2,1,"","get_versionnumber"],[0,3,1,"","indicator_constraints"],[0,3,1,"","linear_constraints"],[0,3,1,"","long_annotations"],[0,3,1,"","multiobj"],[0,3,1,"","objective"],[0,3,1,"","order"],[0,3,1,"","parameters"],[0,2,1,"","populate_solution_pool"],[0,3,1,"","presolve"],[0,3,1,"","problem_type"],[0,3,1,"","pwl_constraints"],[0,3,1,"","quadratic_constraints"],[0,2,1,"","read"],[0,2,1,"","read_annotations"],[0,2,1,"","register_callback"],[0,2,1,"","remove_aborter"],[0,2,1,"","runseeds"],[0,2,1,"","set_callback"],[0,2,1,"","set_error_stream"],[0,2,1,"","set_log_stream"],[0,2,1,"","set_modeling_assistance_callback"],[0,2,1,"","set_parameter_set"],[0,2,1,"","set_problem_name"],[0,2,1,"","set_problem_type"],[0,2,1,"","set_results_stream"],[0,2,1,"","set_warning_stream"],[0,3,1,"","solution"],[0,2,1,"","solve"],[0,3,1,"","start"],[0,2,1,"","unregister_callback"],[0,2,1,"","use_aborter"],[0,3,1,"","variables"],[0,2,1,"","write"],[0,2,1,"","write_annotations"],[0,2,1,"","write_as_string"],[0,2,1,"","write_benders_annotation"],[0,2,1,"","write_to_stream"]],"cplex.ParameterSet":[[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","__len__"],[0,2,1,"","add"],[0,2,1,"","clear"],[0,2,1,"","delete"],[0,2,1,"","end"],[0,2,1,"","get"],[0,2,1,"","get_ids"],[0,2,1,"","read"],[0,2,1,"","write"]],"cplex.SparsePair":[[0,2,1,"","__init__"],[0,2,1,"","__repr__"],[0,2,1,"","isvalid"],[0,2,1,"","unpack"]],"cplex.SparseTriple":[[0,2,1,"","__init__"],[0,2,1,"","__repr__"],[0,2,1,"","isvalid"],[0,2,1,"","unpack"]],"cplex.Stats":[[0,2,1,"","__init__"],[0,2,1,"","__str__"]],"cplex._internal":[[1,1,1,"","Environment"],[1,1,1,"","ProblemType"],[1,0,0,"-","_anno"],[1,0,0,"-","_aux_functions"],[1,0,0,"-","_baseinterface"],[1,0,0,"-","_constants"],[1,0,0,"-","_constantsenum"],[1,0,0,"-","_matrices"],[1,0,0,"-","_multiobj"],[1,0,0,"-","_multiobjsoln"],[1,0,0,"-","_parameter_classes"],[1,0,0,"-","_procedural"],[1,0,0,"-","_pwl"],[1,0,0,"-","_solutionstrategyenum"],[1,0,0,"-","_subinterfaces"]],"cplex._internal.Environment":[[1,3,1,"","ERROR_CHNL_IDX"],[1,3,1,"","LOG_CHNL_IDX"],[1,3,1,"","RESULTS_CHNL_IDX"],[1,3,1,"","WARNING_CHNL_IDX"],[1,2,1,"","__del__"],[1,2,1,"","__init__"],[1,2,1,"","get_dettime"],[1,2,1,"","get_num_cores"],[1,2,1,"","get_time"],[1,2,1,"","get_version"],[1,2,1,"","get_versionnumber"],[1,2,1,"","register_callback"],[1,2,1,"","set_error_stream"],[1,2,1,"","set_log_stream"],[1,2,1,"","set_results_stream"],[1,2,1,"","set_warning_stream"],[1,2,1,"","unregister_callback"]],"cplex._internal.ProblemType":[[1,3,1,"","LP"],[1,3,1,"","MILP"],[1,3,1,"","MIQCP"],[1,3,1,"","MIQP"],[1,3,1,"","QCP"],[1,3,1,"","QP"],[1,3,1,"","fixed_MILP"],[1,3,1,"","fixed_MIQP"],[1,3,1,"","node_LP"],[1,3,1,"","node_QCP"],[1,3,1,"","node_QP"]],"cplex._internal._anno":[[1,1,1,"","AnnotationInterface"],[1,1,1,"","AnnotationObjectType"],[1,1,1,"","DoubleAnnotationInterface"],[1,1,1,"","LongAnnotationInterface"]],"cplex._internal._anno.AnnotationInterface":[[1,3,1,"","object_type"]],"cplex._internal._anno.AnnotationObjectType":[[1,3,1,"","indicator_constraint"],[1,3,1,"","objective"],[1,3,1,"","quadratic_constraint"],[1,3,1,"","row"],[1,3,1,"","sos_constraint"],[1,3,1,"","variable"]],"cplex._internal._anno.DoubleAnnotationInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_default_values"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_values"],[1,2,1,"","set_values"]],"cplex._internal._anno.LongAnnotationInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","benders_annotation"],[1,3,1,"","benders_mastervalue"],[1,2,1,"","delete"],[1,2,1,"","get_default_values"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_values"],[1,2,1,"","set_values"]],"cplex._internal._aux_functions":[[1,4,1,"","apply_freeform_one_arg"],[1,4,1,"","apply_freeform_two_args"],[1,4,1,"","apply_pairs"],[1,4,1,"","convert"],[1,4,1,"","convert_sequence"],[1,4,1,"","delete_set_by_range"],[1,1,1,"","deprecated"],[1,4,1,"","deprecated_class"],[1,4,1,"","identity"],[1,4,1,"","init_list_args"],[1,4,1,"","listify"],[1,4,1,"","make_group"],[1,4,1,"","make_ranges"],[1,4,1,"","max_arg_length"],[1,4,1,"","unzip"],[1,4,1,"","validate_arg_lengths"]],"cplex._internal._aux_functions.deprecated":[[1,2,1,"","__init__"]],"cplex._internal._baseinterface":[[1,1,1,"","BaseInterface"]],"cplex._internal._baseinterface.BaseInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_indices"]],"cplex._internal._matrices":[[1,4,1,"","unpack_pair"],[1,4,1,"","unpack_triple"]],"cplex._internal._multiobj":[[1,1,1,"","MultiObjInterface"]],"cplex._internal._multiobj.MultiObjInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_abstol"],[1,2,1,"","get_definition"],[1,2,1,"","get_linear"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_offset"],[1,2,1,"","get_priority"],[1,2,1,"","get_reltol"],[1,2,1,"","get_sense"],[1,2,1,"","get_weight"],[1,3,1,"","sense"],[1,2,1,"","set_abstol"],[1,2,1,"","set_definition"],[1,2,1,"","set_linear"],[1,2,1,"","set_name"],[1,2,1,"","set_num"],[1,2,1,"","set_offset"],[1,2,1,"","set_priority"],[1,2,1,"","set_reltol"],[1,2,1,"","set_sense"],[1,2,1,"","set_weight"]],"cplex._internal._multiobjsoln":[[1,1,1,"","MultiObjFloatInfo"],[1,1,1,"","MultiObjIntInfo"],[1,1,1,"","MultiObjLongInfo"],[1,1,1,"","MultiObjSolnInterface"]],"cplex._internal._multiobjsoln.MultiObjFloatInfo":[[1,3,1,"","best_objective"],[1,3,1,"","dettime"],[1,3,1,"","objective"],[1,3,1,"","time"]],"cplex._internal._multiobjsoln.MultiObjIntInfo":[[1,3,1,"","blend"],[1,3,1,"","dfeas"],[1,3,1,"","error"],[1,3,1,"","method"],[1,3,1,"","pfeas"],[1,3,1,"","priority"],[1,3,1,"","status"]],"cplex._internal._multiobjsoln.MultiObjLongInfo":[[1,3,1,"","num_barrier_iterations"],[1,3,1,"","num_degenerate_iterations"],[1,3,1,"","num_dual_exchanges"],[1,3,1,"","num_dual_pushes"],[1,3,1,"","num_iterations"],[1,3,1,"","num_nodes"],[1,3,1,"","num_nodes_left"],[1,3,1,"","num_phase1_iterations"],[1,3,1,"","num_primal_exchanges"],[1,3,1,"","num_primal_pushes"],[1,3,1,"","num_sifting_iterations"],[1,3,1,"","num_sifting_phase1_iterations"]],"cplex._internal._multiobjsoln.MultiObjSolnInterface":[[1,2,1,"","__init__"],[1,3,1,"","float_info"],[1,2,1,"","get_info"],[1,2,1,"","get_num_solves"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_objval_by_priority"],[1,3,1,"","int_info"],[1,3,1,"","long_info"]],"cplex._internal._parameter_classes":[[1,1,1,"","NumParameter"],[1,1,1,"","Parameter"],[1,1,1,"","ParameterGroup"],[1,1,1,"","RootParameterGroup"],[1,1,1,"","StrParameter"],[1,1,1,"","TuningConstants"],[1,1,1,"","advance_constants"],[1,1,1,"","agg_constants"],[1,1,1,"","alg_constants"],[1,1,1,"","auto_off_on_constants"],[1,1,1,"","bar_alg_constants"],[1,1,1,"","bar_order_constants"],[1,1,1,"","bar_start_alg_constants"],[1,1,1,"","benders_strategy_constants"],[1,1,1,"","brdir_constants"],[1,1,1,"","cardls_constants"],[1,1,1,"","clocktype_constants"],[1,1,1,"","coeffreduce_constants"],[1,1,1,"","conflict_algorithm_constants"],[1,1,1,"","crossover_constants"],[1,1,1,"","datacheck_constants"],[1,1,1,"","dependency_constants"],[1,1,1,"","display_constants"],[1,1,1,"","dive_constants"],[1,1,1,"","dual_constants"],[1,1,1,"","dual_pricing_constants"],[1,1,1,"","feasopt_mode_constants"],[1,1,1,"","file_constants"],[1,1,1,"","fpheur_constants"],[1,1,1,"","kappastats_constants"],[1,1,1,"","linear_constants"],[1,1,1,"","measure_constants"],[1,1,1,"","mip_display_constants"],[1,1,1,"","mip_emph_constants"],[1,1,1,"","miqcp_constants"],[1,1,1,"","network_display_constants"],[1,1,1,"","network_netfind_constants"],[1,1,1,"","network_pricing_constants"],[1,1,1,"","nodesel_constants"],[1,1,1,"","off_on_constants"],[1,1,1,"","optimalitytarget_constants"],[1,1,1,"","ordertype_constants"],[1,1,1,"","par_constants"],[1,1,1,"","prered_constants"],[1,1,1,"","prereform_constants"],[1,1,1,"","presolve_constants"],[1,1,1,"","primal_pricing_constants"],[1,1,1,"","qcpduals_constants"],[1,1,1,"","qp_alg_constants"],[1,1,1,"","repeatpre_constants"],[1,1,1,"","replace_constants"],[1,1,1,"","scale_constants"],[1,1,1,"","search_constants"],[1,1,1,"","sift_alg_constants"],[1,1,1,"","solutiontype_constants"],[1,1,1,"","sos1reform_constants"],[1,1,1,"","sos2reform_constants"],[1,1,1,"","subalg_constants"],[1,1,1,"","sym_constants"],[1,1,1,"","tune_display_constants"],[1,1,1,"","v_agg_constants"],[1,1,1,"","varsel_constants"],[1,1,1,"","writelevel_constants"]],"cplex._internal._parameter_classes.NumParameter":[[1,2,1,"","max"],[1,2,1,"","min"]],"cplex._internal._parameter_classes.Parameter":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","default"],[1,2,1,"","get"],[1,2,1,"","help"],[1,2,1,"","reset"],[1,2,1,"","set"],[1,2,1,"","type"]],"cplex._internal._parameter_classes.ParameterGroup":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","get_all"],[1,2,1,"","get_changed"],[1,2,1,"","reset"]],"cplex._internal._parameter_classes.RootParameterGroup":[[1,2,1,"","__init__"],[1,2,1,"","__repr__"],[1,2,1,"","read_file"],[1,2,1,"","reset"],[1,2,1,"","tune_problem"],[1,2,1,"","tune_problem_set"],[1,3,1,"","tuning_status"],[1,2,1,"","write_file"]],"cplex._internal._parameter_classes.TuningConstants":[[1,3,1,"","abort"],[1,3,1,"","completed"],[1,3,1,"","dettime_limit"],[1,3,1,"","time_limit"]],"cplex._internal._parameter_classes.advance_constants":[[1,3,1,"","alternate"],[1,3,1,"","none"],[1,3,1,"","standard"]],"cplex._internal._parameter_classes.agg_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","moderate"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","concurrent"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"],[1,3,1,"","sifting"]],"cplex._internal._parameter_classes.auto_off_on_constants":[[1,3,1,"","auto"],[1,3,1,"","off"],[1,3,1,"","on"]],"cplex._internal._parameter_classes.bar_alg_constants":[[1,3,1,"","default"],[1,3,1,"","infeas_constant"],[1,3,1,"","infeas_estimate"],[1,3,1,"","standard"]],"cplex._internal._parameter_classes.bar_order_constants":[[1,3,1,"","approx_min_degree"],[1,3,1,"","approx_min_fill"],[1,3,1,"","nested_dissection"]],"cplex._internal._parameter_classes.bar_start_alg_constants":[[1,3,1,"","average_primal_estimated_dual"],[1,3,1,"","average_primal_zero_dual"],[1,3,1,"","estimated_dual"],[1,3,1,"","zero_dual"]],"cplex._internal._parameter_classes.benders_strategy_constants":[[1,3,1,"","auto"],[1,3,1,"","full"],[1,3,1,"","none"],[1,3,1,"","user"],[1,3,1,"","workers"]],"cplex._internal._parameter_classes.brdir_constants":[[1,3,1,"","auto"],[1,3,1,"","down"],[1,3,1,"","up"]],"cplex._internal._parameter_classes.cardls_constants":[[1,3,1,"","at_all_nodes"],[1,3,1,"","at_root"],[1,3,1,"","auto"],[1,3,1,"","disabled"]],"cplex._internal._parameter_classes.clocktype_constants":[[1,3,1,"","CPU"],[1,3,1,"","auto"],[1,3,1,"","wall"]],"cplex._internal._parameter_classes.coeffreduce_constants":[[1,3,1,"","any"],[1,3,1,"","integral"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.conflict_algorithm_constants":[[1,3,1,"","auto"],[1,3,1,"","fast"],[1,3,1,"","iis"],[1,3,1,"","limitedsolve"],[1,3,1,"","presolve"],[1,3,1,"","propagate"],[1,3,1,"","solve"]],"cplex._internal._parameter_classes.crossover_constants":[[1,3,1,"","auto"],[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.datacheck_constants":[[1,3,1,"","assist"],[1,3,1,"","off"],[1,3,1,"","warn"]],"cplex._internal._parameter_classes.dependency_constants":[[1,3,1,"","auto"],[1,3,1,"","begin"],[1,3,1,"","begin_and_end"],[1,3,1,"","end"],[1,3,1,"","off"]],"cplex._internal._parameter_classes.display_constants":[[1,3,1,"","detailed"],[1,3,1,"","none"],[1,3,1,"","normal"]],"cplex._internal._parameter_classes.dive_constants":[[1,3,1,"","auto"],[1,3,1,"","guided"],[1,3,1,"","probing"],[1,3,1,"","traditional"]],"cplex._internal._parameter_classes.dual_constants":[[1,3,1,"","auto"],[1,3,1,"","no"],[1,3,1,"","yes"]],"cplex._internal._parameter_classes.dual_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","devex"],[1,3,1,"","full"],[1,3,1,"","full_steep"],[1,3,1,"","steep"],[1,3,1,"","steep_Q_start"]],"cplex._internal._parameter_classes.feasopt_mode_constants":[[1,3,1,"","min_inf"],[1,3,1,"","min_quad"],[1,3,1,"","min_sum"],[1,3,1,"","opt_inf"],[1,3,1,"","opt_quad"],[1,3,1,"","opt_sum"]],"cplex._internal._parameter_classes.file_constants":[[1,3,1,"","auto"],[1,3,1,"","disk"],[1,3,1,"","disk_compressed"],[1,3,1,"","memory"]],"cplex._internal._parameter_classes.fpheur_constants":[[1,3,1,"","auto"],[1,3,1,"","feas"],[1,3,1,"","none"],[1,3,1,"","obj_and_feas"]],"cplex._internal._parameter_classes.kappastats_constants":[[1,3,1,"","auto"],[1,3,1,"","full"],[1,3,1,"","none"],[1,3,1,"","sample"]],"cplex._internal._parameter_classes.linear_constants":[[1,3,1,"","full"],[1,3,1,"","only_linear"]],"cplex._internal._parameter_classes.measure_constants":[[1,3,1,"","average"],[1,3,1,"","minmax"]],"cplex._internal._parameter_classes.mip_display_constants":[[1,3,1,"","LP_all"],[1,3,1,"","LP_root"],[1,3,1,"","integer_feasible"],[1,3,1,"","mip_interval_nodes"],[1,3,1,"","node_cuts"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.mip_emph_constants":[[1,3,1,"","balanced"],[1,3,1,"","best_bound"],[1,3,1,"","feasibility"],[1,3,1,"","heuristic"],[1,3,1,"","hidden_feasibility"],[1,3,1,"","optimality"]],"cplex._internal._parameter_classes.miqcp_constants":[[1,3,1,"","LP_at_node"],[1,3,1,"","QCP_at_node"],[1,3,1,"","auto"]],"cplex._internal._parameter_classes.network_display_constants":[[1,3,1,"","none"],[1,3,1,"","penalized_objective_values"],[1,3,1,"","true_objective_values"]],"cplex._internal._parameter_classes.network_netfind_constants":[[1,3,1,"","general_scaling"],[1,3,1,"","pure"],[1,3,1,"","reflection_scaling"]],"cplex._internal._parameter_classes.network_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","multiple_partial"],[1,3,1,"","multiple_partial_with_sorting"],[1,3,1,"","partial"]],"cplex._internal._parameter_classes.nodesel_constants":[[1,3,1,"","best_bound"],[1,3,1,"","best_estimate"],[1,3,1,"","best_estimate_alt"],[1,3,1,"","depth_first"]],"cplex._internal._parameter_classes.off_on_constants":[[1,3,1,"","off"],[1,3,1,"","on"]],"cplex._internal._parameter_classes.optimalitytarget_constants":[[1,3,1,"","auto"],[1,3,1,"","first_order"],[1,3,1,"","optimal_convex"],[1,3,1,"","optimal_global"]],"cplex._internal._parameter_classes.ordertype_constants":[[1,3,1,"","bounds"],[1,3,1,"","cost"],[1,3,1,"","default"],[1,3,1,"","scaled_cost"]],"cplex._internal._parameter_classes.par_constants":[[1,3,1,"","auto"],[1,3,1,"","deterministic"],[1,3,1,"","opportunistic"]],"cplex._internal._parameter_classes.prered_constants":[[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"],[1,3,1,"","primal_and_dual"]],"cplex._internal._parameter_classes.prereform_constants":[[1,3,1,"","all"],[1,3,1,"","interfere_crush"],[1,3,1,"","interfere_uncrush"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.presolve_constants":[[1,3,1,"","auto"],[1,3,1,"","force"],[1,3,1,"","none"],[1,3,1,"","probe"]],"cplex._internal._parameter_classes.primal_pricing_constants":[[1,3,1,"","auto"],[1,3,1,"","devex"],[1,3,1,"","full"],[1,3,1,"","partial"],[1,3,1,"","steep"],[1,3,1,"","steep_Q_start"]],"cplex._internal._parameter_classes.qcpduals_constants":[[1,3,1,"","force"],[1,3,1,"","if_possible"],[1,3,1,"","no"]],"cplex._internal._parameter_classes.qp_alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.repeatpre_constants":[[1,3,1,"","auto"],[1,3,1,"","new_root_cuts"],[1,3,1,"","off"],[1,3,1,"","with_cuts"],[1,3,1,"","without_cuts"]],"cplex._internal._parameter_classes.replace_constants":[[1,3,1,"","diversity"],[1,3,1,"","firstin_firstout"],[1,3,1,"","worst_objective"]],"cplex._internal._parameter_classes.scale_constants":[[1,3,1,"","aggressive"],[1,3,1,"","equilibration"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.search_constants":[[1,3,1,"","auto"],[1,3,1,"","dynamic"],[1,3,1,"","traditional"]],"cplex._internal._parameter_classes.sift_alg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"]],"cplex._internal._parameter_classes.solutiontype_constants":[[1,3,1,"","auto"],[1,3,1,"","basic"],[1,3,1,"","non_basic"]],"cplex._internal._parameter_classes.sos1reform_constants":[[1,3,1,"","auto"],[1,3,1,"","logarithmic"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.sos2reform_constants":[[1,3,1,"","auto"],[1,3,1,"","logarithmic"],[1,3,1,"","none"]],"cplex._internal._parameter_classes.subalg_constants":[[1,3,1,"","auto"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","network"],[1,3,1,"","primal"],[1,3,1,"","sifting"]],"cplex._internal._parameter_classes.sym_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","mild"],[1,3,1,"","moderate"],[1,3,1,"","more_aggressive"],[1,3,1,"","off"],[1,3,1,"","very_aggressive"]],"cplex._internal._parameter_classes.tune_display_constants":[[1,3,1,"","minimal"],[1,3,1,"","none"],[1,3,1,"","settings"],[1,3,1,"","settings_and_logs"]],"cplex._internal._parameter_classes.v_agg_constants":[[1,3,1,"","aggressive"],[1,3,1,"","auto"],[1,3,1,"","moderate"],[1,3,1,"","none"],[1,3,1,"","very_aggressive"]],"cplex._internal._parameter_classes.varsel_constants":[[1,3,1,"","default"],[1,3,1,"","max_infeasibility"],[1,3,1,"","min_infeasibility"],[1,3,1,"","pseudo_costs"],[1,3,1,"","pseudo_reduced_costs"],[1,3,1,"","strong_branching"]],"cplex._internal._parameter_classes.writelevel_constants":[[1,3,1,"","all_variables"],[1,3,1,"","auto"],[1,3,1,"","discrete_variables"],[1,3,1,"","nonzero_discrete_variables"],[1,3,1,"","nonzero_variables"]],"cplex._internal._procedural":[[1,4,1,"","Pylolmat_to_CHBmat"],[1,1,1,"","SigIntHandler"],[1,1,1,"","StatusChecker"],[1,4,1,"","addcols"],[1,4,1,"","addfuncdest"],[1,4,1,"","addindconstr"],[1,4,1,"","addlazyconstraints"],[1,4,1,"","addmipstarts"],[1,4,1,"","addpwl"],[1,4,1,"","addqconstr"],[1,4,1,"","addrows"],[1,4,1,"","addsolnpooldivfilter"],[1,4,1,"","addsolnpoolrngfilter"],[1,4,1,"","addsos"],[1,4,1,"","addusercuts"],[1,4,1,"","baropt"],[1,4,1,"","basicpresolve"],[1,4,1,"","binvacol"],[1,4,1,"","binvarow"],[1,4,1,"","binvcol"],[1,4,1,"","binvrow"],[1,4,1,"","boundsa"],[1,4,1,"","boundsa_lower"],[1,4,1,"","boundsa_upper"],[1,4,1,"","branchcallbackbranchasCPLEX"],[1,4,1,"","branchcallbackbranchgeneral"],[1,4,1,"","btran"],[1,4,1,"","callbackabort"],[1,4,1,"","callbackaddusercuts"],[1,4,1,"","callbackcandidateispoint"],[1,4,1,"","callbackcandidateisray"],[1,4,1,"","callbackexitcutloop"],[1,4,1,"","callbackgetcandidateobj"],[1,4,1,"","callbackgetcandidatepoint"],[1,4,1,"","callbackgetcandidateray"],[1,4,1,"","callbackgetgloballb"],[1,4,1,"","callbackgetglobalub"],[1,4,1,"","callbackgetincumbent"],[1,4,1,"","callbackgetincumbentobj"],[1,4,1,"","callbackgetinfodbl"],[1,4,1,"","callbackgetinfoint"],[1,4,1,"","callbackgetinfolong"],[1,4,1,"","callbackgetlocallb"],[1,4,1,"","callbackgetlocalub"],[1,4,1,"","callbackgetrelaxationpoint"],[1,4,1,"","callbackgetrelaxationpointobj"],[1,4,1,"","callbackgetrelaxationstatus"],[1,4,1,"","callbackmakebranch"],[1,4,1,"","callbackpostheursoln"],[1,4,1,"","callbackprunenode"],[1,4,1,"","callbackrejectcandidate"],[1,4,1,"","callbackrejectcandidatelocal"],[1,4,1,"","callbacksetnodeuserhandle"],[1,4,1,"","callbacksetuserhandle"],[1,4,1,"","cb_geterrorstring"],[1,4,1,"","chbmatrix"],[1,4,1,"","chgbds"],[1,4,1,"","chgcoeflist"],[1,4,1,"","chgcolname"],[1,4,1,"","chgctype"],[1,4,1,"","chgmipstarts"],[1,4,1,"","chgobj"],[1,4,1,"","chgobjoffset"],[1,4,1,"","chgobjsen"],[1,4,1,"","chgprobname"],[1,4,1,"","chgprobtype"],[1,4,1,"","chgprobtypesolnpool"],[1,4,1,"","chgqpcoef"],[1,4,1,"","chgrhs"],[1,4,1,"","chgrngval"],[1,4,1,"","chgrowname"],[1,4,1,"","chgsense"],[1,4,1,"","cleanup"],[1,4,1,"","cloneprob"],[1,4,1,"","closeCPLEX"],[1,4,1,"","clpwrite"],[1,4,1,"","completelp"],[1,4,1,"","copylpwnames"],[1,4,1,"","copyobjname"],[1,4,1,"","copyorder"],[1,4,1,"","copyprotected"],[1,4,1,"","copyqpsep"],[1,4,1,"","copyquad"],[1,4,1,"","copystart"],[1,4,1,"","createprob"],[1,4,1,"","crushform"],[1,4,1,"","crushpi"],[1,4,1,"","crushx"],[1,4,1,"","cutcallbackadd"],[1,4,1,"","cutcallbackaddlocal"],[1,4,1,"","delcols"],[1,4,1,"","deldblanno"],[1,4,1,"","delete_native_int"],[1,4,1,"","delfuncdest"],[1,4,1,"","delindconstrs"],[1,4,1,"","dellonganno"],[1,4,1,"","delmipstarts"],[1,4,1,"","delnames"],[1,4,1,"","delpwl"],[1,4,1,"","delpydel"],[1,4,1,"","delqconstrs"],[1,4,1,"","delrows"],[1,4,1,"","delsolnpoolfilters"],[1,4,1,"","delsolnpoolsolns"],[1,4,1,"","delsos"],[1,4,1,"","djfrompi"],[1,4,1,"","dperwrite"],[1,4,1,"","dualfarkas"],[1,4,1,"","dualopt"],[1,4,1,"","dualwrite"],[1,4,1,"","embwrite"],[1,4,1,"","fast_getcolname"],[1,4,1,"","fast_getmipstartname"],[1,4,1,"","fast_getobj"],[1,4,1,"","fast_getrowname"],[1,4,1,"","fast_getrows"],[1,4,1,"","fast_getsosname"],[1,4,1,"","fast_multiobjgetabstol"],[1,4,1,"","fast_multiobjgetobj"],[1,4,1,"","fast_multiobjgetoffset"],[1,4,1,"","fast_multiobjgetpriority"],[1,4,1,"","fast_multiobjgetreltol"],[1,4,1,"","fast_multiobjgetweight"],[1,4,1,"","fast_newcols"],[1,4,1,"","feasoptext"],[1,4,1,"","finitlock"],[1,4,1,"","fixparam"],[1,4,1,"","fltwrite"],[1,4,1,"","free_CHBmat"],[1,4,1,"","freelazyconstraints"],[1,4,1,"","freepresolve"],[1,4,1,"","freeprob"],[1,4,1,"","freeusercuts"],[1,4,1,"","ftran"],[1,4,1,"","get_native_int"],[1,4,1,"","get_wherefrom"],[1,4,1,"","getax"],[1,4,1,"","getbaritcnt"],[1,4,1,"","getbase"],[1,4,1,"","getbasednorms"],[1,4,1,"","getbestobjval"],[1,4,1,"","getbhead"],[1,4,1,"","getcallbackincumbent"],[1,4,1,"","getcallbacknodeinfo"],[1,4,1,"","getcallbacknodeintfeas"],[1,4,1,"","getcallbacknodelb"],[1,4,1,"","getcallbacknodeobjval"],[1,4,1,"","getcallbacknodeub"],[1,4,1,"","getcallbacknodex"],[1,4,1,"","getcallbackpseudocosts"],[1,4,1,"","getcallbackseqinfo"],[1,4,1,"","getcallbacksosinfo"],[1,4,1,"","getchannels"],[1,4,1,"","getcoef"],[1,4,1,"","getcolindex"],[1,4,1,"","getcolinfeas"],[1,4,1,"","getcolname"],[1,4,1,"","getcols"],[1,4,1,"","getconflictext"],[1,4,1,"","getconflictgroups"],[1,4,1,"","getconflictnumgroups"],[1,4,1,"","getconflictnumpasses"],[1,4,1,"","getcrossdexchcnt"],[1,4,1,"","getcrossdpushcnt"],[1,4,1,"","getcrosspexchcnt"],[1,4,1,"","getcrossppushcnt"],[1,4,1,"","getctype"],[1,4,1,"","getcutoff"],[1,4,1,"","getdblanno"],[1,4,1,"","getdblannodefval"],[1,4,1,"","getdblannoindex"],[1,4,1,"","getdblannoname"],[1,4,1,"","getdblparam"],[1,4,1,"","getdblquality"],[1,4,1,"","getdettime"],[1,4,1,"","getdj"],[1,4,1,"","getdnorms"],[1,4,1,"","getdsbcnt"],[1,4,1,"","geterrorstring"],[1,4,1,"","getgrad"],[1,4,1,"","gethist"],[1,4,1,"","getijdiv"],[1,4,1,"","getijrow"],[1,4,1,"","getindconstr"],[1,4,1,"","getindconstr_constant"],[1,4,1,"","getindconstrindex"],[1,4,1,"","getindconstrinfeas"],[1,4,1,"","getindconstrname"],[1,4,1,"","getindconstrslack"],[1,4,1,"","getintparam"],[1,4,1,"","getintquality"],[1,4,1,"","getitcnt"],[1,4,1,"","getlb"],[1,4,1,"","getlonganno"],[1,4,1,"","getlongannodefval"],[1,4,1,"","getlongannoindex"],[1,4,1,"","getlongannoname"],[1,4,1,"","getlongparam"],[1,4,1,"","getmethod"],[1,4,1,"","getmipitcnt"],[1,4,1,"","getmiprelgap"],[1,4,1,"","getmipstartindex"],[1,4,1,"","getmipstartname"],[1,4,1,"","getmipstarts"],[1,4,1,"","getmipstarts_effort"],[1,4,1,"","getmipstarts_size"],[1,4,1,"","getnodecnt"],[1,4,1,"","getnodeint"],[1,4,1,"","getnodeleftcnt"],[1,4,1,"","getnumbin"],[1,4,1,"","getnumcols"],[1,4,1,"","getnumcores"],[1,4,1,"","getnumcuts"],[1,4,1,"","getnumdblanno"],[1,4,1,"","getnumindconstrs"],[1,4,1,"","getnumint"],[1,4,1,"","getnumlonganno"],[1,4,1,"","getnummipstarts"],[1,4,1,"","getnumnz"],[1,4,1,"","getnumobjs"],[1,4,1,"","getnumprios"],[1,4,1,"","getnumpwl"],[1,4,1,"","getnumqconstrs"],[1,4,1,"","getnumqpnz"],[1,4,1,"","getnumquad"],[1,4,1,"","getnumrows"],[1,4,1,"","getnumsemicont"],[1,4,1,"","getnumsemiint"],[1,4,1,"","getnumsos"],[1,4,1,"","getobj"],[1,4,1,"","getobjname"],[1,4,1,"","getobjoffset"],[1,4,1,"","getobjsen"],[1,4,1,"","getobjval"],[1,4,1,"","getorder"],[1,4,1,"","getparamtype"],[1,4,1,"","getphase1cnt"],[1,4,1,"","getpi"],[1,4,1,"","getpnorms"],[1,4,1,"","getprestat_c"],[1,4,1,"","getprestat_oc"],[1,4,1,"","getprestat_or"],[1,4,1,"","getprestat_r"],[1,4,1,"","getprestat_status"],[1,4,1,"","getprobname"],[1,4,1,"","getprobstats"],[1,4,1,"","getprobtype"],[1,4,1,"","getprotected"],[1,4,1,"","getpsbcnt"],[1,4,1,"","getpwl"],[1,4,1,"","getpwlindex"],[1,4,1,"","getpwlname"],[1,4,1,"","getqconstr_info"],[1,4,1,"","getqconstr_lin"],[1,4,1,"","getqconstr_quad"],[1,4,1,"","getqconstrdslack"],[1,4,1,"","getqconstrindex"],[1,4,1,"","getqconstrinfeas"],[1,4,1,"","getqconstrname"],[1,4,1,"","getqconstrslack"],[1,4,1,"","getqpcoef"],[1,4,1,"","getquad"],[1,4,1,"","getqualitymetrics"],[1,4,1,"","getray"],[1,4,1,"","getrhs"],[1,4,1,"","getrngval"],[1,4,1,"","getrowindex"],[1,4,1,"","getrowinfeas"],[1,4,1,"","getrowname"],[1,4,1,"","getrows"],[1,4,1,"","getsense"],[1,4,1,"","getsiftitcnt"],[1,4,1,"","getsiftphase1cnt"],[1,4,1,"","getslack"],[1,4,1,"","getsolnpooldblquality"],[1,4,1,"","getsolnpooldivfilter"],[1,4,1,"","getsolnpooldivfilter_constant"],[1,4,1,"","getsolnpoolfilterindex"],[1,4,1,"","getsolnpoolfiltername"],[1,4,1,"","getsolnpoolfiltertype"],[1,4,1,"","getsolnpoolintquality"],[1,4,1,"","getsolnpoolmeanobjval"],[1,4,1,"","getsolnpoolnumfilters"],[1,4,1,"","getsolnpoolnumreplaced"],[1,4,1,"","getsolnpoolnumsolns"],[1,4,1,"","getsolnpoolobjval"],[1,4,1,"","getsolnpoolqconstrslack"],[1,4,1,"","getsolnpoolrngfilter"],[1,4,1,"","getsolnpoolrngfilter_constant"],[1,4,1,"","getsolnpoolslack"],[1,4,1,"","getsolnpoolsolnindex"],[1,4,1,"","getsolnpoolsolnname"],[1,4,1,"","getsolnpoolx"],[1,4,1,"","getsos"],[1,4,1,"","getsos_info"],[1,4,1,"","getsosindex"],[1,4,1,"","getsosinfeas"],[1,4,1,"","getsosname"],[1,4,1,"","getstat"],[1,4,1,"","getstatstring"],[1,4,1,"","getstrparam"],[1,4,1,"","getsubstat"],[1,4,1,"","gettime"],[1,4,1,"","getub"],[1,4,1,"","getx"],[1,4,1,"","getxqxax"],[1,4,1,"","has_name"],[1,4,1,"","has_non_default_lb"],[1,4,1,"","has_non_default_ub"],[1,4,1,"","hybbaropt"],[1,4,1,"","hybnetopt"],[1,4,1,"","infodblparam"],[1,4,1,"","infointparam"],[1,4,1,"","infolongparam"],[1,4,1,"","infostrparam"],[1,4,1,"","initlock"],[1,4,1,"","ismultiobj"],[1,4,1,"","lpopt"],[1,4,1,"","mbasewrite"],[1,4,1,"","mdleave"],[1,4,1,"","mipopt"],[1,4,1,"","modelasstcallbacksetfunc"],[1,4,1,"","multiobjchgattribs"],[1,4,1,"","multiobjgetdblinfo"],[1,4,1,"","multiobjgetindex"],[1,4,1,"","multiobjgetintinfo"],[1,4,1,"","multiobjgetlonginfo"],[1,4,1,"","multiobjgetname"],[1,4,1,"","multiobjgetnumsolves"],[1,4,1,"","multiobjgetobj"],[1,4,1,"","multiobjgetobjval"],[1,4,1,"","multiobjgetobjvalbypriority"],[1,4,1,"","multiobjopt"],[1,4,1,"","multiobjsetobj"],[1,4,1,"","new_native_int"],[1,4,1,"","newcols"],[1,4,1,"","newdblanno"],[1,4,1,"","newlonganno"],[1,4,1,"","newrows"],[1,4,1,"","objsa"],[1,4,1,"","openCPLEX"],[1,4,1,"","ordwrite"],[1,4,1,"","pack_env_lp_ptr"],[1,4,1,"","paramsetadd"],[1,4,1,"","paramsetadddbl"],[1,4,1,"","paramsetaddint"],[1,4,1,"","paramsetaddlong"],[1,4,1,"","paramsetaddstr"],[1,4,1,"","paramsetapply"],[1,4,1,"","paramsetcopy"],[1,4,1,"","paramsetcreate"],[1,4,1,"","paramsetdel"],[1,4,1,"","paramsetfree"],[1,4,1,"","paramsetget"],[1,4,1,"","paramsetgetdbl"],[1,4,1,"","paramsetgetids"],[1,4,1,"","paramsetgetint"],[1,4,1,"","paramsetgetlong"],[1,4,1,"","paramsetgetnum"],[1,4,1,"","paramsetgetstr"],[1,4,1,"","paramsetreadcopy"],[1,4,1,"","paramsetwrite"],[1,4,1,"","pivot"],[1,4,1,"","pivotin"],[1,4,1,"","pivotout"],[1,4,1,"","populate"],[1,4,1,"","pperwrite"],[1,4,1,"","preaddrows"],[1,4,1,"","prechgobj"],[1,4,1,"","preslvwrite"],[1,4,1,"","presolve"],[1,4,1,"","primopt"],[1,4,1,"","qconstrslackfromx"],[1,4,1,"","qpdjfrompi"],[1,4,1,"","qpindefcertificate"],[1,4,1,"","qpopt"],[1,4,1,"","readcopyanno"],[1,4,1,"","readcopybase"],[1,4,1,"","readcopymipstarts"],[1,4,1,"","readcopyorder"],[1,4,1,"","readcopyparam"],[1,4,1,"","readcopyprob"],[1,4,1,"","readcopysolnpoolfilters"],[1,4,1,"","readcopystartinfo"],[1,4,1,"","refineconflictext"],[1,4,1,"","refinemipstartconflictext"],[1,4,1,"","rhssa"],[1,4,1,"","runseeds"],[1,4,1,"","set_native_int"],[1,4,1,"","set_status_checker"],[1,4,1,"","setbranchcallbackfunc"],[1,4,1,"","setbranchnosolncallbackfunc"],[1,4,1,"","setdblanno"],[1,4,1,"","setdblparam"],[1,4,1,"","setdefaults"],[1,4,1,"","setgenericcallbackfunc"],[1,4,1,"","setheuristiccallbackfunc"],[1,4,1,"","setincumbentcallbackfunc"],[1,4,1,"","setinfocallbackfunc"],[1,4,1,"","setintparam"],[1,4,1,"","setlazyconstraintcallbackfunc"],[1,4,1,"","setlonganno"],[1,4,1,"","setlongparam"],[1,4,1,"","setlpcallbackfunc"],[1,4,1,"","setmipcallbackfunc"],[1,4,1,"","setnetcallbackfunc"],[1,4,1,"","setnodecallbackfunc"],[1,4,1,"","setnumobjs"],[1,4,1,"","setpydel"],[1,4,1,"","setsolvecallbackfunc"],[1,4,1,"","setstrparam"],[1,4,1,"","setterminate"],[1,4,1,"","settuningcallbackfunc"],[1,4,1,"","setusercutcallbackfunc"],[1,4,1,"","showquality"],[1,4,1,"","siftopt"],[1,4,1,"","slackfromx"],[1,4,1,"","solninfo"],[1,4,1,"","solwrite"],[1,4,1,"","solwritesolnpool"],[1,4,1,"","solwritesolnpoolall"],[1,4,1,"","strongbranch"],[1,4,1,"","tightenbds"],[1,4,1,"","tuneparam"],[1,4,1,"","tuneparamprobset"],[1,4,1,"","uncrushform"],[1,4,1,"","uncrushpi"],[1,4,1,"","uncrushx"],[1,4,1,"","version"],[1,4,1,"","versionnumber"],[1,4,1,"","writeanno"],[1,4,1,"","writebendersanno"],[1,4,1,"","writemipstarts"],[1,4,1,"","writeparam"],[1,4,1,"","writeprob"],[1,4,1,"","writeprobdev"]],"cplex._internal._procedural.SigIntHandler":[[1,2,1,"","__init__"]],"cplex._internal._procedural.StatusChecker":[[1,2,1,"","__init__"]],"cplex._internal._pwl":[[1,1,1,"","PWLConstraintInterface"]],"cplex._internal._pwl.PWLConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_definitions"],[1,2,1,"","get_names"],[1,2,1,"","get_num"]],"cplex._internal._solutionstrategyenum":[[1,1,1,"","SolutionStrategy"]],"cplex._internal._solutionstrategyenum.SolutionStrategy":[[1,3,1,"","check_feasible"],[1,3,1,"","no_check"],[1,3,1,"","propagate"],[1,3,1,"","solve"]],"cplex._internal._subinterfaces":[[1,1,1,"","AdvancedCplexInterface"],[1,1,1,"","AdvancedLinearConstraintInterface"],[1,1,1,"","AdvancedSolutionInterface"],[1,1,1,"","AdvancedVariablesInterface"],[1,1,1,"","BasisInterface"],[1,1,1,"","BasisVarStatus"],[1,1,1,"","BranchDirection"],[1,1,1,"","ConflictConstraintType"],[1,1,1,"","ConflictInterface"],[1,1,1,"","ConflictStatus"],[1,1,1,"","CutType"],[1,1,1,"","EffortLevel"],[1,1,1,"","FeasoptConstraintType"],[1,1,1,"","FeasoptInterface"],[1,1,1,"","FilterType"],[1,1,1,"","Histogram"],[1,1,1,"","IndicatorConstraintInterface"],[1,1,1,"","IndicatorType"],[1,1,1,"","InfeasibilityInterface"],[1,1,1,"","InitialInterface"],[1,1,1,"","LinearConstraintInterface"],[1,1,1,"","MIPSolutionInterface"],[1,1,1,"","MIPStartsInterface"],[1,1,1,"","ObjSense"],[1,1,1,"","ObjectiveInterface"],[1,1,1,"","OrderInterface"],[1,1,1,"","PivotVarStatus"],[1,1,1,"","PresolveColStatus"],[1,1,1,"","PresolveInterface"],[1,1,1,"","PresolveMethod"],[1,1,1,"","PresolveRowStatus"],[1,1,1,"","PresolveStatus"],[1,1,1,"","ProgressInterface"],[1,1,1,"","QuadraticConstraintInterface"],[1,1,1,"","QualityMetric"],[1,1,1,"","QualityMetrics"],[1,1,1,"","SOSInterface"],[1,1,1,"","SOSType"],[1,1,1,"","SensitivityInterface"],[1,1,1,"","SolnPoolFilterInterface"],[1,1,1,"","SolnPoolInterface"],[1,1,1,"","SolutionInterface"],[1,1,1,"","SolutionMethod"],[1,1,1,"","SolutionStatus"],[1,1,1,"","SolutionType"],[1,1,1,"","VarTypes"],[1,1,1,"","VariablesInterface"]],"cplex._internal._subinterfaces.AdvancedCplexInterface":[[1,2,1,"","basic_presolve"],[1,2,1,"","complete"],[1,2,1,"","delete_names"],[1,3,1,"","no_variable"],[1,2,1,"","pivot"],[1,2,1,"","pivot_fixed_variables_out"],[1,2,1,"","pivot_slacks_in"],[1,2,1,"","strong_branching"],[1,3,1,"","variable_status"]],"cplex._internal._subinterfaces.AdvancedLinearConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add_lazy_constraints"],[1,2,1,"","add_user_cuts"],[1,2,1,"","free_lazy_constraints"],[1,2,1,"","free_user_cuts"],[1,2,1,"","get_num_lazy_constraints"],[1,2,1,"","get_num_user_cuts"]],"cplex._internal._subinterfaces.AdvancedSolutionInterface":[[1,2,1,"","__init__"],[1,2,1,"","binvacol"],[1,2,1,"","binvarow"],[1,2,1,"","binvcol"],[1,2,1,"","binvrow"],[1,2,1,"","btran"],[1,2,1,"","dual_farkas"],[1,2,1,"","ftran"],[1,2,1,"","get_Driebeek_penalties"],[1,2,1,"","get_diverging_index"],[1,2,1,"","get_gradients"],[1,2,1,"","get_linear_reduced_costs_from_pi"],[1,2,1,"","get_linear_slacks_from_x"],[1,2,1,"","get_quadratic_indefinite_certificate"],[1,2,1,"","get_quadratic_reduced_costs_from_pi"],[1,2,1,"","get_quadratic_slacks_from_x"],[1,2,1,"","get_ray"]],"cplex._internal._subinterfaces.AdvancedVariablesInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_protected"],[1,2,1,"","protect"],[1,2,1,"","tighten_lower_bounds"],[1,2,1,"","tighten_upper_bounds"]],"cplex._internal._subinterfaces.BasisInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_basic_col_index"],[1,2,1,"","get_basic_row_index"],[1,2,1,"","get_basis"],[1,2,1,"","get_basis_dual_norms"],[1,2,1,"","get_dual_norms"],[1,2,1,"","get_header"],[1,2,1,"","get_num_dual_superbasic"],[1,2,1,"","get_num_primal_superbasic"],[1,2,1,"","get_primal_norms"],[1,3,1,"","status"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.BasisVarStatus":[[1,3,1,"","at_lower_bound"],[1,3,1,"","at_upper_bound"],[1,3,1,"","basic"],[1,3,1,"","free_nonbasic"]],"cplex._internal._subinterfaces.BranchDirection":[[1,3,1,"","default"],[1,3,1,"","down"],[1,3,1,"","up"]],"cplex._internal._subinterfaces.ConflictConstraintType":[[1,3,1,"","SOS"],[1,3,1,"","indicator"],[1,3,1,"","linear"],[1,3,1,"","lower_bound"],[1,3,1,"","pwl"],[1,3,1,"","quadratic"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.ConflictInterface":[[1,2,1,"","SOS_constraints"],[1,2,1,"","__init__"],[1,2,1,"","all_constraints"],[1,3,1,"","constraint_type"],[1,2,1,"","get"],[1,2,1,"","get_groups"],[1,2,1,"","get_num_groups"],[1,3,1,"","group_status"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","lower_bound_constraints"],[1,2,1,"","pwl_constraints"],[1,2,1,"","quadratic_constraints"],[1,2,1,"","refine"],[1,2,1,"","refine_MIP_start"],[1,2,1,"","upper_bound_constraints"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.ConflictStatus":[[1,3,1,"","excluded"],[1,3,1,"","member"],[1,3,1,"","possible_member"]],"cplex._internal._subinterfaces.CutType":[[1,3,1,"","BQP"],[1,3,1,"","GUB_cover"],[1,3,1,"","MIR"],[1,3,1,"","RLT"],[1,3,1,"","benders"],[1,3,1,"","clique"],[1,3,1,"","cover"],[1,3,1,"","disjunctive"],[1,3,1,"","flow_cover"],[1,3,1,"","flow_path"],[1,3,1,"","fractional"],[1,3,1,"","implied_bound"],[1,3,1,"","lift_and_project"],[1,3,1,"","local_implied_bound"],[1,3,1,"","multi_commodity_flow"],[1,3,1,"","solution_pool"],[1,3,1,"","table"],[1,3,1,"","user"],[1,3,1,"","zero_half"]],"cplex._internal._subinterfaces.EffortLevel":[[1,3,1,"","auto"],[1,3,1,"","check_feasibility"],[1,3,1,"","no_check"],[1,3,1,"","repair"],[1,3,1,"","solve_MIP"],[1,3,1,"","solve_fixed"]],"cplex._internal._subinterfaces.FeasoptConstraintType":[[1,3,1,"","indicator"],[1,3,1,"","linear"],[1,3,1,"","lower_bound"],[1,3,1,"","quadratic"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.FeasoptInterface":[[1,2,1,"","__call__"],[1,2,1,"","all_constraints"],[1,3,1,"","constraint_type"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","lower_bound_constraints"],[1,2,1,"","quadratic_constraints"],[1,2,1,"","upper_bound_constraints"]],"cplex._internal._subinterfaces.FilterType":[[1,3,1,"","diversity"],[1,3,1,"","range"]],"cplex._internal._subinterfaces.Histogram":[[1,2,1,"","__getitem__"],[1,2,1,"","__init__"],[1,2,1,"","__str__"]],"cplex._internal._subinterfaces.IndicatorConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","add_batch"],[1,2,1,"","delete"],[1,2,1,"","get_complemented"],[1,2,1,"","get_indicator_variables"],[1,2,1,"","get_linear_components"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_rhs"],[1,2,1,"","get_senses"],[1,2,1,"","get_types"],[1,3,1,"","type_"]],"cplex._internal._subinterfaces.IndicatorType":[[1,3,1,"","if_"],[1,3,1,"","iff"],[1,3,1,"","onlyif"]],"cplex._internal._subinterfaces.InfeasibilityInterface":[[1,2,1,"","SOS_constraints"],[1,2,1,"","__init__"],[1,2,1,"","bound_constraints"],[1,2,1,"","indicator_constraints"],[1,2,1,"","linear_constraints"],[1,2,1,"","quadratic_constraints"]],"cplex._internal._subinterfaces.InitialInterface":[[1,2,1,"","read_basis"],[1,2,1,"","read_start"],[1,2,1,"","set_start"],[1,3,1,"","status"]],"cplex._internal._subinterfaces.LinearConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","advanced"],[1,2,1,"","delete"],[1,2,1,"","get_coefficients"],[1,2,1,"","get_histogram"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_range_values"],[1,2,1,"","get_rhs"],[1,2,1,"","get_rows"],[1,2,1,"","get_senses"],[1,2,1,"","set_coefficients"],[1,2,1,"","set_linear_components"],[1,2,1,"","set_names"],[1,2,1,"","set_range_values"],[1,2,1,"","set_rhs"],[1,2,1,"","set_senses"]],"cplex._internal._subinterfaces.MIPSolutionInterface":[[1,2,1,"","__init__"],[1,3,1,"","cut_type"],[1,2,1,"","get_best_objective"],[1,2,1,"","get_cutoff"],[1,2,1,"","get_incumbent_node"],[1,2,1,"","get_mip_relative_gap"],[1,2,1,"","get_num_cuts"],[1,2,1,"","get_subproblem_status"]],"cplex._internal._subinterfaces.MIPStartsInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","change"],[1,2,1,"","delete"],[1,3,1,"","effort_level"],[1,2,1,"","get_effort_levels"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_entries"],[1,2,1,"","get_starts"],[1,2,1,"","read"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.ObjSense":[[1,3,1,"","maximize"],[1,3,1,"","minimize"]],"cplex._internal._subinterfaces.ObjectiveInterface":[[1,2,1,"","get_linear"],[1,2,1,"","get_name"],[1,2,1,"","get_num_quadratic_nonzeros"],[1,2,1,"","get_num_quadratic_variables"],[1,2,1,"","get_offset"],[1,2,1,"","get_quadratic"],[1,2,1,"","get_quadratic_coefficients"],[1,2,1,"","get_sense"],[1,3,1,"","sense"],[1,2,1,"","set_linear"],[1,2,1,"","set_name"],[1,2,1,"","set_offset"],[1,2,1,"","set_quadratic"],[1,2,1,"","set_quadratic_coefficients"],[1,2,1,"","set_sense"]],"cplex._internal._subinterfaces.OrderInterface":[[1,3,1,"","branch_direction"],[1,2,1,"","get"],[1,2,1,"","get_variables"],[1,2,1,"","read"],[1,2,1,"","set"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.PivotVarStatus":[[1,3,1,"","at_lower_bound"],[1,3,1,"","at_upper_bound"]],"cplex._internal._subinterfaces.PresolveColStatus":[[1,3,1,"","aggregated"],[1,3,1,"","fixed"],[1,3,1,"","lower_bound"],[1,3,1,"","other"],[1,3,1,"","upper_bound"]],"cplex._internal._subinterfaces.PresolveInterface":[[1,2,1,"","add_rows"],[1,3,1,"","col_status"],[1,2,1,"","crush_formula"],[1,2,1,"","crush_pi"],[1,2,1,"","crush_x"],[1,2,1,"","free"],[1,2,1,"","get_col_status"],[1,2,1,"","get_presolved_col_status"],[1,2,1,"","get_presolved_row_status"],[1,2,1,"","get_row_status"],[1,2,1,"","get_status"],[1,3,1,"","method"],[1,2,1,"","presolve"],[1,3,1,"","row_status"],[1,2,1,"","set_objective"],[1,3,1,"","status"],[1,2,1,"","uncrush_formula"],[1,2,1,"","uncrush_pi"],[1,2,1,"","uncrush_x"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.PresolveMethod":[[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.PresolveRowStatus":[[1,3,1,"","aggregated"],[1,3,1,"","other"],[1,3,1,"","reduced"]],"cplex._internal._subinterfaces.PresolveStatus":[[1,3,1,"","empty_problem"],[1,3,1,"","has_problem"],[1,3,1,"","no_reductions"]],"cplex._internal._subinterfaces.ProgressInterface":[[1,2,1,"","__init__"],[1,2,1,"","get_num_barrier_iterations"],[1,2,1,"","get_num_conflict_passes"],[1,2,1,"","get_num_dual_exchange"],[1,2,1,"","get_num_dual_push"],[1,2,1,"","get_num_iterations"],[1,2,1,"","get_num_nodes_processed"],[1,2,1,"","get_num_nodes_remaining"],[1,2,1,"","get_num_phase_one_iterations"],[1,2,1,"","get_num_primal_exchange"],[1,2,1,"","get_num_primal_push"],[1,2,1,"","get_num_sifting_iterations"],[1,2,1,"","get_num_sifting_phase_one_iterations"]],"cplex._internal._subinterfaces.QuadraticConstraintInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_linear_components"],[1,2,1,"","get_linear_num_nonzeros"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_quad_num_nonzeros"],[1,2,1,"","get_quadratic_components"],[1,2,1,"","get_rhs"],[1,2,1,"","get_senses"]],"cplex._internal._subinterfaces.QualityMetric":[[1,3,1,"","dual_objective"],[1,3,1,"","exact_kappa"],[1,3,1,"","kappa"],[1,3,1,"","kappa_attention"],[1,3,1,"","kappa_illposed"],[1,3,1,"","kappa_max"],[1,3,1,"","kappa_stable"],[1,3,1,"","kappa_suspicious"],[1,3,1,"","kappa_unstable"],[1,3,1,"","max_comp_slack"],[1,3,1,"","max_dual_infeasibility"],[1,3,1,"","max_dual_residual"],[1,3,1,"","max_indicator_slack_infeasibility"],[1,3,1,"","max_int_infeasibility"],[1,3,1,"","max_pi"],[1,3,1,"","max_primal_infeasibility"],[1,3,1,"","max_primal_residual"],[1,3,1,"","max_pwl_slack_infeasibility"],[1,3,1,"","max_quadratic_primal_residual"],[1,3,1,"","max_quadratic_slack"],[1,3,1,"","max_quadratic_slack_infeasibility"],[1,3,1,"","max_reduced_cost"],[1,3,1,"","max_scaled_dual_infeasibility"],[1,3,1,"","max_scaled_dual_residual"],[1,3,1,"","max_scaled_pi"],[1,3,1,"","max_scaled_primal_infeasibility"],[1,3,1,"","max_scaled_primal_residual"],[1,3,1,"","max_scaled_reduced_cost"],[1,3,1,"","max_scaled_slack"],[1,3,1,"","max_scaled_x"],[1,3,1,"","max_slack"],[1,3,1,"","max_x"],[1,3,1,"","objective_gap"],[1,3,1,"","primal_objective"],[1,3,1,"","sum_comp_slack"],[1,3,1,"","sum_dual_infeasibilities"],[1,3,1,"","sum_dual_residual"],[1,3,1,"","sum_indicator_slack_infeasibility"],[1,3,1,"","sum_integer_infeasibilities"],[1,3,1,"","sum_pi"],[1,3,1,"","sum_primal_infeasibilities"],[1,3,1,"","sum_primal_residual"],[1,3,1,"","sum_pwl_slack_infeasibility"],[1,3,1,"","sum_quadratic_primal_residual"],[1,3,1,"","sum_quadratic_slack"],[1,3,1,"","sum_quadratic_slack_infeasibility"],[1,3,1,"","sum_reduced_cost"],[1,3,1,"","sum_scaled_dual_infeasibilities"],[1,3,1,"","sum_scaled_dual_residual"],[1,3,1,"","sum_scaled_pi"],[1,3,1,"","sum_scaled_primal_infeasibilities"],[1,3,1,"","sum_scaled_primal_residual"],[1,3,1,"","sum_scaled_reduced_cost"],[1,3,1,"","sum_scaled_slack"],[1,3,1,"","sum_scaled_x"],[1,3,1,"","sum_slack"],[1,3,1,"","sum_x"]],"cplex._internal._subinterfaces.QualityMetrics":[[1,2,1,"","__init__"],[1,2,1,"","__str__"]],"cplex._internal._subinterfaces.SOSInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,2,1,"","delete"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_members"],[1,2,1,"","get_sets"],[1,2,1,"","get_types"],[1,3,1,"","type"]],"cplex._internal._subinterfaces.SOSType":[[1,3,1,"","SOS1"],[1,3,1,"","SOS2"]],"cplex._internal._subinterfaces.SensitivityInterface":[[1,2,1,"","__init__"],[1,2,1,"","bounds"],[1,2,1,"","lower_bounds"],[1,2,1,"","objective"],[1,2,1,"","rhs"],[1,2,1,"","upper_bounds"]],"cplex._internal._subinterfaces.SolnPoolFilterInterface":[[1,2,1,"","__init__"],[1,2,1,"","add_diversity_filter"],[1,2,1,"","add_range_filter"],[1,2,1,"","delete"],[1,2,1,"","get_bounds"],[1,2,1,"","get_diversity_filters"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_nonzeros"],[1,2,1,"","get_range_filters"],[1,2,1,"","get_types"],[1,2,1,"","read"],[1,3,1,"","type"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolnPoolInterface":[[1,2,1,"","__init__"],[1,2,1,"","delete"],[1,3,1,"","filter"],[1,2,1,"","get_float_quality"],[1,2,1,"","get_integer_quality"],[1,2,1,"","get_linear_slacks"],[1,2,1,"","get_mean_objective_value"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_replaced"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_quadratic_slacks"],[1,2,1,"","get_quality_metrics"],[1,2,1,"","get_values"],[1,3,1,"","incumbent"],[1,3,1,"","quality_metric"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolutionInterface":[[1,3,1,"","MIP"],[1,2,1,"","__init__"],[1,3,1,"","advanced"],[1,3,1,"","basis"],[1,2,1,"","get_activity_levels"],[1,2,1,"","get_dual_values"],[1,2,1,"","get_float_quality"],[1,2,1,"","get_indicator_slacks"],[1,2,1,"","get_integer_quality"],[1,2,1,"","get_linear_slacks"],[1,2,1,"","get_method"],[1,2,1,"","get_objective_value"],[1,2,1,"","get_quadratic_activity_levels"],[1,2,1,"","get_quadratic_dualslack"],[1,2,1,"","get_quadratic_slacks"],[1,2,1,"","get_quality_metrics"],[1,2,1,"","get_reduced_costs"],[1,2,1,"","get_solution_type"],[1,2,1,"","get_status"],[1,2,1,"","get_status_string"],[1,2,1,"","get_values"],[1,3,1,"","infeasibility"],[1,2,1,"","is_dual_feasible"],[1,2,1,"","is_primal_feasible"],[1,3,1,"","method"],[1,3,1,"","multiobj"],[1,3,1,"","pool"],[1,3,1,"","progress"],[1,3,1,"","quality_metric"],[1,3,1,"","sensitivity"],[1,3,1,"","status"],[1,3,1,"","type"],[1,2,1,"","write"]],"cplex._internal._subinterfaces.SolutionMethod":[[1,3,1,"","MIP"],[1,3,1,"","barrier"],[1,3,1,"","dual"],[1,3,1,"","feasopt"],[1,3,1,"","none"],[1,3,1,"","pivot"],[1,3,1,"","pivot_in"],[1,3,1,"","pivot_out"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.SolutionStatus":[[1,3,1,"","MIP_abort_feasible"],[1,3,1,"","MIP_abort_infeasible"],[1,3,1,"","MIP_dettime_limit_feasible"],[1,3,1,"","MIP_dettime_limit_infeasible"],[1,3,1,"","MIP_feasible"],[1,3,1,"","MIP_feasible_relaxed_inf"],[1,3,1,"","MIP_feasible_relaxed_quad"],[1,3,1,"","MIP_feasible_relaxed_sum"],[1,3,1,"","MIP_infeasible"],[1,3,1,"","MIP_infeasible_or_unbounded"],[1,3,1,"","MIP_optimal"],[1,3,1,"","MIP_optimal_infeasible"],[1,3,1,"","MIP_optimal_relaxed_inf"],[1,3,1,"","MIP_optimal_relaxed_quad"],[1,3,1,"","MIP_optimal_relaxed_sum"],[1,3,1,"","MIP_time_limit_feasible"],[1,3,1,"","MIP_time_limit_infeasible"],[1,3,1,"","MIP_unbounded"],[1,3,1,"","abort_dettime_limit"],[1,3,1,"","abort_dual_obj_limit"],[1,3,1,"","abort_iteration_limit"],[1,3,1,"","abort_obj_limit"],[1,3,1,"","abort_primal_obj_limit"],[1,3,1,"","abort_relaxed"],[1,3,1,"","abort_time_limit"],[1,3,1,"","abort_user"],[1,3,1,"","benders_num_best"],[1,3,1,"","conflict_abort_contradiction"],[1,3,1,"","conflict_abort_dettime_limit"],[1,3,1,"","conflict_abort_iteration_limit"],[1,3,1,"","conflict_abort_memory_limit"],[1,3,1,"","conflict_abort_node_limit"],[1,3,1,"","conflict_abort_obj_limit"],[1,3,1,"","conflict_abort_time_limit"],[1,3,1,"","conflict_abort_user"],[1,3,1,"","conflict_feasible"],[1,3,1,"","conflict_minimal"],[1,3,1,"","fail_feasible"],[1,3,1,"","fail_feasible_no_tree"],[1,3,1,"","fail_infeasible"],[1,3,1,"","fail_infeasible_no_tree"],[1,3,1,"","feasible"],[1,3,1,"","feasible_relaxed_inf"],[1,3,1,"","feasible_relaxed_quad"],[1,3,1,"","feasible_relaxed_sum"],[1,3,1,"","first_order"],[1,3,1,"","infeasible"],[1,3,1,"","infeasible_or_unbounded"],[1,3,1,"","mem_limit_feasible"],[1,3,1,"","mem_limit_infeasible"],[1,3,1,"","multiobj_infeasible"],[1,3,1,"","multiobj_inforunbd"],[1,3,1,"","multiobj_non_optimal"],[1,3,1,"","multiobj_optimal"],[1,3,1,"","multiobj_stopped"],[1,3,1,"","multiobj_unbounded"],[1,3,1,"","node_limit_feasible"],[1,3,1,"","node_limit_infeasible"],[1,3,1,"","num_best"],[1,3,1,"","optimal"],[1,3,1,"","optimal_face_unbounded"],[1,3,1,"","optimal_infeasible"],[1,3,1,"","optimal_populated"],[1,3,1,"","optimal_populated_tolerance"],[1,3,1,"","optimal_relaxed_inf"],[1,3,1,"","optimal_relaxed_quad"],[1,3,1,"","optimal_relaxed_sum"],[1,3,1,"","optimal_tolerance"],[1,3,1,"","populate_solution_limit"],[1,3,1,"","relaxation_unbounded"],[1,3,1,"","solution_limit"],[1,3,1,"","unbounded"],[1,3,1,"","unknown"]],"cplex._internal._subinterfaces.SolutionType":[[1,3,1,"","basic"],[1,3,1,"","nonbasic"],[1,3,1,"","none"],[1,3,1,"","primal"]],"cplex._internal._subinterfaces.VarTypes":[[1,3,1,"","binary"],[1,3,1,"","continuous"],[1,3,1,"","integer"],[1,3,1,"","semi_continuous"],[1,3,1,"","semi_integer"]],"cplex._internal._subinterfaces.VariablesInterface":[[1,2,1,"","__init__"],[1,2,1,"","add"],[1,3,1,"","advanced"],[1,2,1,"","delete"],[1,2,1,"","get_cols"],[1,2,1,"","get_histogram"],[1,2,1,"","get_lower_bounds"],[1,2,1,"","get_names"],[1,2,1,"","get_num"],[1,2,1,"","get_num_binary"],[1,2,1,"","get_num_integer"],[1,2,1,"","get_num_semicontinuous"],[1,2,1,"","get_num_semiinteger"],[1,2,1,"","get_types"],[1,2,1,"","get_upper_bounds"],[1,2,1,"","set_lower_bounds"],[1,2,1,"","set_names"],[1,2,1,"","set_types"],[1,2,1,"","set_upper_bounds"],[1,3,1,"","type"]],"cplex.aborter":[[0,1,1,"","Aborter"]],"cplex.aborter.Aborter":[[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","clear"],[0,2,1,"","end"],[0,2,1,"","is_aborted"]],"cplex.callbacks":[[0,1,1,"","BarrierCallback"],[0,1,1,"","BranchCallback"],[0,1,1,"","BranchType"],[0,1,1,"","Callback"],[0,1,1,"","Context"],[0,1,1,"","ContextType"],[0,1,1,"","ContinuousCallback"],[0,1,1,"","ControlCallback"],[0,1,1,"","CrossoverCallback"],[0,1,1,"","CutCallback"],[0,1,1,"","CutType"],[0,1,1,"","FeasibilityStatus"],[0,1,1,"","HSCallback"],[0,1,1,"","HeuristicCallback"],[0,1,1,"","IncumbentCallback"],[0,1,1,"","LazyConstraintCallback"],[0,1,1,"","MIPCallback"],[0,1,1,"","MIPInfoCallback"],[0,1,1,"","MethodType"],[0,1,1,"","NodeCallback"],[0,1,1,"","OptimizationCallback"],[0,1,1,"","QualityMetric"],[0,1,1,"","RelaxationFlags"],[0,1,1,"","SimplexCallback"],[0,1,1,"","SolutionSource"],[0,1,1,"","SolveCallback"],[0,1,1,"","TuningCallback"],[0,1,1,"","UseConstraint"],[0,1,1,"","UseCut"],[0,1,1,"","UserCutCallback"]],"cplex.callbacks.BarrierCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_dual_objective_value"]],"cplex.callbacks.BranchCallback":[[0,2,1,"","__init__"],[0,3,1,"","branch_type"],[0,2,1,"","get_branch"],[0,2,1,"","get_branch_type"],[0,2,1,"","get_num_branches"],[0,2,1,"","is_integer_feasible"],[0,2,1,"","make_branch"],[0,2,1,"","make_cplex_branch"],[0,2,1,"","prune"]],"cplex.callbacks.BranchType":[[0,3,1,"","SOS1"],[0,3,1,"","SOS2"],[0,3,1,"","any"],[0,3,1,"","variable"]],"cplex.callbacks.Callback":[[0,2,1,"","__call__"],[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","get_dettime"],[0,2,1,"","get_end_dettime"],[0,2,1,"","get_end_time"],[0,2,1,"","get_start_dettime"],[0,2,1,"","get_start_time"],[0,2,1,"","get_time"]],"cplex.callbacks.Context":[[0,2,1,"","__init__"],[0,2,1,"","abort"],[0,2,1,"","add_user_cut"],[0,2,1,"","add_user_cuts"],[0,2,1,"","exit_cut_loop"],[0,2,1,"","get_candidate_objective"],[0,2,1,"","get_candidate_point"],[0,2,1,"","get_candidate_ray"],[0,2,1,"","get_candidate_source"],[0,2,1,"","get_double_info"],[0,2,1,"","get_global_lower_bounds"],[0,2,1,"","get_global_upper_bounds"],[0,2,1,"","get_id"],[0,2,1,"","get_incumbent"],[0,2,1,"","get_incumbent_objective"],[0,2,1,"","get_int_info"],[0,2,1,"","get_local_lower_bounds"],[0,2,1,"","get_local_upper_bounds"],[0,2,1,"","get_long_info"],[0,2,1,"","get_relaxation_objective"],[0,2,1,"","get_relaxation_point"],[0,2,1,"","get_relaxation_status"],[0,3,1,"","id"],[0,2,1,"","in_branching"],[0,2,1,"","in_candidate"],[0,2,1,"","in_global_progress"],[0,2,1,"","in_local_progress"],[0,2,1,"","in_relaxation"],[0,2,1,"","in_thread_down"],[0,2,1,"","in_thread_up"],[0,3,1,"","info"],[0,2,1,"","is_candidate_point"],[0,2,1,"","is_candidate_ray"],[0,2,1,"","make_branch"],[0,2,1,"","post_heuristic_solution"],[0,2,1,"","prune_current_node"],[0,2,1,"","reject_candidate"],[0,2,1,"","reject_candidate_local"],[0,3,1,"","relaxation_flags"],[0,3,1,"","solution_status"],[0,3,1,"","solution_strategy"]],"cplex.callbacks.ContextType":[[0,3,1,"","branching"],[0,3,1,"","candidate"],[0,3,1,"","global_progress"],[0,3,1,"","local_progress"],[0,3,1,"","relaxation"],[0,3,1,"","thread_down"],[0,3,1,"","thread_up"]],"cplex.callbacks.ContinuousCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_dual_infeasibility"],[0,2,1,"","get_num_iterations"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_primal_infeasibility"],[0,2,1,"","is_dual_feasible"],[0,2,1,"","is_primal_feasible"]],"cplex.callbacks.ControlCallback":[[0,2,1,"","__init__"],[0,3,1,"","feasibility_status"],[0,2,1,"","get_SOS_feasibilities"],[0,2,1,"","get_feasibilities"],[0,2,1,"","get_linear_slacks"],[0,2,1,"","get_lower_bounds"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_pseudo_costs"],[0,2,1,"","get_quadratic_slacks"],[0,2,1,"","get_upper_bounds"],[0,2,1,"","get_values"],[0,2,1,"","set_node_data"]],"cplex.callbacks.CrossoverCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_num_dual_exchanges"],[0,2,1,"","get_num_dual_pushes"],[0,2,1,"","get_num_primal_exchanges"],[0,2,1,"","get_num_primal_pushes"],[0,2,1,"","get_num_superbasics"]],"cplex.callbacks.CutType":[[0,3,1,"","GUB_cover"],[0,3,1,"","MIR"],[0,3,1,"","benders"],[0,3,1,"","clique"],[0,3,1,"","cover"],[0,3,1,"","disjunctive"],[0,3,1,"","flow_cover"],[0,3,1,"","flow_path"],[0,3,1,"","fractional"],[0,3,1,"","implied_bound"],[0,3,1,"","lift_and_project"],[0,3,1,"","multi_commodity_flow"],[0,3,1,"","solution_pool"],[0,3,1,"","table"],[0,3,1,"","user"],[0,3,1,"","zero_half"]],"cplex.callbacks.FeasibilityStatus":[[0,3,1,"","feasible"],[0,3,1,"","implied_feasible"],[0,3,1,"","infeasible"]],"cplex.callbacks.HSCallback":[[0,2,1,"","get_cplex_status"],[0,2,1,"","is_dual_feasible"],[0,2,1,"","is_primal_feasible"],[0,3,1,"","method"],[0,2,1,"","solve"],[0,3,1,"","status"]],"cplex.callbacks.HeuristicCallback":[[0,2,1,"","__init__"],[0,2,1,"","set_bounds"],[0,2,1,"","set_solution"]],"cplex.callbacks.IncumbentCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_linear_slacks"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_objective_value"],[0,2,1,"","get_quadratic_slacks"],[0,2,1,"","get_solution_source"],[0,2,1,"","get_values"],[0,2,1,"","reject"],[0,2,1,"","set_node_data"],[0,3,1,"","solution_source"]],"cplex.callbacks.LazyConstraintCallback":[[0,2,1,"","__init__"],[0,2,1,"","add"],[0,2,1,"","add_local"],[0,2,1,"","get_solution_source"],[0,2,1,"","is_unbounded_node"],[0,3,1,"","use_constraint"]],"cplex.callbacks.MIPCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_current_node_depth"],[0,2,1,"","get_objective_coefficients"]],"cplex.callbacks.MIPInfoCallback":[[0,2,1,"","__init__"],[0,3,1,"","cut_type"],[0,2,1,"","get_MIP_relative_gap"],[0,2,1,"","get_best_objective_value"],[0,2,1,"","get_cutoff"],[0,2,1,"","get_float_quality"],[0,2,1,"","get_incumbent_linear_slacks"],[0,2,1,"","get_incumbent_objective_value"],[0,2,1,"","get_incumbent_quadratic_slacks"],[0,2,1,"","get_incumbent_values"],[0,2,1,"","get_num_cols"],[0,2,1,"","get_num_cuts"],[0,2,1,"","get_num_iterations"],[0,2,1,"","get_num_nodes"],[0,2,1,"","get_num_quadratic_constraints"],[0,2,1,"","get_num_remaining_nodes"],[0,2,1,"","get_num_rows"],[0,2,1,"","get_thread_num"],[0,2,1,"","has_incumbent"],[0,3,1,"","quality_metric"]],"cplex.callbacks.MethodType":[[0,3,1,"","barrier"],[0,3,1,"","dual"],[0,3,1,"","network"],[0,3,1,"","primal"]],"cplex.callbacks.NodeCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_branch_variable"],[0,2,1,"","get_current_node_depth"],[0,2,1,"","get_depth"],[0,2,1,"","get_estimated_objective_value"],[0,2,1,"","get_infeasibility_sum"],[0,2,1,"","get_node_ID"],[0,2,1,"","get_node_data"],[0,2,1,"","get_node_number"],[0,2,1,"","get_num_infeasibilities"],[0,2,1,"","get_objective_value"],[0,2,1,"","select_node"],[0,2,1,"","set_node_data"]],"cplex.callbacks.OptimizationCallback":[[0,2,1,"","get_num_cols"],[0,2,1,"","get_num_quadratic_constraints"],[0,2,1,"","get_num_rows"]],"cplex.callbacks.QualityMetric":[[0,3,1,"","kappa_attention"],[0,3,1,"","kappa_illposed"],[0,3,1,"","kappa_max"],[0,3,1,"","kappa_stable"],[0,3,1,"","kappa_suspicious"],[0,3,1,"","kappa_unstable"]],"cplex.callbacks.RelaxationFlags":[[0,3,1,"","no_solve"]],"cplex.callbacks.SimplexCallback":[[0,2,1,"","__init__"]],"cplex.callbacks.SolutionSource":[[0,3,1,"","heuristic_solution"],[0,3,1,"","mipstart_solution"],[0,3,1,"","node_solution"],[0,3,1,"","user_solution"]],"cplex.callbacks.SolveCallback":[[0,2,1,"","__init__"],[0,2,1,"","set_start"],[0,2,1,"","use_solution"]],"cplex.callbacks.TuningCallback":[[0,2,1,"","__init__"],[0,2,1,"","get_progress"]],"cplex.callbacks.UseConstraint":[[0,3,1,"","force"],[0,3,1,"","purge"]],"cplex.callbacks.UseCut":[[0,3,1,"","filter"],[0,3,1,"","force"],[0,3,1,"","purge"]],"cplex.callbacks.UserCutCallback":[[0,2,1,"","__init__"],[0,2,1,"","abort_cut_loop"],[0,2,1,"","add"],[0,2,1,"","add_local"],[0,2,1,"","is_after_cut_loop"],[0,3,1,"","use_cut"]],"cplex.constant_class":[[0,1,1,"","ConstantClass"]],"cplex.constant_class.ConstantClass":[[0,2,1,"","__getitem__"],[0,2,1,"","__init__"],[0,2,1,"","__iter__"]],"cplex.exceptions":[[0,5,1,"","CplexError"],[0,5,1,"","CplexSolverError"],[0,5,1,"","ErrorChannelMessage"],[0,5,1,"","WrongNumberOfArgumentsError"]],"cplex.model_info":[[0,6,1,"","CPXMI_BIGM_COEF"],[0,6,1,"","CPXMI_BIGM_TO_IND"],[0,6,1,"","CPXMI_BIGM_VARBOUND"],[0,6,1,"","CPXMI_CANCEL_TOL"],[0,6,1,"","CPXMI_EPGAP_LARGE"],[0,6,1,"","CPXMI_EPGAP_OBJOFFSET"],[0,6,1,"","CPXMI_FEAS_TOL"],[0,6,1,"","CPXMI_FRACTION_SCALING"],[0,6,1,"","CPXMI_IND_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_IND_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_IND_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_IND_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_KAPPA_ILLPOSED"],[0,6,1,"","CPXMI_KAPPA_SUSPICIOUS"],[0,6,1,"","CPXMI_KAPPA_UNSTABLE"],[0,6,1,"","CPXMI_LB_LARGE_NUM"],[0,6,1,"","CPXMI_LB_SMALL_NUM"],[0,6,1,"","CPXMI_LC_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_LC_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_LC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_LC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_MULTIOBJ_COEFFS"],[0,6,1,"","CPXMI_MULTIOBJ_LARGE_NUM"],[0,6,1,"","CPXMI_MULTIOBJ_MIX"],[0,6,1,"","CPXMI_MULTIOBJ_OPT_TOL"],[0,6,1,"","CPXMI_MULTIOBJ_SMALL_NUM"],[0,6,1,"","CPXMI_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_OBJ_LARGE_NUM"],[0,6,1,"","CPXMI_OBJ_SMALL_NUM"],[0,6,1,"","CPXMI_OPT_TOL"],[0,6,1,"","CPXMI_PWL_SLOPE_LARGE_NUM"],[0,6,1,"","CPXMI_PWL_SLOPE_SMALL_NUM"],[0,6,1,"","CPXMI_QC_LINNZ_LARGE_NUM"],[0,6,1,"","CPXMI_QC_LINNZ_SMALL_NUM"],[0,6,1,"","CPXMI_QC_QNZ_LARGE_NUM"],[0,6,1,"","CPXMI_QC_QNZ_SMALL_NUM"],[0,6,1,"","CPXMI_QC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_QC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_QOBJ_LARGE_NUM"],[0,6,1,"","CPXMI_QOBJ_SMALL_NUM"],[0,6,1,"","CPXMI_QOPT_TOL"],[0,6,1,"","CPXMI_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_SAMECOEFF_COL"],[0,6,1,"","CPXMI_SAMECOEFF_IND"],[0,6,1,"","CPXMI_SAMECOEFF_LAZY"],[0,6,1,"","CPXMI_SAMECOEFF_MULTIOBJ"],[0,6,1,"","CPXMI_SAMECOEFF_OBJ"],[0,6,1,"","CPXMI_SAMECOEFF_QLIN"],[0,6,1,"","CPXMI_SAMECOEFF_QUAD"],[0,6,1,"","CPXMI_SAMECOEFF_RHS"],[0,6,1,"","CPXMI_SAMECOEFF_ROW"],[0,6,1,"","CPXMI_SAMECOEFF_UCUT"],[0,6,1,"","CPXMI_SINGLE_PRECISION"],[0,6,1,"","CPXMI_SYMMETRY_BREAKING_INEQ"],[0,6,1,"","CPXMI_UB_LARGE_NUM"],[0,6,1,"","CPXMI_UB_SMALL_NUM"],[0,6,1,"","CPXMI_UC_NZ_LARGE_NUM"],[0,6,1,"","CPXMI_UC_NZ_SMALL_NUM"],[0,6,1,"","CPXMI_UC_RHS_LARGE_NUM"],[0,6,1,"","CPXMI_UC_RHS_SMALL_NUM"],[0,6,1,"","CPXMI_WIDE_COEFF_RANGE"]],"cplex.paramset":[[0,1,1,"","ParameterSet"]],"cplex.paramset.ParameterSet":[[0,2,1,"","__del__"],[0,2,1,"","__enter__"],[0,2,1,"","__exit__"],[0,2,1,"","__init__"],[0,2,1,"","__len__"],[0,2,1,"","add"],[0,2,1,"","clear"],[0,2,1,"","delete"],[0,2,1,"","end"],[0,2,1,"","get"],[0,2,1,"","get_ids"],[0,2,1,"","read"],[0,2,1,"","write"]]},"objnames":{"0":["py","module","Python module"],"1":["py","class","Python class"],"2":["py","method","Python method"],"3":["py","attribute","Python attribute"],"4":["py","function","Python function"],"5":["py","exception","Python exception"],"6":["py","data","Python data"]},"objtypes":{"0":"py:module","1":"py:class","2":"py:method","3":"py:attribute","4":"py:function","5":"py:exception","6":"py:data"},"terms":{"1e":[0,1],"1e75":0,"32bit":0,"64bit":0,"A":[0,1],"After":[0,1],"All":[0,1],"An":[0,1],"As":[0,2],"At":0,"By":[0,1],"Do":0,"Each":[0,1],"For":[0,1,2],"I":1,"If":[0,1,2],"In":[0,1],"It":[0,1,2],"Most":0,"OR":0,"Some":1,"Such":[0,1],"That":[0,1],"The":[0,1,2],"Then":0,"There":[0,1],"These":[0,1,2],"They":0,"This":[0,1,2],"Those":1,"To":[0,1,2],"When":[0,1],"With":0,"You":[0,2],"_":1,"__call__":[0,1],"__conditionally_convert":0,"__del__":[0,1,3],"__enter__":[0,3],"__exit__":[0,3],"__getitem__":[0,1],"__init__":[0,1,3],"__iter__":0,"__len__":[0,3],"__repr__":[0,1,3],"__str__":[0,1,3],"_anno":0,"_aux_funct":0,"_baseinterfac":0,"_c_hb_matrix":1,"_callbackinfoenum":0,"_constant":0,"_constantsenum":0,"_get":1,"_get_info":1,"_get_node_info":0,"_get_seq_info":0,"_group":1,"_hb_matrix":1,"_intern":[0,2,3],"_list_array_util":1,"_matric":0,"_multiobj":0,"_multiobjsoln":0,"_ostream":1,"_parameter_class":0,"_procedur":0,"_pwl":0,"_set":1,"_solutionstrategyenum":0,"_subinterfac":0,"_wherefrom":0,"ab":1,"abnorm":0,"abort":[1,3],"abort_cut_loop":0,"abort_dettime_limit":1,"abort_dual_obj_limit":1,"abort_iteration_limit":1,"abort_obj_limit":1,"abort_primal_obj_limit":1,"abort_relax":1,"abort_time_limit":1,"abort_us":1,"abov":1,"absmipgap":1,"absolut":[0,1],"abstol":1,"accept":[0,1],"access":[0,1,2],"accomplish":1,"across":0,"action":0,"activ":[1,2],"actual":0,"add":[0,1,2,3],"add_batch":1,"add_diversity_filt":1,"add_lazy_constraint":1,"add_loc":0,"add_range_filt":1,"add_row":1,"add_user_cut":[0,1],"addcol":[0,1],"addfuncdest":[0,1],"addindconstr":[0,1],"addit":[0,1],"addlazyconstraint":[0,1],"addmipstart":[0,1],"addpwl":[0,1],"addqconstr":[0,1],"address":0,"addrow":[0,1],"addso":[0,1],"addsolnpooldivfilt":[0,1],"addsolnpoolrngfilt":[0,1],"addusercut":[0,1],"admipex1":0,"admipex2":0,"admipex3":0,"admipex5":0,"admipex6":0,"admipex8":0,"admipex9":0,"advanc":[0,1,3],"advance_const":[0,1],"advancedcplexinterfac":[0,1],"advancedlinearconstraintinterfac":[0,1],"advancedsolutioninterfac":[0,1],"advancedvariablesinterfac":[0,1],"advis":2,"affect":0,"agg_const":[0,1],"aggreg":1,"aggress":1,"aid":1,"alg":0,"alg_const":[0,1],"algorithm":[0,1],"all_constraint":1,"all_vari":1,"allow":[0,1,2],"allow_empti":1,"allslack":1,"allval":1,"alp":0,"alreadi":[0,1],"also":[0,1,2],"alter":0,"altern":[0,1],"alway":[0,1],"among":[0,1],"amount":1,"anaconda":2,"analysi":1,"ani":[0,1],"ann":[0,1],"ann1":[0,1],"ann2":1,"ann3":1,"ann4":1,"ann5":1,"annot":[0,1],"annotationinterfac":[0,1],"annotationobjecttyp":[0,1],"anoth":0,"api":[0,1],"appear":0,"appli":[0,1],"applic":2,"apply_freeform_one_arg":[0,1],"apply_freeform_two_arg":[0,1],"apply_pair":[0,1],"appropri":2,"approx_min_degre":1,"approx_min_fil":1,"arbitrari":1,"arbitrarili":1,"arg":[0,1],"arg_list":1,"argument":[0,1],"array":0,"ask":0,"aspect":0,"assign":[0,1],"assist":[0,1],"associ":[0,1,2],"assum":[0,2],"assumpt":1,"at_all_nod":1,"at_lower_bound":1,"at_root":1,"at_upper_bound":1,"attach":0,"attempt":[0,1],"attribut":[0,1,2],"augment":1,"author":0,"auto":[0,1],"auto_off_on_const":[0,1],"automat":[0,1],"auxiliari":1,"avail":1,"averag":1,"average_primal_estimated_du":1,"average_primal_zero_du":1,"avoid":0,"b":[0,1],"backward":1,"balanc":1,"bar_alg_const":[0,1],"bar_order_const":[0,1],"bar_start_alg_const":[0,1],"baropt":[0,1],"barrier":[0,1],"barriercallback":[0,3],"bas":1,"base":[0,1],"baseinterfac":[0,1],"basi":[0,1],"basic":1,"basic_presolv":1,"basic_vari":1,"basicpresolv":[0,1],"basisinterfac":[0,1],"basisvarstatus":[0,1],"batch":1,"bb":1,"bbtran":1,"bd":1,"becaus":0,"becom":0,"befor":[0,1],"beg":1,"begin":[0,1],"begin_and_end":1,"behavior":0,"belong":0,"bender":[0,1],"benders_annot":1,"benders_mastervalu":1,"benders_num_best":1,"benders_strategy_const":[0,1],"bendersatsp":0,"bendersatsp2":0,"best":[0,1],"best_bound":1,"best_estim":1,"best_estimate_alt":1,"best_obj":1,"best_object":1,"better":0,"binari":[0,1],"bind":0,"binvacol":[0,1],"binvarow":[0,1],"binvcol":[0,1],"binvrow":[0,1],"bit":0,"bitwis":0,"blend":1,"block":0,"bnd":0,"boolean":0,"bound":[0,1],"bound_constraint":1,"boundsa":[0,1],"boundsa_low":[0,1],"boundsa_upp":[0,1],"bqp":1,"branch":[0,1],"branch_direct":1,"branch_typ":0,"branchcallback":[0,3],"branchcallbackbranchascplex":[0,1],"branchcallbackbranchgener":[0,1],"branchdirect":[0,1],"branchtyp":[0,3],"brdir_const":[0,1],"breaki":1,"breakpoint":1,"breakx":1,"brows":2,"btran":[0,1],"build":0,"bupper":1,"byte":0,"bz2":0,"bzip2":0,"c":[0,1],"c0":1,"c1":[0,1],"c10":1,"c13":1,"c2":[0,1],"c21":1,"c3":1,"c4":1,"c5":1,"c6":1,"c7":1,"c8":1,"c9":1,"c_stat":1,"c_type":1,"cach":1,"calcul":0,"call":[0,1],"callabl":[0,1,2],"callback":[1,3],"callback_class":[0,1],"callbackabort":[0,1],"callbackaddusercut":[0,1],"callbackcandidateispoint":[0,1],"callbackcandidateisray":[0,1],"callbackexitcutloop":[0,1],"callbackgetcandidateobj":[0,1],"callbackgetcandidatepoint":[0,1],"callbackgetcandidateray":[0,1],"callbackgetgloballb":[0,1],"callbackgetglobalub":[0,1],"callbackgetincumb":[0,1],"callbackgetincumbentobj":[0,1],"callbackgetinfodbl":[0,1],"callbackgetinfoint":[0,1],"callbackgetinfolong":[0,1],"callbackgetlocallb":[0,1],"callbackgetlocalub":[0,1],"callbackgetrelaxationpoint":[0,1],"callbackgetrelaxationpointobj":[0,1],"callbackgetrelaxationstatus":[0,1],"callbackinfo":0,"callbackmakebranch":[0,1],"callbackpostheursoln":[0,1],"callbackprunenod":[0,1],"callbackrejectcandid":[0,1],"callbackrejectcandidateloc":[0,1],"callbacksetnodeuserhandl":[0,1],"callbacksetuserhandl":[0,1],"caller":1,"can":[0,1,2],"candid":0,"cardls_const":[0,1],"care":0,"case":[0,1],"categori":0,"cb":0,"cb_geterrorstr":[0,1],"cbhandl":1,"cbstruct":1,"ccnt":1,"cdual":1,"certain":0,"chang":[0,1],"channel":[0,1,2],"charact":[0,1],"chbmatrix":[0,1],"check":[0,1],"check_feas":1,"chgbds":[0,1],"chgcoeflist":[0,1],"chgcolnam":[0,1],"chgctype":[0,1],"chgmipstart":[0,1],"chgobj":[0,1],"chgobjoffset":[0,1],"chgobjsen":[0,1],"chgprobnam":[0,1],"chgprobtyp":[0,1],"chgprobtypesolnpool":[0,1],"chgqpcoef":[0,1],"chgrhs":[0,1],"chgrngval":[0,1],"chgrownam":[0,1],"chgsens":[0,1],"child":0,"children":0,"choos":0,"circumst":0,"class":[0,1,2],"claus":0,"cleanup":[0,1,3],"clear":[0,3],"cliqu":[0,1],"clist":1,"clock":0,"clocktyp":0,"clocktype_const":[0,1],"cloneprob":[0,1],"closecplex":[0,1],"clp":1,"clpwrite":[0,1],"cmat":1,"cnt":[0,1],"code":[0,1],"coeffici":[0,1],"coeffreduce_const":[0,1],"col":1,"col_dual":1,"col_prim":1,"col_status":1,"collist":1,"colnam":[0,1],"column":[0,1],"column_complementarity_max":1,"column_complementarity_tot":1,"combin":[0,1],"come":2,"command":[0,1,2],"common":1,"communiti":2,"compar":0,"compat":0,"complement":1,"complementarity_tot":1,"complet":[0,1,2],"completelp":[0,1],"compon":1,"compos":2,"compress":0,"comptyp":0,"comput":[0,1],"concaten":0,"concurr":[0,1],"conda":2,"condit":1,"cone":1,"config":2,"conflict":[0,1,3],"conflict_abort_contradict":1,"conflict_abort_dettime_limit":1,"conflict_abort_iteration_limit":1,"conflict_abort_memory_limit":1,"conflict_abort_node_limit":1,"conflict_abort_obj_limit":1,"conflict_abort_time_limit":1,"conflict_abort_us":1,"conflict_algorithm_const":[0,1],"conflict_feas":1,"conflict_minim":1,"conflictconstrainttyp":[0,1],"conflictinterfac":[0,1],"conflictstatus":[0,1],"confstatus":1,"consecut":1,"consequ":0,"consid":[0,1],"consider":0,"consist":[0,1],"constant":[0,1],"constant_class":[1,3],"constantclass":[0,1,3],"constraint":[0,1,2],"constraint_typ":1,"constructor":[0,1],"consum":[0,1],"contain":[0,1],"content":0,"context":[0,1,3],"contextid":0,"contextmask":[0,1],"contextptr":[0,1],"contexttyp":[0,3],"continu":[0,1],"continuouscallback":[0,3],"control":[0,1],"controlcallback":[0,3],"conv":1,"conveni":0,"convert":[0,1],"convert_sequ":[0,1],"coordin":1,"copi":[0,1],"copy_parameter_set":[0,3],"copylp":[0,3],"copylpwnam":[0,1],"copyobjnam":[0,1],"copyord":[0,1],"copyprotect":[0,1],"copyqpsep":[0,1],"copyquad":[0,1],"copystart":[0,1],"core":[0,1],"correct":2,"correspond":[0,1,2],"cost":[0,1],"count":[0,1],"cover":[0,1],"cp":2,"cplexerror":[0,3],"cplexsolvererror":[0,3],"cprim":1,"cpu":[0,1],"cpx":[0,1],"cpx_callback_info_my_thread_num":0,"cpx_callbackcontext_branch":0,"cpx_callbackcontext_candid":0,"cpx_callbackcontext_global_progress":0,"cpx_callbackcontext_local_progress":0,"cpx_callbackcontext_relax":0,"cpx_callbackcontext_thread_down":0,"cpx_callbackcontext_thread_up":0,"cpx_incumbent_id":1,"cpx_indicator_if":1,"cpx_indicator_ifandonlyif":1,"cpx_indicator_onlyif":1,"cpx_infbound":0,"cpx_max":1,"cpx_min":1,"cpx_multiobj_baritcnt":1,"cpx_multiobj_bestobjv":1,"cpx_multiobj_blend":1,"cpx_multiobj_degcnt":1,"cpx_multiobj_dettim":1,"cpx_multiobj_dexch":1,"cpx_multiobj_dfea":1,"cpx_multiobj_dpush":1,"cpx_multiobj_error":1,"cpx_multiobj_itcnt":1,"cpx_multiobj_method":1,"cpx_multiobj_nodecnt":1,"cpx_multiobj_nodeleftcnt":1,"cpx_multiobj_objv":1,"cpx_multiobj_pexch":1,"cpx_multiobj_pfea":1,"cpx_multiobj_phase1cnt":1,"cpx_multiobj_ppush":1,"cpx_multiobj_prior":1,"cpx_multiobj_siftitcnt":1,"cpx_multiobj_siftphase1cnt":1,"cpx_multiobj_status":1,"cpx_multiobj_tim":1,"cpx_no_vari":1,"cpx_param_advind":0,"cpx_param_datacheck":0,"cpx_param_warnlim":0,"cpx_prereduce_noprimalordu":0,"cpx_prereduce_primalon":0,"cpx_relaxation_flag_nosolv":0,"cpxbasicpresolv":1,"cpxbenderspartit":1,"cpxcallbackabort":0,"cpxcallbackaddusercut":0,"cpxcallbackcandidateispoint":0,"cpxcallbackcandidateisray":0,"cpxcallbackexitcutloop":0,"cpxcallbackgetcandidatepoint":0,"cpxcallbackgetcandidateray":0,"cpxcallbackgetgloballb":0,"cpxcallbackgetglobalub":0,"cpxcallbackgetincumb":0,"cpxcallbackgetinfodbl":0,"cpxcallbackgetinfoint":0,"cpxcallbackgetinfolong":0,"cpxcallbackgetlocallb":0,"cpxcallbackgetlocalub":0,"cpxcallbackgetrelaxationpoint":0,"cpxcallbackgetrelaxationstatus":0,"cpxcallbackmakebranch":0,"cpxcallbackpostheursoln":0,"cpxcallbackprunenod":0,"cpxcallbackrejectcandid":0,"cpxcallbackrejectcandidateloc":0,"cpxcallbacksetfunc":0,"cpxcallbacksolution_checkfea":1,"cpxcallbacksolution_nocheck":1,"cpxcallbacksolution_propag":1,"cpxcallbacksolution_solv":1,"cpxcallbacksolutionstrategi":1,"cpxchgprobnam":0,"cpxchgprobtyp":0,"cpxchgprobtypesolnpool":0,"cpxcleanup":0,"cpxclpwrite":1,"cpxcompletelp":1,"cpxcopylpwnam":0,"cpxdelcol":1,"cpxdeldblannot":1,"cpxdelindconstr":1,"cpxdellongannot":1,"cpxdelmipstart":1,"cpxdelpwl":1,"cpxdelqconstr":1,"cpxdelrow":1,"cpxdelso":1,"cpxdelsolnpoolfilt":1,"cpxdelsolnpoolsoln":1,"cpxdperwrit":0,"cpxdualfarka":1,"cpxdualwrit":0,"cpxembwrit":0,"cpxfeasoptext":1,"cpxgetbas":1,"cpxgetcallbackinfo":0,"cpxgetconflictext":1,"cpxgetconflictgroup":1,"cpxgetconflictnumgroup":1,"cpxgetconflictnumpass":1,"cpxgetdblqual":1,"cpxgetdettim":0,"cpxgetgrad":1,"cpxgetmiprelgap":[0,1],"cpxgetnumcor":0,"cpxgetnumobj":1,"cpxgetobjsen":1,"cpxgetprobnam":0,"cpxgetprobtyp":0,"cpxgetsolnpooldblqu":1,"cpxgetsolnpoolintqu":1,"cpxgettim":0,"cpxmbasewrit":1,"cpxmi":0,"cpxmi_bigm_coef":[0,3],"cpxmi_bigm_to_ind":[0,3],"cpxmi_bigm_varbound":[0,3],"cpxmi_cancel_tol":[0,3],"cpxmi_epgap_larg":[0,3],"cpxmi_epgap_objoffset":[0,3],"cpxmi_feas_tol":[0,3],"cpxmi_fraction_sc":[0,3],"cpxmi_ind_nz_large_num":[0,3],"cpxmi_ind_nz_small_num":[0,3],"cpxmi_ind_rhs_large_num":[0,3],"cpxmi_ind_rhs_small_num":[0,3],"cpxmi_kappa_illpos":[0,3],"cpxmi_kappa_suspici":[0,3],"cpxmi_kappa_unst":[0,3],"cpxmi_lb_large_num":[0,3],"cpxmi_lb_small_num":[0,3],"cpxmi_lc_nz_large_num":[0,3],"cpxmi_lc_nz_small_num":[0,3],"cpxmi_lc_rhs_large_num":[0,3],"cpxmi_lc_rhs_small_num":[0,3],"cpxmi_multiobj_coeff":[0,3],"cpxmi_multiobj_large_num":[0,3],"cpxmi_multiobj_mix":[0,3],"cpxmi_multiobj_opt_tol":[0,3],"cpxmi_multiobj_small_num":[0,3],"cpxmi_nz_large_num":[0,3],"cpxmi_nz_small_num":[0,3],"cpxmi_obj_large_num":[0,3],"cpxmi_obj_small_num":[0,3],"cpxmi_opt_tol":[0,3],"cpxmi_pwl_slope_large_num":[0,3],"cpxmi_pwl_slope_small_num":[0,3],"cpxmi_qc_linnz_large_num":[0,3],"cpxmi_qc_linnz_small_num":[0,3],"cpxmi_qc_qnz_large_num":[0,3],"cpxmi_qc_qnz_small_num":[0,3],"cpxmi_qc_rhs_large_num":[0,3],"cpxmi_qc_rhs_small_num":[0,3],"cpxmi_qobj_large_num":[0,3],"cpxmi_qobj_small_num":[0,3],"cpxmi_qopt_tol":[0,3],"cpxmi_rhs_large_num":[0,3],"cpxmi_rhs_small_num":[0,3],"cpxmi_samecoeff_col":[0,3],"cpxmi_samecoeff_ind":[0,3],"cpxmi_samecoeff_lazi":[0,3],"cpxmi_samecoeff_multiobj":[0,3],"cpxmi_samecoeff_obj":[0,3],"cpxmi_samecoeff_qlin":[0,3],"cpxmi_samecoeff_quad":[0,3],"cpxmi_samecoeff_rh":[0,3],"cpxmi_samecoeff_row":[0,3],"cpxmi_samecoeff_ucut":[0,3],"cpxmi_single_precis":[0,3],"cpxmi_symmetry_breaking_ineq":[0,3],"cpxmi_ub_large_num":[0,3],"cpxmi_ub_small_num":[0,3],"cpxmi_uc_nz_large_num":[0,3],"cpxmi_uc_nz_small_num":[0,3],"cpxmi_uc_rhs_large_num":[0,3],"cpxmi_uc_rhs_small_num":[0,3],"cpxmi_wide_coeff_rang":[0,3],"cpxmodelasstcallbacksetfunc":0,"cpxmultiobjchgattrib":1,"cpxmultiobjgetdblinfo":1,"cpxmultiobjgetintinfo":1,"cpxmultiobjgetlonginfo":1,"cpxmultiobjgetnam":1,"cpxmultiobjgetnumsolv":1,"cpxmultiobjgetobj":1,"cpxmultiobjgetobjv":1,"cpxmultiobjgetobjvalbyprior":1,"cpxmultiobjopt":0,"cpxmultiobjsetobj":1,"cpxparamsetappli":0,"cpxparamsetcopi":0,"cpxpopul":0,"cpxpperwrit":0,"cpxprob_fixedmilp":1,"cpxprob_lp":1,"cpxprob_milp":1,"cpxprob_miqcp":1,"cpxprob_miqp":1,"cpxprob_nodelp":1,"cpxprob_nodeqp":1,"cpxprob_qcp":1,"cpxprob_qp":1,"cpxreadcopyannot":0,"cpxreadcopybas":1,"cpxreadcopyprob":0,"cpxreadcopystartinfo":1,"cpxrefineconflictext":1,"cpxrefinemipstartconflictext":1,"cpxsetnumobj":1,"cpxsolwrit":1,"cpxstrongbranch":1,"cpxversion":0,"cpxversionnumb":0,"cpxwriteannot":0,"cpxwritebendersannot":0,"cpxwriteprob":0,"creat":[0,1],"create_parameter_set":[0,1,3],"createprob":[0,1],"criterion":0,"crossov":0,"crossover_const":[0,1],"crossovercallback":[0,3],"crush":[0,1],"crush_formula":1,"crush_pi":1,"crush_x":1,"crushed_formula":1,"crushform":[0,1],"crushpi":[0,1],"crushx":[0,1],"cstat":1,"ctrl":1,"current":[0,1],"custom":[0,2],"cut":[0,1],"cut2":1,"cut3":1,"cut_typ":[0,1],"cutcallback":[0,3],"cutcallbackadd":[0,1],"cutcallbackaddloc":[0,1],"cutmanag":[0,1],"cutoff":[0,1],"cuttyp":[0,1,3],"d":1,"data":[0,1,2],"datacheck":[0,1],"datacheck_const":[0,1],"dbl_param_valu":1,"deal":1,"debug":1,"decis":[0,2],"decomposit":0,"decompost":0,"decor":1,"deep":0,"def":0,"default":[0,1,2],"defin":[0,1,2],"definit":1,"defval":1,"degre":1,"del":[0,1],"delcol":[0,1],"deldblanno":[0,1],"delet":[0,1,3],"delete_nam":1,"delete_native_int":[0,1],"delete_set_by_rang":[0,1],"delfuncdest":[0,1],"delindconstr":[0,1],"dellonganno":[0,1],"delmipstart":[0,1],"delnam":[0,1],"delpwl":[0,1],"delpydel":[0,1],"delqconstr":[0,1],"delrow":[0,1],"delso":[0,1],"delsolnpoolfilt":[0,1],"delsolnpoolsoln":[0,1],"demonstr":1,"depend":[0,1],"dependency_const":[0,1],"deprec":[0,1],"deprecated_class":[0,1],"depth":0,"depth_first":1,"describ":[0,1],"descript":[0,1],"design":0,"desir":0,"destoy":0,"destroy":0,"destructor":0,"detail":[0,1,2],"detect":[0,1],"determin":[0,1],"determinist":[0,1],"dettim":1,"dettime_limit":1,"devex":1,"dfea":1,"differ":[0,1],"dimens":0,"dir":0,"direct":[0,1,2],"disabl":[0,1],"discard":0,"discontinu":1,"discret":[0,1],"discrete_vari":1,"disjunct":[0,1],"disk":1,"disk_compress":1,"display":[0,1],"display_const":[0,1],"distanc":0,"distribut":2,"div":1,"div0":1,"dive_const":[0,1],"diverg":1,"divers":1,"djfrompi":[0,1],"docplex":2,"document":[0,1,2],"doe":[0,1],"don":0,"done":0,"doubl":1,"double_annot":[0,1,3],"doubleannotationinterfac":[0,1],"doubt":0,"down_penalti":1,"dpe":0,"dperwrit":[0,1],"driebeek":1,"drop":0,"dsr":2,"dua":0,"dual":[0,1],"dual_const":[0,1],"dual_error_max":1,"dual_error_tot":1,"dual_farka":1,"dual_norm_max":1,"dual_norm_tot":1,"dual_normalized_error":1,"dual_object":1,"dual_pi_bound_error_max":1,"dual_pi_bound_error_tot":1,"dual_pricing_const":[0,1],"dual_reduced_cost_bound_error_max":1,"dual_reduced_cost_bound_error_tot":1,"dualfarka":[0,1],"duality_gap":1,"dualopt":[0,1],"dualwrit":[0,1],"due":0,"duplic":1,"dure":[0,1],"dynam":[0,1],"e":[0,1],"earli":0,"edg":1,"edit":2,"ee":1,"effect":0,"effici":1,"effort":1,"effort_level":1,"effortlevel":[0,1],"egl":1,"eight":1,"either":[0,1,2],"elaps":0,"element":0,"elimin":0,"els":1,"emb":0,"embed":0,"embwrit":[0,1],"emit":1,"empti":[0,1],"empty_problem":1,"enabl":0,"encapsul":[0,1],"end":[0,1,3],"enforc":0,"enter":[0,1],"entir":[0,1],"entri":[0,1],"enum":1,"enumer":1,"env":[0,1],"env_lp_ptr":1,"environ":[0,1,2,3],"ep":1,"epsilon":[0,1],"equal":[0,1,2],"equilibr":1,"equival":[0,1],"errcod":1,"error":[0,1],"error_ax_b_max":1,"error_ax_b_tot":1,"error_chnl_idx":[0,1],"error_fil":[0,1],"error_xqx_dx_f_max":1,"error_xqx_dx_f_tot":1,"errorchannelmessag":[0,3],"errorcod":0,"especi":1,"estim":0,"estimated_du":1,"etc":[0,1],"evalu":0,"even":[0,1],"event":1,"everi":[0,1],"exact":0,"exact_kappa":1,"examin":0,"exampl":[0,1],"exc_typ":0,"exc_valu":0,"exceed":1,"except":[1,3],"exchang":[0,1],"exclud":1,"execut":[0,1],"exist":[0,1],"exit":0,"exit_cut_loop":0,"explan":[0,1],"explicit":0,"explor":0,"expos":1,"express":1,"extens":0,"extern":[0,1],"extra_msg":1,"extract":[0,1],"extrem":2,"f":[0,1],"fact":1,"fail":0,"fail_feas":1,"fail_feasible_no_tre":1,"fail_infeas":1,"fail_infeasible_no_tre":1,"fals":[0,1],"familiar":2,"far":[0,1],"farka":1,"fast":1,"fast_getcolnam":[0,1],"fast_getmipstartnam":[0,1],"fast_getobj":[0,1],"fast_getrow":[0,1],"fast_getrownam":[0,1],"fast_getsosnam":[0,1],"fast_multiobjgetabstol":[0,1],"fast_multiobjgetobj":[0,1],"fast_multiobjgetoffset":[0,1],"fast_multiobjgetprior":[0,1],"fast_multiobjgetreltol":[0,1],"fast_multiobjgetweight":[0,1],"fast_newcol":[0,1],"fathom":0,"fea":1,"feasibility_status":0,"feasibilitystatus":[0,3],"feasibl":[0,1],"feasible_relaxed_inf":1,"feasible_relaxed_quad":1,"feasible_relaxed_sum":1,"feasopt":[0,1,3],"feasopt_mode_const":[0,1],"feasoptconstrainttyp":[0,1],"feasoptext":[0,1],"feasoptinterfac":[0,1],"featur":0,"ff":[0,1],"file":[0,1],"file_const":[0,1],"filenam":[0,1],"fileobj":1,"filetyp":[0,1],"filter":[0,1],"filtertyp":[0,1],"final":1,"find":[0,1],"finish":0,"finitlock":[0,1],"first":[0,1],"first_ord":1,"firstin_firstout":1,"five":1,"fix":1,"fixed_milp":[0,1],"fixed_miqp":[0,1],"fixed_parameters_and_valu":1,"fixedmilp":1,"fixpack":[0,1],"fixparam":[0,1],"flag":[0,1],"fledg":2,"float":[0,1],"float_info":1,"flow_cov":[0,1],"flow_path":[0,1],"flt":1,"fltwrite":[0,1],"flush":[0,1],"fn":[0,1],"follow":[0,1,2],"forc":[0,1],"forcibl":1,"form":[0,1],"format":[0,1],"formul":[0,1],"formula":1,"found":[0,1],"four":[0,1],"fpheur_const":[0,1],"fraction":[0,1],"free":[0,1],"free_chbmat":[0,1],"free_lazy_constraint":1,"free_nonbas":1,"free_user_cut":1,"freelazyconstraint":[0,1],"freepresolv":[0,1],"freeprob":[0,1],"freeusercut":[0,1],"friend":0,"ftran":[0,1],"full":[0,1,2],"full_path_to_this_cplex_studio_instal":2,"full_steep":1,"function":[0,1,2],"functor":0,"futur":0,"g":[0,1],"gap":[0,1],"general":0,"general_sc":1,"generat":[0,1],"generic":0,"genericcb":0,"get":[0,1,3],"get_abort":[0,3],"get_abstol":1,"get_activity_level":1,"get_al":1,"get_basi":1,"get_basic_col_index":1,"get_basic_row_index":1,"get_basis_dual_norm":1,"get_best_object":1,"get_best_objective_valu":0,"get_bound":1,"get_branch":0,"get_branch_typ":0,"get_branch_vari":0,"get_candidate_object":0,"get_candidate_point":0,"get_candidate_ray":0,"get_candidate_sourc":0,"get_chang":1,"get_coeffici":1,"get_col":1,"get_col_status":1,"get_compl":1,"get_cplex_status":0,"get_current_node_depth":0,"get_cutoff":[0,1],"get_default_valu":1,"get_definit":1,"get_depth":0,"get_dettim":[0,1,3],"get_diverging_index":1,"get_diversity_filt":1,"get_double_info":0,"get_driebeek_penalti":1,"get_dual_infeas":0,"get_dual_norm":1,"get_dual_objective_valu":0,"get_dual_valu":1,"get_effort_level":1,"get_end_dettim":0,"get_end_tim":0,"get_estimated_objective_valu":0,"get_feas":0,"get_float_qu":[0,1],"get_global_lower_bound":0,"get_global_upper_bound":0,"get_gradi":1,"get_group":1,"get_head":1,"get_histogram":1,"get_id":[0,3],"get_incumb":0,"get_incumbent_linear_slack":0,"get_incumbent_nod":1,"get_incumbent_object":0,"get_incumbent_objective_valu":0,"get_incumbent_quadratic_slack":0,"get_incumbent_valu":0,"get_indic":1,"get_indicator_slack":1,"get_indicator_vari":1,"get_infeasibility_sum":0,"get_info":1,"get_int_info":0,"get_integer_qu":1,"get_linear":[0,1],"get_linear_compon":1,"get_linear_num_nonzero":1,"get_linear_reduced_costs_from_pi":1,"get_linear_slack":[0,1],"get_linear_slacks_from_x":1,"get_local_lower_bound":0,"get_local_upper_bound":0,"get_long_info":0,"get_lower_bound":[0,1],"get_mean_objective_valu":1,"get_method":1,"get_mip_relative_gap":[0,1],"get_nam":1,"get_native_int":[0,1],"get_node_data":0,"get_node_id":0,"get_node_numb":0,"get_num":[0,1],"get_num_barrier_iter":1,"get_num_binari":1,"get_num_branch":0,"get_num_col":0,"get_num_conflict_pass":1,"get_num_cor":[0,1,3],"get_num_cut":[0,1],"get_num_dual_exchang":[0,1],"get_num_dual_push":[0,1],"get_num_dual_superbas":1,"get_num_entri":1,"get_num_group":1,"get_num_infeas":0,"get_num_integ":1,"get_num_iter":[0,1],"get_num_lazy_constraint":1,"get_num_memb":1,"get_num_nod":0,"get_num_nodes_process":1,"get_num_nodes_remain":1,"get_num_nonzero":1,"get_num_phase_one_iter":1,"get_num_primal_exchang":[0,1],"get_num_primal_push":[0,1],"get_num_primal_superbas":1,"get_num_quadratic_constraint":0,"get_num_quadratic_nonzero":1,"get_num_quadratic_vari":1,"get_num_remaining_nod":0,"get_num_replac":1,"get_num_row":0,"get_num_semicontinu":1,"get_num_semiinteg":1,"get_num_sifting_iter":1,"get_num_sifting_phase_one_iter":1,"get_num_solv":1,"get_num_superbas":0,"get_num_user_cut":1,"get_objective_coeffici":0,"get_objective_valu":[0,1],"get_objval_by_prior":1,"get_offset":1,"get_parameter_set":[0,3],"get_presolved_col_status":1,"get_presolved_row_status":1,"get_primal_infeas":0,"get_primal_norm":1,"get_prior":1,"get_problem_nam":[0,3],"get_problem_typ":[0,3],"get_progress":0,"get_protect":1,"get_pseudo_cost":0,"get_quad_num_nonzero":1,"get_quadrat":1,"get_quadratic_activity_level":1,"get_quadratic_coeffici":1,"get_quadratic_compon":1,"get_quadratic_dualslack":1,"get_quadratic_indefinite_certif":1,"get_quadratic_reduced_costs_from_pi":1,"get_quadratic_slack":[0,1],"get_quadratic_slacks_from_x":1,"get_quality_metr":1,"get_range_filt":1,"get_range_valu":1,"get_ray":1,"get_reduced_cost":1,"get_relaxation_object":0,"get_relaxation_point":0,"get_relaxation_status":0,"get_reltol":1,"get_rh":1,"get_row":1,"get_row_status":1,"get_sens":1,"get_set":1,"get_solution_sourc":0,"get_solution_typ":1,"get_sos_feas":0,"get_sos_feasibilti":0,"get_start":1,"get_start_dettim":0,"get_start_tim":0,"get_stat":[0,3],"get_status":[0,1],"get_status_str":1,"get_subproblem_status":1,"get_thread_num":0,"get_tim":[0,1,3],"get_typ":1,"get_upper_bound":[0,1],"get_valu":[0,1],"get_vari":1,"get_vers":[0,1,3],"get_versionnumb":[0,1,3],"get_weight":1,"get_wherefrom":[0,1],"getax":[0,1],"getbaritcnt":[0,1],"getbas":[0,1],"getbasednorm":[0,1],"getbestobjv":[0,1],"getbhead":[0,1],"getcallbackincumb":[0,1],"getcallbacknodeinfo":[0,1],"getcallbacknodeintfea":[0,1],"getcallbacknodelb":[0,1],"getcallbacknodeobjv":[0,1],"getcallbacknodeub":[0,1],"getcallbacknodex":[0,1],"getcallbackpseudocost":[0,1],"getcallbackseqinfo":[0,1],"getcallbacksosinfo":[0,1],"getchannel":[0,1],"getcoef":[0,1],"getcol":[0,1],"getcolindex":[0,1],"getcolinfea":[0,1],"getcolnam":[0,1],"getconflictext":[0,1],"getconflictgroup":[0,1],"getconflictnumgroup":[0,1],"getconflictnumpass":[0,1],"getcrossdexchcnt":[0,1],"getcrossdpushcnt":[0,1],"getcrosspexchcnt":[0,1],"getcrossppushcnt":[0,1],"getctyp":[0,1],"getcutoff":[0,1],"getdblanno":[0,1],"getdblannodefv":[0,1],"getdblannoindex":[0,1],"getdblannonam":[0,1],"getdblparam":[0,1],"getdblqual":[0,1],"getdettim":[0,1],"getdj":[0,1],"getdnorm":[0,1],"getdsbcnt":[0,1],"geterrorstr":[0,1],"getgrad":[0,1],"gethist":[0,1],"getijdiv":[0,1],"getijrow":[0,1],"getindconstr":[0,1],"getindconstr_const":[0,1],"getindconstrindex":[0,1],"getindconstrinfea":[0,1],"getindconstrnam":[0,1],"getindconstrslack":[0,1],"getindexfunc":1,"getintparam":[0,1],"getintqu":[0,1],"getitcnt":[0,1],"getlb":[0,1],"getlonganno":[0,1],"getlongannodefv":[0,1],"getlongannoindex":[0,1],"getlongannonam":[0,1],"getlongparam":[0,1],"getmethod":[0,1],"getmipitcnt":[0,1],"getmiprelgap":[0,1],"getmipstart":[0,1],"getmipstartindex":[0,1],"getmipstartnam":[0,1],"getmipstarts_effort":[0,1],"getmipstarts_s":[0,1],"getnodecnt":[0,1],"getnodeint":[0,1],"getnodeleftcnt":[0,1],"getnumbin":[0,1],"getnumcol":[0,1],"getnumcor":[0,1],"getnumcut":[0,1],"getnumdblanno":[0,1],"getnumindconstr":[0,1],"getnumint":[0,1],"getnumlonganno":[0,1],"getnummipstart":[0,1],"getnumnz":[0,1],"getnumobj":[0,1],"getnumprio":[0,1],"getnumpwl":[0,1],"getnumqconstr":[0,1],"getnumqpnz":[0,1],"getnumquad":[0,1],"getnumrow":[0,1],"getnumsemicont":[0,1],"getnumsemiint":[0,1],"getnumso":[0,1],"getobj":[0,1],"getobjnam":[0,1],"getobjoffset":[0,1],"getobjsen":[0,1],"getobjv":[0,1],"getord":[0,1],"getparamtyp":[0,1],"getphase1cnt":[0,1],"getpi":[0,1],"getpnorm":[0,1],"getprestat_c":[0,1],"getprestat_oc":[0,1],"getprestat_or":[0,1],"getprestat_r":[0,1],"getprestat_status":[0,1],"getprobnam":[0,1],"getprobstat":[0,1],"getprobtyp":[0,1],"getprotect":[0,1],"getpsbcnt":[0,1],"getpwl":[0,1],"getpwlindex":[0,1],"getpwlnam":[0,1],"getqconstr_info":[0,1],"getqconstr_lin":[0,1],"getqconstr_quad":[0,1],"getqconstrdslack":[0,1],"getqconstrindex":[0,1],"getqconstrinfea":[0,1],"getqconstrnam":[0,1],"getqconstrslack":[0,1],"getqpcoef":[0,1],"getquad":[0,1],"getqualitymetr":[0,1],"getray":[0,1],"getrh":[0,1],"getrngval":[0,1],"getrow":[0,1],"getrowindex":[0,1],"getrowinfea":[0,1],"getrownam":[0,1],"getsens":[0,1],"getsiftitcnt":[0,1],"getsiftphase1cnt":[0,1],"getslack":[0,1],"getso":[0,1],"getsolnpooldblqu":[0,1],"getsolnpooldivfilt":[0,1],"getsolnpooldivfilter_const":[0,1],"getsolnpoolfilterindex":[0,1],"getsolnpoolfilternam":[0,1],"getsolnpoolfiltertyp":[0,1],"getsolnpoolintqu":[0,1],"getsolnpoolmeanobjv":[0,1],"getsolnpoolnumfilt":[0,1],"getsolnpoolnumreplac":[0,1],"getsolnpoolnumsoln":[0,1],"getsolnpoolobjv":[0,1],"getsolnpoolqconstrslack":[0,1],"getsolnpoolrngfilt":[0,1],"getsolnpoolrngfilter_const":[0,1],"getsolnpoolslack":[0,1],"getsolnpoolsolnindex":[0,1],"getsolnpoolsolnnam":[0,1],"getsolnpoolx":[0,1],"getsos_info":[0,1],"getsosindex":[0,1],"getsosinfea":[0,1],"getsosnam":[0,1],"getstat":[0,1],"getstatstr":[0,1],"getstrparam":[0,1],"getsubstat":[0,1],"gettim":[0,1],"getub":[0,1],"getx":[0,1],"getxqxax":[0,1],"ggll":1,"give":[0,1],"given":[0,1],"global":0,"global_progress":0,"gnu":[0,2],"goodlist":1,"grace":0,"grad":1,"greater":[0,1],"group":[0,1],"group_status":1,"grpbeg":1,"grpind":1,"grppref":1,"grptype":1,"guarante":0,"gub_cov":[0,1],"guid":1,"gz":0,"half":1,"handl":[0,1],"happen":0,"has_incumb":0,"has_nam":[0,1],"has_non_default_lb":[0,1],"has_non_default_ub":[0,1],"has_problem":1,"head":1,"header":1,"help":1,"heurist":[0,1],"heuristic_solut":0,"heuristiccallback":[0,3],"hidden_feas":1,"hierarchi":[0,1],"higher":2,"histogram":[0,1],"howev":[0,1],"hscallback":[0,3],"huge":0,"human":[0,1],"hybbaropt":[0,1],"hybnetopt":[0,1],"i0":1,"i1":1,"i2":1,"i3":1,"i4":1,"i5":1,"i6":1,"i7":1,"i8":1,"i9":1,"ibmdecisionoptim":2,"iconstraint":1,"id":[0,1],"ide":2,"ident":[0,1],"identifi":[0,1],"idl":2,"idx":[0,1],"idx1":1,"idx2":1,"if_":1,"if_poss":1,"iff":1,"ignor":[0,1],"ii":1,"immedi":[0,1],"implement":0,"impli":[0,1],"implied_bound":[0,1],"implied_feas":0,"impliedfeas":0,"import":[0,1],"in_branch":0,"in_candid":0,"in_global_progress":0,"in_local_progress":0,"in_relax":0,"in_thread_down":0,"in_thread_up":0,"includ":[0,1,2],"inclus":[0,1],"incumb":[0,1],"incumbentcallback":[0,3],"ind":[0,1],"ind1":[0,1],"ind2":[0,1],"indcnt":1,"indefinit":1,"independ":1,"index":[0,1],"indexerror":1,"indic":[0,1],"indicator_constraint":[0,1,3],"indicator_slack_bound_error_max":1,"indicator_slack_bound_error_tot":1,"indicatorconstraintinterfac":[0,1],"indicatortyp":[0,1],"individu":[0,1],"indtyp":1,"indvar":1,"infeas":[0,1],"infeas_const":1,"infeas_estim":1,"infeasibilityinterfac":[0,1],"infeasible_or_unbound":1,"infer":0,"infin":[0,1,3],"infinit":0,"info":0,"infodblparam":[0,1],"infointparam":[0,1],"infolongparam":[0,1],"inform":[0,1,2],"infostrparam":[0,1],"init_list_arg":[0,1],"initi":1,"initialinterfac":[0,1],"initlock":[0,1],"input":[0,1],"instal":[0,2],"instanc":[0,1,2],"instanti":[0,1,2],"instead":[0,1],"instruct":[0,1],"int":1,"int_info":1,"int_param_valu":1,"integ":[0,1],"integer_feas":1,"integr":[0,1],"integrality_error_max":1,"integrality_error_tot":1,"intend":0,"interact":[0,1,2],"interfac":[0,1,2],"interfer":[0,1],"interfere_crush":1,"interfere_uncrush":1,"intern":[0,1],"interpret":[0,1,2],"interv":1,"invalid":0,"invers":1,"invert":1,"invoc":0,"invok":[0,1],"involv":[0,1],"is_abort":[0,3],"is_after_cut_loop":0,"is_candidate_point":0,"is_candidate_ray":0,"is_dual_feas":[0,1],"is_integer_feas":0,"is_primal_feas":[0,1],"is_row_index":1,"is_unbounded_nod":0,"ismultiobj":[0,1],"isn":1,"issu":0,"issueid":0,"isvalid":[0,3],"it_limit":1,"item":[0,1],"iter":[0,1],"ith":1,"itlim":1,"j":[0,1],"jenter":1,"jleav":1,"just":[0,1],"kappa":1,"kappa_attent":[0,1],"kappa_illpos":[0,1],"kappa_max":[0,1],"kappa_st":[0,1],"kappa_suspici":[0,1],"kappa_unst":[0,1],"kappastats_const":[0,1],"key":[0,1],"keyword":1,"know":[0,1],"known":[0,1,2],"l":[0,1],"land":2,"languag":[0,2],"larg":[0,1],"last":[0,1],"later":[0,1],"lazi":[0,1],"lazyconstraintcallback":[0,3],"lb":[0,1],"lconstraint":1,"least":[0,1],"leav":1,"leavestat":1,"left":1,"lefthand":[0,1],"legaci":0,"len":[0,1],"length":[0,1],"less":[0,1],"level":[1,2],"lexicograph":1,"lhs":1,"librari":[0,1,2],"lift_and_project":[0,1],"like":[0,1,2],"limit":[0,1,2],"limitedsolv":1,"lin":1,"lin_expr":1,"line":1,"linear":[0,1],"linear_const":[0,1],"linear_constraint":[0,1,2,3],"linearconstraintinterfac":[0,1],"linind":1,"linmat":1,"linux":2,"linval":1,"list":[0,1],"listifi":[0,1],"ll":[0,1],"local":[0,1],"local_implied_bound":1,"local_progress":0,"lock":1,"log":[0,1],"log_chnl_idx":[0,1],"log_fil":[0,1],"logarithm":1,"logic":0,"lolmat":1,"long":1,"long_annot":[0,1,3],"long_info":1,"longannotationinterfac":[0,1],"longer":[0,1],"loop":[0,1],"lot":0,"low":2,"lower":[0,1],"lower_bound":1,"lower_bound_constraint":1,"lp":[0,1],"lp_all":1,"lp_at_nod":1,"lp_root":1,"lp_str":0,"lpex":[0,1],"lpex1":0,"lpex4":0,"lpmethod":1,"lpopt":[0,1],"lu":1,"lz1":1,"lz2":1,"lz3":1,"m":1,"m1":1,"m2":1,"m3":1,"m4":1,"mac":2,"machin":[0,1],"magnitud":0,"main":0,"make":[0,1,2],"make_branch":0,"make_cplex_branch":0,"make_group":[0,1],"make_rang":[0,1],"manag":0,"mani":[0,1],"manner":1,"manual":[0,1],"map":1,"mark":[0,1],"master":1,"matbeg":[0,1],"match":1,"matcnt":[0,1],"mathemat":2,"matind":[0,1],"matrix":[0,1],"matrix_convers":1,"matval":[0,1],"max":1,"max_arg_length":[0,1],"max_ax_minus_b":1,"max_bound_infea":1,"max_c_minus_bpi":1,"max_comp_slack":1,"max_dual_infeas":1,"max_dual_residu":1,"max_ind":0,"max_indicator_rh":0,"max_indicator_slack_infeas":1,"max_infeas":1,"max_int_infeas":1,"max_kappa":1,"max_lazy_constraint":0,"max_lazy_constraint_rh":0,"max_linear_constraint":0,"max_linear_constraints_rh":0,"max_linear_object":0,"max_linear_rang":0,"max_num":1,"max_pi":1,"max_primal_infeas":1,"max_primal_residu":1,"max_pwl_slack_infeas":1,"max_quadrat":0,"max_quadratic_linear":0,"max_quadratic_object":0,"max_quadratic_primal_residu":1,"max_quadratic_rh":0,"max_quadratic_slack":1,"max_quadratic_slack_infeas":1,"max_reduced_cost":1,"max_reduced_cost_infea":1,"max_scaled_ax_minus_b":1,"max_scaled_bound_infea":1,"max_scaled_c_minus_bpi":1,"max_scaled_dual_infeas":1,"max_scaled_dual_residu":1,"max_scaled_pi":1,"max_scaled_primal_infeas":1,"max_scaled_primal_residu":1,"max_scaled_reduced_cost":1,"max_scaled_reduced_cost_infea":1,"max_scaled_slack":1,"max_scaled_x":1,"max_slack":1,"max_upper_bound":0,"max_user_cut":0,"max_user_cut_rh":0,"max_x":1,"maxim":[0,1],"maximum":1,"maxormin":1,"maxval":1,"may":[0,1],"mbasewrit":[0,1],"mdleav":[0,1],"mean":[0,1],"meaning":[0,1],"meant":[0,1],"measur":[0,1],"measure_const":[0,1],"mem_limit_feas":1,"mem_limit_infeas":1,"member":[0,1],"memori":[0,1],"messag":0,"method":[0,1,2],"methodtyp":[0,3],"metric":[0,1],"middl":1,"mild":1,"milp":[0,1],"min":1,"min_ind":0,"min_indicator_rh":0,"min_inf":1,"min_infeas":1,"min_lazy_constraint":0,"min_lazy_constraint_rh":0,"min_linear_constraint":0,"min_linear_constraints_rh":0,"min_linear_object":0,"min_linear_rang":0,"min_lower_bound":0,"min_quad":1,"min_quadrat":0,"min_quadratic_linear":0,"min_quadratic_object":0,"min_quadratic_rh":0,"min_sum":1,"min_user_cut":0,"min_user_cut_rh":0,"minim":[0,1],"minimum":1,"minmax":1,"mip":[0,1],"mip_abort_feas":1,"mip_abort_infeas":1,"mip_dettime_limit_feas":1,"mip_dettime_limit_infeas":1,"mip_display_const":[0,1],"mip_emph_const":[0,1],"mip_feas":1,"mip_feasible_relaxed_inf":1,"mip_feasible_relaxed_quad":1,"mip_feasible_relaxed_sum":1,"mip_infeas":1,"mip_infeasible_or_unbound":1,"mip_interval_nod":1,"mip_optim":1,"mip_optimal_infeas":1,"mip_optimal_relaxed_inf":1,"mip_optimal_relaxed_quad":1,"mip_optimal_relaxed_sum":1,"mip_start":[0,1,3],"mip_start_solut":0,"mip_time_limit_feas":1,"mip_time_limit_infeas":1,"mip_unbound":1,"mipcallback":[0,3],"mipex4":0,"mipgap":1,"mipinfocallback":[0,3],"mipopt":[0,1],"mipsolutioninterfac":[0,1],"mipstart_solut":0,"mipstartindex":1,"mipstartindic":1,"mipstartnam":1,"mipstartsinterfac":[0,1],"miqcp":[0,1],"miqcp_const":[0,1],"miqp":[0,1],"mir":[0,1],"misi":1,"mix":[0,1],"mixtur":1,"mm":[0,1],"mo1":1,"mode":0,"model":[0,1,2],"model_info":3,"modelasstcallbacksetfunc":[0,1],"modelasstcb":0,"moder":1,"modif":[0,1],"modifi":[0,1,2],"modul":[2,3],"more_aggress":1,"mov":1,"move":1,"mp":2,"mps":[0,1],"mst":1,"mst0":1,"mst1":1,"mst2":1,"mst3":1,"mst4":1,"mst5":1,"mst6":1,"mst7":1,"mst8":1,"mst9":1,"multi":[0,1],"multi_commodity_flow":[0,1],"multiobj":[0,1,3],"multiobj_infeas":1,"multiobj_inforunbd":1,"multiobj_non_optim":1,"multiobj_optim":1,"multiobj_stop":1,"multiobj_unbound":1,"multiobjchgattrib":[0,1],"multiobject":1,"multiobjfloatinfo":[0,1],"multiobjgetdblinfo":[0,1],"multiobjgetindex":[0,1],"multiobjgetintinfo":[0,1],"multiobjgetlonginfo":[0,1],"multiobjgetnam":[0,1],"multiobjgetnumsolv":[0,1],"multiobjgetobj":[0,1],"multiobjgetobjv":[0,1],"multiobjgetobjvalbyprior":[0,1],"multiobjinterfac":[0,1],"multiobjintinfo":[0,1],"multiobjlonginfo":[0,1],"multiobjopt":[0,1],"multiobjsetobj":[0,1],"multiobjsolninterfac":[0,1],"multipl":[0,1],"multiple_parti":1,"multiple_partial_with_sort":1,"multipli":1,"must":[0,1],"my_quad":1,"mymipinfocallback":0,"n":[0,1],"name":[0,1,2],"nan":1,"nb":1,"nbreak":1,"ncut":1,"necessari":[0,1],"necessarili":[0,1],"need":0,"negat":1,"neither":1,"nested_dissect":1,"network":[0,1],"network_display_const":[0,1],"network_netfind_const":[0,1],"network_pricing_const":[0,1],"never":0,"new":[0,1],"new_native_int":[0,1],"new_root_cut":1,"newcol":[0,1],"newdblanno":[0,1],"newli":0,"newlonganno":[0,1],"newnam":1,"newrow":[0,1],"newvalu":1,"next":0,"nice":0,"no_check":1,"no_reduct":1,"no_solv":0,"no_vari":1,"node":[0,1],"node_cut":1,"node_data":0,"node_limit_feas":1,"node_limit_infeas":1,"node_lp":[0,1],"node_qcp":[0,1],"node_qp":[0,1],"node_solut":0,"nodecallback":[0,3],"nodeest":1,"nodeindex":1,"nodelp":1,"nodeqcp":1,"nodeqp":1,"nodesel_const":[0,1],"non":[0,1],"non_bas":1,"nonbas":1,"nondefault":[0,1],"none":[0,1],"nonneg":1,"nonzero":[0,1],"nonzero_discrete_vari":1,"nonzero_vari":1,"noopstream":0,"norm":1,"norm_max":1,"norm_tot":1,"normal":[0,1],"normalized_error_max":1,"notat":1,"note":[0,1],"notimplementederror":1,"null":1,"num":1,"num_barrier_iter":1,"num_best":1,"num_binari":0,"num_box":0,"num_cor":0,"num_degenerate_iter":1,"num_dual_exchang":1,"num_dual_push":1,"num_exch":1,"num_fix":0,"num_fre":0,"num_indicator_compl":0,"num_indicator_constraint":0,"num_indicator_equ":0,"num_indicator_great":0,"num_indicator_less":0,"num_indicator_nz":0,"num_indicator_rhs_nz":0,"num_integ":0,"num_it":1,"num_iter":1,"num_lazy_constraint":0,"num_lazy_eq":0,"num_lazy_gt":0,"num_lazy_lt":0,"num_lazy_nnz":0,"num_lazy_rhs_nnz":0,"num_linear_constraint":0,"num_linear_equ":0,"num_linear_great":0,"num_linear_less":0,"num_linear_nz":0,"num_linear_objective_nz":0,"num_linear_rang":0,"num_linear_rhs_nz":0,"num_nod":1,"num_nodes_left":1,"num_nonneg":0,"num_object":0,"num_oth":0,"num_phase1_iter":1,"num_primal_exchang":1,"num_primal_push":1,"num_push":1,"num_pwl_break":0,"num_pwl_constraint":0,"num_quadratic_constraint":0,"num_quadratic_great":0,"num_quadratic_less":0,"num_quadratic_linear_nz":0,"num_quadratic_nz":0,"num_quadratic_objective_nz":0,"num_quadratic_rhs_nz":0,"num_quadratic_vari":0,"num_semicontinu":0,"num_semiinteg":0,"num_sifting_iter":1,"num_sifting_phase1_iter":1,"num_solut":1,"num_sos1":0,"num_sos1_memb":0,"num_sos2":0,"num_sos2_memb":0,"num_sos_constraint":0,"num_user_cut":0,"num_user_cuts_eq":0,"num_user_cuts_gt":0,"num_user_cuts_lt":0,"num_user_cuts_nnz":0,"num_user_cuts_rhs_nnz":0,"num_vari":0,"number":[0,1,2],"numcol":[0,1],"numer":0,"numobj":1,"numparamet":[0,1],"numrow":[0,1],"nzcnt":1,"o":1,"obj":[0,1],"obj1":1,"obj_and_fea":1,"obj_val":1,"object":[0,1,2,3],"object_typ":[0,1],"objective_estim":0,"objective_gap":1,"objective_valu":0,"objectiveinterfac":[0,1],"objidx":1,"objind":1,"objnam":1,"objsa":[0,1],"objsens":[0,1],"objtyp":[0,1],"objval":1,"obtain":0,"occur":[0,1],"off_on_const":[0,1],"offer":2,"offset":1,"often":0,"old_cpx":0,"omit":0,"onc":[0,1],"one":[0,1],"onli":[0,1,2],"only_linear":1,"onlyif":1,"open":[0,1],"opencplex":[0,1],"oper":[0,1,2],"opportun":0,"opportunist":1,"opposit":1,"opt_inf":1,"opt_quad":1,"opt_sum":1,"optim":[0,1,2],"optimal_convex":1,"optimal_face_unbound":1,"optimal_glob":1,"optimal_infeas":1,"optimal_popul":1,"optimal_populated_toler":1,"optimal_relaxed_inf":1,"optimal_relaxed_quad":1,"optimal_relaxed_sum":1,"optimal_toler":1,"optimalitytarget_const":[0,1],"optimizationcallback":[0,3],"option":[0,1],"order":[0,1,3],"orderinterfac":[0,1],"ordertype_const":[0,1],"ordwrit":[0,1],"orient":[1,2],"origin":[0,1],"otherwis":[0,1,2],"outcom":1,"output":[0,1],"overhead":1,"overrid":[0,1],"overridden":0,"overview":0,"overwrit":[0,1],"p":1,"pack_env_lp_ptr":[0,1],"packag":3,"page":2,"pair":[0,1],"pair_of_list":1,"par_const":[0,1],"parallel":0,"param":0,"param_nam":1,"paramet":[0,1,3],"parametergroup":[0,1],"parameterset":[0,1,3],"paramnum":1,"paramset":[1,3],"paramsetadd":[0,1],"paramsetadddbl":[0,1],"paramsetaddint":[0,1],"paramsetaddlong":[0,1],"paramsetaddstr":[0,1],"paramsetappli":[0,1],"paramsetcopi":[0,1],"paramsetcr":[0,1],"paramsetdel":[0,1],"paramsetfre":[0,1],"paramsetget":[0,1],"paramsetgetdbl":[0,1],"paramsetgetid":[0,1],"paramsetgetint":[0,1],"paramsetgetlong":[0,1],"paramsetgetnum":[0,1],"paramsetgetstr":[0,1],"paramsetreadcopi":[0,1],"paramsetwrit":[0,1],"paramtyp":1,"parent":[0,1],"part":[1,2],"partial":[0,1],"particular":[0,1],"partit":1,"pass":[0,1],"pct_kappa_illpos":1,"pct_kappa_st":1,"pct_kappa_suspici":1,"pct_kappa_unst":1,"penalized_objective_valu":1,"penalti":1,"perform":[0,1],"pertain":1,"perturb":0,"pfea":1,"pgradient":1,"phase":0,"pi":1,"piecewis":1,"piecewise_linear_error_max":1,"piecewise_linear_error_tot":1,"pind":1,"pip":2,"pivot":[0,1],"pivot_fixed_variables_out":1,"pivot_in":1,"pivot_out":1,"pivot_slacks_in":1,"pivotin":[0,1],"pivotout":[0,1],"pivotvarstatus":[0,1],"place":0,"plane":0,"platform":2,"plus":0,"pnorm":1,"point":[0,1],"pool":[0,1],"popul":[0,1],"populate_solution_limit":1,"populate_solution_pool":[0,1,3],"posit":1,"possibl":0,"possible_memb":1,"post":[0,1],"post_heuristic_solut":[0,1],"postslop":1,"potenti":0,"ppe":0,"pperwrit":[0,1],"practic":0,"pre_formula":1,"pre_pi":1,"pre_x":1,"preaddrow":[0,1],"prechgobj":[0,1],"prefer":1,"prepi":1,"preprocess":[0,1],"prered_const":[0,1],"prereform_const":[0,1],"presenc":0,"present":0,"preslop":1,"preslvwrit":[0,1],"presolv":[0,1,3],"presolve_const":[0,1],"presolvecallback":1,"presolvecolstatus":[0,1],"presolveinterfac":[0,1],"presolvemethod":[0,1],"presolverowstatus":[0,1],"presolvestatus":[0,1],"prevent":1,"previous":[0,1],"prex":1,"primal":[0,1],"primal_and_du":1,"primal_error_max":1,"primal_error_tot":1,"primal_norm_max":1,"primal_norm_tot":1,"primal_normalized_error":1,"primal_object":1,"primal_pricing_const":[0,1],"primal_slack_bound_error_max":1,"primal_slack_bound_error_tot":1,"primal_x_bound_error_max":1,"primal_x_bound_error_tot":1,"primopt":[0,1],"print":[0,1],"prior":0,"prioriti":1,"prm":0,"prob1":0,"probe":1,"problem":[0,1,2],"problem_typ":[0,3],"problemtyp":[0,1,3],"probnam":1,"probtyp":1,"procedur":1,"proceed":0,"process":[0,1],"program":[0,1,2],"progress":[0,1],"progressinterfac":[0,1],"project":1,"proof":1,"propag":1,"proper":[0,1],"protect":1,"prove":1,"proven":1,"provid":[0,1,2],"prune":0,"prune_current_nod":0,"ps":[0,1],"pseudo":0,"pseudo_cost":1,"pseudo_reduced_cost":1,"public":[0,1],"pure":1,"purg":0,"purgeabl":1,"purpos":0,"push":[0,1],"pval":1,"pwl":1,"pwl1":1,"pwl_constraint":[0,1,3],"pwlconstraintinterfac":[0,1],"py":0,"pylolmat_to_chbmat":[0,1],"pypi":2,"python":[0,1],"q":1,"q1":1,"q10":1,"q2":1,"q3":1,"q4":1,"q5":1,"q6":1,"q7":1,"q8":1,"q9":1,"qc1":1,"qc3":1,"qconstrslackfromx":[0,1],"qcp":[0,1],"qcp_at_nod":1,"qcpduals_const":[0,1],"qind":1,"qm":1,"qmatbeg":1,"qmatind":1,"qmatval":1,"qp":[0,1],"qp_alg_const":[0,1],"qpdjfrompi":[0,1],"qpindef":1,"qpindefcertif":[0,1],"qpopt":[0,1],"qreducedcost":1,"qsepvec":1,"qslack":1,"quad":1,"quad_expr":1,"quadcol":1,"quadrat":[0,1],"quadratic_constraint":[0,1,3],"quadratic_slack_bound_error_max":1,"quadratic_slack_bound_error_tot":1,"quadratically_constrain":1,"quadraticconstraintinterfac":[0,1],"quadrow":1,"quadval":1,"qual":1,"qualiti":[0,1],"quality_metr":[0,1],"quality_typ":1,"qualitymetr":[0,1,3],"queri":[0,1,2],"querri":1,"qx":1,"r":[0,1],"r_c":1,"rais":[0,1],"random":0,"randomse":1,"rang":[0,1],"range_valu":[0,1],"rather":[0,2],"ratio":1,"ray":[0,1],"rcnt":1,"rdual":1,"read":[0,1,2,3],"read_annot":[0,3],"read_basi":1,"read_fil":[0,1],"read_start":1,"readabl":[0,1],"readcopyanno":[0,1],"readcopybas":[0,1],"readcopymipstart":[0,1],"readcopyord":[0,1],"readcopyparam":[0,1],"readcopyprob":[0,1],"readcopysolnpoolfilt":[0,1],"readcopystartinfo":[0,1],"readlin":2,"real":[0,1],"reay":0,"recurs":0,"redlb":1,"redub":1,"reduc":[0,1],"reducedcost":1,"reduct":[0,1],"redund":1,"ref":1,"refer":[0,1],"refin":1,"refine_mip_start":1,"refineconflictext":[0,1],"refinemipstartconflictext":[0,1],"reflect":0,"reflection_sc":1,"reformul":[0,1],"regist":[0,1],"register_callback":[0,1,3],"regular":1,"reject":0,"reject_candid":0,"reject_candidate_loc":0,"relat":[0,1],"relationship":1,"relax":[0,1],"relaxation_flag":0,"relaxation_unbound":1,"relaxationflag":[0,3],"releas":[0,1],"reltol":1,"remain":[0,1],"remov":[0,1,2],"remove_abort":[0,3],"repair":1,"repeatpre_const":[0,1],"replac":1,"replace_const":[0,1],"replic":0,"report":0,"repres":[0,1],"represent":0,"requir":[0,1,2],"rescal":0,"reset":1,"resid":0,"resolv":0,"respect":[0,1],"rest":0,"restrict":0,"result":[0,1],"results_chnl_idx":[0,1],"results_fil":[0,1],"retain":0,"retreiv":1,"retriev":1,"return":[0,1],"rew":0,"rhs":[0,1],"rhssa":[0,1],"right":2,"righthand":[0,1],"rlcomplet":2,"rlist":1,"rlp":0,"rlt":1,"rmat":1,"rmatbeg":1,"rmatind":1,"rmatval":1,"rng":1,"rng0":1,"rngval":1,"root":0,"rootparametergroup":[0,1],"round":0,"routin":0,"row":[0,1],"row_complementarity_max":1,"row_complementarity_tot":1,"row_dual":1,"row_prim":1,"row_status":1,"rowindex":1,"rowlist":1,"rownam":[0,1],"rprim":1,"rr":[0,1],"rstat":1,"rule":0,"run":[1,2],"runse":[0,1,3],"runtim":[0,2],"s":[0,1],"s1":1,"s2":1,"sampl":1,"satisfi":1,"sav":0,"save":0,"scale":[0,1],"scale_const":[0,1],"scaled_cost":1,"script":2,"search":[0,1,2],"search_const":[0,1],"second":[0,1],"section":[0,1],"see":[0,1,2],"seed":0,"segment":1,"select":0,"select_nod":0,"self":[0,1],"semi":1,"semi_continu":1,"semi_integ":1,"sens":[0,1],"sensit":1,"sensitivityinterfac":[0,1],"sent":[0,1],"separ":[0,1],"separat":0,"seq":1,"seq_of_pair":1,"seq_of_tripl":0,"sequenc":[0,1],"sequence_of_pair":1,"serv":0,"set":[0,1],"set1":1,"set_abstol":1,"set_bound":0,"set_callback":[0,3],"set_coeffici":1,"set_definit":1,"set_error_stream":[0,1,3],"set_linear":1,"set_linear_compon":1,"set_log_stream":[0,1,3],"set_lower_bound":[0,1],"set_modeling_assistance_callback":[0,3],"set_nam":1,"set_native_int":[0,1],"set_node_data":0,"set_num":1,"set_object":1,"set_offset":1,"set_parameter_set":[0,3],"set_prior":1,"set_problem_nam":[0,3],"set_problem_typ":[0,3],"set_quadrat":1,"set_quadratic_coeffici":1,"set_range_valu":1,"set_reltol":1,"set_results_stream":[0,1,3],"set_rh":1,"set_sens":1,"set_solut":0,"set_start":[0,1],"set_status_check":[0,1],"set_typ":1,"set_upper_bound":1,"set_valu":[0,1],"set_warning_stream":[0,1,3],"set_weight":1,"setbranchcallbackfunc":[0,1],"setbranchnosolncallbackfunc":[0,1],"setdblanno":[0,1],"setdblparam":[0,1],"setdefault":[0,1],"setgenericcallbackfunc":[0,1],"setheuristiccallbackfunc":[0,1],"setincumbentcallbackfunc":[0,1],"setinfocallbackfunc":[0,1],"setintparam":[0,1],"setlazyconstraintcallbackfunc":[0,1],"setlonganno":[0,1],"setlongparam":[0,1],"setlpcallbackfunc":[0,1],"setmipcallbackfunc":[0,1],"setnetcallbackfunc":[0,1],"setnodecallbackfunc":[0,1],"setnumobj":[0,1],"setpydel":[0,1],"setsens":1,"setsolvecallbackfunc":[0,1],"setstrparam":[0,1],"settermin":[0,1],"settings_and_log":1,"settuningcallbackfunc":[0,1],"setup":0,"setusercutcallbackfunc":[0,1],"shall":0,"share":[0,1],"shortcut":0,"show":1,"showqual":[0,1],"side":[0,1],"sift":1,"sift_alg_const":[0,1],"siftopt":[0,1],"siginthandl":[0,1],"sign":0,"signatur":[0,1],"similar":1,"simpl":1,"simplex":[0,1],"simplexcallback":[0,3],"sinc":[0,1],"singl":[0,1],"site":2,"situat":0,"size":[1,2],"slack":[0,1],"slack_bound_error_max":1,"slack_bound_error_tot":1,"slackfromx":[0,1],"slice":1,"slope":1,"smaller":0,"sol":1,"sol_val":1,"soln":[0,1],"solninfo":[0,1],"solnpoolfilterinterfac":[0,1],"solnpoolinterfac":[0,1],"solut":[0,1,2,3],"solution_limit":1,"solution_nam":1,"solution_pool":[0,1],"solution_sourc":0,"solution_status":0,"solution_strategi":0,"solutioninterfac":[0,1],"solutionmethod":[0,1],"solutionsourc":[0,3],"solutionstatus":[0,1],"solutionstrategi":[0,1],"solutiontyp":[0,1],"solutiontype_const":[0,1],"solv":[0,1,2,3],"solve_dettim":0,"solve_fix":1,"solve_mip":1,"solve_tim":0,"solvecallback":[0,3],"solver":1,"solwrit":[0,1],"solwritesolnpool":[0,1],"solwritesolnpoolal":[0,1],"someslack":1,"someth":[0,1],"somev":1,"soon":0,"sos":[0,1,3],"sos1":[0,1],"sos10":1,"sos1reform_const":[0,1],"sos2":[0,1],"sos2reform_const":[0,1],"sos3":1,"sos4":1,"sos5":1,"sos6":1,"sos7":1,"sos8":1,"sos9":1,"sos_constraint":1,"sosbeg":1,"sosind":1,"sosindex":1,"sosinterfac":[0,1],"sosnam":1,"sostyp":[0,1],"soswt":1,"sourc":[0,1],"sourcep":1,"sp":1,"space":1,"spair":0,"spars":[0,1],"sparsepair":[0,1,3],"sparsetripl":[0,1,3],"special":[0,1],"specif":1,"specifi":[0,1],"specifif":1,"spent":0,"st":1,"stack":1,"stacklevel":1,"stamp":0,"standard":[1,2],"start":[0,1,3],"stat":[0,3],"statement":0,"statind":1,"statist":[0,1],"status":[0,1],"status_cod":1,"statuscheck":[0,1],"steep":1,"steep_q_start":1,"steepest":1,"still":0,"stop":0,"store":[0,1],"str":1,"str_param_valu":1,"strategi":[0,1],"stream":[0,1],"strengthen":1,"string":[0,1],"stripl":0,"strong":[0,1],"strong_branch":1,"strongbranch":[0,1],"strparamet":[0,1],"structur":[0,1],"stuff":0,"sub":1,"subalg_const":[0,1],"subclass":[0,1],"subinterfac":0,"submit":[0,1],"submodul":3,"subpackag":[2,3],"subprob":1,"subproblem":[0,1],"subsequ":[0,1],"subset":1,"subtract":0,"subtre":0,"success":1,"suggest":[0,2],"suitabl":[0,2],"sum":[0,1],"sum_comp_slack":1,"sum_dual_infeas":1,"sum_dual_residu":1,"sum_indicator_slack_infeas":1,"sum_integer_infeas":1,"sum_pi":1,"sum_primal_infeas":1,"sum_primal_residu":1,"sum_pwl_slack_infeas":1,"sum_quadratic_primal_residu":1,"sum_quadratic_slack":1,"sum_quadratic_slack_infeas":1,"sum_reduced_cost":1,"sum_scaled_dual_infeas":1,"sum_scaled_dual_residu":1,"sum_scaled_pi":1,"sum_scaled_primal_infeas":1,"sum_scaled_primal_residu":1,"sum_scaled_reduced_cost":1,"sum_scaled_slack":1,"sum_scaled_x":1,"sum_slack":1,"sum_x":1,"summari":0,"superbas":[0,1],"superclass":[0,1],"support":[0,2],"suppos":0,"suppress":[0,1],"sure":[1,2],"sym_const":[0,1],"symbol":0,"symmetr":1,"system":[1,2],"t":[0,1],"tab":2,"tabl":[0,1],"tableau":1,"take":[0,1],"taken":[0,1],"target":0,"targetp":1,"techniqu":0,"tell":0,"term":[0,1],"termin":[0,1],"test":[0,1],"test_al":1,"test_four":1,"test_on":1,"th":0,"themselv":0,"third":1,"thread":[0,1],"thread_down":0,"thread_up":0,"three":[0,1],"thus":[0,1],"tick":[0,1],"tight":1,"tighten":[0,1],"tighten_lower_bound":1,"tighten_upper_bound":1,"tightenbd":[0,1],"time":[0,1,2],"time_limit":1,"timestamp":1,"titl":1,"togeth":1,"toler":1,"top":[1,2],"topic":[0,1],"traceback":0,"tradit":1,"treat":[0,1],"tree":[0,1],"tripl":[0,1],"true":[0,1],"true_objective_valu":1,"tune":[0,1],"tune_display_const":[0,1],"tune_problem":1,"tune_problem_set":1,"tuneparam":[0,1],"tuneparamprobset":[0,1],"tuning_status":1,"tuningcallback":[0,3],"tuningconst":[0,1],"tupl":[0,1],"turn":[0,1],"two":[0,1,2],"txt":0,"type":[0,1],"type_":1,"type_on":1,"type_sos1":0,"type_sos2":0,"type_two":1,"typeerror":0,"typic":2,"u":0,"ub":[0,1],"ufl_25_35_1":0,"unblp":1,"unbound":[0,1],"unchang":0,"uncrush":[0,1],"uncrush_formula":1,"uncrush_pi":1,"uncrush_x":1,"uncrushform":[0,1],"uncrushpi":[0,1],"uncrushx":[0,1],"undocu":[0,1],"unexpect":1,"unexplor":[0,1],"uniqu":0,"unknown":1,"unlik":1,"unlimit":2,"unpack":[0,3],"unpack_pair":[0,1],"unpack_singl":1,"unpack_tripl":[0,1],"unregist":[0,1],"unregister_callback":[0,1,3],"unspecifi":1,"unzip":[0,1],"up_penalti":1,"updat":0,"upgrad":2,"upper":[0,1],"upper_bound":1,"upper_bound_constraint":1,"usag":[0,1],"use":[0,1,2],"use_abort":[0,3],"use_constraint":0,"use_cut":0,"use_solut":0,"useconstraint":[0,3],"usecut":[0,3],"user":[0,1,2],"user_solut":0,"usercutcallback":[0,3],"userhandl":1,"usr1":1,"usr2":1,"usr3":1,"v":1,"v1":[0,1],"v12":1,"v2":[0,1],"v3":[0,1],"v_agg_const":[0,1],"val":[0,1],"valid":[0,1],"validate_arg_length":[0,1],"vallist":1,"valu":[0,1],"valueerror":0,"var":[0,1],"vari":1,"variabl":[0,1,3],"variable_status":1,"variablesinterfac":[0,1],"varieti":0,"varind":1,"varindic":1,"various":0,"varsel_const":[0,1],"vartyp":[0,1],"varx":1,"vec":0,"vector":[0,1],"veri":0,"verifi":0,"version":[0,1,2],"versionnumb":[0,1],"very_aggress":1,"via":1,"view":0,"violat":[0,1],"vv":[0,1],"vvrrmmff":[0,1],"w":0,"wall":[0,1],"wallclock":[0,1],"want":0,"warn":[0,1],"warning_chnl_idx":[0,1],"warning_fil":[0,1],"warninglimit":0,"was_cal":0,"weight":1,"well":2,"whenev":0,"whether":[0,1],"which_branch":0,"which_nod":0,"whichparam":1,"whose":[0,1],"will":[0,1,2],"window":2,"wise":0,"wish":0,"with_cut":1,"within":[0,1,2],"without":0,"without_cut":1,"word":[0,1],"work":[0,1],"worker":1,"worst_object":1,"wrap":1,"wrapper":[0,1],"write":[0,1,2,3],"write_annot":[0,3],"write_as_str":[0,3],"write_benders_annot":[0,3],"write_fil":[0,1],"write_to_stream":[0,3],"writeanno":[0,1],"writebendersanno":[0,1],"writelevel_const":[0,1],"writemipstart":[0,1],"writeparam":[0,1],"writeprob":[0,1],"writeprobdev":[0,1],"written":[0,1],"wrong":0,"wrongnumberofargumentserror":[0,3],"wts":1,"x":[0,1],"x0":1,"x1":[0,1],"x10":1,"x2":[0,1],"x3":[0,1],"x4":1,"x5":1,"x6":1,"x7":1,"x8":1,"x9":1,"x_bound_error_max":1,"x_bound_error_tot":1,"x_norm_max":1,"x_norm_tot":1,"xctype":1,"xqxax":1,"y":1,"yes":1,"yet":0,"yield":0,"z":1,"zero":[0,1],"zero_du":1,"zero_half":[0,1],"zip":[0,1]},"titles":["cplex package","cplex._internal package","CPLEX Python API Reference Manual","cplex"],"titleterms":{"What":2,"_anno":1,"_aux_funct":1,"_baseinterfac":1,"_constant":1,"_constantsenum":1,"_intern":1,"_matric":1,"_multiobj":1,"_multiobjsoln":1,"_parameter_class":1,"_procedur":1,"_pwl":1,"_solutionstrategyenum":1,"_subinterfac":1,"abort":0,"api":2,"callback":0,"constant_class":0,"content":2,"cplex":[0,1,2,3],"except":0,"ibm":2,"know":2,"manual":2,"model_info":0,"modul":[0,1],"need":2,"packag":[0,1,2],"paramset":0,"python":2,"refer":2,"structur":2,"submodul":[0,1],"subpackag":0}}) \ No newline at end of file